/*
 * Ladenaanhuis Mobile Nav Fix
 * Fixes common Elementor mobile menu issues:
 * - hamburger cannot be clicked because another container overlays it
 * - dropdown opens behind hero/section
 * - horizontal mobile scroll / white space on the right side
 */

html,
body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

body {
    position: relative;
}

/* Keep Elementor page wrappers inside the viewport. */
.elementor,
.elementor-section,
.elementor-container,
.elementor-widget-wrap,
.e-con,
.e-con-inner,
.elementor-location-header,
.elementor-location-header * {
    box-sizing: border-box;
}

.elementor,
.elementor-section,
.elementor-container,
.elementor-widget-wrap,
.e-con,
.e-con-inner {
    max-width: 100% !important;
}

/* Header/menu should always sit above the page content. */
.elementor-location-header,
.elementor-location-header .elementor-section,
.elementor-location-header .elementor-container,
.elementor-location-header .e-con,
.elementor-location-header .elementor-widget-nav-menu,
.elementor-location-header .elementor-nav-menu__container,
.elementor-location-header .elementor-menu-toggle,
.elementor-location-header .elementor-nav-menu--dropdown {
    z-index: 99999 !important;
}

.elementor-location-header {
    position: relative !important;
    isolation: isolate;
}

.elementor-location-header .elementor-widget-nav-menu,
.elementor-location-header .elementor-menu-toggle {
    position: relative !important;
    pointer-events: auto !important;
}

.elementor-location-header .elementor-menu-toggle {
    cursor: pointer !important;
    user-select: none;
    touch-action: manipulation;
}

/* Make sure the dropdown can escape the header container. */
.elementor-location-header,
.elementor-location-header .elementor-section,
.elementor-location-header .elementor-container,
.elementor-location-header .elementor-widget-wrap,
.elementor-location-header .e-con,
.elementor-location-header .e-con-inner,
.elementor-location-header .elementor-widget-nav-menu {
    overflow: visible !important;
}

/* Mobile-only layout safety. */
@media (max-width: 1024px) {
    .elementor-location-header,
    .elementor-location-header .elementor-section,
    .elementor-location-header .elementor-container,
    .elementor-location-header .elementor-widget-wrap,
    .elementor-location-header .e-con,
    .elementor-location-header .e-con-inner {
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        right: auto !important;
    }

    .elementor-location-header .elementor-widget-nav-menu {
        max-width: 100% !important;
    }

    .elementor-location-header .elementor-nav-menu--dropdown,
    .elementor-location-header .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .elementor-location-header .elementor-nav-menu--dropdown ul,
    .elementor-location-header .elementor-nav-menu--dropdown li,
    .elementor-location-header .elementor-nav-menu--dropdown a {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Stop accidental wide buttons/text blocks in the top bar from creating right-side white space. */
    .elementor-location-header img,
    .elementor-location-header svg,
    .elementor-location-header video,
    .elementor-location-header iframe {
        max-width: 100% !important;
        height: auto;
    }
}

/* Elementor sometimes marks dropdown hidden with max-height/display logic. This class is added by our JS fallback only. */
.lah-menu-force-open > .elementor-nav-menu--dropdown,
.lah-menu-force-open .elementor-nav-menu--dropdown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    height: auto !important;
    max-height: none !important;
}

/* Optional: when Elementor leaves aria-expanded true, make sure menu is actually visible. */
.elementor-menu-toggle[aria-expanded="true"] ~ .elementor-nav-menu--dropdown,
.elementor-menu-toggle[aria-expanded="true"] + .elementor-nav-menu--dropdown {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
