/* ═══════════════════════════════════════════════════════════
   Spare Parts Shop — Cart & Checkout Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Cart Icon / Mini Badge ───────────────────────────────── */
.sps-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background .2s;
}
.sps-cart-icon:hover { background: var(--sps-light-2, #edf0f5); }
.sps-cart-icon svg { width: 22px; height: 22px; }
.sps-cart-count {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--sps-accent, #e85d04);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.sps-cart-count[data-count="0"],
.sps-cart-count:empty { display: none; }

/* ── Toast Notification ───────────────────────────────────── */
.sps-cart-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--sps-dark, #1a1a1a);
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    transform: translateY(80px);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    max-width: 340px;
}
.sps-cart-notice--visible {
    transform: translateY(0);
    opacity: 1;
}
.sps-cart-notice--success { border-left: 4px solid var(--sps-success, #22c55e); }
.sps-cart-notice--error   { border-left: 4px solid var(--sps-danger, #ef4444); }

/* ── Cart Page Layout ─────────────────────────────────────── */
.sps-cart-page {
    padding: 60px 0 80px;
    min-height: 60vh;
}
.sps-cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 900px) {
    .sps-cart-layout { grid-template-columns: 1fr; }
}

/* ── Cart Table ───────────────────────────────────────────── */
.sps-cart-table-wrap {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    overflow: hidden;
}
.sps-cart-table {
    width: 100%;
    border-collapse: collapse;
}
.sps-cart-table thead {
    background: var(--sps-light, #f5f7fa);
}
.sps-cart-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--sps-gray, #6c757d);
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
}
.sps-cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
    vertical-align: middle;
    font-size: 14px;
}
.sps-cart-table tbody tr:last-child td { border-bottom: none; }
.sps-cart-table tbody tr:hover { background: var(--sps-light, #f5f7fa); }

/* Product cell */
.sps-cart-product {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sps-cart-product img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.sps-cart-product-name {
    font-weight: 600;
    color: var(--sps-dark, #1a1a1a);
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}
.sps-cart-product-name:hover { color: var(--sps-primary, #0d3b6e); }
.sps-cart-product-sku { font-size: 12px; color: var(--sps-gray, #6c757d); }

/* Qty input */
.sps-qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sps-qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--sps-border, #e0e6ef);
    background: var(--sps-light, #f5f7fa);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    color: var(--sps-dark, #1a1a1a);
    font-weight: 600;
    line-height: 1;
    padding: 0;
}
.sps-qty-btn:hover { background: var(--sps-primary, #0d3b6e); color: #fff; border-color: var(--sps-primary); }
.sps-cart-qty {
    width: 52px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--sps-border, #e0e6ef);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}
.sps-cart-qty::-webkit-outer-spin-button,
.sps-cart-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Remove button */
.sps-cart-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sps-gray, #6c757d);
    padding: 6px;
    border-radius: 6px;
    transition: color .2s, background .2s;
    display: flex;
}
.sps-cart-remove:hover { color: var(--sps-danger, #ef4444); background: #fef2f2; }
.sps-cart-remove svg { width: 18px; height: 18px; }

/* Subtotal */
.sps-cart-subtotal { font-weight: 700; color: var(--sps-primary, #0d3b6e); }

/* ── Empty Cart State ─────────────────────────────────────── */
.sps-cart-empty {
    text-align: center;
    padding: 80px 20px;
}
.sps-cart-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    opacity: .5;
}
.sps-cart-empty h2 { margin-bottom: 10px; font-size: 24px; }
.sps-cart-empty p  { color: var(--sps-gray); margin-bottom: 24px; }

/* ── Cart Actions ─────────────────────────────────────────── */
.sps-cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 0;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Order Summary Sidebar ────────────────────────────────── */
.sps-cart-summary {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 28px;
    position: sticky;
    top: 20px;
}
.sps-cart-summary h3 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
}
.sps-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--sps-gray);
}
.sps-summary-row strong { color: var(--sps-dark); }
.sps-summary-divider {
    border: none;
    border-top: 1px solid var(--sps-border, #e0e6ef);
    margin: 16px 0;
}
.sps-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════
   Checkout Page
   ═══════════════════════════════════════════════════════════ */
.sps-checkout-page {
    padding: 60px 0 80px;
    min-height: 70vh;
    overflow-x: hidden;
}
.sps-checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
@media (max-width: 960px) {
    .sps-checkout-layout { grid-template-columns: 1fr; }
}

/* ── Checkout Form ────────────────────────────────────────── */
#spsCheckoutForm {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.sps-checkout-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 32px;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
}

/* Stepped card variant — no global padding, sections control own padding */
.sps-checkout-card--step { 
    padding: 0; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Step header (badge + title + subtitle) */
.sps-step-hd {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
    flex-wrap: wrap;
    overflow: hidden;
}
.sps-step-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sps-accent, #e85d04);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sps-step-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--sps-dark, #1a1a1a);
    margin-bottom: 2px;
}
.sps-step-sub {
    font-size: 13px;
    color: var(--sps-gray, #6c757d);
    margin: 0;
}

/* Fields area inside stepped card */
.sps-checkout-fields { padding: 24px; }

/* Newsletter checkbox */
.sps-newsletter-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    margin-top: 4px;
    line-height: 1.5;
}
.sps-newsletter-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sps-accent, #e85d04);
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
}

.sps-checkout-card h3 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sps-gray);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sps-light, #f5f7fa);
}
.sps-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.sps-form-row--full { grid-template-columns: 1fr; }
@media (max-width: 600px) {
    .sps-form-row { grid-template-columns: 1fr; }
}
.sps-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sps-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.sps-form-group label .sps-required { color: #ef4444; margin-left: 1px; }
.sps-optional { font-weight: 400; color: var(--sps-gray, #6c757d); font-size: 12px; }
.sps-input, .sps-select, .sps-textarea {
    width: 100%;
    padding: 3px 13px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--sps-dark, #1a1a1a);
    background: #f5f6f8;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.sps-input::placeholder,
.sps-textarea::placeholder {
    color: #9ca3af;
    font-weight: 400;
}
.sps-input:focus, .sps-select:focus, .sps-textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--sps-accent, #e85d04);
    box-shadow: 0 0 0 3px rgba(232,93,4,.12);
}
.sps-textarea { resize: vertical; min-height: 80px; }

/* ── SSL badge in payment header ──────────────────────────── */
.sps-ssl-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 4px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Payment tab bar ──────────────────────────────────────── */
.sps-pay-tabs {
    display: flex;
    background: var(--sps-light, #f5f7fa);
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: var(--sps-accent, #e85d04) #f5f7fa;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    min-width: 0;
}
.sps-pay-tabs::-webkit-scrollbar {
    height: 7px;
    background: #f5f7fa;
}
.sps-pay-tabs::-webkit-scrollbar-thumb {
    background: var(--sps-accent, #e85d04);
    border-radius: 6px;
}


.sps-pay-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sps-gray, #6c757d);
    background: transparent;
    border: none;
    border-right: 1px solid var(--sps-border, #e0e6ef);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    min-width: 100px;
}
.sps-pay-tab:last-child { border-right: none; }
.sps-pay-tab:hover { background: #edf0f5; color: var(--sps-dark, #1a1a1a); }
.sps-pay-tab--active {
    background: #fff;
    color: var(--sps-dark, #1a1a1a);
    box-shadow: inset 0 -2px 0 var(--sps-primary, #0d3b6e);
}

.sps-pay-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.sps-pay-tab-icon img,
.sps-pay-tab-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* ── Payment panels ───────────────────────────────────────── */
.sps-pay-panels {
    padding: 20px 24px;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 100%;
}
.sps-pay-panel { display: none; }
.sps-pay-panel--active { display: block; }

/* Stripe card element */
#spsStripeCardElement {
    padding: 12px 14px;
    background: #fff;
    border: 1.5px solid var(--sps-border, #e0e6ef);
    border-radius: 8px;
    margin-top: 12px;
}
#spsStripeErrors {
    color: var(--sps-danger, #ef4444);
    font-size: 13px;
    margin-top: 8px;
}

/* ── Payment info panels ──────────────────────────────────── */
.sps-payment-info {
    margin-top: 14px;
    border-radius: 10px;
    border: 1px solid var(--sps-border, #e0e6ef);
    overflow: hidden;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 1px 4px rgba(13,59,110,.06);
}

/* Coloured header strip */
.sps-payment-info > strong {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--sps-primary, #0d3b6e);
    background: linear-gradient(135deg, #eef3fa 0%, #f5f8fd 100%);
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
}
.sps-payment-info > strong::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--sps-primary, #0d3b6e);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Fallback 'not configured' paragraph */
.sps-payment-info > p {
    margin: 0;
    padding: 14px 16px;
    color: var(--sps-gray, #6c757d);
    font-size: 13px;
}

/* ── Individual field rows ────────────────────────────────── */
.sps-payment-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
    min-height: 48px;
    background: #fff;
    transition: background .15s;
}
.sps-payment-row:last-of-type { border-bottom: none; }
.sps-payment-row:hover { background: #f9fbfd; }

.sps-payment-row-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sps-gray, #6b7280);
    min-width: 110px;
    flex-shrink: 0;
    padding: 12px 12px 12px 0;
}

.sps-payment-row-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--sps-dark, #1a2332);
    flex: 1;
    padding: 12px 8px 12px 0;
    word-break: break-all;
}

/* ── Instructions callout ────────────────────────────────── */
.sps-payment-instructions {
    display: flex;
    gap: 10px;
    margin: 0 !important;
    padding: 13px 16px !important;
    background: #f0f5fb !important;
    border-top: 1px solid #dce8f5;
    font-size: 13px !important;
    color: #344360 !important;
    line-height: 1.6 !important;
}
.sps-payment-instructions::before {
    content: 'ℹ';
    font-size: 15px;
    line-height: 1.4;
    color: var(--sps-primary, #0d3b6e);
    flex-shrink: 0;
    opacity: .75;
}

/* ── Crypto payment rows ──────────────────────────────────── */
.sps-crypto-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.sps-crypto-coin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.sps-crypto-coin--btc  { background: #F7931A; color: #fff; }
.sps-crypto-coin--eth  { background: #627EEA; color: #fff; }
.sps-crypto-coin--usdt { background: #26A17B; color: #fff; }
.sps-crypto-addr {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: var(--sps-light, #f5f7fa);
    border: 1px solid var(--sps-border, #e0e6ef);
    border-radius: 4px;
    padding: 4px 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sps-dark, #1a2332);
}
.sps-copy-btn {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 1.5px solid var(--sps-primary, #0d3b6e);
    border-radius: 20px;
    background: transparent;
    color: var(--sps-primary, #0d3b6e);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1.4;
}
.sps-copy-btn:hover  { background: var(--sps-primary, #0d3b6e); color: #fff; }
.sps-copy-btn.copied { background: #16a34a; border-color: #16a34a; color: #fff; }
.sps-crypto-network {
    font-size: 11px;
    color: var(--sps-gray, #64748b);
    flex-shrink: 0;
}

/* ── Error message ────────────────────────────────────────── */
#spsCheckoutError {
    display: none;
    background: #fef2f2;
    border: 1px solid var(--sps-danger, #ef4444);
    color: var(--sps-danger, #ef4444);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Checkout Summary ─────────────────────────────────────── */
.sps-checkout-summary {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 28px;
    position: sticky;
    top: 20px;
}
/* ── Order Summary toggle — desktop (card header) ────────── */
.sps-order-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 20px;
    cursor: default;
}
.sps-order-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--sps-dark, #1a1a1a);
}
/* Elements shown only on mobile — hidden on desktop */
.sps-order-toggle-cart-icon,
.sps-order-toggle-chevron,
.sps-order-toggle-price,
.sps-order-toggle-label-mobile { display: none; }

/* Desktop: always show body, show desktop label */
@media (min-width: 961px) {
    .sps-order-body { display: block !important; }
    .sps-order-toggle-label-desktop { display: inline; }
}

/* ── Order Summary toggle — mobile (dark banner) ─────────── */
@media (max-width: 960px) {
    /* Strip the card look off the wrapper */
    .sps-checkout-summary {
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        position: static;
        width: 100%;
        box-sizing: border-box;
    }
    .sps-checkout-layout > div:last-child { width: 100%; box-sizing: border-box; }

    /* Dark banner toggle */
    .sps-order-toggle {
        background: #1a2332;
        color: #fff;
        border-radius: 10px;
        padding: 16px 20px;
        cursor: pointer;
        user-select: none;
        margin: 0;
    }
    .sps-order-toggle-left { color: #fff; font-size: 15px; font-weight: 600; gap: 10px; }
    .sps-order-toggle-label-desktop { display: none; }
    .sps-order-toggle-label-mobile  { display: inline; }
    .sps-order-toggle-cart-icon     { display: block; color: var(--sps-accent, #e85d04); flex-shrink: 0; }
    .sps-order-toggle-chevron {
        display: inline;
        font-size: 11px;
        transition: transform .25s ease;
    }
    .sps-order-toggle--open .sps-order-toggle-chevron { transform: rotate(180deg); }
    .sps-order-toggle-price {
        display: block;
        color: var(--sps-accent, #e85d04);
        font-size: 18px;
        font-weight: 700;
        white-space: nowrap;
    }

    /* Collapsible body — white card below the banner */
    .sps-order-body {
        display: none;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0,0,0,.06);
        padding: 20px;
        margin-top: 8px;
    }
    .sps-order-body--open { display: block; }
}
.sps-checkout-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}
.sps-checkout-item img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.sps-checkout-item-info { flex: 1; min-width: 0; }
.sps-checkout-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sps-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sps-checkout-item-qty { font-size: 12px; color: var(--sps-gray); }
.sps-checkout-item-price { font-size: 14px; font-weight: 700; white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════
   Order Confirmed Page
   ═══════════════════════════════════════════════════════════ */
.sps-order-confirmed {
    max-width: 680px;
    margin: 60px auto 80px;
    padding: 0 20px;
}
.sps-confirmed-header {
    text-align: center;
    margin-bottom: 40px;
}
.sps-confirmed-icon {
    width: 80px;
    height: 80px;
    background: #f0fdf4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}
.sps-confirmed-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}
.sps-confirmed-header p { color: var(--sps-gray); font-size: 16px; }
.sps-confirmed-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 28px;
    margin-bottom: 20px;
}
.sps-confirmed-card h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sps-gray);
    margin: 0 0 16px;
}
.sps-confirmed-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--sps-border, #e0e6ef);
    font-size: 14px;
}
.sps-confirmed-row:last-child { border-bottom: none; }
.sps-confirmed-row strong { font-weight: 700; }
.sps-confirmed-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    padding-top: 16px;
    border-top: 2px solid var(--sps-border);
    margin-top: 4px;
}
.sps-confirmed-actions { text-align: center; margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════
   Responsive — Cart & Checkout
   ═══════════════════════════════════════════════════════════ */

/* ── Always: prevent horizontal overflow ──────────────────── */
.sps-cart-page,
.sps-checkout-page {
    overflow-x: hidden;
}

/* ── Always: mobile viewport considerations ───────────────── */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ── Always: fluid page heading (beats inline font-size) ─── */
.sps-cart-page h1,
.sps-checkout-page h1 {
    font-size: clamp(18px, 5vw, 32px) !important;
}

/* ── Always: Place Order button may wrap on small screens ─── */
#spsPlaceOrderBtn {
    white-space: normal;
    word-break: break-word;
    min-height: 44px;
}

/* ── Always: ensure inputs never overflow their container ─── */
.sps-input,
.sps-select,
.sps-textarea {
    max-width: 100%;
    box-sizing: border-box;
    /* Better mobile rendering */
    font-size: 16px;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

/* Fix select dropdown on iOS */
.sps-select {
    background-image: 
        linear-gradient(45deg, transparent 50%, #666 50%),
        linear-gradient(135deg, #666 50%, transparent 50%);
    background-position: 
        calc(100% - 16px) center,
        calc(100% - 11px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

/* ── Always: better spacing for touch-friendly checkout ──────*/
.sps-form-group {
    margin-bottom: 2px;
}

.sps-form-row .sps-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sps-form-group label {
    user-select: none;
    padding: 0;
    margin: 0;
}

/* ── Always: checkbox improvements ─────────────────────────── */
.sps-newsletter-label input[type="checkbox"],
input[type="checkbox"].sps-form-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

/* ── Always: payment tab scrolling (horizontal scroll helper) ───*/
.sps-pay-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* ── Always: error and success messages responsive ────────── */
#spsCheckoutError {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ── Laptop / small desktop (≤ 1280px) ───────────────────────
   Only applies ABOVE the 960px collapse point to avoid
   overriding the single-column rule below it.             ── */
@media (max-width: 1280px) and (min-width: 961px) {
    .sps-checkout-layout {
        grid-template-columns: 1fr 320px;
        gap: 24px;
    }
}

/* ── Tablet landscape (≤ 1024px, still 2 cols) ───────────── */
@media (max-width: 1024px) and (min-width: 961px) {
    .sps-cart-page,
    .sps-checkout-page { padding: 40px 0 60px; }
    .sps-checkout-card { padding: 24px 20px; }
    .sps-cart-summary,
    .sps-checkout-summary { padding: 22px 18px; }
}

/* ── Tablet portrait (≤ 960px) — layouts collapse to 1 col ─ */
@media (max-width: 960px) {
    .sps-cart-page,
    .sps-checkout-page { padding: 32px 0 52px; }

    /* Cart summary: un-sticky when stacked */
    .sps-cart-summary,
    .sps-checkout-summary {
        position: static;
        padding: 20px;
    }

    /* Checkout: show order summary ABOVE the form on mobile */
    .sps-checkout-layout {
        display: flex;
        flex-direction: column;
    }
    .sps-checkout-layout > div:last-child {
        order: -1;
    }

    /* Section header responsive */
    .sps-section-header { 
        margin-bottom: 24px;
        padding: 0 20px;
    }
    .sps-section-header h1 {
        font-size: clamp(22px, 6vw, 32px);
    }
}

/* ── Cart grid collapses at 900px (existing) ─────────────── */
@media (max-width: 900px) {
    .sps-cart-summary { position: static; }
}

/* ── Small tablet / large mobile (≤ 768px) ───────────────── */
@media (max-width: 768px) {
    .sps-cart-page,
    .sps-checkout-page { padding: 28px 0 48px; }

    /* Checkout cards */
    .sps-checkout-card { padding: 20px 16px; }
    .sps-checkout-card--step { padding: 0; }
    .sps-step-hd { 
        padding: 14px 16px; 
        flex-wrap: wrap;
        gap: 10px;
    }
    .sps-checkout-fields { padding: 16px; }
    .sps-cart-summary,
    .sps-checkout-summary { padding: 18px 16px; }

    /* Form improvements */
    .sps-form-row { gap: 12px; margin-bottom: 12px; }
    .sps-form-group label { font-size: 12px; }
    .sps-input, .sps-select, .sps-textarea { padding: 10px 11px; font-size: 13px; }

    /* Payment tabs responsive - improved for tablet */
    .sps-pay-tabs { 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--sps-accent, #e85d04) #f5f7fa;
    }
    .sps-pay-tabs::-webkit-scrollbar {
        height: 6px;
    }
    .sps-pay-tabs::-webkit-scrollbar-thumb {
        background: var(--sps-accent, #e85d04);
        border-radius: 3px;
    }
    .sps-pay-tab { 
        padding: 11px 12px; 
        font-size: 12px; 
        gap: 6px;
        min-width: 90px;
    }
    .sps-pay-tab-icon { width: 18px; height: 18px; }
    .sps-pay-tab-icon img,
    .sps-pay-tab-icon svg { width: 15px; height: 15px; }
    .sps-pay-panels { padding: 16px; }

    /* ── Cart table → stacked card layout ─────────────────── */
    .sps-cart-table thead { display: none; }
    .sps-cart-table,
    .sps-cart-table tbody,
    .sps-cart-table tr,
    .sps-cart-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .sps-cart-table tr {
        position: relative;
        padding: 14px 48px 14px 14px;
        border-bottom: 1px solid var(--sps-border, #e0e6ef);
        background: #fff;
    }
    .sps-cart-table tbody tr:last-child { border-bottom: none; }
    .sps-cart-table tbody tr:hover { background: #f9fbfd; }
    .sps-cart-table td {
        border-bottom: none;
        padding: 4px 0;
        display: flex;
        align-items: center;
    }

    /* Product cell layout */
    .sps-cart-product {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sps-cart-product img {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    /* CSS-generated column labels */
    .sps-cart-table td:nth-child(2)::before {
        content: "Price";
        display: inline-block; 
        font-size: 10px; 
        font-weight: 700;
        text-transform: uppercase; 
        letter-spacing: .5px;
        color: var(--sps-gray); 
        margin-right: 6px;
        width: 40px;
        flex-shrink: 0;
    }
    .sps-cart-table td:nth-child(3)::before {
        content: "Qty";
        display: inline-block; 
        font-size: 10px; 
        font-weight: 700;
        text-transform: uppercase; 
        letter-spacing: .5px;
        color: var(--sps-gray); 
        margin-right: 6px;
        width: 30px;
        flex-shrink: 0;
    }
    .sps-cart-table td:nth-child(4)::before {
        content: "Total";
        display: inline-block; 
        font-size: 10px; 
        font-weight: 700;
        text-transform: uppercase; 
        letter-spacing: .5px;
        color: var(--sps-gray); 
        margin-right: 6px;
        width: 40px;
        flex-shrink: 0;
    }

    /* Remove button anchored top-right of each row */
    .sps-cart-table td:last-child {
        position: absolute;
        top: 14px;
        right: 10px;
        width: auto;
        padding: 0;
    }

    /* Cart actions: stack vertically */
    .sps-cart-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .sps-cart-actions .sps-btn { 
        justify-content: center;
        width: 100%;
    }

    /* Confirmed page */
    .sps-order-confirmed { margin: 28px auto 44px; padding: 0 14px; }
    .sps-confirmed-header h1 { font-size: 20px !important; }
    .sps-confirmed-header p { font-size: 13px; }
    .sps-confirmed-card { padding: 16px 12px; }
    .sps-confirmed-row { font-size: 12px; }
    .sps-confirmed-actions { gap: 8px; }
}

/* ── Mobile (≤ 600px) — form rows already single-column ─── */
@media (max-width: 600px) {
    .sps-cart-page,
    .sps-checkout-page { padding: 16px 0 36px; }

    /* Checkout cards - more aggressive padding reduction */
    .sps-checkout-card { padding: 14px 12px; }
    .sps-checkout-card--step { padding: 0; }
    .sps-checkout-fields { padding: 12px; }
    .sps-step-hd { 
        padding: 12px 14px; 
        gap: 8px;
        flex-wrap: wrap;
    }
    .sps-step-badge { width: 32px; height: 32px; font-size: 14px; }
    .sps-step-title { font-size: 15px; }
    .sps-step-sub { font-size: 12px; }

    /* Cart and checkout summary */
    .sps-cart-summary,
    .sps-checkout-summary { padding: 14px 12px; }
    .sps-summary-row { font-size: 13px; }
    .sps-summary-total { font-size: 15px; }

    /* Form fields - better mobile experience */
    .sps-form-row { gap: 10px; margin-bottom: 10px; }
    .sps-form-group { gap: 4px; }
    .sps-form-group label { font-size: 11px; font-weight: 600; }
    .sps-input, 
    .sps-select, 
    .sps-textarea { 
        padding: 9px 10px; 
        font-size: 14px;
        line-height: 1.4;
    }

    /* Larger touch targets for qty controls */
    .sps-qty-btn { width: 36px; height: 36px; font-size: 16px; }
    .sps-cart-qty { width: 44px; height: 36px; font-size: 14px; }

    /* Empty cart */
    .sps-cart-empty { padding: 40px 12px; }
    .sps-cart-empty-icon { font-size: 44px; }
    .sps-cart-empty h2 { font-size: 19px; }

    /* Payment section improvements */
    .sps-payment-info { font-size: 12px; line-height: 1.5; }
    .sps-payment-row { min-height: 40px; padding: 0 12px; }
    .sps-payment-row-label { 
        min-width: 75px; 
        font-size: 9px; 
        max-width: 60px;
    }
    .sps-payment-row-value { 
        font-size: 12px; 
        overflow-wrap: break-word;
    }
    .sps-payment-instructions { 
        font-size: 11px !important; 
        padding: 10px 12px !important;
        gap: 6px;
    }
    .sps-copy-btn { 
        font-size: 10px; 
        padding: 3px 8px;
        min-width: auto;
    }

    /* Payment tabs responsive - better horizontal scrolling for mobile */
    .sps-pay-tabs { 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--sps-accent, #e85d04) #f5f7fa;
        padding-bottom: 4px;
    }
    .sps-pay-tabs::-webkit-scrollbar {
        height: 5px;
    }
    .sps-pay-tabs::-webkit-scrollbar-thumb {
        background: var(--sps-accent, #e85d04);
        border-radius: 2px;
    }
    .sps-pay-tab { 
        padding: 10px 11px; 
        font-size: 11px; 
        gap: 4px;
        min-width: 75px;
        flex: 0 0 auto;
        border-bottom: 2px solid transparent;
    }
    .sps-pay-tab:last-child { 
        border-right: none;
        border-bottom: 2px solid transparent;
    }
    .sps-pay-tab-icon { width: 16px; height: 16px; }
    .sps-pay-tab-icon img,
    .sps-pay-tab-icon svg { width: 13px; height: 13px; }
    .sps-pay-panels { padding: 12px; }
    
    /* SSL badge responsive */
    .sps-ssl-badge { 
        font-size: 10px; 
        padding: 3px 7px;
        order: 3;
        flex-basis: 100%;
    }

    /* Confirmed page */
    .sps-confirmed-header h1 { font-size: 20px !important; }
    .sps-confirmed-icon { width: 60px; height: 60px; font-size: 26px; }
    .sps-confirmed-card { padding: 16px 12px; }
    .sps-confirmed-row { font-size: 13px; padding: 6px 0; }
    .sps-confirmed-total { font-size: 16px; padding-top: 12px; }
    .sps-confirmed-actions { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 8px;
    }
    .sps-confirmed-actions .sps-btn { 
        justify-content: center;
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Back to cart link */
    .sps-section-header a { font-size: 12px; }
    .sps-section-header h1 { font-size: clamp(18px, 5vw, 28px) !important; }
}

/* ── Small mobile (≤ 400px) — ultra-compact design ────────── */
@media (max-width: 400px) {
    .sps-cart-page,
    .sps-checkout-page { padding: 12px 0 32px; }

    .sps-cart-table tr { padding-right: 44px; }
    .sps-checkout-card { padding: 12px 10px; }
    .sps-checkout-fields { padding: 10px; }
    .sps-step-hd { 
        padding: 10px 12px; 
        gap: 6px;
    }
    .sps-step-badge { 
        width: 28px; 
        height: 28px; 
        font-size: 12px;
        flex-shrink: 0;
    }
    .sps-step-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
    .sps-step-sub { font-size: 11px; line-height: 1.3; }

    .sps-cart-summary,
    .sps-checkout-summary { padding: 12px 10px; }

    /* Form - ultra compact */
    .sps-form-row { gap: 8px; margin-bottom: 8px; }
    .sps-form-group { gap: 3px; }
    .sps-form-group label { font-size: 10px; line-height: 1.3; }
    .sps-input, .sps-select, .sps-textarea { 
        padding: 8px 9px; 
        font-size: 13px;
        border-radius: 6px;
    }

    /* Touch targets adjusted */
    .sps-qty-btn { width: 32px; height: 32px; font-size: 14px; }
    .sps-cart-qty { width: 40px; height: 32px; font-size: 13px; }

    /* Buttons */
    .sps-btn { 
        padding: 9px 14px; 
        font-size: 12px;
        gap: 6px;
    }

    /* Payment tabs - extreme optimization */
    .sps-pay-tabs { 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--sps-accent, #e85d04) #f5f7fa;
        padding: 0 0 4px 0;
    }
    .sps-pay-tabs::-webkit-scrollbar {
        height: 4px;
    }
    .sps-pay-tabs::-webkit-scrollbar-thumb {
        background: var(--sps-accent, #e85d04);
        border-radius: 2px;
    }
    .sps-pay-tab { 
        padding: 8px 9px; 
        font-size: 10px; 
        gap: 3px;
        min-width: 60px;
        border-right: none;
        border-bottom: 2px solid transparent;
    }
    .sps-pay-tab:last-child { border-bottom: 2px solid transparent; }
    .sps-pay-tab-icon { width: 14px; height: 14px; }
    .sps-pay-tab-icon img,
    .sps-pay-tab-icon svg { width: 11px; height: 11px; }
    .sps-pay-panels { padding: 10px; }

    /* Payment info optimizations */
    .sps-payment-info { font-size: 11px; line-height: 1.4; }
    .sps-payment-row { 
        min-height: 36px; 
        padding: 0 10px;
        flex-wrap: wrap;
    }
    .sps-payment-row-label { 
        min-width: 60px;
        font-size: 8px;
        max-width: 55px;
        padding: 8px 8px 8px 0;
    }
    .sps-payment-row-value { 
        font-size: 11px;
        flex: 0 0 auto;
        padding: 8px 0;
    }
    .sps-copy-btn { 
        font-size: 9px; 
        padding: 2px 6px;
    }

    /* SSL badge on separate line */
    .sps-ssl-badge { 
        font-size: 9px; 
        padding: 2px 5px;
        white-space: normal;
        line-height: 1.3;
    }

    /* Confirmed page */
    .sps-confirmed-header h1 { font-size: 18px !important; }
    .sps-confirmed-header p { font-size: 12px; }
    .sps-confirmed-icon { 
        width: 52px; 
        height: 52px; 
        font-size: 22px; 
        margin: 0 auto 12px;
    }
    .sps-confirmed-card { 
        padding: 12px 10px; 
        margin-bottom: 12px;
    }
    .sps-confirmed-card h3 { 
        font-size: 11px; 
        margin: 0 0 10px;
    }
    .sps-confirmed-row { 
        font-size: 11px; 
        padding: 4px 0;
        flex-wrap: wrap;
        gap: 4px;
    }
    .sps-confirmed-total { 
        font-size: 13px; 
        padding-top: 8px;
        margin-top: 0;
    }

    /* Newsletter checkbox */
    .sps-newsletter-label { 
        font-size: 11px;
        gap: 8px;
    }
    .sps-newsletter-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-top: 0;
    }

    /* Error banner */
    #spsCheckoutError { 
        padding: 10px 12px; 
        font-size: 12px;
        border-radius: 6px;
    }
}
