/* ==========================================================================
   AI Mega Menu — Glass Design (matching bike-compare)
   ========================================================================== */

/* ---- Reset ---- */
.aimm-mega, .aimm-mega *, .aimm-mega *::before, .aimm-mega *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-weight: 500;
}
.aimm-mega {
    position: relative;
    z-index: 99999;
    font-family: var(--aimm-font, 'Merriweather Sans', sans-serif);
    color: #000000;
    -webkit-font-smoothing: antialiased;
}
.aimm-mega a { text-decoration: none; color: inherit; }
.aimm-mega ul { list-style: none; }
.aimm-mega svg { flex-shrink: 0; display: block; }

/* ---- Top bar ---- */
.aimm-bar {
    position: relative;
    background: transparent;
    border-bottom: 0;
}

.aimm-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
}

/* ---- Nav items ---- */
.aimm-nav {
    display: flex;
    align-items: center;
    justify-content: var(--aimm-align, flex-end);
    gap: 0;
    width: 100%;
}

.aimm-nav-item {
    position: static;
}

.aimm-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    font-size: 15px !important;        /* gelijk aan submenu link-labels + !important tegen Elementor */
    font-weight: 500;
    color: var(--aimm-bar-text, #ffffff);
    background: transparent !important; /* niet-actief — forceer tegen Elementor */
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: color 0.25s ease, opacity 0.25s ease, background 0.25s ease;
    position: relative;
}

/* Hoofdmenu-item actief (hover op desktop, submenu open) — blauwe accent-tint */
.aimm-nav-item:hover > .aimm-nav-link,
.aimm-nav-item.aimm-active > .aimm-nav-link {
    background: rgba(0,144,227,0.08) !important;
}

.aimm-nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--aimm-bar-text, #ffffff);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.aimm-nav-item:hover .aimm-nav-link::after,
.aimm-nav-item.aimm-active .aimm-nav-link::after {
    transform: scaleX(1);
}

.aimm-nav-link:hover {
    opacity: 0.85;
}

.aimm-nav-link svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.aimm-chev {
    width: 13px !important;
    height: 13px !important;
    opacity: 0.5;
    margin-left: -2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aimm-nav-item:hover .aimm-chev,
.aimm-nav-item.aimm-active .aimm-chev {
    transform: rotate(180deg);
    opacity: 0.8;
}

/* ==========================================================================
   MEGA DROPDOWN — Glass Panel
   ========================================================================== */

.aimm-mega-drop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;

    /* Glass surface */
    background: var(--aimm-drop-bg, rgba(255,255,255,0.45));
    color: var(--aimm-drop-text, #000000);
    border: 1px solid var(--aimm-border, rgba(255,255,255,0.6));
    border-radius: 20px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.7),
        0 12px 40px rgba(0,0,0,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    pointer-events: none;
}

/* Glass sheen */
.aimm-mega-drop::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
    z-index: 0;
}

/* Hover reveal on desktop */
.aimm-nav-item:hover > .aimm-mega-drop,
.aimm-nav-item.aimm-active > .aimm-mega-drop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.aimm-mega-inner {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 28px 32px;
}

/* ---- Columns grid (max 3) ---- */
.aimm-cols {
    display: grid;
    gap: 28px;
}
.aimm-cols-1 { grid-template-columns: 1fr; max-width: 380px; }
.aimm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.aimm-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- Column heading ---- */
.aimm-col-heading {
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0;
    text-transform: none;
    color: #000000 !important;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.aimm-col-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ---- Individual link — glass card ---- */
.aimm-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.aimm-link:hover {
    background: rgba(255,255,255,0.55);
    border-color: rgba(255,255,255,0.8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 4px 16px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}

.aimm-link:focus-visible {
    outline: 2px solid var(--aimm-accent, #1e5faa);
    outline-offset: -2px;
    background: rgba(255,255,255,0.55);
}

/* Icon — blue glass circle */
.aimm-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: rgba(0,144,227,0.08);
    border: 1px solid rgba(0,144,227,0.12);
    color: #0090e3;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
    transition: all 0.25s ease;
}

.aimm-link:hover .aimm-link-icon {
    background: #0090e3;
    border-color: rgba(0,144,227,0.4);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        0 2px 8px rgba(0,144,227,0.2);
    transform: scale(1.05);
}

.aimm-link-icon svg {
    width: 18px;
    height: 18px;
}

.aimm-link-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 3px;
}

.aimm-link-label {
    font-size: var(--aimm-link-size, 15px);
    font-weight: 600 !important;
    color: #000000;
    line-height: 1.3;
}

.aimm-link:hover .aimm-link-label {
    color: var(--aimm-accent, #1e5faa);
}

.aimm-link-desc {
    font-size: var(--aimm-desc-size, 13px);
    color: #3d4f6a;
    line-height: 1.4;
    font-weight: 400 !important;
}

/* ==========================================================================
   Mobile Toggle (hamburger)
   ========================================================================== */

.aimm-toggle {
    display: none;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    background: rgba(255,255,255,0.15) !important;   /* niet-actief — forceer tegen Elementor */
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    color: var(--aimm-bar-text, #ffffff);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.aimm-toggle:hover {
    background: rgba(255,255,255,0.25) !important;
}

.aimm-toggle svg line {
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
}

.aimm-toggle[aria-expanded="true"] .aimm-l1 { transform: translateY(6px) rotate(45deg); }
.aimm-toggle[aria-expanded="true"] .aimm-l2 { opacity: 0; }
.aimm-toggle[aria-expanded="true"] .aimm-l3 { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Desktop — Breek mega-drop uit Elementor-kolom (gecentreerd, max 1340px)
   --aimm-drop-top wordt door JS dynamisch ingevuld op basis van .aimm-bar
   ========================================================================== */
@media (min-width: 1025px) {
    .aimm-mega-drop {
        position: fixed;
        top: var(--aimm-drop-top, 64px);
        left: 50%;
        right: auto;
        width: calc(100vw - 32px);
        max-width: 1340px;
        transform: translate(-50%, -6px);   /* gecentreerd + verborgen-startpositie */
    }

    /* Override de basis open-state transform zodat -50% bewaard blijft */
    .aimm-nav-item:hover > .aimm-mega-drop,
    .aimm-nav-item.aimm-active > .aimm-mega-drop {
        transform: translate(-50%, 0);
    }

    .aimm-mega-inner {
        max-width: none;
        margin: 0;
    }
}

/* ==========================================================================
   Responsive — Tablet + Mobile
   Full-width overlay, compactere hamburger, kleinere typografie
   ========================================================================== */

@media (max-width: 1024px) {
    /* Hamburger rechts uitlijnen + compacter */
    .aimm-bar-inner {
        justify-content: flex-end;
    }

    .aimm-toggle {
        display: flex !important;
        position: relative;
        z-index: 100000;   /* boven het overlay zodat de X-knop bereikbaar blijft */
        padding: 6px 10px !important;
        gap: 6px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
    }

    /* Bij geopend overlay: pin de toggle vast aan de viewport als nette
       vierkante knop. Blauwe accent-tint + donkere X, alles !important
       zodat Elementor de vorm/kleur niet kan overschrijven. */
    .aimm-mega.aimm-overlay-open .aimm-toggle {
        position: fixed !important;
        top: 12px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        gap: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
        background: rgba(0,144,227,0.08) !important;   /* actief — forceer tegen Elementor */
        border: 1px solid rgba(0,144,227,0.30) !important;
        box-shadow: none !important;
        color: #1a1a1a !important;                     /* donkere X (stroke volgt currentColor) */
    }

    .aimm-mega.aimm-overlay-open .aimm-toggle:hover {
        background: rgba(0,144,227,0.14) !important;
    }

    /* X iets groter en strak gecentreerd in de vierkante knop */
    .aimm-mega.aimm-overlay-open .aimm-toggle svg {
        width: 20px !important;
        height: 20px !important;
    }

    .aimm-toggle svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* "Menu"-label weg op tablet én mobiel voor compacte look */
    .aimm-toggle span:last-child {
        display: none;
    }

    /* Menu paneel = full-screen overlay (breekt uit smalle parent) */
    .aimm-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        justify-content: flex-start;   /* override desktop flex-end — anders zakken items naar de onderkant in column-flex */
        align-items: stretch;          /* override desktop center — items full-width */
        background: rgba(255,255,255,0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 72px 16px 24px;   /* top = ruimte voor de toggle (tweak naar header-hoogte) */
        max-height: 100vh;
        overflow-y: auto;
        z-index: 99998;
    }

    .aimm-nav.aimm-open {
        display: flex;
        animation: aimmReveal 0.25s ease forwards;
    }

    @keyframes aimmReveal {
        from { opacity: 0; transform: translateY(-6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .aimm-nav-item { width: 100%; }

    .aimm-nav-link {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px !important;   /* gelijk aan submenu link-labels op mobiel */
        justify-content: flex-start;
        color: #000000 !important;    /* forceer donker — anders maakt Elementor het actieve item wit */
    }

    .aimm-nav-link::after { display: none; }

    /* Mega-drop inline binnen het overlay (geen fixed meer, geen glass) */
    .aimm-mega-drop {
        position: relative;
        top: auto; left: auto; right: auto;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        display: none;
        transition: none;
    }

    .aimm-mega-drop::before { display: none; }

    .aimm-nav-item:hover > .aimm-mega-drop { display: none; }
    .aimm-nav-item.aimm-active > .aimm-mega-drop { display: block; }

    .aimm-mega-inner {
        padding: 4px 0 8px 12px;
        border-left: 2px solid rgba(0,144,227,0.4);
        margin-left: 8px;
        max-width: none;
    }

    .aimm-cols,
    .aimm-cols-2,
    .aimm-cols-3 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Compactere link-cards (descriptions zijn weg op mobiel) */
    .aimm-link {
        align-items: center;
        padding: 5px 8px;
        gap: 10px;
    }

    .aimm-link:hover {
        transform: none;
    }

    .aimm-link-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        border-radius: 8px;
    }

    .aimm-link-icon svg {
        width: 14px;
        height: 14px;
    }

    .aimm-link-text {
        padding-top: 0;
    }

    .aimm-link-label {
        font-size: 13px;
        line-height: 1.3;
    }

    /* Descriptions verbergen — anders wordt het menu te hoog en verliest overzicht */
    .aimm-link-desc {
        display: none;
    }

    .aimm-col-heading {
        font-size: 11.5px !important;
        padding-bottom: 6px;
        margin-bottom: 4px;
    }

    .aimm-col-links {
        gap: 0;
    }
}

@media (max-width: 480px) {
    .aimm-bar-inner { padding: 0; }

    .aimm-toggle {
        padding: 5px 8px !important;
    }

    .aimm-toggle svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Bij open overlay op smartphone: iets compacter, dicht bij de hoek */
    .aimm-mega.aimm-overlay-open .aimm-toggle {
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
    }

    .aimm-mega.aimm-overlay-open .aimm-toggle svg {
        width: 18px !important;
        height: 18px !important;
    }

    .aimm-nav {
        padding: 64px 12px 20px;
    }

    .aimm-nav-link {
        padding: 9px 10px;
        font-size: 12px !important;   /* gelijk aan submenu link-labels op smartphone */
    }

    .aimm-link {
        padding: 5px 6px;
        gap: 8px;
    }

    .aimm-link-label  { font-size: 12px; }
    .aimm-col-heading { font-size: 11px !important; }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print { .aimm-mega { display: none !important; } }
