/* =========================================
   MEGA MENU NAVBAR
   ========================================= */

.navbar--mega {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-surface-overlay);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border-light);
    padding: 0.75rem 0;
}

.navbar__menu--mega {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.navbar__item {
    position: relative;
}

.navbar__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.navbar__link:hover {
    color: var(--color-accent);
    background: var(--color-bg-alt);
}

.navbar__item.is-active > .navbar__link {
    color: var(--color-primary);
    font-weight: 600;
}

.dropdown-icon {
    width: 14px;
    height: 14px;
    transition: transform var(--transition-fast);
}

.navbar__item.has-dropdown:hover .dropdown-icon,
.navbar__item.has-dropdown.is-open .dropdown-icon {
    transform: rotate(180deg);
}

/* =========================================
   DROPDOWN - MODO SIMPLE
   ========================================= */

.mega-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
    overflow: hidden;
}

.navbar__item.has-dropdown:hover > .mega-dropdown,
.navbar__item.has-dropdown.is-open > .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-dropdown__content {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.mega-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: 6px;
    transition: background var(--transition-fast);
}

.mega-dropdown__item:hover {
    background: var(--color-bg-alt);
}

.mega-dropdown__text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mega-dropdown__label {
    font-weight: 500;
    font-size: 0.95rem;
}

/* =========================================
   DROPDOWN - MODO MEGA (ancho con descripciones)
   ========================================= */

.mega-dropdown--mega {
    min-width: 380px;
    padding: 0;
}

.mega-dropdown--mega .mega-dropdown__content {
    padding: 1rem;
}

.mega-dropdown--mega .mega-dropdown__item {
    padding: 1rem;
    gap: 1rem;
}

.mega-dropdown__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-text-on-primary);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.mega-dropdown__icon svg {
    width: 20px;
    height: 20px;
}

.mega-dropdown--mega .mega-dropdown__desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* =========================================
   CTA BUTTON
   ========================================= */

.navbar__item--cta {
    margin-left: auto;
}

/* 🔥 FIX: el CTA "Reservar" usaba --color-accent (casi negro en esta marca) con un
   hover marrón fijo incoherente. Se usa el primario de marca con su hover dinámico. */
.navbar__item--cta .btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.navbar__item--cta .btn-primary:hover {
    background: var(--color-primary-hover);
    color: #fff;
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .navbar__menu--mega {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-surface);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.25rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        opacity: 0;
        transition: transform var(--transition-normal), opacity var(--transition-normal);
        pointer-events: none;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .navbar__menu--mega.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    .navbar__item {
        width: 100%;
    }
    
    .navbar__link {
        width: 100%;
        justify-content: space-between;
        padding: 0.875rem 1rem;
    }
    
    /* Dropdown en móvil: accordion */
    .mega-dropdown {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
        background: var(--color-bg-alt);
        border-radius: 6px;
        margin-top: 0.25rem;
    }
    
    .navbar__item.has-dropdown.is-open > .mega-dropdown {
        max-height: 500px;
    }
    
    .mega-dropdown--mega {
        min-width: 0;
    }
    
    .navbar__item--cta {
        margin-left: 0;
        margin-top: 0.5rem;
    }
    
    .navbar__item--cta .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   DIFERENCIACIÓN PÁGINAS vs SECCIONES + HOVER ANIMADO EN MEGA MENÚ
   ========================================================================== */

/* Links de páginas en el navbar */
.navbar__link--page {
    position: relative;
    color: #2d3748;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* Línea animada debajo */
.navbar__link--page::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    opacity: 0;
}

.navbar__link--page:hover::after {
    width: 100%;
    opacity: 1;
}

.navbar__link--page:hover {
    color: var(--color-primary);
}

/* Items de sección en el dropdown */
.mega-dropdown__item--section {
    padding-left: 1rem;
}

.mega-dropdown__item--section .mega-dropdown__label {
    color: #718096;
    font-weight: 400;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s ease;
}

/* Hover en items de sección */
.mega-dropdown__item--section:hover .mega-dropdown__label {
    color: #4a5568;
}

.mega-dropdown__item--section:hover .mega-dropdown__label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #cbd5e1;
    animation: lineGrow 0.3s ease forwards;
}

@keyframes lineGrow {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Items de página en el dropdown */
.mega-dropdown__item:not(.mega-dropdown__item--section) .mega-dropdown__label {
    color: #2d3748;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.mega-dropdown__item:not(.mega-dropdown__item--section):hover .mega-dropdown__label {
    color: var(--color-primary);
}

.mega-dropdown__item:not(.mega-dropdown__item--section):hover .mega-dropdown__label::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
    animation: lineGrow 0.3s ease forwards;
}