/* Mehr-Navigation: nach swim.css laden. Header und Inhalt kommen aus footer.php.
 * Das bisherige 65vh-Panel war absichtlich unten begrenzt, nicht verdeckt.
 * Stacking-Heuristik: Navigation ist ein body-Kind außerhalb von .site;
 * in den geprüften Theme-Styles kein transformierter gemeinsamer Vorfahr.
 * Keine globalen transform-/Stacking-Resets: fremde Komponenten bleiben intakt.
 */
@media screen and (max-width: 1030px) {
    body {
        --mbn-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
        padding-bottom: calc(var(--mbn-nav-height) + 5px) !important;
    }

    body.mbn-menu-open {
        position: fixed;
        top: var(--mbn-scroll-top, 0px);
        left: 0;
        right: 0;
        width: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    #mobileBottomNav {
        box-sizing: border-box;
        height: var(--mbn-nav-height);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        z-index: 10002;
    }

    #mobileBottomNav .mbn-more {
        border: 0;
        border-radius: 0;
        background: transparent;
        font-family: inherit;
        color: inherit;
        cursor: pointer;
        min-height: 44px;
        appearance: none;
    }

    #mobileBottomNav .mbn-more.active {
        color: #384656;
        background: #f0f2f5;
    }

    #mbnOverlay {
        display: none;
        position: fixed;
        inset: 0 0 var(--mbn-nav-height);
        z-index: 10001;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        max-height: none;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #fff;
        color: #384656;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        transform: none;
        opacity: 0;
        pointer-events: none;
        transition: none;
    }

    #mbnOverlay.open {
        display: flex;
        flex-direction: column;
        opacity: 1;
        pointer-events: auto;
    }

    #mbnOverlay .mbn-overlay-header {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: calc(12px + env(safe-area-inset-top, 0px))
            max(16px, env(safe-area-inset-right, 0px))
            12px max(20px, env(safe-area-inset-left, 0px));
        border-bottom: 1px solid #e0e0e0;
        background: #fff;
    }

    #mbnOverlay .mbn-overlay-title {
        margin: 0;
        padding: 0;
        color: #384656;
        font-size: 22px;
        font-weight: 700;
        line-height: 1.3;
        text-transform: none;
        letter-spacing: normal;
    }

    #mbnOverlay .mbn-overlay-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-width: 44px;
        min-height: 44px;
        margin: 0;
        padding: 8px;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: inherit;
        font-family: inherit;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        appearance: none;
    }

    #mbnOverlay .mbn-overlay-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        padding: 8px max(16px, env(safe-area-inset-right, 0px))
            24px max(16px, env(safe-area-inset-left, 0px));
    }

    #mbnOverlay .mbn-overlay-section {
        margin: 0;
        padding: 12px 0;
        border-bottom: 1px solid #e0e0e0;
    }

    #mbnOverlay .mbn-overlay-section:last-child {
        border-bottom: 0;
    }

    #mbnOverlay .mbn-overlay-heading {
        margin: 0;
        padding: 8px 12px;
        color: #576685;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.5;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    #mbnOverlay .mbn-overlay-section a {
        display: flex;
        align-items: center;
        box-sizing: border-box;
        min-height: 48px;
        margin: 0;
        padding: 12px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: #384656;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.5;
        text-decoration: none;
        overflow-wrap: anywhere;
    }

    #mbnOverlay .mbn-overlay-section a:hover,
    #mbnOverlay .mbn-overlay-section a:active {
        background: #f0f2f5;
    }

    #mbnOverlay .mbn-overlay-section a[aria-current="page"],
    #mbnOverlay .mbn-overlay-section a.active,
    #mbnOverlay .mbn-overlay-section .current-menu-item > a {
        background: #e6eff9;
        color: #384656;
        font-weight: 700;
        box-shadow: inset 4px 0 0 #384656;
    }

    #mbnOverlay a:focus-visible,
    #mbnOverlay .mbn-overlay-close:focus-visible,
    #mobileBottomNav .mbn-more:focus-visible {
        outline: 2px solid #384656;
        outline-offset: -3px;
    }
}

@media screen and (min-width: 1031px) {
    #mbnOverlay,
    #mbnOverlay.open {
        display: none;
    }
}
