/* Checkout UX — progress bar, alerts, shipping status */

.checkout-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin: 0 0 20px;
    padding: 18px 16px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

body.checkout-page .cart-level {
    display: none !important;
}

.comment-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-attachment-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

.checkout-progress__item {
    display: flex;
    align-items: center;
}

.checkout-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    min-width: 88px;
}

.checkout-progress__step.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.checkout-progress__circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.25s ease;
}

.checkout-progress__label {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.checkout-progress__line {
    width: 56px;
    height: 2px;
    margin: 0 6px 20px;
    border-radius: 2px;
}

.checkout-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.checkout-alert.d-none { display: none !important; }

.checkout-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.checkout-alert--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

.checkout-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.checkout-inline-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-primary, #310ffb);
    margin-bottom: 12px;
}

.checkout-inline-status.d-none { display: none !important; }

.checkout-inline-status::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: checkout-spin 0.8s linear infinite;
}

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

#shipping-cost.is-calculating {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .checkout-progress__line { width: 28px; }
    .checkout-progress__step { min-width: 72px; }
    .checkout-progress__label { font-size: 11px; }
}

/* ========== Discount code (payment step) — جدا از main.css ========== */
body.checkout-page .checkout-discount {
    margin-top: 16px;
    max-width: 100%;
}

body.checkout-page .checkout-discount__row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    direction: rtl;
}

body.checkout-page .checkout-discount__input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid var(--c-border, #ede9fe);
    border-radius: 12px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.checkout-page .checkout-discount__input:hover,
body.checkout-page .checkout-discount__input:focus {
    border-color: rgba(var(--c-primary-rgb, 109, 40, 217), 0.45);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb, 109, 40, 217), 0.1);
    outline: none;
}

body.checkout-page .checkout-discount__input:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

body.checkout-page .checkout-discount__btn {
    flex: 0 0 auto;
    position: static !important;
    left: auto !important;
    top: auto !important;
    height: 46px;
    min-width: 104px;
    margin: 0;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    background: var(--c-primary, #6d28d9) !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

body.checkout-page .checkout-discount__btn:hover,
body.checkout-page .checkout-discount__btn:focus {
    background: var(--c-primary-dark, #4c1d95) !important;
    color: #fff !important;
}

body.checkout-page .checkout-discount__btn.is-remove {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

body.checkout-page .checkout-discount__btn.is-remove:hover,
body.checkout-page .checkout-discount__btn.is-remove:focus {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
}

body.checkout-page .checkout-discount__btn.loading,
body.checkout-page .checkout-discount__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

body.checkout-page .checkout-discount__msg {
    margin: 10px 0 0;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
}

body.checkout-page .checkout-discount__msg.success { color: #15803d; }
body.checkout-page .checkout-discount__msg.error { color: #b91c1c; }

@media (max-width: 576px) {
    body.checkout-page .checkout-discount__row {
        flex-direction: column;
    }

    body.checkout-page .checkout-discount__btn {
        width: 100%;
    }
}
