/* ===== HEADER.CSS ===== */

.main-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    pointer-events: none;
}

.header-shell {
    padding: 1rem 1.25rem 0;
}

.header-container {
    pointer-events: auto;
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    min-height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 0.95rem 1.4rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    background: rgba(248, 249, 252, 0.96);
    backdrop-filter: blur(18px);
    transition: all 220ms ease;
}

.main-header.is-scrolled .header-container {
    background: rgba(242, 244, 248, 0.96);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}

.header-brand {
    display: flex;
    align-items: center;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.brand-name {
    color: #111827;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-accent {
    color: #e2a13b;
}

.main-nav {
    display: flex;
    justify-content: center;
}

.nav-list {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1rem;
    border-radius: 999px;
    color: #4b5563;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 180ms ease;
}

.nav-link:hover {
    color: #111827;
    background: rgba(255, 255, 255, 0.84);
}

.nav-link.active {
    color: #ffffff; /* Cambia el texto a blanco */
    background: rgb(224, 158, 61); /* Nuevo color de fondo */
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-login {
    color: #374151;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 200ms ease;
}

.btn-login:hover {
    background: #ffffff;
    color: #111827;
    transform: translateY(-2px);
}

.btn-cta {
    background: linear-gradient(135deg, #e7a641 0%, #c47a2e 100%);
    color: white;
    border-radius: 999px;
    padding: 0.75rem 1.4rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 200ms ease;
}

.btn-cta:hover {
    background: linear-gradient(135deg, #d48f2a 0%, #b5681f 100%);
    transform: translateY(-2px);
}

.mobile-menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.toggle-bar {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
    transition: all 180ms ease;
}

.mobile-menu-toggle.is-active .toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-active .toggle-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active .toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* MOBILE NAV - SIMPLE Y FUNCIONAL */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    pointer-events: auto;
}

.mobile-nav.is-open {
    display: block;
}

.mobile-nav-inner {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 380px;
    background: white;
    padding: 1rem;
    overflow-y: auto;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.mobile-nav-close {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
}

.mobile-nav-list {
    display: grid;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.85);
    text-decoration: none;
}

.mobile-nav-link.active {
    color: #111827;
    background: #ffffff;
}

.mobile-actions {
    display: grid;
    gap: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* Dropdown Desktop */
.nav-item-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dropdown-icon {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-item-dropdown.open .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 240px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.15);
    padding: 0.6rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1001;
    border: 1px solid rgba(203, 213, 225, 0.4);
}

.nav-item-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid rgba(203, 213, 225, 0.3);
    border-top: 1px solid rgba(203, 213, 225, 0.3);
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1.25rem;
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-link i {
    width: 20px;
    color: #e2a13b;
}

.dropdown-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #111827;
    padding-left: 1.5rem;
}

/* Dropdown Móvil */
.mobile-dropdown-item {
    margin: 0;
    padding: 0;
}

.mobile-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 200ms ease;
}

.mobile-dropdown-toggle i {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
    color: #e2a13b;
}

.mobile-dropdown-item.open .mobile-dropdown-toggle {
    background: #ffffff;
    border-color: rgba(226, 161, 59, 0.3);
}

.mobile-dropdown-item.open .mobile-dropdown-toggle i {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-dropdown-item.open .mobile-dropdown-menu {
    max-height: 500px;
}

.mobile-dropdown-menu .mobile-nav-link {
    margin-top: 0.5rem;
    padding-left: 2rem;
    background: rgba(248, 250, 252, 0.95);
}

/* Responsive */
@media (max-width: 1180px) {
    .main-nav,
    .header-actions {
        display: none;
    }

    .header-container {
        grid-template-columns: auto auto;
        justify-content: space-between;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }
}

@media (max-width: 640px) {
    .header-shell {
        padding: 0.75rem;
    }

    .header-container {
        min-height: 60px;
        padding: 0.7rem 1rem;
    }

    .logo {
        width: 34px;
        height: 34px;
    }

    .brand-name {
        font-size: 1rem;
    }
}

/* ===== ARREGLO DESKTOP HOVER ===== */
@media (min-width: 1181px) {
    /* Mostrar menú al hacer hover en el contenedor padre */
    .nav-item-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* Rotar flecha al hacer hover */
    .nav-item-dropdown:hover .dropdown-icon {
        transform: rotate(180deg);
    }

    /* Evitar que el JS bloquee el hover en desktop */
    .dropdown-menu {
        pointer-events: auto !important;
    }
}