/*
کامپوننت «نوار مراحل خرید» (سبد خرید و تسویه حساب)
[سبد خرید] ──── [اطلاعات ارسال] ──── [پرداخت]
فقط توکن‌های قالب فرزند؛ تنظیم ظاهر فقط در بخش توکن‌ها.
*/

.scc-steps {
    /* ---- توکن‌ها ---- */
    --scc-steps-line:    var(--surface-muted);   /* خط رابط و قاب آیکون مرحله‌های بعدی */
    --scc-steps-ink:     var(--ink-disabled);    /* مرحله‌های بعدی */
    --scc-steps-active:  var(--brand);           /* مرحلهٔ فعلی و گذشته */
    --scc-steps-on:      var(--on-brand);
    --scc-steps-icon:    2.25rem;
    --scc-steps-svg:     1.25rem;
    --scc-steps-fs:      .75rem;

    margin: 0 0 var(--space-s);
}

.scc-steps__list {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 30rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.scc-steps__item {
    position: relative;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xxs);
    margin: 0;
    padding: 0;
    color: var(--scc-steps-ink);
    text-align: center;
}

/* خط رابط بین مراحل (از وسط آیکون این مرحله تا وسط آیکون مرحلهٔ قبل) */
.scc-steps__item + .scc-steps__item::before {
    content: "";
    position: absolute;
    top: calc(var(--scc-steps-icon) / 2);
    inset-inline-end: calc(50% + var(--scc-steps-icon) / 2 + .375rem);
    width: calc(100% - var(--scc-steps-icon) - .75rem);
    height: 1px;
    background: var(--scc-steps-line);
}

/* مرحلهٔ گذشته با لینک (بازگشت به سبد) */
.scc-steps__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xxs);
    color: inherit;
    text-decoration: none;
}

.scc-steps__link:is(:hover, :focus-visible) {
    color: var(--brand-h);
}

.scc-steps__link:is(:hover, :focus-visible) .scc-steps__label {
    text-decoration: underline;
    text-underline-offset: .25em;
}

.scc-steps__icon {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: var(--scc-steps-icon);
    height: var(--scc-steps-icon);
    border: 1px solid var(--scc-steps-line);
    border-radius: 50%;
    background: var(--surface-base);
}

.scc-steps__icon svg {
    width: var(--scc-steps-svg);
    height: var(--scc-steps-svg);
}

.scc-steps__label {
    font-size: var(--scc-steps-fs);
    line-height: 1.5;
}

.scc-steps__item:is(.is-current, .is-done) {
    color: var(--scc-steps-active);
}

.scc-steps__item.is-current .scc-steps__icon {
    border-color: var(--scc-steps-active);
    background: var(--scc-steps-active);
    color: var(--scc-steps-on);
}

.scc-steps__item.is-current .scc-steps__label {
    font-weight: 500;
}

.scc-steps__item.is-done .scc-steps__icon {
    border-color: var(--scc-steps-active);
}

/* خطی که به مرحلهٔ انجام‌شده/فعلی می‌رسد، رنگ برند */
.scc-steps__item:is(.is-current, .is-done) + .scc-steps__item:is(.is-current, .is-done)::before {
    background: var(--scc-steps-active);
    opacity: .35;
}

/* موبایل و تبلت: جمع‌وجورتر */
@media (max-width: 1023px) {
    .scc-steps {
        --scc-steps-icon: 2rem;
        --scc-steps-svg:  1.125rem;
        margin-block-end: var(--space-xs);
    }
}
