
/* ============================================================
   KOVIA — Cart & Checkout Final
   Mobile-First · RTL · Coffee Theme
   Compatible with:
   - templates/cart/cart.html
   - templates/cart/shopping_payment.html
   - static/js/cart.js
   ============================================================ */

:root {
    --coffee: #6f4e37;
    --coffee-dark: #4b3423;
    --coffee-light: #a07856;
    --cream: #f7f1ea;
    --surface: #fffdfb;
    --white: #ffffff;
    --ink: #2b2118;
    --muted: #8a7b6e;
    --line: #eee4d9;
    --line-strong: #e6ddd2;
    --danger: #d9534f;
    --success: #1e9e5a;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;
    --shadow: 0 6px 24px rgba(75, 52, 35, 0.08);
    --shadow-hover: 0 10px 28px rgba(75, 52, 35, 0.12);
    --shadow-soft: 0 4px 14px rgba(75, 52, 35, 0.06);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    text-decoration: none;
}

body {
    color: var(--ink);
    background: var(--surface);
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Shared
   ============================================================ */

.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 56px;
}

.step-dot {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1.5px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.step.active .step-dot {
    background: var(--coffee);
    border-color: var(--coffee);
    color: #fff;
    box-shadow: 0 6px 16px rgba(111, 78, 55, 0.24);
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.3;
    text-align: center;
}

.step.active .step-label {
    color: var(--coffee-dark);
}

.step.disabled {
    opacity: 0.55;
}

.step-line {
    flex: 0 1 28px;
    height: 2px;
    background: var(--line);
    border-radius: 999px;
    margin-bottom: 20px;
}

/* ============================================================
   CART PAGE
   ============================================================ */

.cart-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #fdfaf6 0%, #f6efe7 100%);
    color: var(--ink);
    padding: 16px 0 100px;
}

.cart-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fdf9f4);
}

.cart-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 800;
    color: var(--coffee-dark);
}

.cart-header h1 i {
    color: var(--coffee);
    font-size: 13px;
}

.cart-count {
    background: var(--cream);
    color: var(--coffee-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.cart-items {
    display: flex;
    flex-direction: column;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    animation: itemIn 0.3s ease both;
}

.cart-item:last-child {
    border-bottom: none;
}

@keyframes itemIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.ci-media {
    flex: 0 0 76px;
}

.ci-media img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--cream);
}

.ci-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ci-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.ci-title {
    min-width: 0;
    color: inherit;
}

.ci-title h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.ci-title:hover h3 {
    color: var(--coffee);
}

.delete-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #f3dedd;
    border-radius: 10px;
    background: #fdf3f3;
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: all 0.2s ease;
}

.delete-btn i {
    font-size: 12px;
}

.delete-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.delete-btn:active {
    transform: scale(0.95);
}

.ci-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ci-tags span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--cream);
    color: var(--coffee-dark);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    line-height: 1.4;
}

.ci-tags i {
    font-size: 9px;
    color: var(--coffee-light);
}

.ci-unit-price {
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.5;
}

.ci-unit-price b {
    color: var(--ink);
    font-feature-settings: "tnum";
}

.ci-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}

.quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 118px;
    height: 40px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    overflow: hidden;
    flex-direction: row-reverse;
    flex-shrink: 0;
}

.qty-btn {
    width: 36px;
    height: 100%;
    border: 0;
    background: #f8f3ed;
    color: var(--coffee-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    transition: 0.2s ease;
    flex-shrink: 0;
}

.qty-btn:hover {
    background: #ede2d5;
}

.qty-btn:active {
    transform: scale(0.96);
}

.qty-btn i {
    font-size: 11px;
    line-height: 1;
    margin: 0;
}

.qty-input {
    flex: 1;
    width: 44px;
    height: 100%;
    border: 0;
    background: #fff;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    color: #2b211d;
    outline: none;
    padding: 0;
    margin: 0;
    appearance: textfield;
    -moz-appearance: textfield;
    font-feature-settings: "tnum";
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ci-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.45;
    min-width: 84px;
}

.ci-total small {
    font-size: 10.5px;
    color: var(--muted);
}

.ci-total strong {
    font-size: 14px;
    font-weight: 900;
    color: var(--coffee-dark);
    font-feature-settings: "tnum";
}

.ci-total strong i {
    font-style: normal;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
}

/* Coupon */

.coupon-box {
    margin: 12px;
    padding: 14px;
    border: 1.5px dashed var(--coffee-light);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fffdf9, #fbf5ed);
}

.coupon-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.coupon-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--coffee);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(111, 78, 55, 0.25);
}

.coupon-text {
    flex: 1;
    min-width: 0;
}

.coupon-text strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 800;
    color: var(--coffee-dark);
}

.coupon-text p {
    margin: 0;
    font-size: 11px;
    line-height: 1.7;
    color: var(--muted);
}

.coupon-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.coupon-form input {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.coupon-form input:focus {
    border-color: var(--coffee);
    box-shadow: 0 0 0 4px rgba(111, 78, 55, 0.1);
}

.coupon-form button {
    flex: 0 0 84px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--coffee);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.coupon-form button:hover {
    background: var(--coffee-dark);
}

.coupon-form button:active {
    transform: scale(0.97);
}

.coupon-active {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #e9f8f0;
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.coupon-active i {
    font-size: 12px;
}

.checkout-coupon { margin: 0 0 1.5rem; }
.coupon-active { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.coupon-remove { border: 0; background: transparent; color: #b42318; cursor: pointer; font: inherit; }
.coupon-remove:hover { text-decoration: underline; }

/* Recommendation shelf styles live in kovia-reco.css */

@media (max-width: 767px) {
    .coupon-active { align-items: flex-start; flex-direction: column; }
}

/* Summary */

.summary-card {
    position: static;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}

.summary-card h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 800;
    color: var(--coffee-dark);
    display: flex;
    align-items: center;
    gap: 7px;
}

.summary-card h3 i {
    color: var(--coffee);
    font-size: 13px;
}

.sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    padding: 7px 0;
}

.sum-row strong {
    color: var(--ink);
    font-weight: 700;
    font-feature-settings: "tnum";
    font-size: 12.5px;
}

.sum-discount strong {
    color: var(--success);
}

#shipping-cost.is-free {
    color: var(--success);
}

.sum-divider {
    height: 1px;
    background: var(--line);
    margin: 10px 0;
}

.sum-final {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0 12px;
}

.sum-final span {
    font-size: 13px;
    font-weight: 800;
    color: var(--coffee-dark);
}

.sum-final b {
    font-size: 18px;
    font-weight: 900;
    color: var(--coffee-dark);
    font-feature-settings: "tnum";
}

.sum-final small {
    font-size: 10px;
    color: var(--muted);
}

.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(111, 78, 55, 0.28);
    transition: all 0.2s ease;
}

.checkout-btn i {
    font-size: 12px;
}

.checkout-btn:hover {
    filter: brightness(1.06);
}

.checkout-btn:active {
    transform: scale(0.98);
}

.trust-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.trust-row div {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.trust-row i {
    font-size: 13px;
    color: var(--coffee);
}

/* Mobile bottom bar */

.cart-mobile-bar {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1030;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(75, 52, 35, 0.1);
}

.cmb-price {
    display: flex;
    flex-direction: column;
    line-height: 1.45;
    min-width: 0;
}

.cmb-price span {
    font-size: 10px;
    color: var(--muted);
}

.cmb-price b {
    font-size: 16px;
    font-weight: 900;
    color: var(--coffee-dark);
    font-feature-settings: "tnum";
}

.cmb-price strong {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.cmb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 132px;
    height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(111, 78, 55, 0.28);
    transition: transform 0.15s ease;
    white-space: nowrap;
}

.cmb-btn i {
    font-size: 11px;
}

.cmb-btn:active {
    transform: scale(0.97);
}

/* Empty cart */

.empty-cart {
    text-align: center;
    padding: 46px 18px;
}

.empty-icon {
    width: 82px;
    height: 82px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--cream);
    color: var(--coffee-light);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-cart h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--coffee-dark);
    margin-bottom: 8px;
}

.empty-cart p {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 20px;
    line-height: 1.8;
}

.empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(111, 78, 55, 0.28);
    transition: all 0.2s ease;
}

.empty-btn i {
    font-size: 11px;
}

/* ============================================================
   CHECKOUT PAGE
   ============================================================ */

.checkout-page {
    min-height: 100vh;
    background: var(--surface);
    color: var(--ink);
    padding: 18px 0 90px;
}

.checkout-header {
    margin-bottom: 18px;
}

.checkout-header h1 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--ink);
}

.checkout-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.8;
}

.checkout-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
    animation: fade-up 0.45s ease both;
}

.checkout-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.checkout-card-header h3 {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--coffee-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.checkout-card-header h3 i {
    color: var(--coffee);
    font-size: 13px;
}

.checkout-card-header p {
    font-size: 11.5px;
    color: var(--muted);
    margin: 4px 0 0;
    line-height: 1.7;
}

.checkout-add-address {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--coffee);
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.checkout-add-address i {
    font-size: 12px;
}

.checkout-add-address:hover {
    background: var(--coffee-dark);
}

/* Selected address */

.selected-address {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: #fff;
    animation: fade-up 0.45s ease both;
}

.selected-address-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.selected-address-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
}

.selected-address-title i {
    color: var(--coffee);
    font-size: 12px;
}

.default-address-badge {
    background: var(--coffee);
    color: #fff;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.address-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.address-row div {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.7;
}

.address-row i {
    color: var(--coffee-light);
    font-size: 11px;
}

.full-address {
    margin-top: 12px;
    line-height: 2;
    font-size: 12px;
    color: var(--ink);
}

.checkout-empty-address {
    border: 1.5px dashed var(--coffee-light);
    border-radius: var(--radius);
    padding: 30px 16px;
    text-align: center;
    background: #fefdfb;
}

.checkout-empty-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--cream);
    color: var(--coffee-light);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.checkout-empty-address h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--coffee-dark);
    margin-bottom: 8px;
}

.checkout-empty-address p {
    color: var(--muted);
    margin-bottom: 18px;
    font-size: 12px;
    line-height: 1.8;
}

.checkout-main-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    background: var(--coffee);
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.2s ease;
}

.checkout-main-btn:hover {
    background: var(--coffee-dark);
}

/* ============================================================
   Gateway / Shipping Cards
   IMPORTANT: compatible with current HTML structure:
   <label class="gateway-card">
       <input ...>
       <div class="gateway-card-body">...</div>
   </label>
   ============================================================ */

.gateway-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.gateway-card {
    display: block;
    position: relative;
    cursor: pointer;
    margin: 0;
}

.gateway-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gateway-card-body {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 10px;
    transition: all 0.2s ease;
    min-height: 150px;
}

.shipping-list .gateway-card-body {
    min-height: 164px;
}

.gateway-card:hover .gateway-card-body {
    border-color: var(--coffee-light);
    box-shadow: 0 4px 16px rgba(111, 78, 55, 0.08);
    transform: translateY(-1px);
}

.gateway-card input:checked + .gateway-card-body {
    border-color: var(--coffee);
    background: #faf7f2;
    box-shadow: 0 0 0 4px rgba(111, 78, 55, 0.08);
}

.gateway-image {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.gateway-image i {
    font-size: 18px;
    color: var(--coffee);
}

.gateway-image img {
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.gateway-info {
    flex: 1;
    width: 100%;
}

.gateway-info h5 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.7;
}

.gateway-info span {
    display: block;
    margin-top: 5px;
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.7;
}

.gateway-info small {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: var(--coffee-light);
    line-height: 1.7;
    font-weight: 700;
}

.gateway-check {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--muted);
}

.gateway-check strong {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--coffee-dark);
    line-height: 1.6;
}

.gateway-check i {
    font-size: 15px;
    color: #d8ccc0;
    transition: color 0.2s ease;
}

.gateway-card input:checked + .gateway-card-body .gateway-check i {
    color: var(--coffee);
}

/* Note */

.checkout-payment-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--cream);
    color: var(--coffee-dark);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.9;
}

.checkout-payment-note i {
    font-size: 14px;
    color: var(--coffee);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Sidebar */

.checkout-sidebar {
    position: static;
}

.checkout-page .summary-card {
    padding: 16px;
    margin-bottom: 0;
    animation: fade-up 0.45s ease both;
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: var(--coffee-dark);
    margin-bottom: 16px;
}

.summary-title i {
    font-size: 13px;
    color: var(--coffee);
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.8;
}

.summary-row strong {
    color: var(--ink);
    font-weight: 800;
    font-feature-settings: "tnum";
    text-align: left;
}

.summary-row.total {
    font-size: 13px;
    font-weight: 800;
}

.summary-row.total strong {
    color: var(--coffee-dark);
    font-size: 1.05rem;
}

.discount {
    color: var(--success);
}

.summary-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 0;
}

.checkout-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(111, 78, 55, 0.28);
    transition: all 0.2s ease;
    margin-top: 18px;
    cursor: pointer;
}

.checkout-pay-btn i {
    font-size: 12px;
}

.checkout-pay-btn:hover {
    filter: brightness(1.06);
}

.checkout-pay-btn:active {
    transform: scale(0.98);
}

.checkout-pay-btn.disabled,
.checkout-pay-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: none;
}

.payment-security {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.payment-security div {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.payment-security i {
    font-size: 13px;
    color: var(--coffee);
}

.checkout-help-card {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    animation: fade-up 0.45s ease both;
}

.help-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--cream);
    color: var(--coffee);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

.checkout-help-card h5 {
    font-size: 13px;
    font-weight: 800;
    color: var(--coffee-dark);
    margin: 0 0 6px;
}

.checkout-help-card p {
    margin: 0;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.9;
}

/* ============================================================
   Payment Result Pages
   ============================================================ */

.payment-error-card,
.payment-success-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 16px;
    margin-top: 24px;
    animation: fade-up 0.5s ease both;
}

.error-icon-box {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #fef0ef;
    color: var(--danger);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(217, 83, 79, 0.12);
}

.payment-error-card h1,
.payment-success-card h1 {
    font-size: 18px;
    font-weight: 900;
    color: var(--coffee-dark);
    margin-bottom: 12px;
    line-height: 1.6;
}

.error-reason {
    background: #fdf3f3;
    border: 1px solid #f3dedd;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.error-reason span {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.error-reason strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--danger);
    word-break: break-word;
    line-height: 1.8;
}

.error-notice,
.success-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.9;
    margin-bottom: 20px;
}

.error-actions,
.success-actions {
    display: flex;
    justify-content: center;
}

.retry-btn,
.success-actions .checkout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 180px;
    height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--coffee), var(--coffee-dark));
    color: #fff !important;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(111, 78, 55, 0.28);
    transition: all 0.2s ease;
}

.retry-btn i,
.success-actions .checkout-btn i {
    font-size: 11px;
}

.success-image {
    max-width: 170px;
    margin: 0 auto 20px;
}

.order-code {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cream);
    padding: 12px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.order-code span {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
}

.order-code strong {
    font-size: 15px;
    font-weight: 900;
    color: var(--coffee-dark);
    font-feature-settings: "tnum";
    letter-spacing: 0.03em;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 379.98px) {
    .checkout-steps {
        gap: 6px;
    }

    .step-line {
        flex-basis: 20px;
    }

    .coupon-form {
        flex-direction: column;
    }

    .coupon-form button {
        width: 100%;
        flex-basis: auto;
    }

    .gateway-list {
        grid-template-columns: 1fr;
    }

    .quantity {
        width: 108px;
    }

    .qty-btn {
        width: 34px;
    }

    .qty-input {
        font-size: 15px;
    }
}

@media (min-width: 576px) {
    .cart-page {
        padding-top: 22px;
    }

    .cart-header {
        padding: 16px 18px;
    }

    .cart-header h2 {
        font-size: 15px;
    }

    .cart-item {
        padding: 16px;
        gap: 14px;
    }

    .ci-media {
        flex-basis: 88px;
    }

    .ci-media img {
        width: 88px;
        height: 88px;
    }

    .ci-title h3 {
        font-size: 14px;
    }

    .coupon-box,
    .summary-card,
    .checkout-card,
    .checkout-page .summary-card {
        padding: 18px;
    }

    .gateway-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gateway-card-body {
        padding: 16px 12px;
    }

    .checkout-header h1 {
        font-size: 1.6rem;
    }
}

@media (min-width: 768px) {
    .step-dot {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }

    .step-label {
        font-size: 12px;
    }

    .step-line {
        flex-basis: 54px;
    }

    .cart-page {
        padding-bottom: 30px;
    }

    .cart-mobile-bar {
        display: none;
    }

    .summary-card .checkout-btn {
        display: flex;
    }

    .cart-header h2 {
        font-size: 16px;
    }

    .cart-count {
        font-size: 12px;
    }

    .ci-title h3 {
        font-size: 14.5px;
    }

    .ci-tags span {
        font-size: 11px;
    }

    .ci-unit-price {
        font-size: 12px;
    }

    .quantity {
        width: 132px;
        height: 44px;
    }

    .qty-btn {
        width: 40px;
    }

    .qty-btn i {
        font-size: 12px;
    }

    .qty-input {
        font-size: 17px;
    }

    .ci-total strong {
        font-size: 15px;
    }

    .gateway-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .gateway-image {
        width: 58px;
        height: 58px;
    }

    .gateway-image i {
        font-size: 20px;
    }

    .gateway-image img {
        max-width: 40px;
        max-height: 40px;
    }

    .gateway-info h5 {
        font-size: 13px;
    }

    .gateway-info span {
        font-size: 11px;
    }

    .gateway-check strong {
        font-size: 12px;
    }

    .payment-error-card,
    .payment-success-card {
        padding: 34px 24px;
    }
}

@media (min-width: 992px) {
    .cart-page {
        padding-bottom: 40px;
    }

    .checkout-page {
        padding-bottom: 60px;
    }

    .checkout-steps {
        margin-bottom: 28px;
    }

    .step-line {
        flex-basis: 70px;
    }

    .summary-card {
        position: sticky;
        top: 90px;
    }

    .checkout-sidebar {
        position: sticky;
        top: 100px;
    }

    .gateway-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .gateway-card-body {
        min-height: 164px;
        padding: 20px 14px;
    }

    .shipping-list .gateway-card-body {
        min-height: 178px;
    }

    .checkout-pay-btn {
        position: static;
    }

    .checkout-sidebar {
        margin-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    .checkout-add-address,
    .checkout-main-btn {
        width: 100%;
    }

    .checkout-pay-btn {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + var(--safe-bottom));
        z-index: 999;
        border-radius: 14px;
        height: 50px;
        box-shadow: 0 12px 30px rgba(111, 78, 55, 0.3);
    }

    .checkout-sidebar {
        margin-bottom: 78px;
    }

    .checkout-card-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
   Motion / Accessibility
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
/* Address Compact Box */
.address-compact-box {
    background: var(--surface-02, #FBF8F4);
    border: 1px solid var(--border-color, #ECE3D5);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.address-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.address-compact-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #3B2F2A);
    display: flex;
    align-items: center;
    gap: 6px;
}

.address-default-badge {
    font-size: 0.7rem;
    background: var(--accent, #5b3820);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.address-compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.81rem;
    color: var(--text-secondary, #6B5D54);
}

.address-compact-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.address-compact-full {
    font-size: 0.81rem;
    color: var(--text-muted, #9A8B80);
    margin: 0;
    line-height: 1.7;
    border-top: 1px solid var(--border-color, #ECE3D5);
    padding-top: 8px;
}

/* Change Address Button */
.btn-change-address {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    color: var(--accent, #5b3820);
    border: 1px solid var(--accent, #5b3820);
    border-radius: 10px;
    padding: 6px 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.btn-change-address:hover {
    background: var(--accent, #5b3820);
    color: #fff;
}

.success-icon-box {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #e9f8f0;
    color: var(--success);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(30, 158, 90, 0.14);
}

.order-code{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin:25px 0;
}

.order-code-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px 18px;
    border:1px solid #e8e8e8;
    border-radius:12px;
    background:#fafafa;
}

.order-code-item span{
    color:#777;
    font-size:14px;
}

.order-code-item strong{
    color:#2f2f2f;
    font-size:17px;
    font-weight:700;
    direction:ltr;
    letter-spacing:.5px;
}

/* SnappPay text size */
.snapppay-gateway .snapppay-title {
    font-size: 10px;
    line-height: 1.5;
}

.snapppay-gateway .snapppay-description {
    font-size: 9.5px;
    line-height: 1.5;
    margin-top: 3px;
}