.saniyar-checkout-timeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.saniyar-checkout-timeline-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    text-align: center;
}

.saniyar-checkout-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: calc(50% + 1rem);
    width: calc(100% - 2rem);
    border-top: 2px solid var(--bs-border-color);
    z-index: 0;
}

.saniyar-checkout-timeline-marker {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 50%;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-weight: 700;
}

.saniyar-checkout-timeline-label {
    color: var(--bs-secondary-color);
    font-size: .78rem;
    line-height: 1.4;
}

.saniyar-checkout-timeline-step[data-checkout-step-state='current']
.saniyar-checkout-timeline-marker,
.saniyar-checkout-timeline-step[data-checkout-step-state='completed']
.saniyar-checkout-timeline-marker {
    border-color: var(--main-color-one);
    background: var(--main-color-one);
    color: #fff;
}

.saniyar-checkout-timeline-step[data-checkout-step-state='current']
.saniyar-checkout-timeline-label,
.saniyar-checkout-timeline-step[data-checkout-step-state='completed']
.saniyar-checkout-timeline-label {
    color: var(--bs-body-color);
    font-weight: 700;
}

.saniyar-checkout-timeline-step[data-checkout-step-state='completed']:not(:last-child)::after {
    border-top-color: var(--main-color-one);
}

.saniyar-checkout-completed-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-tertiary-bg);
    padding: 1rem;
}

@media (max-width: 575.98px) {
    .saniyar-checkout-timeline {
        overflow-x: auto;
        grid-template-columns: repeat(5, minmax(5.25rem, 1fr));
        padding-bottom: .5rem;
    }

    .saniyar-checkout-timeline-label {
        font-size: .72rem;
    }
}

/*
 * CHECKOUT-1A V1.1 — Fast-auth modal containment.
 *
 * Some shared authentication steps use page-oriented Bootstrap grid widths.
 * When such a step is rendered inside the Saniyar fast-auth modal, viewport
 * breakpoints can shrink the nested column relative to the modal itself.
 * Keep that shared content full-width only inside this modal.
 */
#saniyarFastAuthModal #verify-mobile-otp.container {
    width: 100%;
    max-width: none;
    padding-inline: 0;
}

#saniyarFastAuthModal #verify-mobile-otp > .row {
    margin-inline: 0;
}

#saniyarFastAuthModal #verify-mobile-otp > .row > [class*='col-'] {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
}

#saniyarFastAuthModal [data-saniyar-fast-auth-mobile],
#saniyarFastAuthModal [data-saniyar-fast-auth-otp] {
    width: 100%;
    min-width: 0;
}

/* NAFISPOD_CHECKOUT_1A_V11 */

/* CHECKOUT-1B-B — address selection and Neshan capture. */
.saniyar-checkout-address-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-body-bg);
    padding: .875rem 1rem;
    cursor: pointer;
}

.saniyar-checkout-address-card:has(.form-check-input:checked) {
    border-color: var(--main-color-one);
    box-shadow: 0 0 0 .12rem color-mix(in srgb, var(--main-color-one) 18%, transparent);
}

.saniyar-checkout-address-map {
    position: relative;
    width: 100%;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-tertiary-bg);
}

.saniyar-checkout-address-map .maplibregl-canvas {
    outline: none;
}

@media (max-width: 575.98px) {
    .saniyar-checkout-address-map {
        min-height: 260px;
    }
}

/* CHECKOUT-1B-B v1.0.3 — keep the secondary address modal viewport-bounded. */
#saniyarCheckoutAddressModal .modal-content {
    max-height: calc(100vh - 1rem);
}

#saniyarCheckoutAddressModal .saniyar-checkout-address-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#saniyarCheckoutAddressModal .saniyar-checkout-address-form > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#saniyarCheckoutAddressModal .saniyar-checkout-address-form > .modal-footer {
    flex: 0 0 auto;
}

@supports (height: 100dvh) {
    #saniyarCheckoutAddressModal .modal-content {
        max-height: calc(100dvh - 1rem);
    }
}

/* CHECKOUT-2A — branch-owned shipping/payment option selection. */
.saniyar-checkout-sales-option-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-body-bg);
    padding: .875rem 1rem;
    cursor: pointer;
}

.saniyar-checkout-sales-option-card:has(.form-check-input:checked) {
    border-color: var(--main-color-one);
    box-shadow: 0 0 0 .12rem color-mix(in srgb, var(--main-color-one) 18%, transparent);
}

.saniyar-checkout-sales-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    background: var(--bs-tertiary-bg);
    font-size: 1.1rem;
}

/* CHECKOUT-2B — server-owned commercial review. */
.saniyar-checkout-review-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: var(--bs-body-bg);
    padding: 1rem;
}

.saniyar-checkout-review-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.saniyar-checkout-review-line:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.saniyar-checkout-review-grand-total {
    border-top: 1px solid var(--bs-border-color);
}

.saniyar-checkout-order-ready-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
    font-size: 2rem;
}
