/* Custom SPCO progress bar (pmt_render_checkout_progress_bar).
   Override the colours by redefining these vars in the theme if needed. */
.pmt-spco-steps {
    --pmt-step-accent: #008080;
    --pmt-step-done: #008080;
    --pmt-step-idle: #c5cbd6;
    --pmt-step-track: #e2e6ee;
    --pmt-step-marker-size: 2.25rem;

    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    margin: 0 0 2rem;
    padding: 0;
    counter-reset: pmt-step;
}

.pmt-spco-step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0.25rem;
}

/* Connector track between markers (drawn on the left edge of each step,
   skipped on the first). */
.pmt-spco-step::before {
    content: "";
    position: absolute;
    top: calc(var(--pmt-step-marker-size) / 2);
    right: 50%;
    left: -50%;
    height: 2px;
    background: var(--pmt-step-track);
    z-index: 0;
}
.pmt-spco-step:first-child::before {
    display: none;
}
/* Completed/active steps fill the connector leading into them. */
.pmt-spco-step.is-complete::before,
.pmt-spco-step.is-active::before {
    background: var(--pmt-step-done);
}

.pmt-spco-step__marker {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--pmt-step-marker-size);
    height: var(--pmt-step-marker-size);
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pmt-step-idle);
    color: var(--pmt-step-idle);
    font-weight: 700;
    line-height: 1;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.pmt-spco-step__num {
    font-size: 0.95rem;
}

.pmt-spco-step__tick {
    fill: #fff;
    width: 1.5rem;
    height: 1.5rem;
}

.pmt-spco-step__label {
    margin-top: 0.5rem;
    font-family: "Circular", sans-serif;
    font-size: 20px;
    line-height: 25px;
    color: #5b6472;
    max-width: 12ch;
    overflow-wrap: break-word;
}

/* States */
.pmt-spco-step.is-active .pmt-spco-step__marker {
    background: var(--pmt-step-accent);
    border-color: var(--pmt-step-accent);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.18);
}
.pmt-spco-step.is-active .pmt-spco-step__label {
    color: #1f2733;
    font-weight: 600;
}

.pmt-spco-step.is-complete .pmt-spco-step__marker {
    background: var(--pmt-step-done);
    border-color: var(--pmt-step-done);
    color: #fff;
}
.pmt-spco-step.is-complete .pmt-spco-step__label {
    color: #2f3744;
}

/* Stack vertically on narrow screens for legibility. */
@media (max-width: 600px) {
    .pmt-spco-steps {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .pmt-spco-step {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        text-align: left;
        padding: 0.4rem 0;
    }
    .pmt-spco-step::before {
        top: calc(-0.4rem);
        bottom: auto;
        left: calc(var(--pmt-step-marker-size) / 2);
        right: auto;
        width: 2px;
        height: 0.8rem;
    }
    .pmt-spco-step__label {
        margin-top: 0;
        max-width: none;
    }
}
