/* =========================================
   3. MEGA MENU – HOVER ONLY, CENTRE
========================================= */

.mega-nav {
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid rgba(12, 34, 55, 0.06);
    position: relative;
    z-index: 8000; /* 🔧 hoger zodat niets erboven komt */
    overflow: visible;
}

.mega-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* =========================================
   ROOT MENU (DESKTOP)
========================================= */

.mega-root {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: center;
}

.mega-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* =========================================
   MENU BUTTON
========================================= */

.mega-button {
    border: none;
    background: rgba(12, 34, 55, 0.02);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--dark-blue);
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.mega-item:hover .mega-button {
    background: var(--grey-blue);
    box-shadow: var(--dark-green);
}

/* =========================================
   DESKTOP DROPDOWN (HOVER)
========================================= */

.mega-dropdown {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 70vw;
    max-width: 960px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 90;
}

.mega-item:hover .mega-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.mega-dropdown-inner {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(12, 34, 55, 0.18);
    padding: 22px 24px 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 260px;
    gap: 20px;
}

/* =========================================
   DROPDOWN CONTENT
========================================= */

.mega-col {
    font-size: 0.9rem;
}

.mega-col-title {
    margin: 0 0 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.mega-col a {
    display: block;
    margin-bottom: 4px;
    color: rgba(12, 34, 55, 0.8);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.18s ease, transform 0.18s ease;
}

.mega-col a:hover {
    color: var(--dark-green);
    transform: translateX(2px);
}

.mega-col--highlight {
    align-self: stretch;
}

.mega-highlight-card {
    height: 100%;
    border-radius: 20px;
    background: var(--grey-blue);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
}

.mega-highlight-card--orange {
    background: var(--orange);
}

.mega-highlight-card h4 {
    margin: 0 0 4px;
    font-size: 0.96rem;
}

.mega-highlight-card p {
    margin: 0 0 10px;
    font-size: 0.88rem;
    opacity: 0.9;
}

.mega-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--dark-blue);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* =========================================
   TABLET & TELEFOON – CATEGORY SLIDER
========================================= */

@media (max-width: 1024px) {

    .mega-container {
        display: grid;
        grid-template-columns: 56px 1fr;
        align-items: center;
    }

    .mega-hamburger {
        grid-column: 1;
        justify-self: center;
        align-self: center;
    }

    .mega-root {
        grid-column: 2;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-left: 4px;
        max-width: 100%;
    }

    .mega-root::-webkit-scrollbar {
        display: none;
    }

    .mega-item {
        flex: 0 0 calc((100% - (2 * 18px)) / 3);
        justify-content: center;
    }

    .mega-button {
        width: 100%;
        text-align: center;
    }

    .mega-dropdown {
        display: none;
    }

    .mega-item.is-active .mega-button {
        background: var(--grey-blue);
    }

    .mega-mobile-panel {
        display: none;
        margin-top: 16px;
        background: #ffffff;
        border-radius: 20px;
        padding: 20px;
        box-shadow: 0 16px 36px rgba(12, 34, 55, 0.16);
        grid-column: 1 / -1;
        max-width: 100%;
        overflow-x: hidden;
    }

    .mega-mobile-panel.is-open {
        display: block;
    }

    .mega-mobile-panel .mega-dropdown-inner {
        display: block;
        padding: 0;
        box-shadow: none;
        max-width: 100%;
    }
}

/* =========================================
   ☰ FULLSCREEN MENU (OVERLAY)
========================================= */

.mega-hamburger {
    display: none;
}

.mega-overlay {
    display: none;
}

@media (max-width: 1024px) {

    .mega-hamburger {
        display: inline-flex;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid rgba(12,34,55,0.2);
        background: var(--white);
        color: var(--dark-blue);
        font-size: 1.2rem;
        font-weight: 700;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        z-index: 100;
    }

    .mega-overlay {
        position: fixed;
        inset: 0;
        background: var(--white);
        z-index: 10000; /* 🔧 ALTIJD boven header */
        display: none;
        flex-direction: column;
        overflow-x: hidden;
        width: 100vw;
    }

    .mega-overlay.is-open {
        display: flex;
    }

    .mega-overlay-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(12,34,55,0.1);
        flex-shrink: 0;
    }

    .mega-overlay-title {
        font-weight: 700;
        color: var(--dark-blue);
    }

    .mega-overlay-close {
        border: none;
        background: none;
        font-size: 1.4rem;
        color: var(--dark-blue);
        cursor: pointer;
    }

    .mega-overlay-body {
        padding: 16px 20px 24px;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }

    .mega-overlay-item {
        border: 1px solid rgba(12,34,55,0.12);
        border-radius: 20px;
        margin-bottom: 16px;
        overflow: hidden;
        background: var(--white);
        width: 100%;
    }

    .mega-overlay-item-btn {
        width: 100%;
        padding: 14px;
        background: rgba(12,34,55,0.03);
        border: none;
        font-weight: 700;
        text-align: left;
        display: flex;
        justify-content: space-between;
        cursor: pointer;
    }

    .mega-overlay-item-panel {
        display: none;
        padding: 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .mega-overlay-item.is-open .mega-overlay-item-panel {
        display: block;
    }

    /* 🔒 DIT VERHINDERT LEKKEN DEFINITIEF */
    .mega-overlay .mega-dropdown-inner,
    .mega-overlay .mega-col,
    .mega-overlay .mega-highlight-card {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .mega-overlay .mega-dropdown-inner {
        display: block;
        padding: 0;
        box-shadow: none;
    }
}
