/* ============================================================
   header.css — Header / navegación (desktop y responsive)
   ============================================================ */

/* --- HEADER FLOTANTE (Desktop) --- */
header {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 40px);
    max-width: 1240px;
    padding: 12px 0;
    border-radius: 28px;
    z-index: 1000;
    /* Reducido para que el menú pueda taparlo */
}

/* Pseudo-elemento que dibuja el fondo visual del header */
header::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgb(255, 255, 255);
    background: rgba(255, 255, 255, 0.581);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    z-index: -1;
    pointer-events: none;
}

/* Forzamos a que el contenido interno siempre esté en 1 sola línea */
.header-content {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    width: 100%;
    padding: 0 30px;
    box-sizing: border-box;
}

.logo {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
}

.logo-img {
    height: 34px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Ajuste de tamaño en móviles */
@media (max-width: 1024px) {
    .logo-img {
        height: 24px;
    }
}

/* Logo para el Footer (Fondo oscuro) */
.footer-logo-img {
    height: 36px;
    width: auto;
    margin-bottom: 12px;
    display: block;
    filter: none;
}

/* Estructura Desktop */
.nav-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-between;
    margin-left: 50px;
}

.mobile-menu-header {
    display: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    font-size: 14px;
    font-weight: 500;
}

.nav-links li i {
    font-size: 10px;
    margin-left: 4px;
    color: var(--text-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.login-link {
    font-size: 14px;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

/* Fondo oscuro (Overlay Base) */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    /* Mayor que el header */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Bloqueo extremo de scroll para móviles */
html.no-scroll,
body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none;
}


/* --- RESPONSIVE HEADER --- */
/* ==========================================
   HEADER FLOTANTE Y MENÚ MÓVIL (COMPLETO)
   ========================================== */
@media (max-width: 1024px) {

    /* 1. Barra Flotante Delgada */
    header {
        top: 12px !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto !important;
        width: calc(100% - 24px) !important;
        max-width: 100% !important;
        border-radius: 20px !important;
        padding: 8px 0 !important;
        z-index: 1000 !important;
    }

    /* El fondo visual del header en mobile */
    header::before {
        border-radius: 20px !important;
        border: 1px solid rgb(255, 255, 255) !important;
        background: rgba(255, 255, 255, 0.581) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06) !important;
    }

    .header-content {
        padding: 0 18px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .logo {
        font-size: 22px !important;
    }

    /* 2. Botón Hamburguesa */
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: none !important;
        border: none !important;
        font-size: 22px !important;
        color: var(--text-dark) !important;
        cursor: pointer !important;
        padding: 4px !important;
        flex-shrink: 0 !important;
        z-index: 10 !important;
    }

    .menu-overlay {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        z-index: 10000 !important;
        /* Tapa el header */
    }

    /* 3. Cajón de Menú Lateral */
    .nav-wrapper {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;

        transform: translateX(100%);
        width: 85vw !important;
        max-width: 380px !important;
        height: 100dvh !important;
        background-color: var(--white) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 0 30px 40px !important;
        box-shadow: none;
        visibility: hidden;
        transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, visibility 0.3s;
        z-index: 10001 !important;
        /* Por encima del overlay y del header */
        overflow-y: auto;
    }

    .nav-wrapper.active {
        transform: translateX(0) !important;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15) !important;
        visibility: visible !important;
    }

    .mobile-menu-header {
        display: flex !important;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding: 25px 0;
        margin-bottom: 20px;
        border-bottom: 1px solid var(--border);
    }

    .close-menu-btn {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-dark);
        cursor: pointer;
    }

    .nav-links {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important;
        margin-bottom: 30px !important;
    }

    .nav-links li {
        width: 100% !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    .nav-links li a {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 18px 0 !important;
        font-size: 16px !important;
        font-weight: 600 !important;
    }

    .header-actions {
        flex-direction: column !important;
        width: 100% !important;
        gap: 15px !important;
    }

    .header-actions .login-link {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 14px 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 22px !important;
        box-sizing: border-box !important;
    }

    .header-actions .btn {
        width: 100% !important;
        padding: 14px 0 !important;
    }
}