/* WC Bricks Checkout Steps — Progressive bar */
.checkout-steps {
    counter-reset: step;
    position: relative;
    margin-top: var(--space-m);
}

/* Background track and progressive fill */
.checkout-steps::before,
.checkout-steps::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    top: 50%; /* aligned roughly with step centers */
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0; /* behind the items */
}
.checkout-steps::before {
    background: var(--shade-light); /* track */
    opacity: 0.6;
}
.checkout-steps::after {
    background: var(--primary); /* fill */
    width: var(--progress, 0%);
    right: auto; /* so width takes effect from left */
}

/* List & spacing */
.checkout-steps__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    --step-gap: var(--space-s); /* ACSS var for spacing */
    gap: var(--step-gap);
    position: relative;
    z-index: 1; /* above the progress bar */
}

.checkout-steps__item {
    position: relative;
    background: var(--white);
}

.checkout-steps__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs); /* ACSS var */
    padding: calc(var(--space-xs) * 0.7) var(--space-xs); /* ACSS var */
    color: var(--text-700);
    background: var(--surface-100);
    border: 1px solid var(--shade-light);
    border-radius: var(--radius-m);
    text-decoration: none;
    line-height: 1.2;
    position: relative;
}

/* Ensure the progress bar doesn't overlap rounded corners */
.checkout-steps__item:first-child .checkout-steps__link,
.checkout-steps__item:last-child .checkout-steps__link {
    position: relative;
}

.checkout-steps__link[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.65;
}

.checkout-steps__label {
    font-size: var(--text-s);
}

.checkout-steps__index {
    display: inline-grid;
    place-items: center;
    min-width: 1.75rem;
    min-height: 1.75rem;
    border-radius: var(--radius-50);
    background: var(--primary);
    color: var(--white);
    font-size: var(--text-s);
    font-weight: 700;
}

/* macht den Wrapper unabhängig von text-align des Parents */
.checkout-steps {
    display: block;
    width: 100%;
    text-align: start; /* neutralisiert vererbtes text-align:right */
}

/* Nav sicher als Block */
.checkout-steps__nav {
    display: block;
}

/* Liste als Block-Flex statt inline-flex -> richtet sich nicht mehr nach text-align */
.checkout-steps__list {
    display: flex; /* statt inline-flex */
    justify-content: flex-start;
}

/* Remove old mini connector (now the big progressive bar handles the connection) */
.checkout-steps__item + .checkout-steps__item::before {
    content: none;
}

/* States */
.checkout-steps__item--completed .checkout-steps__link {
    border-color: var(--primary);
}
.checkout-steps__item--completed .checkout-steps__index {
    background: var(--primary);
}

.checkout-steps__item--current .checkout-steps__link {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: var(--primary-light);
}

.checkout-steps__item--current .checkout-steps__index {
    color: black;
    background: var(--primary-ultra-light);
}

.checkout-steps__item--todo .checkout-steps__index {
    background: var(--shade-medium);
}

/* Focus */
.checkout-steps__link:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Small screens: hide background bar to avoid wrap artifacts */
@media (max-width: 600px) {
    .checkout-steps::before,
    .checkout-steps::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .checkout-steps__label {
        font-size: 0.85rem;
        white-space: nowrap;
    }
}
