﻿/* ============================================
   Checkout page — theme-matched
   Theme palette:
     primary: #D10024  (sale / danger / primary CTA)
     dark:    #15161D  (text, dark surfaces)
     body:    #2B2D42  (body text)
     grey:    #8D99AE  (secondary text)
     border:  #E4E7ED  (dividers)
     surface: #FBFBFC  (light bg)
   ============================================ */
:root {
    --ck-primary: #D10024;
    --ck-primary-dark: #b00020;
    --ck-dark: #15161D;
    --ck-ink: #1E1F29;
    --ck-body: #2B2D42;
    --ck-grey: #8D99AE;
    --ck-border: #E4E7ED;
    --ck-surface: #FBFBFC;
}

/* Steps */
.checkout-steps {
    background: #ffffff;
    border-bottom: 1px solid var(--ck-border);
    padding: 18px 0;
}

.ck-steps {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.ck-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ck-grey);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ck-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ck-surface);
    color: var(--ck-grey);
    font-size: 12px;
    border: 1px solid var(--ck-border);
}

.ck-step-divider {
    flex: 0 1 60px;
    height: 1px;
    background: var(--ck-border);
    margin: 0 14px;
}

.ck-step-active { color: var(--ck-dark); }
.ck-step-active .ck-step-num {
    background: var(--ck-primary);
    color: #ffffff;
    border-color: var(--ck-primary);
    box-shadow: 0 0 0 4px rgba(209, 0, 36, 0.12);
}

.ck-step-done { color: #0d9e71; }
.ck-step-done .ck-step-num {
    background: #0d9e71;
    color: #ffffff;
    border-color: #0d9e71;
}

/* Layout */
.ck-section { padding-top: 30px; padding-bottom: 60px; }

.ck-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: flex-start;
}

@media (max-width: 991px) {
    .ck-layout { grid-template-columns: 1fr; }
    .ck-summary { order: -1; }
}

/* Cards */
.ck-card {
    background: #ffffff;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ck-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--ck-border);
    background: var(--ck-surface);
}

.ck-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ck-dark);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ck-card-title i { color: var(--ck-primary); }

.ck-card-body { padding: 24px; }

.ck-step-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ck-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

/* Alerts */
.ck-alert {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid;
    background: #ffffff;
}

.ck-alert i { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.ck-alert strong { display: block; font-size: 14px; }
.ck-alert p { margin: 4px 0 0; font-size: 13px; color: var(--ck-grey); }
.ck-alert ul { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--ck-grey); }

.ck-alert-error   { background: rgba(209, 0, 36, 0.05); border-color: rgba(209, 0, 36, 0.25); }
.ck-alert-error i,
.ck-alert-error strong { color: var(--ck-primary); }
.ck-alert-warning { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.25); }
.ck-alert-warning i,
.ck-alert-warning strong { color: #b45309; }
.ck-alert-info    { background: rgba(13, 158, 113, 0.05); border-color: rgba(13, 158, 113, 0.25); }
.ck-alert-info i,
.ck-alert-info strong { color: #0d9e71; }

.ck-inline-warning,
.ck-inline-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 18px;
    border: 1px solid;
}

.ck-inline-warning { background: rgba(245, 158, 11, 0.06); border-color: rgba(245, 158, 11, 0.25); color: #92400e; }
.ck-inline-info { background: rgba(13, 158, 113, 0.05); border-color: rgba(13, 158, 113, 0.25); color: #065f46; }

/* Mode toggle */
.ck-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ck-mode-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--ck-body);
    background: #ffffff;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ck-mode-btn i { font-size: 18px; color: var(--ck-grey); transition: color 0.15s ease; }
.ck-mode-btn:hover { border-color: var(--ck-primary); }

.ck-mode-btn.is-active {
    border-color: var(--ck-primary);
    background: rgba(209, 0, 36, 0.04);
}

.ck-mode-btn.is-active i { color: var(--ck-primary); }

.ck-mode-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ck-mode-name {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ck-mode-sub {
    font-size: 12px;
    color: var(--ck-grey);
}

.ck-account-prompt {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    background: var(--ck-surface);
}

.ck-account-prompt p { margin: 0 0 12px; font-size: 13px; color: var(--ck-body); }

.ck-account-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ck-signed-in {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(13, 158, 113, 0.08);
    border: 1px solid rgba(13, 158, 113, 0.25);
    border-radius: 4px;
    color: #065f46;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ck-signed-in i { color: #0d9e71; }

/* Fields */
.ck-subheading {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ck-body);
    margin: 8px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ck-subheading i { color: var(--ck-primary); }
.ck-optional { color: var(--ck-grey); font-weight: 500; margin-left: 4px; font-size: 12px; }

.ck-field { margin-bottom: 16px; }
.ck-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ck-field-row-3 { grid-template-columns: 2fr 1fr 1fr; }
.ck-field-span-3 { grid-column: 1 / -1; }

@media (max-width: 560px) {
    .ck-field-row,
    .ck-field-row-3 { grid-template-columns: 1fr; }
}

.ck-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--ck-body);
    margin-bottom: 6px;
}

.ck-required { color: var(--ck-primary); margin-left: 2px; }

.ck-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    background: #ffffff;
    color: var(--ck-dark);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.ck-input {
    height: auto;
    padding: 10px 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
}

.ck-input::placeholder { color: var(--ck-grey); }
.ck-input:focus {
    outline: none;
    border-color: var(--ck-primary);
    box-shadow: 0 0 0 3px rgba(209, 0, 36, 0.12);
}

.ck-input:disabled {
    background: var(--ck-surface);
    color: var(--ck-grey);
    cursor: not-allowed;
}

.ck-address-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--ck-border);
}

.ck-field-error {
    color: var(--ck-primary);
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
}

/* Inline field validation error (client-side JS marks .ck-field-has-error) */
.ck-field-has-error > .ck-input,
.ck-field-has-error > .ck-pay-option {
    border-color: var(--ck-primary);
    box-shadow: 0 0 0 3px rgba(209, 0, 36, 0.12);
}
.ck-inline-field-error {
    color: var(--ck-primary);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}
.ck-inline-field-error::before {
    content: "⚠ ";
    margin-right: 2px;
}

/* Payment options */
.ck-payment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ck-pay-option {
    display: grid;
    grid-template-columns: 24px 40px 1fr 24px;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    cursor: pointer;
    background: #ffffff;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.ck-pay-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.ck-pay-option:hover { border-color: var(--ck-grey); }

.ck-pay-option.is-active {
    border-color: var(--ck-primary);
    background: rgba(209, 0, 36, 0.04);
    box-shadow: 0 0 0 3px rgba(209, 0, 36, 0.08);
}

.ck-pay-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--ck-grey);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: border-color 0.15s ease;
}

.ck-pay-option.is-active .ck-pay-radio { border-color: var(--ck-primary); }

.ck-pay-option.is-active .ck-pay-radio::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--ck-primary);
    border-radius: 50%;
}

.ck-pay-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--ck-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ck-body);
    font-size: 18px;
    border: 1px solid var(--ck-border);
}

.ck-pay-option.is-active .ck-pay-icon {
    background: #ffffff;
    color: var(--ck-primary);
    border-color: var(--ck-primary);
}

.ck-pay-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ck-pay-name { font-size: 14px; font-weight: 700; color: var(--ck-dark); }
.ck-pay-sub { font-size: 12px; color: var(--ck-grey); }

.ck-pay-check {
    color: var(--ck-primary);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ck-pay-option.is-active .ck-pay-check { opacity: 1; }

/* Payment detail */
.ck-pay-detail {
    display: none;
    margin-top: 14px;
    padding: 18px 20px;
    background: var(--ck-surface);
    border: 1px solid var(--ck-border);
    border-radius: 4px;
}

.ck-pay-detail-title {
    margin: 0 0 14px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--ck-body);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ck-pay-detail-title i { color: var(--ck-primary); }

.ck-pay-detail-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--ck-grey);
}

.ck-stripe-mount {
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
}

.ck-bank-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 560px) {
    .ck-bank-list { grid-template-columns: 1fr; }
}

.ck-bank-card {
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid var(--ck-border);
    border-radius: 4px;
}

.ck-bank-name {
    font-weight: 700;
    color: var(--ck-dark);
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--ck-border);
}

.ck-bank-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    padding: 4px 0;
}

.ck-bank-row span { color: var(--ck-grey); }
.ck-bank-row strong { color: var(--ck-dark); font-family: monospace; }

/* Checkbox */
.ck-checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--ck-surface);
    border: 1px solid var(--ck-border);
    border-radius: 4px;
    cursor: pointer;
    margin-top: 16px;
}

.ck-checkbox input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

.ck-checkbox-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--ck-grey);
    border-radius: 3px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
    margin-top: 1px;
}

.ck-checkbox input:checked + .ck-checkbox-mark {
    background: var(--ck-primary);
    border-color: var(--ck-primary);
}

.ck-checkbox input:checked + .ck-checkbox-mark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ck-checkbox-label {
    font-size: 13px;
    color: var(--ck-body);
    line-height: 1.5;
}

.ck-checkbox-label a {
    color: var(--ck-primary);
    text-decoration: none;
    font-weight: 600;
}

.ck-checkbox-label a:hover { text-decoration: underline; }

/* Buttons */
.ck-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border-radius: 4px;
    border: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.ck-btn:active { transform: translateY(1px); }

.ck-btn-primary {
    background: var(--ck-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(209, 0, 36, 0.28);
}
.ck-btn-primary:hover { background: var(--ck-primary-dark); }
.ck-btn-primary:disabled,
.ck-btn-primary.is-loading {
    background: var(--ck-grey);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.85;
}

.ck-btn-ghost {
    background: transparent;
    color: var(--ck-body);
    border: 1px solid var(--ck-border);
}
.ck-btn-ghost:hover { border-color: var(--ck-primary); color: var(--ck-primary); }

.ck-btn-place-order {
    width: 100%;
    height: 54px;
    font-size: 14px;
    margin-top: 16px;
    gap: 12px;
}

.ck-btn-amount {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.16);
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0;
}

.ck-btn.is-loading i:first-child {
    animation: ck-spin 0.8s linear infinite;
}

@keyframes ck-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Order summary */
.ck-summary-card .ck-card-header {
    background: var(--ck-dark);
    color: #ffffff;
}

.ck-summary-card .ck-card-title {
    color: #ffffff;
}

.ck-summary-card .ck-card-title i { color: var(--ck-primary); }

.ck-item-count {
    font-size: 12px;
    color: var(--ck-grey);
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ck-line-items {
    margin: -8px -8px 16px;
    padding: 4px 0;
}

.ck-line {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--ck-border);
}

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

.ck-line-img {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--ck-surface);
    border: 1px solid var(--ck-border);
}

.ck-line-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ck-line-qty {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--ck-primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #ffffff;
}

.ck-line-body { min-width: 0; }
.ck-line-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ck-dark);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ck-line-brand { font-size: 11px; color: var(--ck-grey); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.ck-line-total { font-weight: 700; color: var(--ck-dark); font-size: 13px; white-space: nowrap; }

.ck-totals {
    border-top: 1px solid var(--ck-border);
    padding-top: 14px;
}

.ck-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ck-body);
}

.ck-total-row span:last-child { font-weight: 600; }

.ck-free { color: #0d9e71; font-weight: 700; }

.ck-total-discount { color: var(--ck-primary); }

.ck-total-grand {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--ck-border);
    font-size: 16px;
    color: var(--ck-dark);
}
.ck-total-grand span:last-child {
    color: var(--ck-primary);
    font-size: 20px;
    font-weight: 700;
}

.ck-currency-note {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--ck-surface);
    border-radius: 4px;
    font-size: 11px;
    color: var(--ck-grey);
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

/* Trust card */
.ck-trust-card {
    padding: 0;
}

.ck-trust-list {
    list-style: none;
    padding: 16px 24px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ck-trust-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 12px;
    color: var(--ck-grey);
}

.ck-trust-list li i {
    color: #0d9e71;
    font-size: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.ck-trust-list li strong {
    display: block;
    color: var(--ck-dark);
    font-size: 13px;
}

/* Locale RTL */
.locale-rtl .ck-step-divider { transform: scaleX(-1); }
.locale-rtl .ck-mode-toggle { direction: rtl; }
.locale-rtl .ck-pay-option { direction: rtl; }
.locale-rtl .ck-pay-text { text-align: right; }
.locale-rtl .ck-bank-row { flex-direction: row-reverse; }
.locale-rtl .ck-line-total { text-align: left; }
.locale-rtl .ck-total-row { direction: rtl; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ck-btn, .ck-input, .ck-pay-option, .ck-pay-check, .ck-pay-radio {
        transition: none !important;
    }
}