/* =========================================================================
   1. ESTILOS BASE DEL HEADER (EFECTO CRISTAL)
   ========================================================================= */
.glass-header {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1200px;
    border-radius: 90px;
    padding: 15px 30px;
    z-index: 99999 !important;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    height: 80px;
    display: flex;
    align-items: flex-start;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 50px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   2. ESTADO COMPACTO (AL HACER SCROLL)
   ========================================================================= */
.glass-header.compact-mode:not(.expanded) {
    padding: 8px 25px;
    top: 50px;
    width: 70%;
    max-width: 800px;
    height: 60px;
}

.glass-header.compact-mode:not(.expanded) .header-container {
    max-width: 800px;
    width: 100%;
    justify-content: space-between;
    height: 44px;
}

.glass-header.compact-mode:not(.expanded) .logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* =========================================================================
   3. LOGO
   ========================================================================= */
.logo {
    position: relative;
    flex-shrink: 0;
    z-index: 10002;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-img {
    width: 90px;
    height: auto;
    object-fit: contain;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 1;
    filter: blur(0);
}

.logo-img.changing {
    opacity: 0;
    filter: blur(5px);
}

.logo-img:hover {
    transform: scale(1.05);
}

/* =========================================================================
   4. BOTÓN DE MENÚ (HAMBURGUESA)
   ========================================================================= */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 6px;
    z-index: 10001;
    transition: all 0.3s ease;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 2px;
    background: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    position: relative;
}

/* Efecto Hover limpio: Glow en las líneas */
.menu-toggle:hover,
.menu-toggle:focus,
.menu-toggle:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.menu-toggle:hover span {
    background: #ffffff;
    box-shadow: 0 0 12px 3px rgba(255, 255, 255, 0.6);
}

.menu-toggle:hover span:nth-child(1),
.menu-toggle:hover span:nth-child(3) {
    transform: none;
}

/* =========================================================================
   5. MENÚ EXPANDIDO (DROPDOWN)
   ========================================================================= */
.glass-header.expanded {
    height: auto;
    width: 90%;
    max-width: 500px;
    border-radius: 50px;
    padding: 20px 40px 30px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.glass-header.expanded .header-container {
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0;
}

.glass-header.expanded .logo {
    position: relative;
    order: 1;
}

.glass-header.expanded .logo-img {
    width: 90px;
    height: auto;
}

.glass-header.expanded .menu-toggle {
    position: relative;
    order: 2;
    margin: 0;
}

/* Transformación de iconos a 'X' */
.glass-header.expanded .menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
    width: 24px;
}

.glass-header.expanded .menu-toggle span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.glass-header.expanded .menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
    width: 24px;
}

/* Contenido del menú desplegable */
.menu-content {
    display: none;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    width: 100%;
    padding: 20px 0 0;
    box-sizing: border-box;
}

.glass-header.expanded .menu-content {
    display: flex;
    order: 3;
    width: 100%;
    margin-top: 30px;
}

/* Animaciones de entrada escalonadas */
.glass-header.expanded .menu-logos-container {
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.1s;
    opacity: 0;
    transform: translateY(30px);
}

.glass-header.expanded .menu-links-container {
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.25s;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logos dentro del menú */
.menu-logos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    width: 100%;
}

.menu-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.menu-logo-link:hover {
    transform: scale(1.1) translateY(-10px);
    filter: drop-shadow(0 20px 50px rgba(255, 255, 255, 0.2));
}

.menu-logo-img {
    width: 120px;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    transition: all 0.4s ease;
}

/* Animación Houdini para degradado de logos */
@property --foco-opacity {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}

.degradado-logos {
    --foco-opacity: 0;
    transition: --foco-opacity 0.25s ease;
    background:
        radial-gradient(circle 340px at var(--x, 50%) var(--y, 50%),
            rgba(82, 101, 240, var(--foco-opacity)) 0%,
            transparent 100%),
        linear-gradient(to bottom, transparent, #2a39a859 40%, #2a39a859 60%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    position: relative;
}

.degradado-logos:hover {
    --foco-opacity: 1;
}

/* Enlaces del menú inferior */
.menu-links-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
}

.menu-link-item {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    transition: all 0.3s ease;
    padding: 8px 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-link-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    transition: width 0.4s ease;
}

.menu-link-item:hover {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.menu-link-item:hover::after {
    width: 100%;
}


