:root {
    --spx-primary: #12A3A3;
    --spx-green: #07A843;
    --spx-orange: #F47B20;
    --spx-border: #E2E8EC;
    --spx-muted: #6A7282;
    --spx-dark: #0f172a;
    --spx-font: inherit;
}

.spx-cart-wrapper {
    background-color: #F5F7F8;
    direction: rtl;
    text-align: right;
    font-family: var(--spx-font);
    color: var(--spx-dark);
}

/* 1. Stepper / خطوات الطلب */
.spx-stepper-container {
    max-width: 650px;
    margin: 0 auto;
}

.spx-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.spx-stepper-track {
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: var(--spx-border);
    z-index: 1;
}

.spx-step {
    position: relative;
    z-index: 2;
    text-align: center;
}

.spx-step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #F8FAFC;
    border: 2px solid var(--spx-border);
    color: var(--spx-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 auto 6px auto;
}

.spx-step.active .spx-step-circle {
    background-color: var(--spx-primary);
    border-color: var(--spx-primary);
    color: #ffffff;
}

.spx-step-label {
    font-size: 0.8rem;
    color: var(--spx-muted);
    font-weight: 500;
}

.spx-step.active .spx-step-label {
    color: var(--spx-dark);
    font-weight: 700;
}

/* 2. Header */
.spx-back-link {
    color: var(--spx-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
}

.spx-back-link:hover {
    color: #0d8383;
}

.spx-page-title {
    font-weight: 800;
    font-size: 1.75rem;
    color: #0b1e28;
}

.spx-page-subtitle {
    color: var(--spx-muted);
    font-size: 0.88rem;
}

/* 3. كارد المنتج في السلة */
.spx-cart-card {
    background: #ffffff;
    border: 1px solid var(--spx-border);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    gap: 16px;
}

.spx-item-thumb img,
.spx-thumb-placeholder {
    width: 150px;
    height: 150px;
    object-fit: cover;
    background-color: #f8fafc;
}

.spx-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--spx-muted);
    font-size: 1.5rem;
}

.spx-item-details {
    flex: 1;
}

.spx-item-title {
    font-size: 1.4rem;
}

.spx-stock-status {
    color: var(--spx-green);
    font-size: 0.82rem;
    /* font-weight: 600; */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.spx-stock-indicator {
    width: 7px;
    height: 7px;
    background-color: var(--spx-green);
    border-radius: 50%;
}

/* أداة التحكم في الكمية (Pill Style) */
.spx-qty-pill {
    display: flex;
    align-items: center;
    background: #ffffff;
    width: fit-content;
    border: 1px solid var(--spx-border);
    border-radius: 1rem;
    padding: 3px 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.spx-qty-btn {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--spx-dark);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.spx-qty-btn:hover {
    background-color: #f1f5f9;
}

.spx-qty-val {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 10px;
    min-width: 28px;
    text-align: center;
}

/* السعر وزر الحذف */
.spx-item-price-col {
    font-weight: 800;
    font-size: 1.25rem;
    color: #0f172a;
    white-space: nowrap;
}

.spx-currency {
    font-size: 0.95rem;
    font-weight: 700;
}

.spx-delete-btn {
    border: none;
    background: none;
    color: var(--spx-border);
    align-self: end;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s ease, transform 0.15s ease;
}

.spx-delete-btn:hover {
    color: #ef4444;
    /* يتحول للأحمر عند الوقوف عليه */
    transform: scale(1.1);
}

/* 4. كارد ملخص الطلب والكوبون */
.spx-summary-card,
.spx-coupon-card {
    background: #ffffff;
    border: 1px solid var(--spx-border);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.spx-badge-count {
    color: var(--spx-muted);
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 8px;
}

.spx-summary-title {
    font-weight: 800;
    font-size: 1.15rem;
}

.spx-summary-label {
    color: var(--spx-muted);
    font-size: 0.9rem;
}

.spx-summary-value {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
}

.spx-free-shipping {
    color: var(--spx-green);
    font-weight: 700;
    font-size: 0.95rem;
}

.spx-dashed-divider {
    border-top: 1.5px dashed var(--spx-border);
}

.spx-total-label {
    font-weight: 800;
    font-size: 1.25rem;
}

.spx-total-value {
    font-weight: 800;
    font-size: 1.35rem;
    color: #0f172a;
}

.spx-tax-note {
    font-size: 0.77rem;
    color: var(--spx-muted);
}

/* كوبون الخصم */
.spx-coupon-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.spx-coupon-input {
    border: 1.5px solid var(--spx-border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.spx-coupon-input:focus {
    border-color: var(--spx-primary) !important;
}

.spx-coupon-btn {
    background-color: #1e293b;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.spx-coupon-btn:hover {
    background-color: #0f172a;
}

/* 5. زر متابعة إتمام الطلب */
.spx-checkout-btn {
    background-color: var(--spx-orange);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(244, 123, 32, 0.28);
    transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.spx-checkout-btn:hover {
    background-color: #e06912;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(244, 123, 32, 0.35);
}

.spx-checkout-btn:active {
    transform: translateY(0);
}

.spx-secure-badge {
    color: var(--spx-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ضبط الكارد في الشاشات الصغيرة لنزول السعر تحت الكمية في أقصى اليسار */
@media (max-width: 576px) {
    .spx-cart-card {
        position: relative;
        flex-wrap: wrap;
    }

    /* 1. تثبيت سلة الحذف في أقصى اليسار بالأعلى */
    .spx-cart-card .spx-delete-btn {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 2;
    }

    /* 2. إعطاء كتلة المنتج (الصورة + الاسم + الكمية) العرض كاملاً مع مسافة أمان للحذف */
    .spx-cart-card>div:first-child {
        width: 100%;
        padding-left: 35px;
        /* يمنع تداخل الاسم مع سلة الحذف */
    }

    /* 3. نزول كتلة السعر في سطر مستقل تحت الكمية */
    .spx-cart-card>div:last-child {
        width: 100%;
        margin-top: 12px;
        align-items: flex-end !important;
        /* محاذاة السعر لأقصى الشمال في RTL */
    }

    /* 4. تثبيت السعر في أقصى اليسار دائماً */
    .spx-cart-card .spx-item-price-col {
        margin-right: auto;
        text-align: left;
    }
}
