/**
 * Ngăn kéo giỏ hàng bản chung (cờ cart_v2): desktop trượt từ phải, mobile ≤640px dạng bottom sheet; màu nhấn --bnc-cart-ac do cart.js lấy theo theme; ẩn khung giỏ cũ của theme khi html.bnc-cart-on.
 */
html.bnc-cart-on .f-miniCart-miniv2 .wrap_cart,
html.bnc-cart-on .f-miniCart-miniv2 .miniCart-top,
html.bnc-cart-on .f-miniCart-miniv2 .miniCart-body,
html.bnc-cart-on .bnc_cart .cart_content .wrap_cart,
html.bnc-cart-on .header-mini-cart .wrap_cart {
    display: none !important;
}

html.bnc-cart-on .f-miniCart-miniv2-toolbar,
html.bnc-cart-on .header-cart-trigger,
html.bnc-cart-on .bnc_cart_item {
    cursor: pointer;
}

html.bnc-cart-lock,
html.bnc-cart-lock body {
    overflow: hidden !important;
}

html.bnc-cart-lock body {
    padding-right: var(--bnc-cart-gap, 0px) !important;
}

.bnc-cart {
    --bnc-cart-ac: #16181d;
    --bnc-cart-ac-rgb: 22, 24, 29;
    --bnc-cart-on: #ffffff;
    --bnc-cart-ink: #16181d;
    --bnc-cart-mute: #5a606b;
    --bnc-cart-bg: #ffffff;
    --bnc-cart-tone: #f4f4f3;
    --bnc-cart-tone-2: #ebebea;
    --bnc-cart-line: #e4e4e2;
    --bnc-cart-err: #b42318;
    --bnc-cart-ok: #146c43;
    --bnc-cart-ease: cubic-bezier(.22, 1, .36, 1);
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    font-size: 15px;
    line-height: 1.45;
    color: var(--bnc-cart-ink);
    font-family: inherit;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

.bnc-cart[hidden] {
    display: none !important;
}

.bnc-cart,
.bnc-cart *,
.bnc-cart *::before,
.bnc-cart *::after {
    box-sizing: border-box;
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    float: none;
}

.bnc-cart ::selection {
    background: rgba(var(--bnc-cart-ac-rgb), .18);
    color: var(--bnc-cart-ink);
}

.bnc-cart ul,
.bnc-cart li,
.bnc-cart p,
.bnc-cart h2 {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    list-style: none;
}

.bnc-cart li::before,
.bnc-cart li::after {
    content: none;
    display: none;
}

.bnc-cart a {
    color: inherit;
    text-decoration: none;
    background: none;
    border: 0;
    transition: none;
}

.bnc-cart button,
.bnc-cart input {
    margin: 0;
    font: inherit;
    color: inherit;
    line-height: 1.2;
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    -webkit-appearance: none;
    appearance: none;
}

.bnc-cart button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.bnc-cart svg {
    display: block;
    flex: none;
}

.bnc-cart :focus {
    outline: none;
}

.bnc-cart :focus-visible {
    outline: 2px solid var(--bnc-cart-ac);
    outline-offset: 2px;
}

.bnc-cart-scrim {
    position: absolute;
    inset: 0;
    background: rgba(17, 18, 22, .46);
    opacity: 0;
    transition: opacity .24s ease-out;
}

.bnc-cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(420px, 100vw);
    max-width: 100%;
    background: var(--bnc-cart-bg);
    box-shadow: -18px 0 48px rgba(17, 18, 22, .18);
    transform: translate3d(100%, 0, 0);
    transition: transform .34s var(--bnc-cart-ease);
    will-change: transform;
}

.bnc-cart.is-open .bnc-cart-scrim {
    opacity: 1;
}

.bnc-cart.is-open .bnc-cart-panel {
    transform: translate3d(0, 0, 0);
}

.bnc-cart-grip {
    display: none;
}

.bnc-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 16px 14px 24px;
}

.bnc-cart .bnc-cart-title {
    font-family: inherit;
    font-size: 19px;
    font-weight: 650;
    line-height: 1.25;
    color: var(--bnc-cart-ink);
    text-align: left;
}

.bnc-cart-n {
    font-weight: 500;
    color: var(--bnc-cart-mute);
    font-variant-numeric: tabular-nums;
}

.bnc-cart .bnc-cart-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    color: var(--bnc-cart-ink);
    transition: background-color .16s ease-out;
}

.bnc-cart .bnc-cart-x:hover {
    background: var(--bnc-cart-tone);
}

.bnc-cart-note {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 24px 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(20, 108, 67, .08);
    color: var(--bnc-cart-ok);
    font-size: 14px;
    font-weight: 550;
}

.bnc-cart-note.is-shown {
    display: flex;
    animation: bnc-cart-note .32s var(--bnc-cart-ease);
}

.bnc-cart-note.is-err {
    background: rgba(180, 35, 24, .08);
    color: var(--bnc-cart-err);
}

@keyframes bnc-cart-note {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.bnc-cart-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4px 24px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--bnc-cart-tone-2) transparent;
}

.bnc-cart-body::-webkit-scrollbar {
    width: 8px;
}

.bnc-cart-body::-webkit-scrollbar-thumb {
    background: var(--bnc-cart-tone-2);
    border-radius: 8px;
}

.bnc-cart .bnc-cart-item {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: start;
    padding: 16px 0;
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 12px;
    transition: opacity .2s ease-out, background-color .6s ease-out;
}

.bnc-cart .bnc-cart-item + .bnc-cart-item {
    border-top: 1px solid var(--bnc-cart-line);
    border-radius: 0;
}

.bnc-cart .bnc-cart-item.is-new {
    animation: bnc-cart-new 1.8s ease-out;
}

@keyframes bnc-cart-new {
    0%,
    35% {
        background-color: rgba(var(--bnc-cart-ac-rgb), .07);
    }
    100% {
        background-color: transparent;
    }
}

.bnc-cart .bnc-cart-item.is-leaving {
    opacity: .4;
    pointer-events: none;
}

.bnc-cart .bnc-cart-img {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bnc-cart-tone);
}

.bnc-cart .bnc-cart-img img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    border: 0;
    margin: 0;
}

.bnc-cart-img-ph {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #9a9ea6;
}

.bnc-cart-info {
    min-width: 0;
}

.bnc-cart .bnc-cart-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 550;
    line-height: 1.4;
    color: var(--bnc-cart-ink);
}

.bnc-cart .bnc-cart-name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.bnc-cart .bnc-cart-var {
    margin-top: 3px;
    font-size: 13px;
    color: var(--bnc-cart-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bnc-cart .bnc-cart-unit {
    margin-top: 3px;
    font-size: 13px;
    color: var(--bnc-cart-mute);
    font-variant-numeric: tabular-nums;
}

.bnc-cart-ctl {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.bnc-cart-qty {
    display: inline-flex;
    align-items: center;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--bnc-cart-line);
    background: var(--bnc-cart-bg);
}

.bnc-cart .bnc-cart-qty-b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    color: var(--bnc-cart-ink);
    transition: background-color .14s ease-out, transform .1s ease-out;
}

.bnc-cart .bnc-cart-qty-b:hover:not(:disabled) {
    background: var(--bnc-cart-tone);
}

.bnc-cart .bnc-cart-qty-b:active:not(:disabled) {
    transform: scale(.92);
}

.bnc-cart .bnc-cart-qty-b:disabled {
    color: #b9bcc2;
    cursor: default;
}

.bnc-cart .bnc-cart-qty-in {
    width: 40px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 14.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--bnc-cart-ink);
}

.bnc-cart .bnc-cart-qty-in:focus-visible {
    outline-offset: -2px;
    border-radius: 6px;
}

.bnc-cart .bnc-cart-rm {
    font-size: 13px;
    color: var(--bnc-cart-mute);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(90, 96, 107, .45);
    padding: 8px 2px;
    transition: color .14s ease-out;
}

.bnc-cart .bnc-cart-rm:hover {
    color: var(--bnc-cart-err);
    text-decoration-color: currentColor;
}

.bnc-cart .bnc-cart-line {
    font-size: 14.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
    color: var(--bnc-cart-ink);
    transition: opacity .16s ease-out;
}

.bnc-cart .bnc-cart-item.is-busy .bnc-cart-line {
    opacity: .4;
}

.bnc-cart-foot {
    flex: none;
    padding: 18px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    background: var(--bnc-cart-tone);
}

.bnc-cart-foot[hidden] {
    display: none !important;
}

.bnc-cart-sub {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
}

.bnc-cart-sub-v {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bnc-cart .bnc-cart-tax {
    margin: 6px 0 16px;
    font-size: 13px;
    color: var(--bnc-cart-mute);
}

.bnc-cart .bnc-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 15.5px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease-out, background-color .16s ease-out, color .16s ease-out, opacity .16s ease-out;
}

.bnc-cart .bnc-cart-btn:active {
    transform: scale(.985);
}

.bnc-cart .bnc-cart-btn--primary {
    background: var(--bnc-cart-ac);
    color: var(--bnc-cart-on);
}

.bnc-cart .bnc-cart-btn--primary:hover {
    color: var(--bnc-cart-on);
    opacity: .9;
}

.bnc-cart .bnc-cart-btn--primary.is-busy {
    opacity: .7;
    cursor: progress;
}

.bnc-cart .bnc-cart-btn--primary.is-busy::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: bnc-cart-spin .7s linear infinite;
}

@keyframes bnc-cart-spin {
    to {
        transform: rotate(360deg);
    }
}

.bnc-cart .bnc-cart-btn--ghost {
    margin-top: 8px;
    background: transparent;
    color: var(--bnc-cart-ink);
    min-height: 44px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

.bnc-cart .bnc-cart-btn--ghost:hover {
    color: var(--bnc-cart-ac);
}

.bnc-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 48px 12px 64px;
    text-align: center;
}

.bnc-cart-empty-ic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: var(--bnc-cart-tone);
    color: var(--bnc-cart-ink);
}

.bnc-cart .bnc-cart-empty-t {
    font-size: 18px;
    font-weight: 650;
    color: var(--bnc-cart-ink);
}

.bnc-cart .bnc-cart-empty-d {
    max-width: 30ch;
    margin: 8px 0 28px;
    font-size: 14.5px;
    color: var(--bnc-cart-mute);
}

.bnc-cart-empty .bnc-cart-btn {
    max-width: 280px;
}

.bnc-cart-load {
    padding-top: 8px;
}

.bnc-cart-load span {
    display: block;
    height: 80px;
    margin: 16px 0;
    border-radius: 10px;
    background: var(--bnc-cart-tone);
    animation: bnc-cart-pulse 1.2s ease-in-out infinite;
}

.bnc-cart-load span:nth-child(2) {
    animation-delay: .15s;
}

.bnc-cart-load span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes bnc-cart-pulse {
    50% {
        opacity: .45;
    }
}

@media (max-width: 640px) {
    .bnc-cart-panel {
        top: auto;
        left: 0;
        width: 100%;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -12px 40px rgba(17, 18, 22, .2);
        transform: translate3d(0, 100%, 0);
    }

    .bnc-cart-panel.is-empty {
        min-height: 0;
    }

    .bnc-cart-grip {
        display: block;
        width: 40px;
        height: 4px;
        margin: 8px auto 0;
        border-radius: 999px;
        background: var(--bnc-cart-tone-2);
    }

    .bnc-cart-head {
        padding: 8px 8px 8px 16px;
    }

    .bnc-cart .bnc-cart-title {
        font-size: 17px;
    }

    .bnc-cart-note {
        margin: 0 16px 4px;
    }

    .bnc-cart-body {
        padding: 0 16px 8px;
    }

    .bnc-cart .bnc-cart-item {
        grid-template-columns: 72px minmax(0, 1fr) auto;
        column-gap: 12px;
        padding: 14px 8px;
        margin: 0 -8px;
    }

    .bnc-cart .bnc-cart-img {
        width: 72px;
        height: 72px;
    }

    .bnc-cart-foot {
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .bnc-cart .bnc-cart-tax {
        margin-bottom: 12px;
    }

    .bnc-cart-empty {
        padding: 32px 8px 40px;
    }
}

@media (max-width: 360px) {
    .bnc-cart .bnc-cart-item {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .bnc-cart .bnc-cart-img {
        width: 64px;
        height: 64px;
    }

    .bnc-cart .bnc-cart-line {
        grid-column: 2;
        text-align: left;
        margin-top: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bnc-cart-panel,
    .bnc-cart-scrim {
        transition: opacity .12s linear;
    }

    .bnc-cart-panel,
    .bnc-cart.is-open .bnc-cart-panel {
        transform: none;
        opacity: 0;
    }

    .bnc-cart.is-open .bnc-cart-panel {
        opacity: 1;
    }

    .bnc-cart-note.is-shown,
    .bnc-cart .bnc-cart-item.is-new,
    .bnc-cart-load span {
        animation: none;
    }
}
