

.loile-header-container {
    --header-padding-top: 20px;
    --header-content-height: 50px;
    --header-bar-total: calc(var(--header-padding-top) * 2 + var(--header-content-height));
    --mega-content-gap: 24px; /* ruimte tussen nav en afbeeldingen (2× ~12px) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 40px);
    max-width: 1100px;
    margin: 0 auto;
    background-color: #fafafacf;
    backdrop-filter: blur(8px);
    border-radius: 25px;
    padding: 20px 10px 20px 20px;
    height: 50px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    transition: all 0.3s ease, background-color 0.3s ease;
}

.loile-header-container > * {
    opacity: 1;
}

.loile-header-container.mega-menu-active {
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 25px;
}

/* Smal dropdown-submenu (desktop): compacte lijst met alleen links */
.menu-item-has-children {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 260px;
    width: max-content;
    background-color: #fafafaf2;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    z-index: 50;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s linear 0.22s;
    box-sizing: border-box;
}

.menu-item-has-children.active .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.header-logo {
    display: flex;
    justify-content: flex-start;
    z-index: 1;
    flex-shrink: 0;
    position: relative;
}

.header-logo img {
    max-height: 25px;
    width: auto !important;
    height: auto;
}

.menu-container {
    position: relative;
    width: 100%;
    overflow: visible;
    display: flex;
    justify-content: center;
    flex: 1;
}

.menu-items {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
    align-items: center;
    position: relative;
}

.menu-items li {
    display: inline-block;
}

.menu-items > li > a {
    color: #1d1d1d;
    font-size: 15px;
    text-decoration: none !important;
    font-weight: 400;
    padding: 8px 15px;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease, font-weight 0.3s ease;
    outline: none !important;
    border: none !important;
    background: none !important;
    display: inline-block;
}

.menu-items > li > a:hover {
    color: #1d1d1d;
    text-decoration: none !important;
    font-weight: 600;
}

.menu-items > li > a:focus {
    outline: none !important;
    text-decoration: none !important;
    color: #1d1d1d;
}

.menu-items > li > a:active {
    outline: none !important;
    text-decoration: none !important;
    color: #1d1d1d;
}

.hover-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: #f3f3f3;
    border-radius: 20px;
    transition: all 0.3s ease;
    z-index: 1;
}

.menu-items .current-menu-item a,
.menu-items li.current-menu-ancestor > a,
.menu-items li.current-menu-parent > a,
.menu-items li.current-page-ancestor > a {
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-flex;
    justify-content: center;
    width: 100%;
    color: #2563EB;
    position: relative;
    font-weight: 600;
}

.menu-items .current-menu-item a::before,
.menu-items li.current-menu-ancestor > a::before,
.menu-items li.current-menu-parent > a::before,
.menu-items li.current-page-ancestor > a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #ffffff;
    border-radius: 20px;
    z-index: -1;
}

.menu-items .current-menu-item a,
.menu-items .current-menu-item a:focus,
.menu-items .current-menu-item a:active,
.menu-items li.current-menu-ancestor > a,
.menu-items li.current-menu-ancestor > a:focus,
.menu-items li.current-menu-ancestor > a:active,
.menu-items li.current-page-ancestor > a,
.menu-items li.current-page-ancestor > a:focus,
.menu-items li.current-page-ancestor > a:active {
    color: #2563EB;
}

.menu-items .current-menu-item a:hover,
.menu-items li.current-menu-ancestor > a:hover,
.menu-items li.current-page-ancestor > a:hover {
    color: #2563EB !important;
}

.text-container {
    background-color: #2563EB;
    color: #ffffff!important;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    text-decoration: none !important;
    height: 36px;
    align-items: center;
}

.text-container:hover {
    background-color: #1d1d1d;
    color: #fff!important;
    text-decoration: none !important;
}

.mega-menu-inner {
    width: 100%;
}

.submenu-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu-item {
    display: block;
    min-width: 0;
    background: none;
}

.submenu-item__link {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    text-decoration: none;
    background: transparent;
    color: #1d1d1d;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-sizing: border-box;
}

.submenu-item__link:hover {
    /* Zelfde lichtgrijze pill als de hover in de hoofdnavigatie */
    background-color: #f3f3f3;
    color: #1d1d1d;
    text-decoration: none;
}

/* Submenu toont alleen links — geen afbeeldingen */
.submenu-image {
    display: none;
}

.submenu-item__title,
.submenu-item h4 {
    display: block;
    position: static;
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: inherit;
    text-align: left;
    background: transparent;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.submenu-item__link:hover .submenu-item__title,
.submenu-item a:hover h4 {
    color: #1d1d1d;
}

.submenu-item .submenu-item__link {
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
    position: static;
    z-index: auto;
}

.menu-item-has-children > a {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.menu-item-has-children.active > a .dropdown-icon {
    transform: rotate(180deg);
}

.mega-menu-close {
    /* Overbodig bij het compacte dropdown-menu */
    display: none;
    position: absolute;
    top: 10px;
    right: 20px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.35s, transform 0.3s ease;
}

.menu-item-has-children.active:not(.closing) .mega-menu-close {
    opacity: 1;
}

.mega-menu-close svg {
    width: 24px;
    height: 24px;
    color: #000000;
    transition: transform 0.3s ease;
}

.mega-menu-close:hover svg {
    transform: rotate(90deg);
}

.menu-item-has-children.closing .mega-menu-close {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.hamburger-menu {
    display: none;
    /* 44px hit-area (Apple HIG / WCAG 2.5.8), icoon blijft 24px */
    width: 44px;
    height: 44px;
    position: relative;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    border-radius: 0;
    padding: 0;
    color: #333333;
    /* Voorkom dat iOS Safari zijn eigen (blauwe) knopstijl tekent */
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
}

    .hamburger-menu svg {
        width: 24px;
        height: 24px;
        color: #333333;
        transition: all 0.3s ease;
    }

.mobile-logo {
    display: none;
}

.mobile-menu-footer {
    display: none;
}

.menu-item-has-children.closing .mega-menu {
    transition:
        opacity 0.25s cubic-bezier(0.4, 0, 1, 1),
        max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
        width 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.12s,
        padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item-has-children.closing .submenu-item {
    opacity: 0;
    transform: translateY(-10px);
    transition:
        opacity 0.2s cubic-bezier(0.4, 0, 1, 1),
        transform 0.25s cubic-bezier(0.4, 0, 1, 1);
}

.menu-item-has-children.closing .submenu-item:nth-child(1) { transition-delay: 0s; }
.menu-item-has-children.closing .submenu-item:nth-child(2) { transition-delay: 0.03s; }
.menu-item-has-children.closing .submenu-item:nth-child(3) { transition-delay: 0.06s; }
.menu-item-has-children.closing .submenu-item:nth-child(4) { transition-delay: 0.09s; }
.menu-item-has-children.closing .submenu-item:nth-child(5) { transition-delay: 0.12s; }
.menu-item-has-children.closing .submenu-item:nth-child(6) { transition-delay: 0.15s; }

@media (max-width: 768px) {
    .menu-container,
    .text-container,
    .hover-indicator {
        display: none;
    }
    
    .menu-items .current-menu-item a::before {
        display: none;
    }

    .hamburger-menu {
        display: flex;
        position: absolute;
        /* Vaste positie in beide staten: gecentreerd in de 50px-balk,
           uitgelijnd met het logo als het menu open is — geen versprong */
        top: 3px;
        right: 10px;
        z-index: 100;
    }

    .loile-header-container {
        padding: 20px 10px 20px 20px;
        justify-content: space-between;
        /* Breed genoeg voor logo (58px) + 44px knop zonder overlap */
        width: 156px;
        max-width: 156px;
        background-color: #fafafacf;
        box-sizing: border-box;
        /* Hoogte wordt door JS gemeten en gezet; breedte en hoogte animeren samen */
        transition:
            height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            background-color 0.3s ease;
    }

    .loile-header-container.mobile-active {
        background-color: #fafafacf !important;
        backdrop-filter: blur(8px);
        width: calc(100% - 40px);
        max-width: 1100px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .loile-header-container.mobile-active .header-logo {
        position: absolute;
        left: 20px;
        top: 13px;
    }

    .loile-header-container.mobile-closing {
        width: 156px;
        max-width: 156px;
    }

    .loile-header-container > * {
        opacity: 1;
        animation: none;
    }




    .hamburger-menu .hamburger-icon {
        display: block;
    }

    .hamburger-menu .close-icon {
        display: none;
    }

    .hamburger-menu.active .hamburger-icon {
        display: none;
    }

    .hamburger-menu.active .close-icon {
        display: block;
    }

    .mobile-active .menu-container {
        display: block;
        margin: 40px 35px 20px 30px;
        opacity: 0;
        transform: translateY(-20px);
        animation: fadeInMenu 0.5s ease 0.2s forwards;
    }

    .mobile-closing .menu-container {
        animation: fadeOutMenu 0.25s ease 0s forwards;
    }

    @keyframes fadeInMenu {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeOutMenu {
        to {
            opacity: 0;
            transform: translateY(-20px);
        }
    }

    .mobile-active .menu-items {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .mobile-active .menu-items > li > a {
        color: #333333;
        font-size: 24px;
        font-weight: normal;
        opacity: 0;
        transform: translateX(-20px);
        animation: slideInMenuItem 0.5s ease forwards;
        padding: 0px!important;
    }

    /* Stagger via --i (gezet door JS), zodat elk aantal menu-items meedoet */
    .mobile-active .menu-items > li > a {
        animation-delay: calc(0.25s + var(--i, 0) * 0.07s);
    }

    .mobile-closing .menu-items > li > a {
        animation: slideOutMenuItem 0.25s ease forwards;
    }

    @keyframes slideInMenuItem {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .mobile-active .menu-items > li.current-menu-item > a,
    .mobile-active .menu-items > li.current-menu-ancestor > a,
    .mobile-active .menu-items > li.current-page-ancestor > a {
        color: #2563EB;
        background: none;
        animation-name: slideInMenuItemActive;
    }

    .mobile-active .menu-items > li > a:hover {
        color: #2563EB;
        text-decoration: none;
    }

    @keyframes slideInMenuItemActive {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes slideOutMenuItem {
        to {
            opacity: 0;
            transform: translateX(-20px);
        }
    }

    /* Submenu's als accordeon binnen het uitgeklapte mobiele menu */
    .mobile-active .mega-menu {
        display: block;
        position: static;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: 0;
        opacity: 1;
        visibility: visible;
        overflow: hidden;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0 !important;
        margin: 0;
        z-index: auto;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-active .menu-item-has-children.submenu-open .mega-menu {
        max-height: 500px;
    }

    .mobile-active .mega-menu-close {
        display: none;
    }

    .mobile-active .mega-menu-inner {
        padding: 8px 0 4px 16px;
        opacity: 1 !important;
        transform: none !important;
        transition: none;
    }

    .mobile-active .submenu-grid {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .mobile-active .submenu-item {
        opacity: 1 !important;
        transform: none !important;
        transition: none;
    }

    .mobile-active .submenu-item .submenu-image {
        display: none;
    }

    .mobile-active .submenu-item__link {
        display: block;
        padding: 4px 0;
        text-decoration: none;
    }

    .mobile-active .submenu-item__title {
        color: #333333;
        font-size: 18px;
        font-weight: normal;
    }

    .mobile-active .submenu-item__link:hover .submenu-item__title {
        color: #2563EB;
    }

    .mobile-active .dropdown-icon {
        display: inline-block;
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
    }

    .mobile-active .menu-item-has-children.submenu-open > a .dropdown-icon {
        transform: rotate(180deg);
    }

    .mobile-active .mobile-menu-footer {
        display: flex;
        margin-top: auto;
        padding-top: 15px;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInFooter 0.5s ease 0.4s forwards;
    }

    .mobile-closing .mobile-menu-footer {
        animation: fadeOutFooter 0.25s ease 0s forwards;
    }

    @keyframes fadeInFooter {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeOutFooter {
        to {
            opacity: 0;
            transform: translateY(20px);
        }
    }

    .mobile-login {
        color: #333333;
        text-decoration: none;
    }

    .mobile-login:hover {
        color: #2563EB;
        text-decoration: none;
    }

    /* Logo weergave op mobiel */
    .desktop-logo {
        display: none;
    }
    
    .mobile-logo {
        display: block;
    }
}

.submenu-item.current-menu-item a,
.submenu-item.current-menu-item .submenu-item__title,
.submenu-item.current-menu-item h4,
.submenu-item.active a {
    background: none;
    text-decoration: none;
}

.menu-items .current-menu-item .submenu-item a,
.menu-items .current-menu-item .submenu-item__link {
    background: none;
    padding: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
}
