/* ==========================================================================
   BARSÄZ — Cart / Checkout
   سبد خرید، تسویه‌حساب و نتیجهٔ پرداخت
   ========================================================================== */

/* --------------------------------------------------------------------------
   Vue mount / boot (مرحلهٔ سبد با Vue رندر می‌شود)
   -------------------------------------------------------------------------- */
[v-cloak] {
    display: none !important;
}

.cart-app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 0;
    color: var(--muted);
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--line-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: cart-spin .8s linear infinite;
}

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

.cart-boot-error {
    padding-top: 26px;
}

.cart-boot-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 60px;
}

/* --------------------------------------------------------------------------
   Minimal layout (سبد خرید بدون منو/فوتر)
   -------------------------------------------------------------------------- */
.lite-header {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.lite-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
}

.lite-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.lite-back svg {
    width: 15px;
    height: 15px;
}

.lite-back:hover {
    border-color: var(--ink);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   Cart page
   -------------------------------------------------------------------------- */
.cart-page {
    padding: 40px 0 90px;
}

.cart-page .cart-layout {
    padding: 0;
}

.cart-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.cart-page-head h1 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.cart-count {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
}

.cart-page .cart-item {
    padding: 16px;
    gap: 18px;
    border-radius: var(--radius-lg);
}

.cart-page .cart-item-media {
    width: 116px;
    border-radius: var(--radius);
}

.cart-page .cart-item-body h3 {
    font-size: 16.5px;
}

.cart-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* استپر تعداد در یک نوار جمع‌وجور */
.cart-page .cart-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--bg);
}

.cart-page .cart-qty .cart-qty-value {
    min-width: 22px;
    text-align: center;
    font-size: 15px;
}

.cart-page .cart-qty-btn {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    font-size: 15px;
    line-height: 1;
}

.cart-page .cart-qty-btn:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.cart-qty-fixed {
    padding: 5px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.cart-page .cart-item-end {
    gap: 8px;
}

.cart-page .cart-remove {
    border-color: transparent;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Flow steps (مسیر خرید)
   -------------------------------------------------------------------------- */
.flow-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.flow-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}

.flow-step .dot {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    font-size: 11px;
}

.flow-step.done {
    color: var(--accent);
}

.flow-step.done .dot {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
}

.flow-step.active {
    color: var(--ink);
}

.flow-step.active .dot {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.flow-line {
    flex: 1;
    height: 1px;
    min-width: 18px;
    background: var(--line);
}

/* --------------------------------------------------------------------------
   Form controls (checkout)
   -------------------------------------------------------------------------- */
.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

/* سلکت‌های فرم چک‌اوت: آیکن SVG با فاصله از لبهٔ چپ */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-inline-end: 40px;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 14px 14px;
    cursor: pointer;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.mb-3 {
    margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Address (checkout flow)
   -------------------------------------------------------------------------- */
.addr-option-list {
    display: grid;
    gap: 12px;
}

.addr-option {
    position: relative;
    display: grid;
    grid-template-columns: auto 44px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 18px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    cursor: pointer;
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
        box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.addr-option:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.addr-option:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.addr-option-radio {
    width: 18px;
    height: 18px;
    margin-top: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}

.addr-option-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    flex: none;
}

.addr-option-icon svg {
    width: 21px;
    height: 21px;
}

.addr-option-body {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.addr-option-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.addr-option-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.addr-option-title b {
    font-size: 14.5px;
    line-height: 1.7;
}

.addr-option-title small {
    color: var(--muted);
    font-size: 12.5px;
}

.addr-option-text {
    margin: 0;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.9;
}

.addr-option-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    color: var(--muted);
    font-size: 12.5px;
}

.addr-option-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.addr-option-meta svg {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--muted);
}

/* کارت آدرس پیش‌فرض کمی برجسته‌تر */
.addr-option:has(input:checked) .addr-option-icon {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.addr-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
}

.addr-divider::before,
.addr-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.addr-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.addr-form-grid .full {
    grid-column: 1 / -1;
}

.addr-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Result pages
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Summary (cart page)
   -------------------------------------------------------------------------- */
.cart-page .cart-summary {
    top: 24px;
    padding: 22px;
}

.summary-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 13px;
    color: var(--muted);
}

.summary-total-row .summary-total {
    font-size: 19px;
}

.summary-total-row .summary-total small {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Empty state (cart)
   -------------------------------------------------------------------------- */
.cart-empty {
    display: grid;
    place-items: center;
    gap: 10px;
    max-width: 560px;
    margin: 24px auto 0;
    padding: 56px 28px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
}

.cart-empty .ic {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}

.cart-empty .ic svg {
    width: 34px;
    height: 34px;
}

.cart-empty h2 {
    margin: 6px 0 0;
    font-size: 1.25rem;
}

.cart-empty p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 2;
}

.cart-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Sticky mobile checkout bar
   -------------------------------------------------------------------------- */
.cart-mobile-bar {
    display: none;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 42px;
    align-items: start;
    padding: 46px 0 90px;
}

/* بدون باکس کنار (مثلاً صفحهٔ آدرس که مبلغ بالای صفحه نمایش داده می‌شود) */
.cart-layout-single {
    grid-template-columns: minmax(0, 1fr);
}

/* نوار مبلغ قابل پرداخت بالای صفحه (صفحهٔ آدرس) */
.checkout-total-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    font-size: 13.5px;
    color: var(--ink-2, var(--muted));
}

.checkout-total-note b {
    font-size: 1.05rem;
    color: var(--accent);
}

/* پیام قرمز اقلام غیرقابل‌خرید سبد (توقف فروش/ناموجود/غیرفعال) */
.cart-issues ul {
    margin: 8px 0 0;
    padding-inline-start: 18px;
    display: grid;
    gap: 4px;
}

.cart-issues b {
    font-weight: 800;
}

.cart-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Cart item
   -------------------------------------------------------------------------- */
.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.cart-item:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}

.cart-item-media {
    position: relative;
    display: block;
    width: 132px;
    flex: none;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.cart-item-media img,
.cart-item-media .ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-body {
    display: grid;
    gap: 7px;
    flex: 1;
    min-width: 0;
}

.cart-item-body h3 {
    font-size: 17px;
    line-height: 1.6;
}

.cart-item-body h3 a:hover {
    color: var(--accent);
}

.cart-item-body .muted {
    font-size: 12.5px;
}

.cart-item-end {
    display: grid;
    justify-items: end;
    gap: 12px;
    flex: none;
}

.cart-qty {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.cart-qty-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.cart-qty-value {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
    color: var(--accent);
}

.cart-qty-actions {
    display: flex;
    gap: 8px;
}

.cart-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.cart-qty-btn:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--accent);
}

.cart-item-price {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 900;
    color: var(--accent);
    white-space: nowrap;
}

.cart-item-price small {
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 400;
    color: var(--muted);
}

.cart-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
    transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
        background-color var(--dur) var(--ease);
}

.cart-remove svg {
    width: 14px;
    height: 14px;
}

.cart-remove:hover {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
}

/* --------------------------------------------------------------------------
   Boxes (checkout)
   -------------------------------------------------------------------------- */
.cart-box {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

/* گروه آیتم‌های سفارش (تسویه‌حساب) — همان کارت‌های سبد بدون دکمهٔ عملیات */
.cart-group {
    display: grid;
    gap: 12px;
}

.cart-group .cart-box-head {
    margin-bottom: 0;
}

.cart-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.cart-box-head h2 {
    font-size: 1.15rem;
}

.cart-box-head .muted {
    font-size: 12.5px;
}

.cart-line {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.cart-line:first-of-type {
    padding-top: 0;
}

.cart-line-thumb {
    width: 58px;
    flex: none;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-xs);
    background: var(--surface-2);
}

.cart-line-thumb img,
.cart-line-thumb .ph {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-line-body {
    display: grid;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.cart-line-body b {
    font-size: 14px;
}

.cart-line-body small {
    color: var(--muted);
    font-size: 12px;
}

.cart-line-price {
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 900;
    color: var(--accent);
    white-space: nowrap;
}

.cart-account {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.cart-account .info-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
}

.cart-account .info-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.cart-account .info-item b {
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Summary
   -------------------------------------------------------------------------- */
.cart-summary {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    padding: 26px;
    border: 1px solid var(--line-strong);
    border-top: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    box-shadow: var(--shadow);
}

.cart-summary h2 {
    margin-bottom: 18px;
    font-size: 1.15rem;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
    color: var(--muted);
}

.summary-row b {
    color: var(--ink);
}

.summary-total {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
    color: var(--accent) !important;
    white-space: nowrap;
}

.cart-summary-actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

/* در صفحهٔ تسویه‌حساب فاصلهٔ بالای فرم پرداخت حذف می‌شود */
.cart-summary:has(#checkout-place) .cart-summary-actions {
    margin-top: 0;
}

/* تیک پذیرش قوانین پیش از ورود به درگاه */
.cart-terms {
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.cart-terms .terms-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cart-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: none;
    margin: 4px 0 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.cart-terms label {
    margin: 0;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.9;
    cursor: pointer;
}

.cart-terms label a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cart-terms label a:hover {
    color: var(--ink);
}

.cart-terms .field-error {
    margin-top: 8px;
}

.cart-clear {
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
}

.cart-clear:hover {
    color: var(--danger);
}

.cart-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
}

.cart-note svg {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 4px;
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Result (success / failed)
   -------------------------------------------------------------------------- */
.result-wrap {
    display: grid;
    place-items: center;
    padding: 66px 0 100px;
}

.result-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 46px 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.result-icon {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin: 0 auto 24px;
    border-radius: 50%;
}

.result-icon svg {
    width: 40px;
    height: 40px;
}

.result-icon.success {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.result-icon.failed {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}

.result-card h1 {
    margin-bottom: 12px;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.result-card > p {
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 2.05;
}

.result-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 30px 0;
    text-align: start;
}

.result-facts .info-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
}

.result-facts .info-item span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.result-facts .info-item b {
    font-size: 14px;
}

.result-items {
    margin: 0 0 30px;
    text-align: start;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}

.result-item:last-child {
    border-bottom: 0;
}

.result-item b {
    font-weight: 700;
}

.result-item .price {
    font-family: var(--font-display);
    font-weight: 900;
    color: var(--accent);
    white-space: nowrap;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 34px;
    }
    .cart-summary {
        position: static;
    }

    /* سبد خرید بدون فوتر: نوار پرداخت چسبان پایین صفحه */
    .cart-page:has(.cart-mobile-bar) {
        padding-bottom: 120px;
    }
    .cart-mobile-bar {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 60;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 12px var(--gutter);
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: var(--surface);
        box-shadow: 0 -12px 30px color-mix(in srgb, var(--ink) 9%, transparent);
    }
    .cmb-total {
        display: grid;
        gap: 2px;
    }
    .cmb-total span {
        color: var(--muted);
        font-size: 11px;
    }
    .cmb-total b {
        font-family: var(--font-display);
        font-size: 17px;
        font-weight: 900;
        color: var(--accent);
        white-space: nowrap;
    }
    .cmb-total b small {
        font-family: var(--font-body);
        font-size: 10.5px;
        font-weight: 400;
        color: var(--muted);
    }
    .cart-mobile-bar .btn {
        flex: none;
    }
    /* دکمهٔ پرداخت در خلاصهٔ درون‌صفحه پنهان می‌شود (نوار پایین جایش را گرفته) */
    .cart-page:has(.cart-mobile-bar) .cart-summary-actions .btn-primary {
        display: none;
    }
}

@media (max-width: 640px) {
    .cart-item {
        flex-wrap: wrap;
        gap: 14px;
    }
    .cart-item-media {
        width: 96px;
    }
    .cart-item-body {
        flex-basis: calc(100% - 116px);
    }
    .cart-item-end {
        width: 100%;
        grid-auto-flow: column;
        align-items: center;
        justify-content: space-between;
        justify-items: start;
    }
    .cart-box {
        padding: 20px;
    }
    .result-card {
        padding: 34px 22px;
    }
    .result-icon {
        width: 72px;
        height: 72px;
    }
    .result-actions .btn {
        flex: 1 1 100%;
    }

    /* سبد خرید */
    .cart-page {
        padding-top: 24px;
    }
    .cart-page-head {
        margin-bottom: 20px;
    }
    .cart-page .cart-item {
        padding: 14px;
        gap: 12px;
    }
    .cart-page .cart-item-media {
        width: 84px;
    }
    .cart-page .cart-item-body {
        flex-basis: calc(100% - 96px);
    }
    .cart-page .cart-item-body h3 {
        font-size: 15px;
    }
    .cart-page .cart-item-end {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-top: 10px;
        border-top: 1px dashed var(--line);
    }
    .cart-page .cart-item-price {
        font-size: 15.5px;
    }
    .cart-page .cart-remove {
        padding: 8px 12px;
    }
    .cart-empty {
        padding: 40px 20px;
    }
    .cart-empty-actions .btn {
        flex: 1 1 100%;
    }

    /* مراحل خرید */
    .flow-steps {
        gap: 6px;
    }
    .flow-step {
        gap: 6px;
    }
    .flow-step .dot {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    .flow-step .lbl {
        font-size: 10.5px;
    }
    .flow-line {
        min-width: 8px;
    }

    /* فرم‌های آدرس */
    .addr-form-grid {
        grid-template-columns: 1fr;
    }

    .addr-option {
        grid-template-columns: auto 40px minmax(0, 1fr);
        padding: 14px;
        gap: 10px;
    }

    .addr-option-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .addr-option-meta {
        gap: 6px 14px;
    }
}

/* ---------------------------------------------------------------------------
   عرض‌های بسیار کم — هدر مینیمال و ردیف قیمت/حذف باید جا شوند
   --------------------------------------------------------------------------- */
@media (max-width: 420px) {
    .lite-header-inner {
        gap: 10px;
        min-height: 66px;
    }
    .lite-header .brand {
        gap: 7px;
        min-width: 0;
    }
    .lite-header .brand-img {
        height: 32px;
        max-width: 84px;
    }
    .lite-header .brand-text strong {
        font-size: 13px;
    }
    .lite-header .brand-text small {
        font-size: 8px;
        letter-spacing: 2px;
    }
    .lite-back {
        padding: 8px 12px;
        font-size: 12px;
        flex: none;
    }

    .cart-page .cart-qty {
        gap: 4px;
        padding: 3px;
    }
    .cart-page .cart-qty-btn {
        width: 26px;
        height: 26px;
    }
    .cart-page .cart-qty .cart-qty-value {
        min-width: 18px;
        font-size: 13.5px;
    }
    .cart-page .cart-item-price {
        font-size: 14px;
    }
    .cart-page .cart-remove {
        padding: 8px 10px;
        font-size: 11.5px;
    }
}

@media (max-width: 340px) {
    /* در باریک‌ترین صفحه‌ها فقط نشان برند + دکمهٔ بازگشت آیکونی */
    .lite-header .brand-text {
        display: none;
    }
    .lite-back {
        width: 42px;
        height: 42px;
        padding: 0;
        justify-content: center;
    }
    .lite-back span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    /* مراحل خرید فقط نقطه‌ها */
    .flow-step .lbl {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}
/* --------------------------------------------------------------------------
   Checkout address page — دو ستون مثل سبد خرید
   -------------------------------------------------------------------------- */
.addr-submit {
    margin-top: 18px;
}

/* جداکنندهٔ بین آدرس‌های ذخیره‌شده و فرم آدرس جدید */
.checkout-layout .addr-divider {
    margin: 2px 0;
}

/* خلاصهٔ فاکتور در ستون کنار، هم‌خانواده با خلاصهٔ سبد خرید */
.checkout-summary {
    padding: 24px;
}

@media (max-width: 1000px) {
    /* در موبایل خلاصه قبل از فرم‌ها دیده شود */
    .checkout-layout .checkout-summary {
        order: -1;
    }
}
