/* Basket uses MStore's off-canvas and featured-entry components. */
.basket-open .sf-toolbar { visibility: hidden; }

/* Search and basket are separate MStore panels and must not share open state. */
#offcanvas-search {
    right: -100%;
    left: auto;
    width: 100%;
    z-index: 1040;
}
body.search-open #offcanvas-search {
    display: block;
    right: 0;
    left: auto;
    box-shadow: -1.375rem 0 2.25rem -0.75rem rgba(0, 0, 0, .08);
}
#offcanvas-search .offcanvas-header {
    position: relative;
    width: 100%;
}
#offcanvas-search .offcanvas-body { overscroll-behavior: contain; }

.storefront-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 25, .45);
    z-index: 1034;
    opacity: 0;
    visibility: hidden;
    transition: opacity 300ms ease-in-out 250ms, visibility 0s linear 550ms;
}
body.search-open .storefront-drawer-backdrop,
body.basket-open .storefront-drawer-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity 300ms ease-in-out 250ms, visibility 0s linear;
}

#offcanvas-cart.basket-drawer {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 1040;
    right: -100%;
    left: auto;
}
#offcanvas-cart.basket-drawer.show { display: flex; flex-direction: column; }
/* Basket owns its position; MStore's generic offcanvas-open state belongs to
   legacy panels and must never reveal the cart. */
body.basket-open #offcanvas-cart.basket-drawer {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    visibility: visible;
    opacity: 1;
    transform: none;
    z-index: 1040;
}
#offcanvas-cart.basket-drawer .offcanvas-header {
    position: relative;
    width: 100%;
    height: auto;
    flex: none;
}
#offcanvas-cart.basket-drawer .basket-status { margin: 0; }

.basket-drawer .raw-cart-data,
.basket-drawer-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}
.basket-drawer-scroll.offcanvas-body {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.basket-drawer-scroll .offcanvas-body-inner { padding-bottom: 1rem; }
.basket-items { min-width: 0; }
.basket-item {
    align-items: flex-start;
    display: flex;
    width: 100%;
    min-width: 0;
    padding: .25rem 0 1rem;
    margin-bottom: 1rem !important;
    border-bottom: 1px solid #e7e7e7;
}
.basket-item .featured-entry-thumb { flex: 0 0 4rem; margin-right: .75rem !important; }
.basket-item .media-body { flex: 1 1 0; width: auto; min-width: 0; }
.basket-item .featured-entry-thumb > a > img {
    display: block;
    width: 4rem;
    height: 4rem;
    object-fit: contain;
    background: #f7f7f7;
}
.basket-item-details { min-width: 0; }
.basket-item-title { overflow-wrap: anywhere; }
.basket-item-title > a { color: #000; text-decoration: none; }
.basket-item-title > a:hover { color: #000; text-decoration: none; }
.basket-item-variant { overflow-wrap: anywhere; }
.basket-item-price { margin-bottom: 0; }
.basket-item-actions { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .5rem; }
.basket-quantity { display: flex; align-items: center; width: fit-content; max-width: 100%; }
.basket-quantity .input-group-prepend,
.basket-quantity .input-group-append { flex: none; }
.basket-quantity .btn { min-width: 2.5rem; height: 2.625rem; padding: .35rem .6rem; line-height: 1.2; }
.basket-quantity input {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    max-width: 2.5rem;
    height: 2.625rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #222;
    font-size: .875rem;
    text-align: center;
}
.basket-quantity button:disabled { cursor: default; opacity: .5; }
.basket-item .basket-remove { color: #404040; text-decoration: none; }
.basket-item .basket-remove:hover { color: #222; text-decoration: underline; }
.basket-summary {
    z-index: 1;
    flex: none;
    padding: 0 1.25rem max(1rem, env(safe-area-inset-bottom));
    border-top: 1px solid #e7e7e7;
    background: #fff;
    box-shadow: 0 -.5rem 1rem rgba(34, 34, 34, .04);
}
.basket-summary hr { margin: 0; }
.basket-delivery-note,
.basket-summary .basket-checkout-note,
.basket-split-note {
    margin: 0 0 .75rem;
    font-size: .8125rem;
    line-height: 1.4;
}
.basket-summary .btn-block { min-height: 2.5rem; }
.basket-summary .btn-primary:disabled {
    color: #fff;
    background-color: #0f7c40;
    border-color: #0f7c40;
    opacity: .65;
    cursor: not-allowed;
}
.basket-empty { padding-top: 3rem !important; }
#offcanvas-cart.basket-drawer .basket-empty > [data-basket-close] {
    color: #000 !important;
    background-color: #fff;
    border-color: #000;
}
#offcanvas-cart.basket-drawer .basket-empty > [data-basket-close]:focus {
    color: #000 !important;
    background-color: #fff;
    border-color: #000;
}
#offcanvas-cart.basket-drawer .basket-empty > [data-basket-close]:hover {
    color: #000 !important;
    background-color: #f2f2f2;
    border-color: #000;
}

@media (min-width: 576px) {
    #offcanvas-search {
        width: min(360px, 100vw);
        right: -360px;
    }
    #offcanvas-cart.basket-drawer {
        width: min(360px, 100vw);
        right: -360px;
    }
}

@media (max-height: 500px) {
    .basket-summary { padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
    .basket-summary-row { padding-top: .5rem !important; padding-bottom: .5rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    #offcanvas-search,
    #offcanvas-cart.basket-drawer,
    .storefront-drawer-backdrop { transition: none; }
}
