/* Child-owned mobile/tablet header. Desktop XStore output is untouched. */
.bambu-mobile-header,
.bambu-mobile-drawer,
.bambu-mobile-drawer-overlay {
    display: none;
}

@media (max-width: 1023px) {
    /* The configured XStore mobile hook currently produces no usable header.
       Hide any partial native wrapper so only one responsive header exists. */
    body > .mobile-header-wrapper,
    body .template-container > .mobile-header-wrapper,
    body .header-wrapper,
    body .sticky-header-wrapper {
        display: none !important;
    }

    .bambu-mobile-header {
        position: sticky;
        top: 0;
        z-index: 10010;
        display: grid;
        box-sizing: border-box;
        width: 100%;
        height: 58px;
        grid-template-columns: 48px 1fr 128px;
        align-items: center;
        padding: 0 6px;
        background: #fff;
        border-bottom: 1px solid #e6e6e6;
        box-shadow: none;
    }

    .bambu-mobile-header svg,
    .bambu-mobile-drawer svg {
        display: block;
        width: 21px;
        height: 21px;
    }

    .bambu-mobile-header__menu,
    .bambu-mobile-header__action,
    .bambu-mobile-drawer__account,
    .bambu-mobile-drawer__close,
    .bambu-mobile-drawer__back,
    .bambu-mobile-drawer__expand {
        display: inline-flex;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        align-items: center;
        justify-content: center;
        color: #171717;
        background: transparent;
        border: 0;
        border-radius: 6px;
        box-shadow: none;
        text-decoration: none;
        cursor: pointer;
    }

    .bambu-mobile-header__menu {
        grid-column: 1;
        justify-self: start;
    }

    .bambu-mobile-header__logo {
        position: absolute;
        top: 50%;
        left: 50%;
        display: flex;
        width: 78px;
        height: 42px;
        align-items: center;
        justify-content: center;
        transform: translate(-50%, -50%);
    }

    .bambu-mobile-header__logo img,
    .bambu-mobile-drawer__logo img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 34px;
        object-fit: contain;
    }

    .bambu-mobile-header__actions {
        grid-column: 3;
        display: flex;
        justify-self: end;
        align-items: center;
    }

    .bambu-mobile-header__search {
        display: contents;
    }

    .bambu-mobile-header__action {
        position: relative;
        flex: 0 0 40px;
        width: 40px;
        min-width: 40px;
        height: 44px;
    }

    .bambu-mobile-header__menu:hover,
    .bambu-mobile-header__menu:focus-visible,
    .bambu-mobile-header__action:hover,
    .bambu-mobile-header__action:focus-visible,
    .bambu-mobile-drawer button:hover,
    .bambu-mobile-drawer button:focus-visible,
    .bambu-mobile-drawer a:focus-visible {
        outline: 2px solid #00ae42;
        outline-offset: 1px;
    }

    .bambu-mobile-cart-count {
        position: absolute;
        top: 4px;
        right: 1px;
        display: flex;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        align-items: center;
        justify-content: center;
        color: #fff;
        background: #00b94f;
        border: 1px solid #fff;
        border-radius: 999px;
        font-size: 9px;
        font-weight: 600;
        line-height: 15px;
    }

    .bambu-mobile-cart-count.is-empty {
        display: none;
    }

    .bambu-mobile-drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 10020;
        display: block;
        background: rgba(0, 0, 0, .42);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .22s ease, visibility .22s ease;
    }

    .bambu-mobile-drawer-overlay[hidden] {
        display: none;
    }

    .bambu-mobile-drawer-overlay.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .bambu-mobile-drawer {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 10030;
        display: flex;
        width: min(84vw, 380px);
        max-width: calc(100vw - 48px);
        flex-direction: column;
        overflow: hidden;
        background: #f8f8f8;
        box-shadow: 8px 0 26px rgba(0, 0, 0, .16);
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform .25s ease, visibility .25s ease;
    }

    .bambu-mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .bambu-mobile-drawer__top {
        position: relative;
        z-index: 2;
        display: grid;
        flex: 0 0 58px;
        height: 58px;
        grid-template-columns: minmax(0, 1fr) 44px 44px;
        align-items: center;
        padding: 0 8px 0 16px;
        background: #fff;
        border-bottom: 1px solid #e7e7e7;
    }

    .bambu-mobile-drawer__logo {
        display: flex;
        width: 82px;
        height: 40px;
        align-items: center;
    }

    .bambu-mobile-drawer__account {
        grid-column: 2;
    }

    .bambu-mobile-drawer__close {
        grid-column: 3;
    }

    .bambu-mobile-drawer__stage {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .bambu-mobile-drawer__panel {
        position: absolute;
        inset: 0;
        display: block;
        padding: 12px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #f8f8f8;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: transform .22s ease, opacity .18s ease, visibility .22s ease;
    }

    .bambu-mobile-drawer__panel.is-active {
        z-index: 2;
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    .bambu-mobile-drawer__panel.is-parent {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-24%);
    }

    .bambu-mobile-drawer__all-products,
    .bambu-mobile-drawer__all-link {
        display: flex;
        min-height: 52px;
        padding: 10px 13px;
        align-items: center;
        gap: 10px;
        color: #152536;
        background: #e5f3ff;
        border-radius: 7px;
        font-size: 13px;
        font-weight: 500;
        text-decoration: none;
    }

    .bambu-mobile-drawer__all-link {
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .bambu-mobile-drawer__all-link svg {
        width: 16px;
        height: 16px;
    }

    .bambu-mobile-drawer__section-title {
        margin: 16px 4px 6px !important;
        color: #969696;
        font-size: 10px !important;
        font-weight: 500 !important;
        line-height: 1.4 !important;
        text-transform: none;
    }

    .bambu-mobile-drawer__list {
        margin: 0;
        padding: 0;
        overflow: hidden;
        list-style: none;
        background: #fff;
        border-radius: 7px;
    }

    .bambu-mobile-drawer__item {
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #f1f1f1;
        list-style: none;
    }

    .bambu-mobile-drawer__item:last-child {
        border-bottom: 0;
    }

    .bambu-mobile-drawer__row {
        display: grid;
        min-height: 48px;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: stretch;
    }

    .bambu-mobile-drawer__link {
        display: flex;
        min-width: 0;
        min-height: 48px;
        padding: 9px 12px;
        align-items: center;
        gap: 10px;
        color: #202020;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.35;
        text-decoration: none;
    }

    .bambu-mobile-drawer__services .bambu-mobile-drawer__link {
        width: 100%;
    }

    .bambu-mobile-drawer__item-icon {
        display: inline-flex;
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
        align-items: center;
        justify-content: center;
        color: #34424d;
    }

    .bambu-mobile-drawer__item-icon svg {
        width: 18px;
        height: 18px;
    }

    .bambu-mobile-drawer__expand {
        width: 44px;
        min-width: 44px;
        border-radius: 0;
    }

    .bambu-mobile-drawer__expand svg,
    .bambu-mobile-drawer__link-chevron svg {
        width: 15px;
        height: 15px;
    }

    .bambu-mobile-drawer__link-chevron {
        display: inline-flex;
        margin-left: auto;
        color: #777;
    }

    .bambu-mobile-drawer__panel-heading {
        display: grid;
        min-height: 48px;
        margin: -4px 0 10px;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        color: #1d1d1d;
        font-size: 14px;
        font-weight: 600;
        text-align: center;
    }

    .bambu-mobile-drawer__back {
        grid-column: 1;
    }

    .bambu-mobile-drawer__panel-heading > span {
        grid-column: 2;
    }

    html.bambu-mobile-nav-open,
    html.bambu-mobile-nav-open body {
        overflow: hidden !important;
        overscroll-behavior: none;
    }
}

@media (max-width: 359px) {
    .bambu-mobile-header {
        grid-template-columns: 44px 1fr 118px;
        padding-right: 2px;
        padding-left: 2px;
    }

    .bambu-mobile-header__logo {
        width: 68px;
    }

    .bambu-mobile-header__action {
        flex-basis: 38px;
        width: 38px;
        min-width: 38px;
    }

    .bambu-mobile-drawer {
        width: 84vw;
        max-width: calc(100vw - 40px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bambu-mobile-drawer,
    .bambu-mobile-drawer-overlay,
    .bambu-mobile-drawer__panel {
        transition: none !important;
    }
}

