:root {
    --bks-checkout-primary: #b71e23;
    --bks-checkout-primary-dark: #92181c;
    --bks-checkout-ink: #202636;
    --bks-checkout-muted: #687287;
    --bks-checkout-line: #e5e9f1;
    --bks-checkout-soft: #f6f7fa;
    --bks-checkout-success: #16834a;
}

/* Keep only the LTR root as the scrolling box. `clip` is intentional: unlike
   hidden it does not turn the RTL body into a second vertical scroller. */
html[data-bks-checkout-root="1"] {
    direction: ltr;
    margin: 0 !important;
    max-width: 100%;
    overflow-x: clip !important;
    overflow-y: auto !important;
    padding: 0 !important;
    scrollbar-gutter: auto;
}
html[data-bks-checkout-root="1"] body.woocommerce-checkout {
    direction: rtl;
    margin: 0 !important;
    max-width: none !important;
    min-width: 0;
    overflow-x: clip !important;
    overflow-y: visible !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
}
body.woocommerce-checkout .custom-checkout-container,
body.woocommerce-checkout .custom-checkout-container .woocommerce,
body.woocommerce-checkout form.checkout,
body.woocommerce-checkout .bks-checkout-layout,
body.woocommerce-checkout .bks-checkout-main,
body.woocommerce-checkout .bks-checkout-sidebar,
body.woocommerce-checkout .bks-checkout-card,
body.woocommerce-checkout #order_review {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.bks-purchase-progress {
    direction: rtl;
    margin: 18px auto 26px;
    max-width: 920px;
    padding: 0 16px;
}

.bks-purchase-progress ol {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    list-style: none;
    margin: 0;
    padding: 0;
}

.bks-purchase-progress li {
    align-items: center;
    color: #9aa2b1;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    gap: 7px;
    position: relative;
    text-align: center;
}

.bks-purchase-progress li:not(:last-child)::after {
    background: #e2e6ed;
    content: "";
    height: 2px;
    position: absolute;
    right: calc(50% + 24px);
    top: 20px;
    width: calc(100% - 48px);
}

.bks-purchase-progress li.is-complete:not(:last-child)::after {
    background: var(--bks-checkout-success);
}

.bks-purchase-progress__icon {
    align-items: center;
    background: #fff;
    border: 2px solid #dfe3ea;
    border-radius: 50%;
    display: flex;
    height: 42px;
    justify-content: center;
    position: relative;
    width: 42px;
    z-index: 1;
}

.bks-purchase-progress__icon svg { height: 21px; width: 21px; }
.bks-purchase-progress li.is-active { color: var(--bks-checkout-primary); font-weight: 700; }
.bks-purchase-progress li.is-active .bks-purchase-progress__icon { background: #fff4f4; border-color: var(--bks-checkout-primary); box-shadow: 0 0 0 5px rgba(183, 30, 35, .08); }
.bks-purchase-progress li.is-complete { color: var(--bks-checkout-success); }
.bks-purchase-progress li.is-complete .bks-purchase-progress__icon { background: var(--bks-checkout-success); border-color: var(--bks-checkout-success); color: #fff; }

body.woocommerce-checkout:not(.woocommerce-order-received) { background: #f5f6f8; }
.custom-checkout-container { margin: 0 auto; max-width: 1240px; padding: 0 20px 48px; }
.custom-checkout-container .checkout-header { background: transparent; margin-bottom: 4px; }
.custom-checkout-container .woocommerce { direction: rtl; }

.bks-inline-coupon {
    background: #fff;
    border: 1px solid var(--bks-checkout-line);
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(31, 40, 55, .04);
    margin: 0 0 14px;
    overflow: hidden;
}

.bks-inline-coupon summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
    min-height: 54px;
    padding: 0 16px;
}

.bks-inline-coupon summary::-webkit-details-marker { display: none; }
.bks-inline-coupon summary > span { align-items: center; color: var(--bks-checkout-ink); display: flex; font-size: 13px; font-weight: 700; gap: 9px; }
.bks-inline-coupon summary svg { color: var(--bks-checkout-primary); height: 22px; width: 22px; }
.bks-inline-coupon summary small { color: var(--bks-checkout-primary); font-size: 12px; }
.bks-inline-coupon .checkout_coupon { border-top: 1px solid var(--bks-checkout-line); display: flex !important; gap: 8px; margin: 0 !important; padding: 12px 16px !important; }
.bks-inline-coupon input { border: 1px solid #d8dde7 !important; border-radius: 9px !important; flex: 1; font-family: inherit; font-size: 13px; min-width: 0; padding: 10px 12px !important; }
.bks-inline-coupon button { background: var(--bks-checkout-ink) !important; border: 0 !important; border-radius: 9px !important; color: #fff !important; font-family: inherit; min-width: 96px; }

.bks-checkout-layout { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); }
.bks-checkout-main, .bks-checkout-sidebar { min-width: 0; }
.bks-checkout-sidebar { position: sticky; top: 18px; }
.bks-checkout-card { background: #fff !important; border: 1px solid var(--bks-checkout-line) !important; border-radius: 16px !important; box-shadow: 0 8px 28px rgba(31, 40, 55, .045) !important; margin: 0 0 14px !important; padding: 18px !important; }

.bks-checkout-card__header { align-items: flex-start; border-bottom: 1px solid #edf0f4; display: flex; gap: 11px; margin: 0 0 18px; padding: 0 0 15px; }
.bks-checkout-card__header--compact { margin-bottom: 12px; }
.bks-checkout-card__header h2 { color: var(--bks-checkout-ink); font-size: 16px; font-weight: 800; line-height: 1.7; margin: 0; }
.bks-checkout-card__header p { color: var(--bks-checkout-muted); font-size: 12px; line-height: 1.7; margin: 1px 0 0; }
.bks-checkout-card__number { align-items: center; background: var(--bks-checkout-primary); border-radius: 9px; color: #fff; display: flex; flex: 0 0 34px; font-size: 14px; font-weight: 800; height: 34px; justify-content: center; }

.bks-guest-checkout-note { align-items: flex-start; background: #f1f8f4; border: 1px solid #d9eee2; border-radius: 11px; color: #246b46; display: flex; gap: 10px; margin-bottom: 16px; padding: 11px 12px; }
.bks-guest-checkout-note svg { flex: 0 0 22px; height: 22px; margin-top: 1px; width: 22px; }
.bks-guest-checkout-note p { font-size: 12px; line-height: 1.9; margin: 0; }

.bks-fields-grid { display: grid !important; gap: 14px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bks-field-full { grid-column: 1 / -1; }
.bks-field-country { display: none; }
.bks-fields-grid .form-group, .bks-fields-grid .form-row { margin: 0 !important; padding: 0 !important; width: 100% !important; }
.bks-fields-grid label { color: #353c4b; display: block; font-size: 12px; font-weight: 700; margin: 0 0 6px; }
.bks-fields-grid .required { color: var(--bks-checkout-primary); }
.bks-fields-grid input, .bks-fields-grid select, .bks-fields-grid .select2-selection { background: #fff !important; border: 1px solid #d8dde7 !important; border-radius: 10px !important; box-shadow: none !important; color: var(--bks-checkout-ink) !important; font-family: inherit !important; font-size: 13px !important; height: 46px !important; line-height: 46px !important; outline: 0; padding: 0 12px !important; transition: border-color .15s, box-shadow .15s; width: 100% !important; }
.bks-fields-grid input:focus, .bks-fields-grid select:focus { border-color: var(--bks-checkout-primary) !important; box-shadow: 0 0 0 3px rgba(183, 30, 35, .09) !important; }
.bks-fields-grid .woocommerce-invalid input, .bks-fields-grid input.is-invalid { border-color: #d9343a !important; }
.bks-field-help { color: #8790a0; display: block; font-size: 10px; margin-top: 5px; }
.bks-postcode-tip {
    align-items: flex-start;
    background: linear-gradient(135deg, #f5f8ff, #fff);
    border: 1px solid #dce5f5;
    border-radius: 10px;
    color: #526078;
    display: flex;
    font-size: 10px;
    gap: 8px;
    line-height: 1.85;
    margin-top: 7px;
    padding: 8px 9px;
}
.bks-postcode-tip__icon { color: #5563bb; display: inline-flex; flex: 0 0 19px; margin-top: 1px; }
.bks-postcode-tip__icon svg { height: 19px; width: 19px; }
.bks-postcode-tip strong { color: #343e55; font-weight: 800; }

/* Keep the Persian WooCommerce city field visible after checkout refreshes. */
.bks-fields-grid [data-checkout-field="billing_city"],
.bks-fields-grid #billing_city_field {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}
.bks-fields-grid #billing_city,
.bks-fields-grid #billing_city_field .select2-container {
    display: block !important;
    max-width: none !important;
    width: 100% !important;
}
.bks-fields-grid #billing_city:not(.bks-city-search-active) {
    clip: auto !important;
    clip-path: none !important;
    height: 46px !important;
    margin: 0 !important;
    overflow: visible !important;
    position: static !important;
}
.bks-fields-grid #billing_city_field .select2-container { direction: rtl; }
.bks-fields-grid #billing_city_field .select2-selection { align-items: center; display: flex; }
.bks-fields-grid #billing_city_field .select2-selection__rendered { line-height: 44px !important; padding: 0 2px !important; }
.bks-fields-grid #billing_city_field .select2-selection__arrow { height: 44px !important; }
.select2-container .select2-dropdown.bks-city-dropdown,
.select2-container--open .select2-dropdown { direction: rtl; }
.select2-container--open .select2-search--dropdown { display: block; padding: 8px; }
.select2-container--open .select2-search__field { box-sizing: border-box; direction: rtl; font-family: inherit; height: 42px; width: 100% !important; }

.bks-order-note { padding: 0 !important; }
.bks-order-note summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 15px 17px; }
.bks-order-note summary::-webkit-details-marker { display: none; }
.bks-order-note summary span { color: var(--bks-checkout-ink); font-size: 13px; font-weight: 700; }
.bks-order-note summary small { background: var(--bks-checkout-soft); border-radius: 10px; color: var(--bks-checkout-muted); font-size: 10px; padding: 3px 8px; }
.bks-order-note textarea { border: 1px solid #d8dde7 !important; border-radius: 10px !important; box-sizing: border-box; display: block; font-family: inherit; font-size: 13px; margin: 0 16px 16px; min-height: 80px; padding: 10px 12px; resize: vertical; width: calc(100% - 32px); }

.bks-review-products { border-bottom: 1px solid var(--bks-checkout-line); margin-bottom: 12px; padding-bottom: 10px; }
.bks-review-products__heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 8px; }
.bks-review-products__heading strong { color: var(--bks-checkout-ink); font-size: 13px; }
.bks-review-products__heading strong span { color: var(--bks-checkout-muted); font-weight: 500; }
.bks-review-products__heading a { color: var(--bks-checkout-primary); font-size: 11px; text-decoration: none; }
.bks-review-products__list { list-style: none; margin: 0; max-height: 168px; overflow: auto; padding: 0 0 0 3px; scrollbar-width: thin; }
.bks-review-products__list li { align-items: center; display: grid; gap: 9px; grid-template-columns: 42px minmax(0, 1fr) auto; padding: 6px 0; }
.bks-review-products__image, .bks-review-products__image img { border-radius: 8px; display: block; height: 42px; object-fit: cover; width: 42px; }
.bks-review-products__meta { min-width: 0; }
.bks-review-products__name { color: #343b49; display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bks-review-products__meta small { color: var(--bks-checkout-muted); font-size: 10px; }
.bks-review-products__price { color: #343b49; font-size: 11px; font-weight: 700; white-space: nowrap; }

.bks-order-review-card .shop_table { border: 0 !important; border-collapse: collapse !important; margin: 0 !important; width: 100%; }
.bks-order-review-card .shop_table tr { border-bottom: 1px dashed #e5e8ee; }
.bks-order-review-card .shop_table th, .bks-order-review-card .shop_table td { background: transparent !important; border: 0 !important; color: #596274; font-size: 12px; padding: 10px 0 !important; }
.bks-order-review-card .shop_table th { font-weight: 500; text-align: right; }
.bks-order-review-card .shop_table td { font-weight: 700; text-align: left; }
.bks-order-review-card .shop_table .order-total { border: 0; }
.bks-order-review-card .shop_table .order-total th { color: var(--bks-checkout-ink); font-size: 14px; font-weight: 800; }
.bks-order-review-card .shop_table .order-total td, .bks-order-review-card .shop_table .order-total strong { color: var(--bks-checkout-primary); font-size: 16px; font-weight: 900; }
.bks-order-review-card .woocommerce-remove-coupon { color: #cc3238; display: block; font-size: 10px; margin-top: 3px; }

.bks-order-review-card tr.shipping th { color: var(--bks-checkout-ink); display: block; font-size: 13px; font-weight: 800; padding-bottom: 4px !important; text-align: right; }
.bks-order-review-card tr.shipping td { display: block; padding-top: 4px !important; text-align: right; }
.bks-order-review-card .woocommerce-shipping-methods { display: grid; gap: 7px; list-style: none; margin: 0 !important; padding: 0 !important; }
.bks-order-review-card .woocommerce-shipping-methods li { margin: 0 !important; position: relative; }
.bks-order-review-card .woocommerce-shipping-methods input[type="radio"] { height: 1px; opacity: 0; position: absolute; width: 1px; }
.bks-order-review-card .woocommerce-shipping-methods label { align-items: center; background: #fff; border: 1px solid #dfe3eb; border-radius: 10px; color: #394151; cursor: pointer; display: flex !important; font-size: 11px; justify-content: space-between; min-height: 42px; padding: 8px 11px; transition: .15s; width: 100%; }
.bks-order-review-card .woocommerce-shipping-methods input:checked + label { background: #fff5f5; border-color: var(--bks-checkout-primary); box-shadow: 0 0 0 2px rgba(183, 30, 35, .06); }

.payment-section { border-top: 1px solid var(--bks-checkout-line); margin-top: 4px; padding-top: 14px; }
.woocommerce-checkout #payment { box-sizing: border-box; padding: 5px !important; }
.bks-subsection-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 9px; }
.bks-subsection-heading strong { color: var(--bks-checkout-ink); font-size: 13px; }
.bks-subsection-heading span { color: var(--bks-checkout-muted); font-size: 10px; }
.payment-section .payment-warning { align-items: center; background: #fff9e8 !important; border: 1px solid #f5e8b8 !important; border-radius: 9px !important; color: #806417; display: flex; gap: 7px; margin: 0 0 9px !important; padding: 7px 9px !important; }
.payment-section .payment-warning svg { flex: 0 0 18px; height: 18px; width: 18px; }
.payment-section .payment-warning p { font-size: 10px !important; margin: 0 !important; }
.payment-section .payment-methods { display: grid !important; gap: 7px !important; list-style: none; margin: 0 0 12px !important; padding: 0 !important; }
.payment-section .payment-method-label { border: 1px solid #dfe3eb !important; border-radius: 10px !important; cursor: pointer; display: block; margin: 0; padding: 9px 10px !important; }
.payment-section .payment-method-item:has(input:checked) .payment-method-label { background: #fff5f5 !important; border-color: var(--bks-checkout-primary) !important; }
.payment-section .payment-method-content { align-items: center; display: flex; gap: 8px; }
.payment-section .payment-method-content > input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.payment-section .payment-method-radio { flex: 0 0 18px; }
.payment-section .radio-indicator { border: 1.5px solid #aeb5c2; border-radius: 50%; display: block; height: 18px; position: relative; width: 18px; }
.payment-section input:checked + .payment-method-radio .radio-indicator { border-color: var(--bks-checkout-primary); }
.payment-section input:checked + .payment-method-radio .radio-indicator::after { background: var(--bks-checkout-primary); border-radius: 50%; content: ""; inset: 4px; position: absolute; }
.payment-section .payment-method-details { flex: 1; min-width: 0; }
.payment-section .payment-method-details h4 { color: var(--bks-checkout-ink); font-size: 12px !important; margin: 0 !important; }
.payment-section .payment-method-details p { color: var(--bks-checkout-muted); font-size: 9px !important; line-height: 1.6; margin: 1px 0 0 !important; }
.payment-section .payment-method-logo img { max-height: 28px; max-width: 42px; }
.payment-section .payment_box { background: var(--bks-checkout-soft); border-radius: 8px; color: var(--bks-checkout-muted); font-size: 10px; margin-top: 6px; padding: 8px; }
.payment-section .woocommerce-terms-and-conditions-wrapper { color: var(--bks-checkout-muted); font-size: 10px; line-height: 1.8; }
.woocommerce-checkout #payment div.form-row.place-order { display: block !important; margin: 0 !important; padding: 0 !important; width: 100% !important; }
.payment-section #place_order { background: var(--bks-checkout-primary) !important; border: 0 !important; border-radius: 11px !important; box-shadow: 0 7px 18px rgba(183, 30, 35, .2); color: #fff !important; cursor: pointer; float: none !important; font-family: inherit; font-size: 14px !important; font-weight: 800 !important; height: 50px; margin-top: 8px; transition: .15s; width: 100% !important; }
.payment-section #place_order:hover { background: var(--bks-checkout-primary-dark) !important; transform: translateY(-1px); }
.payment-section #place_order:disabled { cursor: wait; opacity: .65; transform: none; }
.bks-payment-security { align-items: center; color: #788295; display: flex; font-size: 9px; gap: 5px; justify-content: center; margin: 9px 0 0; }
.bks-payment-security svg { height: 14px; width: 14px; }

.woocommerce-checkout .woocommerce-NoticeGroup-checkout, .woocommerce-checkout .woocommerce-error { border-radius: 12px; font-size: 12px; line-height: 1.9; margin-bottom: 14px; }
.woocommerce-checkout .blockUI.blockOverlay { border-radius: 14px; }

@media (max-width: 900px) {
    .custom-checkout-container { padding-left: 14px; padding-right: 14px; }
    .bks-checkout-layout { grid-template-columns: 1fr; }
    .bks-checkout-sidebar { position: static; }
    .bks-checkout-main { display: contents; }
}

@media (max-width: 768px) {
    body.woocommerce-checkout:not(.woocommerce-order-received) { padding-bottom: env(safe-area-inset-bottom); }
    .payment-section #place_order { position: static !important; width: 100% !important; }
}

@media (max-width: 560px) {
    body.woocommerce-checkout:not(.woocommerce-order-received) { background: #f4f5f7; }
    .custom-checkout-container { padding: 0 10px 30px; }
    .custom-checkout-container .checkout-header { min-height: 58px; }
    .custom-checkout-container .checkout-back-btn span { display: none; }
    .bks-purchase-progress { margin: 8px auto 18px; padding: 0 4px; }
    .bks-purchase-progress__icon { height: 34px; width: 34px; }
    .bks-purchase-progress__icon svg { height: 17px; width: 17px; }
    .bks-purchase-progress li { font-size: 9px; gap: 5px; }
    .bks-purchase-progress li:not(:last-child)::after { right: calc(50% + 19px); top: 16px; width: calc(100% - 38px); }
    .bks-checkout-card { border-radius: 13px !important; padding: 14px !important; }
    .bks-checkout-card__header { margin-bottom: 14px; padding-bottom: 12px; }
    .bks-checkout-card__header h2 { font-size: 14px; }
    .bks-checkout-card__number { flex-basis: 30px; height: 30px; }
    .bks-fields-grid { gap: 12px 8px; }
    .bks-field-half { grid-column: 1 / -1; }
    .bks-fields-grid input, .bks-fields-grid select, .bks-fields-grid .select2-selection { font-size: 16px !important; }
    .bks-inline-coupon .checkout_coupon { padding: 10px !important; }
    .bks-inline-coupon input { font-size: 16px; }
    .bks-review-products__list { max-height: 132px; }
    .bks-review-products__list li { grid-template-columns: 38px minmax(0, 1fr) auto; }
    .bks-review-products__image, .bks-review-products__image img { height: 38px; width: 38px; }
}

/* Compact, glanceable purchase path shared by cart and checkout. */
.bks-purchase-progress {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--bks-checkout-line);
    border-radius: 13px;
    box-shadow: 0 5px 18px rgba(31, 40, 55, .04);
    margin: 10px auto 14px;
    max-width: 760px;
    padding: 8px 12px;
}
.bks-purchase-progress li { flex-direction: row; font-size: 10px; gap: 5px; justify-content: center; }
.bks-purchase-progress__icon { border-width: 1.5px; flex: 0 0 26px; height: 26px; width: 26px; }
.bks-purchase-progress__icon svg { height: 14px; width: 14px; }
.bks-purchase-progress li:not(:last-child)::after {
    height: 1px;
    right: calc(50% + 41px);
    top: 13px;
    width: calc(100% - 82px);
}
.bks-purchase-progress li.is-active .bks-purchase-progress__icon { box-shadow: 0 0 0 3px rgba(183, 30, 35, .07); }

/* Override legacy checkout edges that create a white strip on RTL phones. */
body.woocommerce-checkout *, body.woocommerce-checkout *::before, body.woocommerce-checkout *::after { box-sizing: border-box; }
body.woocommerce-checkout .checkout-section.payment-section,
body.woocommerce-checkout .bakhshi-checkout-order-notes.woocommerce-additional-fields {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}
body.woocommerce-checkout .custom-checkout-container,
body.woocommerce-checkout .custom-checkout-container .woocommerce { width: 100%; }
body.woocommerce-checkout .custom-checkout-container { touch-action: manipulation; }
body.woocommerce-checkout button,
body.woocommerce-checkout a,
body.woocommerce-checkout label,
body.woocommerce-checkout input,
body.woocommerce-checkout select { touch-action: manipulation; }

/* Cart product cards: keep the title stable and offer one explicit action. */
.woocommerce-cart .cart-item-title-holder { min-width: 0; }
.woocommerce-cart .bks-cart-view-product {
    align-items: center;
    align-self: flex-start;
    background: #f6f7fb;
    border: 1px solid #e1e5ef;
    border-radius: 8px;
    color: #48536c;
    display: inline-flex;
    font-size: 10px;
    font-weight: 750;
    gap: 5px;
    line-height: 1;
    margin-top: 4px;
    padding: 7px 9px;
    text-decoration: none;
}
.woocommerce-cart .bks-cart-view-product:hover { background: #fff5f5; border-color: rgba(183, 30, 35, .28); color: var(--bks-checkout-primary); }
.woocommerce-cart .bks-cart-view-product svg { height: 14px; width: 14px; }

/* Modern cart cards: clearer hierarchy without changing quantity/remove hooks. */
.woocommerce-cart .cart-items-container { background: transparent; border-radius: 0; }
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart .woocommerce-cart-form__contents,
.woocommerce-cart .woocommerce-cart-form__contents tbody { display: block; width: 100%; }
.woocommerce-cart .woocommerce-cart-form__cart-item { display: block; margin-bottom: 9px; }
.woocommerce-cart .woocommerce-cart-form__cart-item > td { display: block; padding: 0 !important; }
.woocommerce-cart .cart-item {
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e9f1;
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(31, 40, 55, .045);
    gap: 11px;
    min-height: 126px;
    padding: 11px;
    position: relative;
}
.woocommerce-cart .cart-item-image { margin: 0; width: 104px; }
.woocommerce-cart .cart-item-image > a {
    align-items: center;
    background: #f7f8fa;
    border: 1px solid #edf0f4;
    border-radius: 11px;
    display: flex;
    height: 88px;
    justify-content: center;
    overflow: hidden;
    width: 104px;
}
.woocommerce-cart .cart-item-image > a img,
.woocommerce-cart .cart-item-image > img { height: 100% !important; object-fit: contain !important; padding: 4px; width: 100% !important; }
.woocommerce-cart .cart-item-details { gap: 7px; min-width: 0; }
.woocommerce-cart .cart-item-title-holder { gap: 5px; padding-left: 30px; }
.woocommerce-cart .cart-item-title { color: #252b37; font-size: 12px; font-weight: 800; line-height: 1.75; margin: 0; }
.woocommerce-cart .cart-item-title a { color: inherit; }
.woocommerce-cart .bks-cart-item-meta { color: #778196; font-size: 9.5px; line-height: 1.7; }
.woocommerce-cart .bks-cart-product-identifiers { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.woocommerce-cart .bks-cart-product-identifiers > span { align-items: center; background: #f5f7fa; border: 1px solid #e8ebf1; border-radius: 7px; display: inline-flex; gap: 5px; max-width: 100%; padding: 3px 6px; }
.woocommerce-cart .bks-cart-product-identifiers small { color: #8992a3; font-size: 8.5px; white-space: nowrap; }
.woocommerce-cart .bks-cart-product-identifiers strong { color: #4b5568; font-size: 9.5px; font-weight: 750; overflow-wrap: anywhere; }
.woocommerce-cart .bks-cart-product-variation { flex: 0 1 auto; }
.woocommerce-cart .bks-cart-item-meta dl { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; }
.woocommerce-cart .bks-cart-item-meta dt,
.woocommerce-cart .bks-cart-item-meta dd { margin: 0; }
.woocommerce-cart .bks-cart-item-meta dt { font-weight: 700; }
.woocommerce-cart .cart-item-price-section { border-top: 1px dashed #e5e8ee; margin-top: auto; min-height: 32px; padding-top: 7px; }
.woocommerce-cart .price-container { align-items: flex-end; gap: 1px; }
.woocommerce-cart .bks-cart-item-price-label { color: #8a93a4; font-size: 8.5px; }
.woocommerce-cart .price-container .amount { color: #252b37; font-size: 12px; font-weight: 850; }
.woocommerce-cart .product-remove { left: 9px; position: absolute; top: 9px; visibility: visible !important; z-index: 3; }
.woocommerce-cart .product-remove .remove {
    align-items: center;
    background: #f7f8fa;
    border: 1px solid #e5e8ee;
    border-radius: 8px;
    color: #8a93a4 !important;
    display: flex;
    font-size: 17px;
    height: 27px;
    justify-content: center;
    line-height: 1;
    width: 27px;
}
.woocommerce-cart .product-remove .remove:hover { background: #fff1f1; border-color: #f0c9cb; color: var(--bks-checkout-primary) !important; }
.woocommerce-cart .product-quantity { margin-top: 6px; }
.woocommerce-cart .cart-item-actions { background: #fafbfc; border-color: #e7eaf0; height: 32px; justify-content: space-between; margin: 0; padding: 3px; }
.woocommerce-cart .qty-decrease,
.woocommerce-cart .qty-increase { height: 24px; width: 24px; }
.woocommerce-cart .qty-display { background: transparent; font-size: 12px; }

/* Cart and checkout totals use the same restrained financial hierarchy. */
.woocommerce-cart .cart_totals {
    background: #fff;
    border: 1px solid #e5e9f1;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(31,40,55,.045);
    margin-top: 12px;
    overflow: hidden;
    padding: 0 13px 6px;
}
.bks-cart-summary__header { align-items: center; border-bottom: 1px solid #edf0f4; display: flex; justify-content: space-between; padding: 11px 0 9px; }
.bks-cart-summary__header > div { display: grid; gap: 0; }
.bks-cart-summary__header span { color: var(--bks-checkout-primary); font-size: 8.5px; font-weight: 800; }
.bks-cart-summary__header h2 { color: #252b37; font-size: 13px; font-weight: 850; margin: 0; }
.bks-cart-summary__header small { background: #f3f5f8; border-radius: 99px; color: #697386; font-size: 9px; padding: 4px 8px; }
.woocommerce-cart .cart_totals .shop_table { border: 0 !important; margin: 0 !important; }
.woocommerce-cart .cart_totals .shop_table tr { border-bottom: 1px dashed #e8ebf0; }
.woocommerce-cart .cart_totals .shop_table tr:last-child { border-bottom: 0; }
.woocommerce-cart .cart_totals .shop_table th,
.woocommerce-cart .cart_totals .shop_table td { background: transparent !important; border: 0 !important; color: #667085; font-size: 10.5px !important; padding: 8px 0 !important; }
.woocommerce-cart .cart_totals .shop_table th { font-weight: 550; text-align: right; }
.woocommerce-cart .cart_totals .shop_table td { font-weight: 750; text-align: left; }
.woocommerce-cart .cart_totals .order-total th { color: #252b37; font-size: 12px !important; font-weight: 850; }
.woocommerce-cart .cart_totals .order-total td,
.woocommerce-cart .cart_totals .order-total .amount { color: var(--bks-checkout-primary); font-size: 13px !important; font-weight: 900; }

.bks-order-review-card .bks-order-totals { background: #fafbfc; border: 1px solid #edf0f4 !important; border-radius: 11px; overflow: hidden; padding: 0 10px; }
.bks-order-review-card .bks-order-totals tr { border-bottom-color: #e7eaf0; }
.bks-order-review-card .bks-order-totals th,
.bks-order-review-card .bks-order-totals td { font-size: 10.5px !important; padding: 8px 0 !important; }
.bks-order-review-card .bks-order-totals .order-total th { font-size: 12px !important; }
.bks-order-review-card .bks-order-totals .order-total td,
.bks-order-review-card .bks-order-totals .order-total strong { font-size: 13.5px !important; }

/* Keep the purchase action after the final cart element, never over content. */
.woocommerce-cart .custom-cart-wrapper { padding-bottom: 20px; }
.woocommerce-cart .cart-collaterals .cart-bottom-navbar {
    position: static !important;
    border: 1px solid #e3e7ef;
    border-radius: 12px;
    bottom: auto !important;
    box-shadow: 0 6px 20px rgba(28, 35, 52, .08);
    gap: 8px;
    left: auto !important;
    margin: 10px 0 0 !important;
    max-width: none !important;
    min-height: 52px;
    padding: 7px 8px !important;
    right: auto !important;
    width: 100% !important;
    z-index: auto !important;
}
.woocommerce-cart .navbar-total { line-height: 1.25; }
.woocommerce-cart .navbar-total-label { font-size: 9px; }
.woocommerce-cart .navbar-total-value { font-size: 14px; font-weight: 800; }
.woocommerce-cart .navbar-total-value img { height: 18px !important; width: 18px !important; }
.woocommerce-cart .checkout-button { border-radius: 9px; font-size: 12px; min-height: 40px; padding: 9px 12px; }

@media (max-width: 560px) {
    .bks-purchase-progress { border-radius: 10px; margin: 6px 4px 10px; padding: 7px 5px; }
    .bks-purchase-progress li { flex-direction: column; font-size: 8px; gap: 3px; }
    .bks-purchase-progress__icon { flex-basis: 24px; height: 24px; width: 24px; }
    .bks-purchase-progress li:not(:last-child)::after { right: calc(50% + 15px); top: 12px; width: calc(100% - 30px); }
    .woocommerce-cart .cart-collaterals .cart-bottom-navbar { margin-top: 8px !important; width: 100% !important; }
    .woocommerce-cart .cart-item { border-radius: 12px; gap: 9px; min-height: 118px; padding: 9px; }
    .woocommerce-cart .cart-item-image { width: 90px; }
    .woocommerce-cart .cart-item-image > a { height: 78px; width: 90px; }
    .woocommerce-cart .cart-item-title-holder { padding-left: 27px; }
    .woocommerce-cart .cart-item-title { font-size: 11px; line-height: 1.65; }
    .woocommerce-cart .bks-cart-item-meta { font-size: 8.7px; }
    .woocommerce-cart .bks-cart-view-product { font-size: 9px; padding: 6px 7px; }
    .woocommerce-cart .cart_totals { border-radius: 12px; padding-inline: 10px; }
}
