/* Mega menu — polished styling */

:root {
    --mega-bg: #2a3141;
    --mega-text: #ffffff;
    --mega-text-muted: #9aa1b2;
    --mega-border: #3a4256;
    --mega-hover: #c95e1f;
    --mega-accent: #c95e1f;
}

.header__nav-list {
    position: relative;
}

.header__nav-item {
    position: static;
}

.header__nav-item.has-mega > .header__nav-link {
    position: relative;
}

.mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    /* background is set dynamically by applyTheme() in JS to match the active section */
    border-top: 1px solid var(--mega-border);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
    z-index: 50;
}

.header__nav-item.has-mega:hover .mega-menu,
.header__nav-item.has-mega:focus-within .mega-menu {
    display: block;
    animation: mega-fade-in 0.15s ease;
}

@keyframes mega-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mega-menu__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 48px;
    display: flex;
    gap: 56px;
}

.mega-menu__body {
    flex: 1;
}

.mega-menu__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mega-text);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--mega-accent);
    display: inline-block;
}

.mega-menu__columns {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
}

.mega-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 170px;
}

.mega-menu__list li {
    margin-bottom: 4px;
}

.mega-menu__link {
    display: block;
    padding: 8px 4px;
    text-decoration: none;
    /* color is set dynamically by applyTheme() in JS */
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.mega-menu__link:hover {
    color: var(--mega-hover) !important;
    padding-left: 10px;
}

.mega-menu__feature {
    flex-shrink: 0;
    width: 260px;
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    align-self: stretch;
}

.mega-menu__feature img,
.mega-menu__feature-fallback {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #f0e4c8, #e3c988);
}

.mega-menu__feature-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 55%);
}

.mega-menu__feature-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--mega-accent);
    font-weight: 700;
    margin-bottom: 4px;
}

.mega-menu__feature-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Mobile: stacked accordion instead of full-width panel */
@media (max-width: 768px) {
    .mega-menu {
        position: static;
        display: none;
        box-shadow: none;
        border-top: none;
    }

    .header__nav-item.has-mega.is-open .mega-menu {
        display: block;
    }

    .mega-menu__inner {
        flex-direction: column;
        padding: 20px;
        gap: 24px;
    }

    .mega-menu__columns {
        gap: 24px;
    }

    .mega-menu__feature {
        width: 100%;
    }
}

