/* ============================================================================
   MEGAMENÚ - Sistema de navegación expandible
   ============================================================================ */

/* ─────────────────────────────────────────────────────────────────────
   CONTENEDOR PRINCIPAL DEL MEGAMENÚ
   ───────────────────────────────────────────────────────────────────── */

.megamenu {
    width: 100%;
    background: transparent; /* El fondo es el degradado del header que se extiende */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-block: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* Estado visible */
.megamenu--active {
    max-height: 1000px; /* Altura suficiente para el contenido */
    opacity: 1;
    padding-block: var(--spacing-xl);
}

/* ─────────────────────────────────────────────────────────────────────
   GRID PRINCIPAL: 3fr (productos) + 1fr (banner)
   ───────────────────────────────────────────────────────────────────── */

.megamenu__grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: var(--spacing-lg); /* 28px - mismo gap que usamos en el proyecto */
}

/* ─────────────────────────────────────────────────────────────────────
   SECCIÓN IZQUIERDA: PRODUCTOS
   ───────────────────────────────────────────────────────────────────── */

.megamenu__products-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md); /* 24px entre el título y las columnas */
}

/* Título "Productos" que abarca las 3 columnas */
.megamenu__products-title {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Grid de 3 columnas de productos */
.megamenu__products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-lg); /* 28px - mismo gap que el grid padre */
}

/* ─────────────────────────────────────────────────────────────────────
   COLUMNAS DE PRODUCTOS INDIVIDUALES
   ───────────────────────────────────────────────────────────────────── */

.megamenu__column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm); /* 16px entre elementos */
}

.megamenu__column-title {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 var(--spacing-xs) 0;
}

.megamenu__column-description {
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 var(--spacing-sm) 0;
}

/* Botón "Ver más" */
.megamenu__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.megamenu__cta:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

.megamenu__cta-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.megamenu__cta:hover .megamenu__cta-icon {
    transform: translateX(4px);
}

/* ─────────────────────────────────────────────────────────────────────
   SECCIÓN DERECHA: BANNER DISPLAY
   ───────────────────────────────────────────────────────────────────── */

.megamenu__banner {
    background: var(--gradient-05); /* Gradiente magenta-morado */
    border-radius: var(--radius-md);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.megamenu__banner-title {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 var(--spacing-md) 0;
}

.megamenu__banner-description {
    font-family: var(--font-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.megamenu__banner-icon {
    position: absolute;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    opacity: 0.9;
}

/* ─────────────────────────────────────────────────────────────────────
   INDICADOR VISUAL EN EL MENÚ PRINCIPAL
   ───────────────────────────────────────────────────────────────────── */

.header__nav a {
    position: relative;
}

.header__nav a.has-megamenu::after {
    content: '▾';
    margin-left: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.header__nav a.has-megamenu.megamenu-open::after {
    transform: rotate(180deg);
}

/* ─────────────────────────────────────────────────────────────────────
   RESPONSIVE: TABLET (max-width: 900px)
   ───────────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .megamenu__grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .megamenu__products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .megamenu__banner {
        min-height: 200px;
    }
}

/* ─────────────────────────────────────────────────────────────────────
   RESPONSIVE: MÓVIL (max-width: 500px)
   ───────────────────────────────────────────────────────────────────── */

@media (max-width: 500px) {
    .megamenu {
        padding-block: var(--spacing-lg);
    }
    
    .megamenu__products-title {
        font-size: 1.25rem;
    }
    
    .megamenu__column-title {
        font-size: 1rem;
    }
    
    .megamenu__banner-title {
        font-size: 1.5rem;
    }
}
