/**
 * Phones (< 768px): header pinned to the top and the full-screen menu built by assets/js/mobile-nav.js.
 * Tablets and desktop keep the header and mega menus from style.css.
 */
.mobile-nav {
    display: none;
}

@media (max-width: 767px) {
    /* .bambu-page and body clip overflow, which stops position: sticky, so the header is fixed and the
       page is pushed down by its height (--bambu-header-height, kept in sync by main.js). */
    .bambu-page {
        padding-top: var(--bambu-header-height, 65px);
    }

    .bambu-page .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
        transition: box-shadow 0.2s ease;
    }

    .admin-bar .bambu-page .site-header {
        top: 46px;
    }

    .bambu-page .site-header.is-scrolled {
        box-shadow: 0 8px 24px rgba(3, 9, 24, 0.35);
    }

    /* The old in-header menu is replaced by the drawer. */
    .bambu-page .site-header.is-menu-open .primary-navigation-wrapper,
    .bambu-page .site-header.is-menu-open .header-actions {
        display: none;
    }

    html.bambu-mobile-nav-open,
    html.bambu-mobile-nav-open body {
        overflow: hidden;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: #071127;
        color: #ffffff;
        font-family: "Manrope", sans-serif;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.22s ease, transform 0.22s ease;
    }

    .admin-bar .mobile-nav {
        top: 46px;
    }

    .mobile-nav[hidden] {
        display: none;
    }

    .mobile-nav.is-open {
        opacity: 1;
        transform: none;
    }

    .mobile-nav svg {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-nav-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        min-height: var(--bambu-header-height, 65px);
        padding: 10px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-nav-brand {
        display: inline-flex;
        flex-direction: column;
        min-width: 0;
        color: #ffffff;
        text-decoration: none;
    }

    .mobile-nav-brand img {
        display: block;
        width: auto;
        height: 38px;
        max-width: 180px;
    }

    .mobile-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        cursor: pointer;
    }

    .mobile-nav-close:hover,
    .mobile-nav-close:focus-visible {
        background: rgba(255, 255, 255, 0.2);
    }

    .mobile-nav-body {
        position: relative;
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav-panel {
        display: flex;
        flex-direction: column;
        min-height: 100%;
        padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
    }

    .mobile-nav-panel[hidden] {
        display: none;
    }

    .mobile-nav-sub.is-open {
        animation: bambu-mobile-nav-in 0.24s ease both;
    }

    @keyframes bambu-mobile-nav-in {
        from {
            opacity: 0;
            transform: translateX(24px);
        }
    }

    .mobile-nav-list {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        min-height: 52px;
        padding: 10px 4px;
        border: 0;
        background: none;
        color: #ffffff;
        font: 600 20px/1.3 "Manrope", sans-serif;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .mobile-nav-link:hover,
    .mobile-nav-link:focus-visible {
        color: #6fd3a0;
    }

    .mobile-nav-opener svg {
        opacity: 0.8;
    }

    .mobile-nav-foot {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: auto;
        padding-top: 32px;
    }

    .mobile-nav-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 52px;
        padding: 12px 20px;
        border-radius: 9999px;
        font: 700 16px/1 "Manrope", sans-serif;
        text-decoration: none;
    }

    .mobile-nav-button.is-outline {
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #ffffff;
    }

    .mobile-nav-button.is-primary {
        color: #ffffff;
        background: linear-gradient(90deg, #43b263 0%, #3ba295 25%, #3b7ab5 50%, #7147a7 75%, #814272 100%);
    }

    .mobile-nav-account {
        justify-content: flex-start;
        padding: 12px 16px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 16px;
        font-size: 17px;
    }

    .mobile-nav-account span {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-account img {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        object-fit: cover;
    }

    .mobile-nav-back {
        display: flex;
        align-items: center;
        gap: 10px;
        width: calc(100% + 40px);
        margin: -20px -20px 12px;
        padding: 18px 20px;
        border: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        background: none;
        color: rgba(255, 255, 255, 0.6);
        font: 600 18px/1.3 "Manrope", sans-serif;
        text-align: left;
        cursor: pointer;
    }

    .mobile-nav-back:hover,
    .mobile-nav-back:focus-visible {
        color: #ffffff;
    }

    .mobile-nav-sub .mobile-nav-link {
        font-size: 19px;
    }
}

/* Below 601px the admin bar scrolls away with the page. */
@media (max-width: 600px) {
    .admin-bar .bambu-page .site-header,
    .admin-bar .mobile-nav {
        top: 0;
    }
}
