/* ===========================================
   VARIABLES Y RESET GLOBAL
   =========================================== */
:root {
    --color-principal: #E42338;
    --color-blanco: #FFFFFF;
    --color-hover: rgba(0, 0, 0, 0.1);
    --zindex-cabecera: 10001;
    --zindex-logo: 10003;
    --zindex-flotantes: 10000;
    --fuente-principal: 'Montserrat', sans-serif;
}

/* ===========================================
   CABECERA PRINCIPAL
   =========================================== */
.cabecera2025 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: var(--zindex-cabecera);
    font-family: var(--fuente-principal);
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Barra de navegación */
.cabecera2025-barra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 30px;
    box-sizing: border-box;
    flex-wrap: nowrap;
    background: var(--color-principal);
    margin: 0;
    height: 70px;
    position: relative;
}

/* ===========================================
   LOGOTIPO - POSICIÓN FIJA COMO EN PC NORMAL
   =========================================== */
.cabecera2025-logo {
    position: absolute;
    top: -35px; /* Posición estándar PC - MANTENIDA EN TODOS LOS DISPOSITIVOS */
    left: 150px; /* Posición estándar PC */
    z-index: var(--zindex-logo);
    margin: 0;
    padding: 0;
    transform-origin: left top;
}

.cabecera2025-logo .logo-container {
    position: relative;
    display: inline-block;
    width: 130px;
    height: 130px;
    background: var(--color-blanco);
    border: 3px solid var(--color-principal);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
}

.cabecera2025-logo .logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 10px;
    box-sizing: border-box;
}

.cabecera2025-logo a:hover .logo-container {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* ===========================================
   MENÚ DE NAVEGACIÓN - ESCRITORIO
   =========================================== */
.cabecera2025-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    transition: all 0.3s ease;
}

.cabecera2025-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: nowrap;
    transition: all 0.3s ease;
}

.cabecera2025-menu li {
    position: relative;
    white-space: nowrap;
}

.cabecera2025-menu li a {
    color: var(--color-blanco);
    font-weight: 800;
    text-decoration: none;
    font-size: 14px;
    padding: 20px 0;
    display: block;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.cabecera2025-menu li a:hover {
    color: var(--color-blanco);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.cabecera2025-menu li .activo {
    color: #eeeeee;
}

.cabecera2025-menu .rojo {
    color: #f5f5f5;
    font-weight: bold;
    font-size: 12px;
}

/* Botón hamburguesa */
.cabecera2025-toggle {
    display: none;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-blanco);
    margin: 0;
    padding: 0;
    z-index: 10004;
}

/* ===========================================
   ELEMENTOS FLOTANTES - REDES SOCIALES
   =========================================== */

/* Contenedor principal redes sociales */
.social-floating {
    display: none; /* Oculto por defecto, se muestra con JS/media queries */
    position: fixed;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 9999;
    pointer-events: none;
}

.social-floating li {
    list-style: none;
    pointer-events: auto;
}

.social-floating a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #222;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.social-floating a img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(1.1);
    transition: all 0.3s ease;
}

.social-floating a:hover {
    transform: scale(1.1);
}

.social-floating a.facebook:hover  { background-color: #1877F2; }
.social-floating a.linkedin:hover  { background-color: #0077B5; }
.social-floating a.tiktok:hover    { background-color: #000000; }
.social-floating a.instagram:hover { background: linear-gradient(45deg,#feda75,#fa7e1e,#d62976,#962fbf,#4f5bd5); }
.social-floating a.youtube:hover   { background-color: #FF0000; }
.social-floating a.x:hover         { background-color: #14171A; }

.social-floating a:hover img {
    filter: brightness(0) invert(1);
}

/* WhatsApp Flotante */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    z-index: var(--zindex-flotantes);
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float img.whatsapp-icon {
    width: 35px;
    height: 35px;
}

/* León Flotante */
.floating-leon {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 120px;
    height: 120px;
    z-index: calc(var(--zindex-flotantes) + 1);
    animation: floatAnimation 3s ease-in-out infinite;
}

.floating-leon .leon-image {
    width: 150%;
    height: 150%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.floating-leon .leon-image:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Animación de flotación */
@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===========================================
   MEDIA QUERIES - ESCRITORIOS MEDIANOS (1201px - 1440px)
   =========================================== */
@media screen and (min-width: 1201px) and (max-width: 1440px) {
    /* Logo mantiene posición vertical PC pero ajusta tamaño y posición lateral */
    .cabecera2025-logo {
        left: 120px; /* Ligera reducción lateral */
        top: -35px; /* ¡POSICIÓN VERTICAL MANTENIDA! */
    }
    
    .cabecera2025-logo .logo-container {
        width: 120px; /* Reducción ligera */
        height: 120px;
    }
    
    /* Menú más compacto */
    .cabecera2025-menu {
        gap: 25px;
    }
    
    .cabecera2025-menu li a {
        font-size: 13.5px;
    }
    
    /* REDES SOCIALES - Ajuste para PCs medianos */
    .social-floating {
        display: flex;
        left: 10px;
        gap: 18px;
    }
    
    .social-floating a {
        width: 48px;
        height: 48px;
    }
    
    .social-floating a img {
        width: 24px;
        height: 24px;
    }
}

/* ===========================================
   MEDIA QUERIES - TABLETAS GRANDES / PCs PEQUEÑOS (1025px - 1200px)
   =========================================== */
@media screen and (min-width: 1025px) and (max-width: 1200px) {
    /* Logo: posición vertical mantenida, ajuste lateral proporcional */
    .cabecera2025-logo {
        left: 100px; /* Reducción proporcional */
        top: -35px; /* ¡POSICIÓN VERTICAL MANTENIDA! */
    }
    
    .cabecera2025-logo .logo-container {
        width: 110px; /* Reducción moderada */
        height: 110px;
    }
    
    /* Menú más compacto */
    .cabecera2025-menu {
        gap: 18px; /* Reducción significativa */
    }
    
    .cabecera2025-menu li a {
        font-size: 13px;
        padding: 18px 0;
    }
    
    /* Ajuste de padding de la barra */
    .cabecera2025-barra {
        padding: 0 20px;
    }
    
    /* REDES SOCIALES - PCs pequeños / Tablets grandes */
    .social-floating {
        display: flex;
        left: 8px;
        gap: 15px;
    }
    
    .social-floating a {
        width: 46px;
        height: 46px;
    }
    
    .social-floating a img {
        width: 22px;
        height: 22px;
    }
}

/* ===========================================
   MEDIA QUERIES - TABLETAS MEDIANAS (901px - 1024px)
   =========================================== */
@media screen and (min-width: 901px) and (max-width: 1024px) {
    /* Logo: posición vertical FIJA, ajuste lateral */
    .cabecera2025-logo {
        left: 80px; /* Reducción proporcional */
        top: -35px; /* ¡IMPORTANTE! Posición vertical MANTENIDA */
    }
    
    .cabecera2025-logo .logo-container {
        width: 100px; /* Reducción moderada */
        height: 100px;
        transform: scale(1); /* Sin escala adicional */
    }
    
    /* Menú ultra compacto */
    .cabecera2025-menu {
        gap: 14px; /* Espacio mínimo pero funcional */
        margin-right: 10px;
    }
    
    .cabecera2025-menu li a {
        font-size: 12px; /* Tamaño mínimo legible */
        padding: 15px 0;
        font-weight: 700;
        letter-spacing: -0.1px; /* Compactar texto */
    }
    
    /* Ajuste de padding de la barra */
    .cabecera2025-barra {
        padding: 0 15px;
        height: 65px; /* Ligera reducción */
    }
    
    /* Ajustar espacio entre elementos */
    .cabecera2025-nav {
        margin-left: auto;
        max-width: 65%; /* Más espacio para el menú */
    }
    
    /* REDES SOCIALES - Tablets medianas */
    .social-floating {
        display: flex;
        left: 6px;
        gap: 12px;
    }
    
    .social-floating a {
        width: 44px;
        height: 44px;
    }
    
    .social-floating a img {
        width: 20px;
        height: 20px;
    }
    
    /* WhatsApp y León más pequeños */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        right: 18px;
        bottom: 18px;
    }
    
    .whatsapp-float img.whatsapp-icon {
        width: 30px;
        height: 30px;
    }
    
    .floating-leon {
        width: 100px;
        height: 100px;
        bottom: 130px;
        right: 18px;
    }
}

/* ===========================================
   MEDIA QUERIES - TABLETAS PEQUEÑAS (769px - 900px)
   =========================================== */
@media screen and (min-width: 769px) and (max-width: 900px) {
    /* Logo: posición vertical FIJA, ajuste lateral mínimo */
    .cabecera2025-logo {
        left: 60px; /* Posición proporcional */
        top: -35px; /* ¡POSICIÓN VERTICAL FIJA! */
    }
    
    .cabecera2025-logo .logo-container {
        width: 90px; /* Tamaño mínimo funcional */
        height: 90px;
        transform: scale(1);
    }
    
    /* Menú ultra compacto - estrategia de supervivencia */
    .cabecera2025-menu {
        gap: 10px; /* Espacio mínimo entre elementos */
        margin-right: 5px;
    }
    
    .cabecera2025-menu li a {
        font-size: 11.5px; /* Tamaño mínimo */
        padding: 12px 0;
        font-weight: 700;
        letter-spacing: -0.2px;
    }
    
    /* Ajuste de padding de la barra */
    .cabecera2025-barra {
        padding: 0 12px;
        height: 60px; /* Reducción para dar espacio */
    }
    
    /* Ajustar espacio entre elementos */
    .cabecera2025-nav {
        margin-left: auto;
        max-width: 62%; /* Más espacio para el menú */
    }
    
    /* Clase opcional para nombres muy largos */
    .cabecera2025-menu li a.texto-largo {
        font-size: 10.5px; /* Reducción extra para nombres largos */
    }
    
    /* Mantener menú horizontal */
    .cabecera2025-toggle {
        display: none;
    }
    
    /* REDES SOCIALES - Tablets pequeñas (opcional: ocultar si es necesario) */
    .social-floating {
        display: flex;
        left: 5px;
        gap: 10px;
    }
    
    .social-floating a {
        width: 42px;
        height: 42px;
    }
    
    .social-floating a img {
        width: 18px;
        height: 18px;
    }
    
    /* WhatsApp y León más pequeños */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 15px;
    }
    
    .whatsapp-float img.whatsapp-icon {
        width: 28px;
        height: 28px;
    }
    
    .floating-leon {
        width: 90px;
        height: 90px;
        bottom: 110px;
        right: 15px;
    }
}

/* ===========================================
   DISPOSITIVOS MÓVILES (≤768px)
   =========================================== */
@media screen and (max-width: 768px) {
    /* Reset general */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Cabecera */
    .cabecera2025 {
        position: fixed !important;
        top: 55px !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 10002 !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: top 0.3s ease-in-out;
    }
    
    .promo-banner.scrolled + .cabecera2025 {
        top: 50px !important;
    }
    
    /* LOGO MÓVIL - posición diferente SOLO para móviles */
    .cabecera2025-logo {
        position: absolute !important;
        top: -20px !important; /* Posición ajustada para móvil */
        left: 15px !important; /* Posición lateral ajustada */
        z-index: var(--zindex-logo) !important;
    }
    
    .cabecera2025-logo .logo-container {
        width: 65px !important;
        height: 65px !important;
        border: 2px solid var(--color-principal) !important;
    }
    
    .promo-banner.scrolled + .cabecera2025 .cabecera2025-logo {
        top: -20px !important;
        transform: scale(0.9) !important;
    }
    
    /* Botón hamburguesa visible en móvil */
    .cabecera2025-toggle {
        display: flex !important;
        margin-left: auto !important;
        width: 40px !important;
        height: 40px !important;
        position: relative;
        right: 10px;
    }
    
    /* Ocultar menú horizontal en móvil */
    .cabecera2025-nav {
        display: none !important;
        position: absolute !important;
        top: 60px !important;
        left: 0 !important;
        width: 100% !important;
        background: var(--color-principal) !important;
        flex-direction: column !important;
        z-index: 10001 !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    }
    
    .cabecera2025-nav.active {
        display: flex !important;
        padding: 10px 0 !important;
    }
    
    /* Menú vertical para móviles */
    .cabecera2025-menu {
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
    }
    
    .cabecera2025-menu li {
        width: 100% !important;
    }
    
    .cabecera2025-menu li a {
        display: block !important;
        width: 100% !important;
        padding: 15px 20px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        text-align: left !important;
    }
    
    .cabecera2025-menu li:last-child a {
        border-bottom: none !important;
    }
    
    .cabecera2025-menu li a:hover {
        background-color: rgba(0, 0, 0, 0.1) !important;
        transform: none !important;
    }
    
    /* REDES SOCIALES - Móviles (ocultar por defecto) */
    .social-floating {
        display: none !important;
    }
    
    /* WhatsApp y León para móviles */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 50px;
    }
    
    .whatsapp-float img.whatsapp-icon {
        width: 28px;
        height: 28px;
    }
    
    .floating-leon {
        width: 80px;
        height: 80px;
        bottom: 120px;
        right: 15px;
    }
}

/* ===========================================
   MEDIA QUERIES ESPECIALES PARA LOGO EN TABLETAS
   =========================================== */

/* Para tablets con altura reducida (modo retrato) */
@media screen and (min-width: 769px) and (max-width: 1024px) and (max-height: 600px) {
    /* Mantener posición vertical del logo */
    .cabecera2025-logo {
        top: -30px; /* Ligero ajuste para altura reducida, pero cerca de -35px */
    }
    
    .cabecera2025-logo .logo-container {
        width: 85px; /* Reducción mínima */
        height: 85px;
    }
    
    /* Ajustar altura de barra */
    .cabecera2025-barra {
        height: 55px;
    }
    
    /* Ajustar menú */
    .cabecera2025-menu li a {
        padding: 10px 0 !important;
        font-size: 11px !important;
    }
    
    /* REDES SOCIALES - Tablets con altura reducida */
    .social-floating {
        gap: 10px;
    }
    
    .social-floating a {
        width: 40px;
        height: 40px;
    }
    
    .social-floating a img {
        width: 18px;
        height: 18px;
    }
}

/* Para tablets en modo horizontal */
@media screen and (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    /* Logo se mantiene en posición vertical fija */
    .cabecera2025-logo {
        left: 60px;
        top: -35px; /* ¡POSICIÓN VERTICAL MANTENIDA! */
    }
    
    /* Menú siempre visible en landscape */
    .cabecera2025-nav {
        display: flex !important;
        position: static !important;
        width: auto !important;
        background: transparent !important;
        max-width: 70% !important;
    }
    
    .cabecera2025-toggle {
        display: none !important;
    }
    
    /* Menú más compacto en landscape */
    .cabecera2025-menu {
        gap: 12px;
    }
    
    .cabecera2025-menu li a {
        font-size: 11.5px;
    }
    
    /* REDES SOCIALES - Tablets landscape */
    .social-floating {
        left: 8px;
        gap: 14px;
    }
}

/* ===========================================
   AJUSTES PARA PCs MUY PEQUEÑOS (801px - 900px)
   =========================================== */
@media screen and (min-width: 801px) and (max-width: 900px) {
    /* Asegurar que el logo mantenga posición */
    .cabecera2025-logo {
        left: 50px;
        top: -35px;
    }
    
    /* Menú más ajustado */
    .cabecera2025-menu {
        gap: 8px;
    }
    
    .cabecera2025-menu li a {
        font-size: 11px;
    }
    
    /* REDES SOCIALES - PCs muy pequeños */
    .social-floating {
        left: 4px;
        gap: 8px;
    }
    
    .social-floating a {
        width: 40px;
        height: 40px;
    }
    
    .social-floating a img {
        width: 18px;
        height: 18px;
    }
}

/* ===========================================
   SOLUCIÓN PARA NOMBRES MUY LARGOS EN EL MENÚ
   =========================================== */

/* Clase opcional para elementos con nombres largos */
.cabecera2025-menu li a.texto-largo {
    font-size: 0.9em; /* Reducción adicional */
}

/* Tooltips para nombres completos en pantallas pequeñas */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .cabecera2025-menu li a[title]:hover::after {
        content: attr(title);
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.85);
        color: white;
        padding: 6px 12px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        z-index: 10005;
        pointer-events: none;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }
}

/* ===========================================
   MEDIA QUERIES ADICIONALES PARA ELEMENTOS FLOTANTES
   =========================================== */

/* Pantallas muy grandes (más de 1440px) */
@media screen and (min-width: 1441px) and (max-width: 1919px) {
    .social-floating {
        display: flex;
        left: 20px;
        gap: 20px;
    }
    
    .social-floating a {
        width: 52px;
        height: 52px;
    }
    
    .social-floating a img {
        width: 26px;
        height: 26px;
    }
}

/* Pantallas 2K/4K (1920px y más) */
@media screen and (min-width: 1920px) {
    .social-floating {
        display: flex;
        left: 30px;
        gap: 25px;
    }
    
    .social-floating a {
        width: 60px;
        height: 60px;
    }
    
    .social-floating a img {
        width: 30px;
        height: 30px;
    }
    
    .social-floating a:hover {
        transform: scale(1.15);
    }
    
    .whatsapp-float {
        width: 70px;
        height: 70px;
        right: 30px;
        bottom: 30px;
    }
    
    .whatsapp-float img.whatsapp-icon {
        width: 40px;
        height: 40px;
    }
    
    .floating-leon {
        width: 140px;
        height: 140px;
        bottom: 180px;
        right: 30px;
    }
}

/* ===========================================
   OPCIÓN: REDES SOCIALES EN CABECERA PARA DISPOSITIVOS MUY PEQUEÑOS
   =========================================== */

/* Opcional: Mostrar redes sociales en la cabecera en tablets muy pequeñas */
@media screen and (min-width: 769px) and (max-width: 850px) {
    /* Si el espacio es muy limitado, considerar esta opción */
    .social-floating.alternativo {
        position: absolute;
        top: 50%;
        right: 60px;
        left: auto;
        transform: translateY(-50%);
        flex-direction: row;
        gap: 8px;
    }
    
    .social-floating.alternativo a {
        width: 36px;
        height: 36px;
    }
    
    .social-floating.alternativo a img {
        width: 16px;
        height: 16px;
    }
}