/* Storefront cart, styled after the 1688 purchase list */
.buyer-cart-page {
    min-height: 80dvh;
    padding: 18px 0 64px;
    background: #f5f6f7;
    color: #222;
}

.buyer-cart-page .storefront-container { max-width: 1440px; container: buyer-cart / inline-size; }

/* Float Buttons (#storefront-right-dock) Collision Prevention on Cart:
   On screens <= 1540px (laptops, split screen, tablet, mobile), hide float
   dock to prevent overlapping the cart summary sidebar and CTA buttons. */
.page-cart .storefront-right-dock,
body:has(.buyer-cart-page) .storefront-right-dock,
.page-cart #storefront-right-dock,
body:has(.buyer-cart-page) #storefront-right-dock {
    display: none !important;
}

@media (min-width: 1541px) {
    .page-cart .storefront-right-dock,
    body:has(.buyer-cart-page) .storefront-right-dock,
    .page-cart #storefront-right-dock,
    body:has(.buyer-cart-page) #storefront-right-dock {
        display: flex !important;
    }
    .page-cart .storefront-right-dock .dock-item-cart,
    body:has(.buyer-cart-page) .storefront-right-dock .dock-item-cart {
        display: none !important;
    }
}
.cart-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding: 0; }
.cart-heading-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cart-mobile-back { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: #1e293b; text-decoration: none; flex-shrink: 0; }
.cart-mobile-back:hover { background: #eef0f3; color: #ff5b00; }
.cart-heading { margin: 0; color: #1a1a1a; font-size: 20px; line-height: 1.25; font-weight: 700; }
.cart-heading-count { color: #ff5b00; font-weight: 700; font-size: 0.88em; }
.cart-mobile-sheet-backdrop,
.cart-mobile-sheet-close,
.cart-mobile-options-bar,
.cart-mobile-cta-row .cart-mobile-select-all,
.cart-mobile-cta-row .cart-mobile-chat-btn { display: none; }
.cart-mobile-cta-row { display: block; }
.checkout-btn-count { margin-left: 3px; font-weight: 700; }
.cart-content-view { display: block; }
.cart-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 480px; align-items: start; gap: 24px; }
.cart-list-column { min-width: 0; }
.cart-toolbar {
    position: sticky;
    top: 56px;
    z-index: 20;
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 16px;
    padding: 0 18px;
    border: 1px solid #e9e9e9;
    background: #fff;
    color: #555;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.cart-toolbar [hidden] { display: none !important; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox-label input[type="checkbox"], .item-checkbox, .vendor-checkbox {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #ff5b00;
    cursor: pointer;
    transition: transform .12s ease;
}
.checkbox-label:hover input[type="checkbox"],
.col-check-item:hover .item-checkbox,
.vendor-header-label:hover .vendor-checkbox {
    transform: scale(1.08);
}
.select-all-label {
    color: #333;
    font-size: 13px;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 4px;
    transition: background-color .15s ease;
}
.select-all-label:hover {
    background: #f8fafc;
}
.toolbar-divider { width: 1px; height: 16px; background: #e5e5e5; }
.btn-delete-selected {
    padding: 6px 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.btn-delete-selected:hover:not(:disabled) {
    color: #ef4444;
    background: #fef2f2;
}
.btn-delete-selected:active:not(:disabled) {
    transform: scale(0.96);
}
.btn-delete-selected:disabled { color: #cbd5e1; cursor: not-allowed; }
.cart-toolbar-hint { margin-left: auto; color: #aaa; font-size: 12px; }
.cart-vendor-list { margin-top: 12px; }
.cart-vendor-group { margin-bottom: 12px; overflow: hidden; border: 1px solid #e9e9e9; background: #fff; }
.vendor-header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px; border-bottom: 1px solid #f0f0f0; color: #333; font-size: 13px; }
.vendor-header-left { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 10px; }
.vendor-header-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 6px 8px;
    margin: -6px -8px;
    border-radius: 4px;
    transition: background-color .15s ease;
}
.vendor-header-label:hover {
    background: #f8fafc;
}
.platform-badge {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #fdba74;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    vertical-align: middle;
    white-space: nowrap;
    background: #fff1e6;
    color: #c2410c;
}
.platform-badge-1688 { border-color: #ff6a00; background: #ff6a00; color: #fff; }
.platform-badge-taobao { background: #ff5000; border-color: #ff5000; color: #fff; }
.platform-badge-tmall { background: #c8102e; border-color: #c8102e; color: #fff; }
.vendor-platform-badge { margin-right: 6px; }
.vendor-platform-badge.platform-badge-1688 { margin-right: -4px; }
.item-platform-badge { margin-right: 6px; }
.item-platform-badge.platform-badge-1688 { margin-right: 8px; }
.platform-badge-modal { margin-left: 6px; padding: 2px 6px; font-size: 12px; }
.vendor-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; }
.vendor-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vendor-title { overflow: hidden; color: #333; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.vendor-badge { padding: 2px 6px; border-radius: 2px; background: #fff3eb; color: #ff5b00; font-size: 10px; }
.vendor-subtotal-info { margin-left: auto; color: #666; font-size: 12px; }
.vendor-subtotal-count { color: #888; }
.vendor-subtotal-cny { color: #ff5b00; font-weight: 600; }
.vendor-subtotal-vnd { color: #888; font-size: 11px; margin-left: 2px; }
.vendor-items-list { padding: 0 18px; }
.cart-item-row { display: grid; grid-template-columns: 32px minmax(230px, 1fr) 112px 116px 112px 56px; align-items: center; gap: 10px; min-height: 132px; padding: 16px 0; border-bottom: 1px solid #f1f1f1; }
.cart-item-row:last-child { border-bottom: 0; }
.cart-item-row:hover { background: #fffdfb; }
.col-check-item {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 12px 6px;
    margin: -12px -6px;
    border-radius: 4px;
    transition: background-color .15s ease;
    user-select: none;
}
.col-check-item:hover {
    background: rgba(255, 91, 0, 0.06);
}
.col-info-item { display: flex; min-width: 0; align-items: flex-start; gap: 14px; }
.item-thumb { width: 120px; height: 120px; flex: 0 0 120px; overflow: hidden; border: 1px solid #eee; background: #f7f7f7; }
.item-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.item-details { min-width: 0; padding-top: 1px; }
.item-title { display: -webkit-box; overflow: hidden; margin: 0 0 9px; color: #333; font-size: 13px; font-weight: 500; line-height: 1.55; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-title:hover { color: #ff5b00; }
.item-title .platform-badge { margin-right: 6px; vertical-align: 1px; }
.item-sku { display: inline-block; max-width: 100%; overflow: hidden; padding: 3px 7px; border: 1px solid #eee; background: #fafafa; color: #888; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.col-price-item, .col-subtotal-item { text-align: center; }
.price-cny { color: #333; font-size: 14px; font-weight: 600; white-space: nowrap; }
.price-vnd { margin-top: 3px; color: #888; font-size: 11px; white-space: nowrap; }
.subtotal-vnd { margin-top: 3px; color: #555; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.qty-stepper {
    display: inline-flex;
    height: 32px;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}
.btn-qty-minus, .btn-qty-plus {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #fafafa;
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all .12s ease;
}
.btn-qty-minus:hover, .btn-qty-plus:hover {
    background: #f1f5f9;
    color: #ff5b00;
}
.btn-qty-minus:active, .btn-qty-plus:active {
    background: #e2e8f0;
    transform: scale(0.92);
}
.qty-input {
    width: 44px;
    height: 32px;
    padding: 0;
    border: 0;
    border-right: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    border-radius: 0;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    appearance: textfield;
}
.qty-input::-webkit-inner-spin-button, .qty-input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.subtotal-cny { color: #ff5b00; font-size: 15px; font-weight: 700; white-space: nowrap; }
.btn-item-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.btn-item-remove-icon { display: none; }
.btn-item-remove:hover {
    color: #ef4444;
    background: #fef2f2;
}
.btn-item-remove:active {
    transform: scale(0.95);
}

.cart-sticky-bottom-bar.cart-summary-card {
    position: sticky;
    top: 76px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 96px);
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.035);
}
.cart-summary-meta { display: block; padding: 18px 18px 12px; }
.cart-summary-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.cart-summary-scroll-body::-webkit-scrollbar {
    width: 5px;
}
.cart-summary-scroll-body::-webkit-scrollbar-track {
    background: transparent;
}
.cart-summary-scroll-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.cart-summary-scroll-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Pinned Bottom CTA Block (Tổng tạm tính + Đặt hàng ngay + Chú thích - Cố định không bị che cắt) */
.cart-summary-cta-block {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: none;
    position: relative;
    z-index: 2;
    padding: 0;
}
.cart-summary-cta-block .summary-total-row {
    margin-top: 0;
    padding: 12px 18px 10px;
    border-top: none;
}
.cart-summary-cta-block .cart-mobile-cta-row {
    display: block;
}
.cart-summary-cta-block .btn-checkout {
    display: block;
    width: calc(100% - 36px);
    min-height: 44px;
    margin: 0 18px;
}
.cart-summary-cta-block .cart-summary-footnote {
    margin: 8px 18px 12px;
}
.summary-title-row { padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.summary-title-row h2 { margin: 0; color: #333; font-size: 16px; font-weight: 700; }
.summary-note { display: block; margin-top: 6px; color: #aaa; font-size: 11px; }
.summary-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0 0; color: #666; font-size: 12px; }
.summary-line strong { color: #444; font-size: 12px; font-weight: 500; text-align: right; white-space: nowrap; }
.summary-line.highlight-service-line { padding-top: 10px; }
.summary-line.highlight-service-line strong { color: #e04b00; font-weight: 600; }
.summary-subtotal { font-weight: 600 !important; }
.summary-conversion { padding-top: 7px; color: #999; font-size: 11px; }
.summary-conversion strong { color: #999; font-size: 11px; }

/* Compact 1-fold summary rows */
.summary-compact-row { padding: 9px 0; display: flex; flex-direction: column; gap: 3px; }

/* Unified & Compact Add-on Services (Kiểm đếm & Đóng kiện gỗ) */
.summary-service-card,
.summary-compact-row.summary-inspection-row,
.summary-compact-row.summary-wood-row {
    padding: 6px 10px;
    margin: 3px 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-service-card:hover,
.summary-compact-row.summary-inspection-row:hover,
.summary-compact-row.summary-wood-row:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
}

.summary-service-card.is-checked,
.summary-compact-row.summary-inspection-row.is-checked,
.summary-compact-row.summary-wood-row.is-checked {
    background: #fff8f5;
    border-color: #ffd2ba;
}

.summary-service-card.is-checked:hover,
.summary-compact-row.summary-inspection-row.is-checked:hover,
.summary-compact-row.summary-wood-row.is-checked:hover {
    background: #fff4ed;
    border-color: #ffbe99;
}

.summary-service-card:focus-visible,
.summary-compact-row.summary-inspection-row:focus-visible,
.summary-compact-row.summary-wood-row:focus-visible {
    outline: none;
    outline-offset: 1px;
}

.service-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.service-card-top-row .compact-chk-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    cursor: pointer;
    margin: 0;
}

.service-card-title {
    font-size: 12.5px;
    font-weight: 500;
    color: #1e293b;
}

.service-card-top-row .service-fee-amount {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.service-card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
}

.service-card-bottom-row .compact-sub {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}
.compact-row-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.compact-label { font-size: 12px; font-weight: 500; color: #666; }
.btn-summary-link,
.btn-clean-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: #ff5000;
    font-size: 13px;
    font-weight: 400;
    padding: 2px 0;
    min-height: auto;
    cursor: pointer;
    user-select: none;
    outline: none;
    line-height: 1.4;
    transition: color 0.15s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.btn-summary-link:hover,
.btn-clean-link:hover {
    color: #e04400;
    background: transparent;
    border: none;
    box-shadow: none;
    text-decoration: none;
}
.btn-summary-link:active,
.btn-clean-link:active {
    color: #c73800;
    background: transparent;
    transform: none;
}
.btn-summary-link svg,
.btn-clean-link svg {
    color: currentColor;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}
.btn-summary-link:hover svg,
.btn-clean-link:hover svg {
    transform: translateX(2px);
}
.compact-chk-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #333; cursor: pointer; user-select: none; }
.btn-compact-info {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: all .15s ease;
}
.btn-compact-info:hover {
    color: #ff5b00;
    border-color: #ff5b00;
    background: #fff5f0;
    box-shadow: 0 1px 3px rgba(255, 91, 0, 0.15);
}
.btn-compact-info:active {
    transform: scale(0.92);
}
.compact-row-content { display: flex; flex-direction: column; gap: 2px; }
.compact-row-content.flex-row { flex-direction: row; align-items: center; justify-content: space-between; }
.compact-val { font-size: 12.5px; color: #222; font-weight: 600; }
.compact-val.text-orange { color: #ff5b00; }
.compact-sub { font-size: 11px; color: #888; line-height: 1.35; }
.deposit-summary-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    margin-top: 4px;
    border: 1px solid #fce3d3;
    border-radius: 6px;
    background: #fffcf9;
    cursor: pointer;
    user-select: none;
    transition: all .15s ease;
}
.deposit-summary-pill:hover {
    background: #fff4ed;
    border-color: #ffcca6;
    box-shadow: 0 1px 4px rgba(255, 91, 0, 0.08);
}
.deposit-summary-pill:active {
    transform: scale(0.99);
}
.deposit-summary-pill:focus-visible {
    outline: none;
    outline-offset: 1px;
}
.deposit-pill-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 3px; background: #fff2eb; color: #ff5b00; font-size: 11px; font-weight: 700; }
.deposit-pill-amt { font-size: 14.5px; color: #ff3b24; font-weight: 700; }

/* Selected warehouse card */
.summary-wh-card { margin-top: 4px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; cursor: pointer; transition: all .15s ease; }
.summary-wh-card:hover { background: #f1f5f9; border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.wh-card-header-line { display: flex; align-items: center; gap: 6px; }
.wh-card-pin-icon { color: #ff5b00; flex-shrink: 0; }
.wh-card-name { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #0f172a; line-height: 1.25; }
.wh-zone-pill { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 3px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; font-size: 10px; font-weight: 700; letter-spacing: .2px; line-height: 1.2; }
.wh-card-tariffs { display: block; margin-top: 3px; padding-left: 19px; font-size: 11px; color: #64748b; line-height: 1.35; }

/* Interactive SKU variant button on cart item row */
.btn-change-sku { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border: 1px dashed #d1d5db; border-radius: 4px; background: #fbfbfb; color: #4b5563; font-size: 12px; font-weight: 500; cursor: pointer; text-align: left; transition: all .15s ease; user-select: none; }
.btn-change-sku:hover { border-color: #ff5b00; border-style: solid; color: #ff5b00; background: #fff8f4; box-shadow: 0 1px 4px rgba(255, 91, 0, 0.08); }
.btn-change-sku:active { transform: scale(0.98); }
.sku-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.sku-caret { font-size: 9px; color: #999; flex-shrink: 0; }

/* Warehouse destination grid */
.summary-warehouse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cart-wh-btn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; cursor: pointer; text-align: left; transition: all .15s ease; }
.cart-wh-btn:hover { border-color: #ffbca3; background: #fffcf9; }
.cart-wh-btn.is-active { border-color: #ff5b00; background: #fff5f0; box-shadow: 0 0 0 1px #ff5b00; }
.wh-radio-indicator { display: inline-block; width: 14px; height: 14px; border: 1.5px solid #ccc; border-radius: 50%; position: relative; flex-shrink: 0; }
.cart-wh-btn.is-active .wh-radio-indicator { border-color: #ff5b00; }
.cart-wh-btn.is-active .wh-radio-indicator::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 6px; height: 6px; border-radius: 50%; background: #ff5b00; }
.wh-btn-content { display: flex; flex-direction: column; min-width: 0; }
.wh-btn-content strong { color: #222; font-size: 12px; font-weight: 600; line-height: 1.25; }
.wh-btn-content small { color: #888; font-size: 10.5px; margin-top: 1px; }

/* International shipping tariffs box */
.summary-tariffs-box { padding: 10px 12px; border-radius: 4px; background: #f9fbfd; border: 1px solid #edf2f7; }
.tariff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 3px; }
.tariff-row.tariff-volume-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e2e8f0; }
.tariff-label { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; color: #555; }
.t-badge { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 2px; font-size: 10px; font-weight: 600; }
.weight-badge { background: #e6f4ea; color: #137333; }
.volume-badge { background: #e8f0fe; color: #1a73e8; }
.tariff-price { display: block; flex: 1 0 100%; min-width: 0; color: #222; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.tariff-calc-status { color: #888; font-size: 11px; line-height: 1.35; padding-left: 2px; }

/* Keep warehouse tariffs scannable in the shared cart/checkout modal. */
#modal-cart-warehouse .summary-tariffs-box {
    display: grid;
    gap: 8px;
    padding: 10px;
}

#modal-cart-warehouse .tariff-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    margin: 0;
}

#modal-cart-warehouse .tariff-row.tariff-volume-row {
    margin: 0;
    padding-top: 8px;
}

#modal-cart-warehouse .tariff-label {
    flex-wrap: wrap;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

#modal-cart-warehouse .tariff-price {
    padding: 6px 8px;
    border-left: 2px solid #86efac;
    border-radius: 3px;
    background: #ffffff;
    color: #1f2937;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}

#modal-cart-warehouse .tariff-volume-row .tariff-price {
    border-left-color: #93c5fd;
}

#modal-cart-warehouse .tariff-calc-status {
    padding: 0 2px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* Deposit tier selector - Compact Minimalism */
#modal-cart-deposit .cart-modal-dialog { width: min(94dvw, 500px); max-height: min(85dvh, 760px); }
#modal-cart-deposit .cart-modal-header { padding: 12px 18px; }
#modal-cart-deposit .cart-modal-body { min-height: 0; padding: 14px 18px; max-height: calc(min(85dvh, 760px) - 108px); }
#modal-cart-deposit .cart-modal-footer { padding: 10px 18px; }
#modal-cart-deposit .cart-modal-title { min-width: 0; overflow-wrap: anywhere; }
.summary-deposit-selector {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
.summary-deposit-selector::-webkit-scrollbar {
    display: none;
}
.deposit-chip-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    height: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
    user-select: none;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}
.deposit-chip-btn:hover { border-color: #ffbca3; background: #fffcf9; }
.deposit-chip-btn.is-active { border-color: #ff5b00; background: #fff5f0; box-shadow: 0 1px 3px rgba(255, 91, 0, 0.12); }
.chip-rate { font-size: 12.5px; font-weight: 700; color: #ff5b00; line-height: 1; }
.chip-desc { font-size: 11px; color: #64748b; font-weight: 600; line-height: 1; transition: color .15s ease; }
.deposit-chip-btn.is-active .chip-desc { color: #c2410c; }
.summary-deposit-preview-box {
    padding: 9px 14px;
    border-radius: 6px;
    background: #fff9f6;
    border: 1px solid #ffe4d6;
    margin-bottom: 10px;
    min-height: 52px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.deposit-row-highlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
    color: #9a3412;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.4;
}
.deposit-num-val {
    color: #ea580c;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.deposit-row-remain {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}
.remain-num-val {
    color: #334155;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Tables inside modals - Compact */
.deposit-policy-table-card { margin-top: 8px; border-top: 1px solid #f1f5f9; padding-top: 8px; }
.policy-table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.policy-table-title { font-size: 11.5px; font-weight: 600; color: #475569; margin: 0; }
.deposit-rules-table { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
.deposit-rules-table th:first-child, .deposit-rules-table td:first-child { width: 62%; }
.deposit-rules-table th:last-child, .deposit-rules-table td:last-child { width: 38%; }
.deposit-rules-table th { background: #f8fafc; padding: 4px 8px; text-align: left; color: #64748b; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.deposit-rules-table td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; color: #475569; overflow-wrap: anywhere; }
.deposit-rules-table td strong { color: #ff5b00; }
.deposit-rules-table tr.is-selectable-tier { cursor: pointer; transition: background .12s ease; }
.deposit-rules-table tr.is-selectable-tier:hover { background: #fff8f5; }
.deposit-rules-table tr.is-active-tier { background: #fff5f0 !important; }
.deposit-rules-table tr.is-active-tier td { color: #c2410c !important; font-weight: 600; }
.deposit-rules-table tr.is-active-tier td strong { color: #ea580c !important; }
.deposit-rules-table tr.is-disabled-tier { opacity: 0.4; cursor: not-allowed; background: #fafafa; }

/* Modal tariff tables (Inspection & Wood packing) */
#modal-cart-inspection .deposit-rules-table,
#modal-cart-wood .deposit-rules-table {
    font-size: 12.5px;
}
#modal-cart-inspection .deposit-rules-table th,
#modal-cart-wood .deposit-rules-table th {
    padding: 8px 10px;
    font-size: 12px;
}
#modal-cart-inspection .deposit-rules-table td,
#modal-cart-wood .deposit-rules-table td {
    padding: 9px 10px;
    font-size: 12.5px;
    color: #334155;
}

/* 3-column tariff layout for Wood packing modal */
.deposit-rules-table.table-wood-tariffs th:first-child,
.deposit-rules-table.table-wood-tariffs td:first-child {
    width: 38%;
}
.deposit-rules-table.table-wood-tariffs th:nth-child(2),
.deposit-rules-table.table-wood-tariffs td:nth-child(2) {
    width: 28%;
}
.deposit-rules-table.table-wood-tariffs th:last-child,
.deposit-rules-table.table-wood-tariffs td:last-child {
    width: 34%;
}

/* Custom Modal System */
.cart-custom-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: var(--z-modal-nested, 250); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; pointer-events: none; overscroll-behavior: contain; transition: opacity .2s ease, visibility .2s ease; }
.cart-custom-modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.cart-modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--overlay-backdrop-bg, rgba(15, 23, 42, 0.22)); z-index: 1; }
.cart-modal-dialog { position: relative; z-index: 2; width: min(92dvw, 520px); max-height: 85dvh; background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); display: flex; flex-direction: column; overflow: hidden; transform: translateY(20px); transition: transform .2s ease; }
.cart-custom-modal.is-open .cart-modal-dialog { transform: translateY(0); }
.cart-modal-dialog.modal-dialog-lg { width: min(94dvw, 680px); }
.cart-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f0; background: #fafafa; }
.cart-modal-title { margin: 0; font-size: 15px; font-weight: 700; color: #222; }
.cart-modal-close { border: 0; background: transparent; font-size: 16px; color: #888; cursor: pointer; padding: 4px; line-height: 1; }
.cart-modal-close:hover { color: #ff5000; }
.cart-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: calc(85dvh - 110px);
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-bg, #d1d5db) transparent;
}
.cart-modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.cart-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.cart-modal-body::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg, #d1d5db);
    border-radius: var(--scrollbar-radius, 9999px);
    transition: background-color 0.15s ease;
}
.cart-modal-body::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg, #9ca3af);
}
.cart-modal-body::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-active-bg, #ff5000);
}

.cart-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #f0f0f0; background: #fafafa; }
.modal-intro-text { font-size: 12px; color: #666; line-height: 1.45; margin: 0 0 12px; }
.btn-modal-primary { padding: 8px 18px; border: 0; border-radius: 4px; background: #ff5b00; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease; }
.btn-modal-primary:hover { background: #f04f00; }
.btn-modal-primary:disabled { background: #ffb28a; cursor: not-allowed; }
.btn-modal-secondary { padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; color: #555; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-modal-secondary:hover { background: #f3f4f6; color: #111; }

/* SKU Variant Selection Modal Details */
#modal-cart-sku .cart-modal-header { background: #ffffff; border-bottom: 1px solid #f1f5f9; }
#modal-cart-sku .cart-modal-title { font-weight: 400; color: #0f172a; }
#modal-cart-sku .cart-modal-body { overflow-x: hidden; padding: 14px 16px; }
#modal-cart-sku strong,
#modal-cart-sku b,
#modal-cart-sku h3,
#modal-cart-sku h4,
#modal-cart-sku button { font-weight: 400; }
.sku-modal-loading { padding: 40px 20px; text-align: center; color: #888; font-size: 13px; }
.sku-modal-product-header { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; margin-bottom: 10px; min-width: 0; }
.sku-modal-thumb { width: 110px; height: 110px; min-width: 110px; min-height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; flex-shrink: 0; background: #f8fafc; }
.sku-modal-product-meta { min-width: 0; flex: 1; }
.sku-modal-title { margin: 0 0 6px; font-size: 13.5px; font-weight: 400; color: #1e293b; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sku-modal-moq-badge { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.badge-moq { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; background: #fff3eb; color: #ea580c; font-size: 11px; font-weight: 400; }
.badge-hint { font-size: 11px; color: #64748b; }

/* Wholesale price ladder in SKU modal */
.sku-modal-price-ladder-card { padding: 8px 10px; border-radius: 6px; background: #fffcf9; border: 1px solid #ffedd5; margin-bottom: 12px; max-width: 100%; box-sizing: border-box; }
.ladder-title { display: block; font-size: 11.5px; font-weight: 400; color: #c2410c; margin-bottom: 6px; }
.sku-modal-ladder-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.price-ladder-tier { display: flex; flex-direction: column; align-items: center; padding: 4px 10px; border: 1px solid #fed7aa; border-radius: 6px; background: #fff; min-width: 74px; }
.price-ladder-tier.is-active { border-color: #ff5b00; background: #fff5f0; box-shadow: 0 0 0 1px #ff5b00; }
.tier-qty-label { font-size: 11px; color: #64748b; font-weight: 400; }
.tier-price-val { font-size: 13px; font-weight: 400; color: #ff5000; }
.price-ladder-tier.is-active .tier-qty-label { color: #ff5000; font-weight: 400; }

/* Modal Dynamic SKU Layouts (PDP-identical Two-Tier & Single-List) */
.sku-modal-layout-container {
    margin-bottom: 12px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-bg, #d1d5db) transparent;
}
.sku-modal-layout-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.sku-modal-layout-container::-webkit-scrollbar-track {
    background: transparent;
}
.sku-modal-layout-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg, #d1d5db);
    border-radius: var(--scrollbar-radius, 9999px);
    transition: background-color 0.15s ease;
}
.sku-modal-layout-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg, #9ca3af);
}
.sku-modal-layout-container::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-active-bg, #ff5000);
}
.sku-modal-layout-container .sku-swatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 4px 4px 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.sku-modal-layout-container .sku-swatch-list.has-swatch-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
}
.sku-modal-layout-container .sku-swatch-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 5px 10px;
    margin: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
    text-align: left;
}
.sku-modal-layout-container .sku-swatch-list.has-swatch-images .sku-swatch-card {
    flex-direction: column;
    align-items: stretch;
    padding: 4px;
    gap: 5px;
    height: auto;
    border-radius: 8px;
}
.sku-modal-layout-container .sku-swatch-card:hover:not(.is-out-of-stock) {
    border-color: #ff5000;
    color: #ff5000;
}
.sku-modal-layout-container .sku-swatch-card.active,
.sku-modal-layout-container .sku-swatch-card.is-selected {
    border-color: #ff5000 !important;
    color: #ff5000 !important;
    background: #fffaf7 !important;
    box-shadow: inset 0 0 0 1px #ff5000;
}
.sku-modal-layout-container .sku-swatch-card.is-out-of-stock {
    background: #fafafa;
    border: 1px dashed #d9d9d9;
    color: #8c8c8c;
    opacity: 0.72;
    cursor: not-allowed;
}
.sku-modal-layout-container .sku-swatch-card .swatch-img-wrap {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
}
.sku-modal-layout-container .sku-swatch-list.has-swatch-images .sku-swatch-card .swatch-img-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}
.sku-modal-layout-container .sku-swatch-card .swatch-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sku-modal-layout-container .sku-swatch-card .swatch-name {
    font-size: 12px;
    font-weight: 400;
    color: #334155;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.34;
    display: block;
    min-width: 0;
}
.sku-modal-layout-container .sku-swatch-list.has-swatch-images .sku-swatch-card .swatch-name {
    text-align: center;
    padding: 0 2px;
}
.sku-modal-layout-container .sku-swatch-card .swatch-stock {
    font-size: 10.5px;
    font-weight: 400;
    color: #94a3b8;
    text-align: center;
    line-height: 1.2;
}
.sku-modal-layout-container .sku-swatch-list:not(.has-swatch-images) .sku-swatch-card .swatch-stock {
    white-space: nowrap;
    flex-shrink: 0;
}
.sku-modal-layout-container .sku-swatch-card.active .swatch-name {
    color: #ff5000;
}
.sku-modal-layout-container .sku-swatch-card .swatch-badge {
    position: absolute;
    top: -6px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--brand-orange, #ff5000);
    color: #ffffff;
    font-family: var(--font-accent, 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: 11px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    text-align: center;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(255, 80, 0, 0.35);
    box-sizing: border-box;
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
}
.sku-modal-layout-container .sku-swatch-card .swatch-oos-pill {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 2px;
    background: #f0f0f0;
    color: #999;
    align-self: center;
}
.sku-modal-layout-container .sku-tier-section { margin-bottom: 10px; min-width: 0; max-width: 100%; }
.sku-modal-layout-container .sku-tier-title { font-size: 12.5px; font-weight: 400; color: #475569; margin: 0 0 6px; }
.sku-modal-layout-container .sku-subtier-panel {
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    padding: 4px 12px !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-bg, #d1d5db) transparent;
}
.sku-modal-layout-container .sku-subtier-panel::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
.sku-modal-layout-container .sku-subtier-panel::-webkit-scrollbar-track {
    background: transparent;
}
.sku-modal-layout-container .sku-subtier-panel::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-bg, #d1d5db);
    border-radius: var(--scrollbar-radius, 9999px);
    transition: background-color 0.15s ease;
}
.sku-modal-layout-container .sku-subtier-panel::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-bg, #9ca3af);
}
.sku-modal-layout-container .sku-subtier-panel::-webkit-scrollbar-thumb:active {
    background-color: var(--scrollbar-thumb-active-bg, #ff5000);
}
.sku-modal-layout-container .sku-subtier-group { display: flex; flex-direction: column; gap: 0; min-width: 0; width: 100%; }
.sku-modal-layout-container .sku-subtier-row,
.sku-modal-layout-container .sku-single-row { display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 9px 0 !important; border: none !important; border-bottom: 1px solid #f1f5f9 !important; background: transparent !important; gap: 10px !important; margin: 0 !important; min-width: 0; width: 100%; box-sizing: border-box; }
.sku-modal-layout-container .sku-subtier-row.is-out-of-stock,
.sku-modal-layout-container .sku-single-row.is-out-of-stock { background: #fafafa !important; }
.sku-modal-layout-container .sku-subtier-row:last-child,
.sku-modal-layout-container .sku-single-row:last-child { border-bottom: none !important; }
.sku-modal-layout-container .sku-subtier-left,
.sku-modal-layout-container .sku-single-left { display: flex !important; align-items: center !important; justify-content: flex-start !important; flex: 1 1 auto !important; min-width: 0 !important; gap: 10px !important; margin: 0 !important; }
.sku-modal-layout-container .sku-subtier-left { flex-direction: column !important; align-items: flex-start !important; justify-content: center !important; gap: 3px !important; }
.sku-modal-layout-container .sku-single-meta { display: flex !important; flex-direction: column !important; gap: 3px !important; min-width: 0 !important; flex: 1 1 auto !important; }
.sku-modal-layout-container .sku-subtier-name,
.sku-modal-layout-container .sku-single-name { flex: 0 0 auto !important; width: 100% !important; min-width: 0 !important; font-size: 13px !important; font-weight: 400 !important; color: #1e293b !important; line-height: 1.36 !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere !important; word-break: break-word !important; display: block !important; }
.sku-modal-layout-container .sku-subtier-price-stock,
.sku-modal-layout-container .sku-single-price-stock { display: flex !important; align-items: baseline !important; flex-wrap: wrap !important; white-space: normal !important; gap: 2px 8px !important; margin-left: 0 !important; padding-right: 0 !important; width: 100% !important; }
.sku-modal-layout-container .sku-subtier-price,
.sku-modal-layout-container .sku-single-price { font-size: 13.5px !important; font-weight: 400 !important; color: #ff5000 !important; white-space: nowrap !important; }
.sku-modal-layout-container .sku-subtier-stock,
.sku-modal-layout-container .sku-single-stock { font-size: 11px !important; font-weight: 400 !important; color: #64748b !important; white-space: nowrap !important; }
.sku-modal-layout-container .sku-single-thumb { width: 56px !important; height: 56px !important; border-radius: 8px !important; overflow: hidden !important; flex: 0 0 56px !important; border: 1px solid #e2e8f0 !important; background: #f8fafc !important; }
.sku-modal-layout-container .sku-single-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sku-modal-layout-container .sku-stepper { display: inline-flex !important; height: 30px !important; align-items: center !important; border: 1px solid #cbd5e1 !important; border-radius: 6px !important; background: #fff !important; overflow: hidden !important; flex-shrink: 0 !important; margin-left: 0 !important; }
.sku-modal-layout-container .sku-stepper .btn-stepper { width: 28px !important; height: 30px !important; padding: 0 !important; border: 0 !important; background: #f8fafc !important; color: #475569 !important; font-size: 15px !important; font-weight: 400 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; cursor: pointer; transition: background .15s, transform .1s; user-select: none; }
.sku-modal-layout-container .sku-stepper .btn-stepper:hover:not(.disabled) { background: #f1f5f9 !important; color: #ff5b00 !important; }
.sku-modal-layout-container .sku-stepper .btn-stepper:active:not(.disabled) { background: #e2e8f0 !important; transform: scale(0.92); }
.sku-modal-layout-container .sku-stepper .btn-stepper.disabled { opacity: 0.35; cursor: not-allowed; }
.sku-modal-layout-container .sku-stepper .sku-qty-input { width: 38px !important; height: 30px !important; padding: 0 !important; border: 0 !important; border-left: 1px solid #e2e8f0 !important; border-right: 1px solid #e2e8f0 !important; text-align: center !important; font-size: 13px !important; font-weight: 400 !important; color: #1e293b !important; background: #ffffff !important; border-radius: 0 !important; appearance: textfield; }
.sku-modal-layout-container .sku-stepper .sku-qty-input::-webkit-inner-spin-button,
.sku-modal-layout-container .sku-stepper .sku-qty-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.sku-stepper.is-over-stock,
.sku-modal-layout-container .sku-stepper.is-over-stock { border-color: #ef4444 !important; background: #fff5f5 !important; }
.sku-stepper.is-over-stock .sku-qty-input,
.sku-modal-layout-container .sku-stepper.is-over-stock .sku-qty-input { color: #dc2626 !important; background: #fff5f5 !important; }
.sku-stock-inline-error { margin-top: 3px; font-size: 11.5px; line-height: 1.35; font-weight: 400; color: #ef4444; }

/* Modal Order Summary Bar */
.sku-modal-summary-bar { margin-top: 8px; padding: 9px 12px; background: #fffcf8; border: 1px solid #ffedd5; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 100%; box-sizing: border-box; }
.modal-summary-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 12.5px; font-weight: 400; color: #475569; width: 100%; min-width: 0; }
.modal-summary-text { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px; font-weight: 400; }
.modal-summary-divider { color: #cbd5e1; margin: 0 4px; }
.modal-summary-meta .summary-highlight { color: #ff5000; font-weight: 400; margin: 0 1px; }
.modal-summary-meta .summary-price { color: #ff5000; font-size: 14.5px; font-weight: 400; margin-left: 2px; white-space: nowrap; }
.modal-summary-meta .summary-vnd { color: #64748b; font-size: 11.5px; font-weight: 400; margin-left: 3px; white-space: nowrap; }
.sku-modal-error-msg { margin-top: 8px; padding: 7px 10px; border-radius: 6px; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; font-size: 12px; font-weight: 400; }

.summary-total-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 14px 0 15px; border-top: 1px solid #f0f0f0; }
.summary-total-label-block { display: flex; flex-direction: column; gap: 3px; }
.summary-total-title { color: #333; font-size: 13px; font-weight: 600; }
.summary-total-sub-note { color: #999; font-size: 10.5px; }
.summary-total-amount-block { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.summary-total-vnd-main { color: #ff3b24; font-size: 22px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.summary-total-cny-aux { color: #888; font-size: 12px; font-weight: 500; }
.rate-dot-mini { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #10b981; margin-right: 4px; vertical-align: 1px; }
.btn-checkout { display: block; width: calc(100% - 36px); min-height: 44px; margin: 0 18px; border: 0; border-radius: 4px; background: #ff5b00; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .15s ease; user-select: none; box-shadow: 0 2px 6px rgba(255, 91, 0, 0.25); }
.btn-checkout:hover:not(:disabled) { background: #f04f00; box-shadow: 0 4px 12px rgba(255, 91, 0, 0.35); transform: translateY(-1px); }
.btn-checkout:active:not(:disabled) { transform: translateY(0); }
.btn-checkout:disabled { background: #ffb28a; cursor: not-allowed; box-shadow: none; transform: none; }
.cart-summary-footnote { margin: 11px 18px 16px; color: #aaa; font-size: 10px; line-height: 1.5; }
.cart-loading-state { padding: 54px 20px; color: #888; font-size: 13px; text-align: center; }
.cart-spinner { width: 30px; height: 30px; margin: 0 auto 12px; border: 3px solid #eee; border-top-color: #ff5b00; border-radius: 50%; animation: cart-spin .8s linear infinite; }
@keyframes cart-spin { to { transform: rotate(360deg); } }

.cart-empty-view { margin: 22px 0 40px; padding: 66px 20px; border: 1px solid #e9e9e9; background: #fff; text-align: center; }
.empty-icon-box { display: flex; width: 76px; height: 76px; align-items: center; justify-content: center; margin: 0 auto 17px; border-radius: 50%; background: #f7f7f7; color: #bbb; }
.empty-title { margin: 0 0 8px; color: #444; font-size: 18px; font-weight: 600; }
.empty-sub { margin: 0 0 22px; color: #999; font-size: 13px; }
.btn-continue-shopping { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 26px; border-radius: 3px; background: #ff5b00; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.btn-continue-shopping:hover { background: #f04f00; color: #fff; }

@media (max-width: 1120px) {
    .cart-workspace { grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; }
    .vendor-items-list { padding: 0 12px; }
    .cart-item-row { grid-template-columns: 24px minmax(180px, 1fr) 88px 96px 96px 36px; gap: 7px; }
    .item-thumb { width: 110px; height: 110px; min-width: 110px; min-height: 110px; flex-basis: 110px; }
}

/* The storefront shell can reduce the cart's usable width even on a wide
   browser window (for example, when the buyer sidebar is open). Base these
   cart breakpoints on the actual content width, not the full viewport. */
@container buyer-cart (max-width: 1500px) {
    .cart-workspace {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
        gap: 18px;
    }

    .vendor-items-list { padding: 0 12px; }
    .cart-item-row {
        grid-template-columns: 24px minmax(160px, 1fr) 90px 100px 96px 38px;
        gap: 8px;
    }
    .item-thumb {
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
        flex-basis: 110px;
    }
}

@container buyer-cart (max-width: 1100px) {
    .cart-workspace { grid-template-columns: minmax(0, 1fr); }
    .cart-summary-card { grid-row: 1; }
    .cart-sticky-bottom-bar.cart-summary-card {
        position: static;
        max-height: none;
    }
    .cart-summary-meta,
    .cart-summary-scroll-body { padding: 14px 14px 0; overflow-y: visible; }
    .cart-summary-cta-block { box-shadow: none; }
    .summary-line { display: none; }
    .cart-heading-row { align-items: center; }
    .cart-toolbar { min-height: 48px; padding: 0 12px; }
    .cart-toolbar-hint { display: none; }
    .cart-vendor-group { margin-bottom: 9px; }
    .vendor-header { min-height: 44px; padding: 0 12px; }
    .vendor-title { max-width: 220px; }
    .vendor-subtotal-info { font-size: 11px; }
    .vendor-subtotal-vnd { display: none; }
    .vendor-items-list { padding: 0 12px; }
    .cart-item-row {
        grid-template-columns: 22px 110px minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto auto;
        column-gap: 10px;
        row-gap: 6px;
        min-height: 0;
        padding: 12px 0;
        align-items: start;
    }
    .col-check-item { grid-column: 1; grid-row: 1 / 5; align-self: center; padding: 8px 2px; margin: 0; }
    .col-info-item { display: contents; }
    .item-thumb {
        grid-column: 2;
        grid-row: 1 / 5;
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
        flex-basis: 110px;
        border-radius: 8px;
        align-self: center;
    }
    .item-details { display: contents; }
    .item-title { grid-column: 3; grid-row: 1; margin: 0; font-size: 13.5px; line-height: 1.4; }
    .col-action-item { grid-column: 4; grid-row: 1; justify-self: end; align-self: start; }
    .btn-change-sku.item-sku { grid-column: 3; grid-row: 2; justify-self: start; align-self: center; }
    .col-qty-item { grid-column: 4; grid-row: 2; justify-self: end; align-self: center; }
    .col-price-item { grid-column: 3 / 5; grid-row: 3; text-align: left; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
    .col-subtotal-item { grid-column: 3 / 5; grid-row: 4; text-align: left; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
    .price-vnd, .subtotal-vnd { margin-top: 0; }
}

/* Mobile Responsive Cart Layout (App-style Cards + Big Thumbs + Bottom Checkout Bar) */
@media (max-width: 820px) {
    body.page-cart {
        padding-bottom: 0 !important;
        overflow-x: clip;
    }
    .page-cart .storefront-right-dock,
    body:has(.buyer-cart-page) .storefront-right-dock,
    .page-cart #storefront-right-dock,
    body:has(.buyer-cart-page) #storefront-right-dock,
    .page-cart .storefront-mobile-nav,
    .page-cart .storefront-subnav,
    .page-cart #mobile-lang-onboarding,
    .page-cart .storefront-footer {
        display: none !important;
    }
    .buyer-cart-page {
        min-height: 100dvh;
        padding: 8px 0 calc(122px + env(safe-area-inset-bottom, 0px));
        background: #f4f5f7;
        overflow-x: clip;
        max-width: 100%;
    }
    .buyer-cart-page strong,
    .buyer-cart-page b,
    .buyer-cart-page h1,
    .buyer-cart-page h2,
    .buyer-cart-page button {
        font-weight: 400;
    }
    .buyer-cart-page .storefront-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
    }
    .cart-heading-row {
        align-items: center;
        padding: 2px 0;
        margin-bottom: 8px;
    }
    .cart-mobile-back {
        display: inline-flex;
    }
    .cart-heading {
        font-size: 16.5px;
        font-weight: 400;
        display: flex;
        align-items: baseline;
        gap: 4px;
    }
    .cart-heading-count {
        font-weight: 400;
    }
    .cart-workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        min-width: 0;
    }
    .cart-toolbar {
        position: sticky;
        top: 52px;
        z-index: 20;
        min-height: 40px;
        padding: 0 12px;
        border-radius: 10px;
        border: 1px solid #eceef2;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    }
    .cart-toolbar-hint { display: none; }
    .btn-delete-selected { margin-left: auto; color: #ef4444; font-weight: 400; padding: 5px 8px; font-size: 12.5px; }
    .toolbar-divider { display: none; }
    .cart-vendor-list { margin-top: 8px; min-width: 0; }
    .cart-vendor-group {
        margin-bottom: 8px;
        border: 1px solid #eceef2;
        border-radius: 10px;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
        max-width: 100%;
    }
    .vendor-header {
        min-height: 38px;
        padding: 6px 12px;
        background: #fafafa;
        gap: 8px;
    }
    .vendor-header-left { gap: 7px; min-width: 0; }
    .vendor-badge { display: none !important; }
    .vendor-title { max-width: none; font-size: 12.5px; font-weight: 400; color: #334155; }
    .vendor-subtotal-info { font-size: 11px; flex-shrink: 0; font-weight: 400; }
    .vendor-subtotal-cny { font-weight: 400; }
    .vendor-subtotal-vnd { display: none; }
    .vendor-items-list { padding: 0 12px; }

    .cart-item-row {
        grid-template-columns: 18px 110px minmax(0, 1fr) auto 28px;
        grid-template-rows: auto auto auto auto;
        column-gap: 9px;
        row-gap: 4px;
        min-height: 0;
        padding: 10px 0;
        align-items: start;
        max-width: 100%;
    }
    .cart-item-row:hover { background: transparent; }
    .col-check-item {
        grid-column: 1;
        grid-row: 1 / 5;
        align-self: center;
        padding: 8px 0;
        margin: 0;
    }
    .col-info-item { display: contents; }
    .item-thumb {
        grid-column: 2;
        grid-row: 1 / 5;
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
        flex: 0 0 110px;
        border-radius: 8px;
        border: 1px solid #eef0f3;
        align-self: center;
    }
    .item-details { display: contents; }
    .item-title {
        grid-column: 3 / 5;
        grid-row: 1;
        margin: 0;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.35;
        color: #1e293b;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: unset;
        -webkit-box-orient: initial;
        align-self: center;
    }
    .platform-badge { font-weight: 400; }
    .col-action-item {
        grid-column: 5;
        grid-row: 1;
        justify-self: end;
        align-self: start;
    }
    .btn-item-remove {
        padding: 3px;
        width: 26px;
        height: 26px;
        border-radius: 6px;
        color: #94a3b8;
    }
    .btn-item-remove-icon { display: block; }
    .btn-item-remove-text { display: none; }
    .btn-change-sku.item-sku {
        grid-column: 3 / 6;
        grid-row: 2;
        justify-self: start;
        align-self: center;
        max-width: 100%;
        padding: 3px 8px;
        border: 1px solid #e2e8f0;
        border-radius: 5px;
        background: #f8fafc;
        color: #475569;
        font-size: 11.5px;
        font-weight: 400;
        line-height: 1.25;
        white-space: nowrap;
        gap: 4px;
    }
    .sku-name-text {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    .col-qty-item {
        grid-column: 4 / 6;
        grid-row: 3;
        justify-self: end;
        align-self: center;
    }
    .qty-stepper {
        height: 26px;
        border-radius: 5px;
        border-color: #cbd5e1;
    }
    .btn-qty-minus, .btn-qty-plus {
        width: 24px;
        height: 26px;
        font-size: 14px;
        font-weight: 400;
    }
    .qty-input {
        width: 34px;
        height: 26px;
        font-size: 16px;
        line-height: 1.1;
        font-weight: 400;
    }
    .col-price-item {
        grid-column: 3;
        grid-row: 3;
        padding-left: 0;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
        align-self: center;
        min-width: 0;
    }
    .price-cny {
        color: #475569;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.2;
    }
    .price-vnd {
        margin-top: 0;
        font-size: 11px;
        font-weight: 400;
        color: #94a3b8;
        line-height: 1.2;
    }
    .col-subtotal-item {
        grid-column: 3 / 6;
        grid-row: 4;
        padding-left: 0;
        text-align: left;
        display: flex;
        align-items: baseline;
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
        overflow: hidden;
    }
    .subtotal-cny {
        font-size: 13.5px;
        font-weight: 400;
        color: #ff5000;
    }
    .subtotal-vnd {
        margin-top: 0;
        font-size: 11.5px;
        font-weight: 400;
        color: #64748b;
    }

    /* Bottom Fixed Checkout Dock & Expandable Options Sheet */
    .cart-sticky-bottom-bar.cart-summary-card {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: var(--z-bottom-action, 40);
        max-height: calc(100dvh - 48px);
        margin: 0;
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        border: 0;
        border-top: 1px solid #e2e8f0;
        border-radius: 12px 12px 0 0;
        background: #ffffff;
        box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.09);
        overflow: visible;
    }
    .cart-sticky-bottom-bar.cart-summary-card.is-mobile-expanded {
        z-index: var(--z-modal-backdrop, 220);
    }
    .cart-summary-card.is-mobile-expanded .cart-mobile-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.38);
        z-index: -1;
    }
    .cart-summary-scroll-body {
        display: none;
        padding: 12px 14px 8px;
        max-height: 56dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #ffffff;
        border-radius: 12px 12px 0 0;
        border-bottom: 1px solid #f1f5f9;
    }
    .cart-summary-card.is-mobile-expanded .cart-summary-scroll-body {
        display: block;
    }
    .cart-summary-card.is-mobile-expanded .summary-line {
        display: flex;
    }
    .summary-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 8px;
    }
    .summary-title-text {
        display: flex;
        align-items: baseline;
        gap: 8px;
        flex-wrap: wrap;
    }
    .summary-note { margin-top: 0; }
    .cart-mobile-sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border: 1px solid #e2e8f0;
        border-radius: 50%;
        background: #f8fafc;
        color: #475569;
        cursor: pointer;
        flex-shrink: 0;
    }
    .cart-summary-cta-block {
        border-top: 0;
        border-radius: 12px 12px 0 0;
        overflow: hidden;
    }
    .cart-summary-card.is-mobile-expanded .cart-summary-cta-block {
        border-radius: 0;
        border-top: 1px solid #f1f5f9;
    }
    .cart-mobile-options-bar {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 5px 12px;
        border: 0;
        border-bottom: 1px solid #f1f5f9;
        background: #fffaf6;
        color: #334155;
        font-size: 11.5px;
        font-weight: 400;
        cursor: pointer;
        text-align: left;
    }
    .mobile-options-summary {
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .mobile-options-pill {
        display: inline-flex;
        align-items: center;
        padding: 1px 6px;
        border-radius: 4px;
        background: #fff0e6;
        color: #ff5b00;
        font-weight: 400;
        font-size: 11px;
        flex-shrink: 0;
    }
    .mobile-options-text {
        font-weight: 400;
        color: #334155;
        flex-shrink: 0;
    }
    .mobile-options-addon {
        color: #059669;
        font-weight: 400;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-options-dot[hidden],
    .mobile-options-addon[hidden] {
        display: none !important;
    }
    .mobile-options-cta {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        color: #ff5b00;
        font-weight: 400;
        font-size: 11.5px;
        flex-shrink: 0;
    }
    .mobile-options-chevron {
        transition: transform .2s ease;
    }
    .cart-summary-card.is-mobile-expanded .mobile-options-chevron {
        transform: rotate(180deg);
    }
    .cart-summary-cta-block .summary-total-row {
        margin-top: 0;
        padding: 5px 12px 2px;
        align-items: baseline;
        flex-wrap: nowrap;
        gap: 8px;
    }
    .cart-summary-cta-block .summary-total-label-block {
        min-width: 0;
        flex-shrink: 0;
    }
    .cart-summary-cta-block .summary-total-title {
        font-size: 13px;
        font-weight: 400;
        color: #334155;
        white-space: nowrap;
    }
    .cart-summary-cta-block .summary-total-sub-note,
    .cart-summary-cta-block .summary-total-amount-block .summary-total-cny-aux {
        display: none;
    }
    .summary-total-vnd-main {
        font-size: 17px;
        font-weight: 400;
        color: #ff5000;
    }
    .cart-summary-cta-block .cart-mobile-cta-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px 8px;
    }
    .cart-mobile-cta-row .cart-mobile-select-all {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
        font-size: 12.5px;
        font-weight: 400;
        color: #475569;
    }
    .cart-mobile-cta-row .cart-mobile-chat-btn {
        display: inline-flex;
        min-height: 38px;
        padding: 0 10px;
        font-size: 12.5px;
    }
    @media (max-width: 420px) {
        .cart-mobile-cta-row .cart-mobile-chat-btn {
            width: 38px;
            min-width: 38px;
            padding: 0;
            gap: 0;
        }
        .cart-mobile-cta-row .cart-mobile-chat-btn .mobile-chat-label {
            display: none;
        }
    }
    .cart-summary-cta-block .btn-checkout {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 auto;
        width: auto;
        min-height: 38px;
        margin: 0;
        border-radius: 7px;
        font-size: 14px;
        font-weight: 400;
    }
    .checkout-btn-count {
        font-weight: 400;
    }
    .cart-summary-cta-block .cart-summary-footnote {
        display: none;
    }
}

@media (max-width: 768px) {
    .cart-toolbar {
        top: 52px;
    }
}

@media (max-width: 480px) {
    .buyer-cart-page .storefront-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .vendor-items-list { padding: 0 10px; }
    .cart-item-row {
        grid-template-columns: 18px 110px minmax(0, 1fr) auto 26px;
        column-gap: 8px;
    }
    .item-thumb {
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
        flex: 0 0 110px;
        border-radius: 8px;
    }
    .item-title { font-size: 12.5px; }
    .qty-stepper { height: 26px; }
    .btn-qty-minus, .btn-qty-plus { width: 24px; height: 26px; font-size: 14px; }
    .qty-input { width: 32px; height: 26px; }
}

@media (max-width: 359px) {
    .buyer-cart-page .storefront-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .vendor-items-list { padding: 0 8px; }
    .cart-item-row {
        grid-template-columns: 16px 110px minmax(0, 1fr) auto 24px;
        column-gap: 6px;
    }
    .item-thumb {
        width: 110px;
        height: 110px;
        min-width: 110px;
        min-height: 110px;
        flex: 0 0 110px;
        border-radius: 7px;
    }
    .btn-qty-minus, .btn-qty-plus { width: 22px; }
    .qty-input { width: 28px; }
}

@media (max-width: 480px) {
    .compact-row-header {
        flex-wrap: wrap;
        gap: 6px;
    }
    .cart-modal-footer button { flex: 1 1 0; min-height: 38px; }
    .deposit-chip-btn { padding: 6px 10px; font-size: 12px; }
}

@media (max-width: 360px) {
    .btn-summary-link,
    .btn-clean-link {
        font-size: 12px;
    }
    .compact-label {
        font-size: 11px;
    }
    .deposit-pill-amt {
        font-size: 13px;
    }
    .cart-heading {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #modal-cart-warehouse .cart-modal-title {
        min-width: 0;
        font-size: 14px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    #modal-cart-warehouse .cart-modal-footer .btn-modal-primary {
        width: 100%;
        min-height: 42px;
    }
}

@media (max-width: 359px) {
    #modal-cart-warehouse .summary-warehouse-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        margin-bottom: 8px;
    }

    #modal-cart-warehouse .cart-wh-btn {
        min-height: 48px;
        padding: 8px 10px;
    }

    #modal-cart-warehouse .summary-tariffs-box {
        padding: 8px;
    }

    #modal-cart-warehouse .tariff-price {
        padding: 6px;
        font-size: 11px;
    }
}

@media (max-width: 319px) {
    #modal-cart-deposit .cart-modal-title { font-size: 13px; }
    #modal-cart-deposit .cart-modal-body { padding: 10px; }
    #modal-cart-deposit .summary-section-header { align-items: flex-start; flex-wrap: wrap; gap: 5px; }
    #modal-cart-deposit .summary-section-label { min-width: 0; overflow-wrap: anywhere; }
    #modal-cart-deposit .summary-deposit-preview-box { padding: 8px; }
    #modal-cart-deposit .deposit-row-highlight,
    #modal-cart-deposit .deposit-row-remain { gap: 5px; font-size: 10.5px; }
    #modal-cart-deposit .deposit-num-val { font-size: 12px; }
    #modal-cart-deposit .deposit-rules-table { font-size: 10px; }
    #modal-cart-deposit .deposit-rules-table th,
    #modal-cart-deposit .deposit-rules-table td { padding: 5px 4px; }
}

.price-ladder-tier .tier-price-approx {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

.modal-variant-selector .sku-price-approx {
    font-size: 11.5px;
    font-weight: 400;
    color: #64748b;
    white-space: nowrap;
}


/* Mobile Bottom Sheet for All Cart Custom Modals (.cart-custom-modal / .cart-modal-dialog) */
@media (max-width: 820px) {
    .cart-custom-modal {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }

    .cart-modal-backdrop {
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
    }

    .cart-modal-dialog,
    .cart-modal-dialog.modal-dialog-lg,
    #modal-cart-deposit .cart-modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        max-height: 90dvh !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.22);
        overflow: hidden !important;
        box-sizing: border-box !important;
        transform: translate3d(0, 100%, 0);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        touch-action: pan-y;
        overscroll-behavior-y: contain;
    }

    .cart-custom-modal.is-open .cart-modal-dialog {
        transform: translate3d(0, 0, 0);
    }

    .cart-modal-header,
    #modal-cart-deposit .cart-modal-header,
    #modal-cart-sku .cart-modal-header {
        position: relative;
        gap: 8px;
        padding: 18px 14px 10px;
        background: #ffffff;
        border-bottom: 1px solid #f1f5f9;
        width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
        cursor: grab;
        touch-action: pan-x;
    }

    .cart-modal-header::before {
        content: "";
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 38px;
        height: 4px;
        border-radius: 999px;
        background: #cbd5e1;
    }

    .cart-modal-title {
        font-size: 14.5px;
        line-height: 1.35;
        color: #0f172a;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #modal-cart-sku .cart-modal-title {
        font-weight: 400 !important;
    }

    .cart-modal-body,
    #modal-cart-deposit .cart-modal-body,
    #modal-cart-sku .cart-modal-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        width: 100%;
        box-sizing: border-box;
        overflow-y: auto;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 12px 14px 14px;
    }

    .cart-modal-footer {
        padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
        border-top: 1px solid #f1f5f9;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    #modal-cart-deposit .cart-modal-footer .btn-modal-primary {
        width: 100%;
        min-height: 42px;
    }

    #modal-cart-deposit .policy-table-title { font-size: 12px; line-height: 1.4; }
    #modal-cart-deposit .deposit-rules-table th,
    #modal-cart-deposit .deposit-rules-table td { padding: 6px; line-height: 1.35; }
    #modal-cart-deposit .deposit-row-highlight,
    #modal-cart-deposit .deposit-row-remain { align-items: flex-start; }
    #modal-cart-deposit .deposit-num-val,
    #modal-cart-deposit .remain-num-val { text-align: right; overflow-wrap: anywhere; }

    #modal-cart-sku .sku-modal-content,
    #modal-cart-sku .sku-modal-product-header,
    #modal-cart-sku .sku-modal-price-ladder-card,
    #modal-cart-sku .sku-modal-layout-container,
    #modal-cart-sku .sku-layout-single-list,
    #modal-cart-sku .sku-layout-two-tier,
    #modal-cart-sku .sku-tier-section,
    #modal-cart-sku .sku-swatch-list,
    #modal-cart-sku .sku-subtier-panel,
    #modal-cart-sku .sku-subtier-group,
    #modal-cart-sku .sku-modal-summary-bar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    #modal-cart-sku .sku-modal-product-header {
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    #modal-cart-sku .sku-modal-thumb {
        width: 110px !important;
        height: 110px !important;
        min-width: 110px !important;
        min-height: 110px !important;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }

    #modal-cart-sku .sku-modal-title {
        font-size: 13px;
        font-weight: 400 !important;
        color: #1e293b;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #modal-cart-sku .badge-moq,
    #modal-cart-sku .ladder-title,
    #modal-cart-sku .tier-price-val,
    #modal-cart-sku .price-ladder-tier.is-active .tier-qty-label,
    #modal-cart-sku .sku-tier-title {
        font-weight: 400 !important;
    }

    #modal-cart-sku .sku-modal-layout-container {
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding: 2px 0 !important;
        margin-bottom: 10px;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-swatch-list.has-swatch-images {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 4px 0 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-swatch-card {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-swatch-card .swatch-name {
        font-weight: 400 !important;
        font-size: 11.5px !important;
        white-space: normal !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-panel {
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding: 4px 12px !important;
        background: #fafafa !important;
        border: 1px solid #edf2f7 !important;
        border-radius: 10px !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-row,
    #modal-cart-sku .sku-modal-layout-container .sku-single-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 10px 0 !important;
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid #eef2f6 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-row:last-child,
    #modal-cart-sku .sku-modal-layout-container .sku-single-row:last-child {
        border-bottom: none !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-single-thumb {
        width: 64px !important;
        height: 64px !important;
        flex: 0 0 64px !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-left,
    #modal-cart-sku .sku-modal-layout-container .sku-single-left {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        gap: 10px !important;
        overflow: hidden !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 3px !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-single-left {
        flex-direction: row !important;
        align-items: center !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-name,
    #modal-cart-sku .sku-modal-layout-container .sku-single-name {
        font-size: 13px !important;
        font-weight: 400 !important;
        color: #1e293b !important;
        white-space: normal !important;
        display: block !important;
        overflow: visible !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        line-height: 1.36 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-price-stock,
    #modal-cart-sku .sku-modal-layout-container .sku-single-price-stock {
        display: flex !important;
        align-items: baseline !important;
        flex-wrap: wrap !important;
        white-space: normal !important;
        gap: 2px 8px !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-price,
    #modal-cart-sku .sku-modal-layout-container .sku-single-price {
        font-size: 13.5px !important;
        font-weight: 400 !important;
        color: #ff5000 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-subtier-stock,
    #modal-cart-sku .sku-modal-layout-container .sku-single-stock {
        font-size: 11px !important;
        font-weight: 400 !important;
        color: #64748b !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-stepper {
        height: 30px !important;
        border-radius: 6px !important;
        border: 1px solid #cbd5e1 !important;
        flex-shrink: 0 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-stepper .btn-stepper {
        width: 28px !important;
        height: 30px !important;
        font-weight: 400 !important;
    }

    #modal-cart-sku .sku-modal-layout-container .sku-stepper .sku-qty-input {
        width: 34px !important;
        height: 30px !important;
        font-size: 16px !important;
        line-height: 1.1 !important;
        font-weight: 400 !important;
    }

    #modal-cart-sku .sku-modal-summary-bar {
        padding: 9px 12px;
        border-radius: 8px;
    }

    #modal-cart-sku .modal-summary-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        font-size: 12.5px;
    }

    #modal-cart-sku .modal-summary-divider {
        display: none;
    }

    #modal-cart-sku .modal-summary-text {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        width: 100%;
        gap: 6px;
    }

    #modal-cart-sku .modal-summary-meta .summary-highlight,
    #modal-cart-sku .modal-summary-meta .summary-price {
        font-weight: 400 !important;
    }

    #modal-cart-sku .cart-modal-footer {
        padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
        border-top: 1px solid #f1f5f9;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    #modal-cart-sku .cart-modal-footer .btn-modal-secondary {
        flex: 0 0 auto;
        min-width: 84px;
        min-height: 40px;
        border-radius: 8px;
        font-weight: 400 !important;
    }

    #modal-cart-sku .cart-modal-footer .btn-modal-primary {
        flex: 1 1 auto;
        min-height: 40px;
        border-radius: 8px;
        font-weight: 400 !important;
    }
}

@media (max-width: 359px) {
    #modal-cart-sku .cart-modal-body {
        padding: 10px 10px 12px;
    }
    #modal-cart-sku .sku-modal-thumb {
        width: 110px !important;
        height: 110px !important;
        min-width: 110px !important;
        min-height: 110px !important;
    }
    #modal-cart-sku .sku-modal-layout-container .sku-swatch-list.has-swatch-images {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    #modal-cart-sku .sku-modal-layout-container .sku-single-thumb {
        width: 56px !important;
        height: 56px !important;
        flex: 0 0 56px !important;
    }
}
