/* ============================================
   Checkout Progress Stepper - Premium UI
   ============================================ */

.cps-wrapper {
    direction: rtl;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 28px 20px;
    font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', system-ui, -apple-system, sans-serif;
    position: relative;
    overflow: hidden;
}

/* پس‌زمینه گرادیان خیلی نرم و لوکس */
.cps-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(124, 58, 237, 0.12) 0%, 
        rgba(15, 15, 25, 0.95) 40%, 
        rgba(15, 15, 25, 0.95) 60%, 
        rgba(168, 85, 247, 0.12) 100%);
    border-radius: 24px;
    z-index: 0;
    border: 1px solid rgba(139, 92, 246, 0.15);
    box-shadow: 
        0 10px 40px -10px rgba(124, 58, 237, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cps-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
}

/* هر مرحله */
.cps-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* دایره */
.cps-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    position: relative;
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

/* حالت Upcoming */
.cps-upcoming .cps-circle {
    background: rgba(30, 30, 45, 0.9);
    border: 2px solid rgba(139, 92, 246, 0.25);
    color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* حالت Active */
.cps-active .cps-circle {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    border: 2px solid transparent;
    color: #ffffff;
    box-shadow: 
        0 0 0 6px rgba(139, 92, 246, 0.25),
        0 8px 25px -5px rgba(124, 58, 237, 0.6),
        0 0 40px rgba(139, 92, 246, 0.35);
    transform: scale(1.12);
}

.cps-active .cps-circle::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    animation: cps-pulse 2.2s ease-in-out infinite;
    z-index: -1;
}

@keyframes cps-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.3; }
}

/* حالت Completed */
.cps-completed .cps-circle {
    background: linear-gradient(145deg, #10b981, #059669);
    border: 2px solid transparent;
    color: #ffffff;
    box-shadow: 
        0 4px 15px -3px rgba(16, 185, 129, 0.5),
        0 0 20px rgba(16, 185, 129, 0.2);
}

.cps-check {
    width: 24px;
    height: 24px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* برچسب */
.cps-label {
    font-size: 14.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    white-space: nowrap;
    transition: all 0.35s ease;
    letter-spacing: -0.2px;
}

.cps-active .cps-label {
    color: #ffffff;
    font-weight: 700;
    font-size: 15.5px;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.cps-completed .cps-label {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
}

/* خط اتصال */
.cps-connector {
    flex: 1 1 auto;
    height: 3px;
    margin: 0 8px;
    position: relative;
    top: -18px; /* تنظیم با مرکز دایره */
    background: rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

.cps-connector-line {
    position: absolute;
    top: 0;
    right: 0; /* RTL */
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 10px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.cps-connector.cps-filled .cps-connector-line {
    width: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* انیمیشن ورود */
.cps-step {
    opacity: 0;
    transform: translateY(12px);
    animation: cps-fade-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cps-step-1 { animation-delay: 0.1s; }
.cps-step-2 { animation-delay: 0.25s; }
.cps-step-3 { animation-delay: 0.4s; }

@keyframes cps-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================
   Responsive - موبایل
   ===================== */
@media (max-width: 640px) {
    .cps-wrapper {
        padding: 22px 16px;
        margin-bottom: 28px;
    }

    .cps-container {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .cps-step {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 10px 0;
    }

    .cps-circle {
        width: 44px;
        height: 44px;
        font-size: 16px;
        flex-shrink: 0;
    }

    .cps-active .cps-circle {
        transform: scale(1.08);
    }

    .cps-label {
        font-size: 14px;
        white-space: normal;
        text-align: right;
    }

    .cps-active .cps-label {
        font-size: 15px;
    }

    /* خط عمودی در موبایل */
    .cps-connector {
        width: 3px;
        height: 28px;
        margin: 0 20px; /* وسط دایره */
        top: 0;
        align-self: flex-start;
        flex: none;
    }

    .cps-connector-line {
        width: 100%;
        height: 0%;
        right: 0;
        top: 0;
        background: linear-gradient(180deg, #8b5cf6, #a78bfa);
        transition: height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .cps-connector.cps-filled .cps-connector-line {
        height: 100%;
        background: linear-gradient(180deg, #10b981, #34d399);
    }
}

/* پشتیبانی از تم روشن (اگر لازم شد) */
@media (prefers-color-scheme: light) {
    /* فعلاً تم تاریک نگه داشته شده چون تصویر اصلی تاریک بود */
}
