/* Free shipping progress bar (inc/woocommerce/shipping-progress.php):
   one component for the Cart Drawer, the cart page, the checkout, the product page
   and the thank-you page. No box, just the message over a thin bar. The fill
   has its own state colors, not the brand: the rule's color (--sp-pending)
   until free shipping is reached, then green; moving stripes in both.
   Width and color changes animate in assets/js/modules/shipping-progress.js. */
.shipping-progress {
    --sp-pending: #e5484d;
    --sp-complete: #2e8b57;
    --sp-text: var(--opsim-text-primary);
    --sp-icon: var(--opsim-brand, #355872);
    --sp-track: #e9ecef;
}

.shipping-progress__msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 9px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--sp-text);
    overflow-wrap: anywhere;
}

.shipping-progress__icon {
    flex: none;
    display: inline-flex;
    height: 1.35em; /* one line: the icon centres on the first line of text */
    align-items: center;
    color: var(--sp-icon);
}

.shipping-progress__icon svg {
    width: 17px;
    height: 17px;
}

.shipping-progress__amount {
    font-weight: 700;
    color: var(--sp-text);
    white-space: nowrap;
}

.shipping-progress.is-complete .shipping-progress__text {
    font-weight: 600;
}

.shipping-progress__track {
    position: relative;
    height: 5px;
    border-radius: 999px;
    background: var(--sp-track);
    overflow: hidden;
}

.shipping-progress__fill {
    position: relative;
    display: block;
    max-width: 100%;
    height: 100%;
    border-radius: inherit;
    background-color: var(--sp-pending);
    overflow: hidden;
}

.shipping-progress.is-complete .shipping-progress__fill {
    background-color: var(--sp-complete);
}

.shipping-progress__fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.22) 0,
        rgba(255, 255, 255, 0.22) 6px,
        transparent 6px,
        transparent 12px
    );
    background-size: 16.97px 16.97px; /* 12px period across the diagonal: tiles seamlessly */
    animation: shipping-progress-stripes 1.2s linear infinite;
}

@keyframes shipping-progress-stripes {
    from { background-position: 0 0; }
    to { background-position: 16.97px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .shipping-progress__fill::after {
        animation: none; /* static stripes */
    }
}

/* ── Placement ─────────────────────────────────────────── */

/* Cart Drawer: between the header and the lines. */
.shipping-progress--drawer {
    --sp-text: var(--cd-text);
    --sp-icon: var(--cd-brand);
    flex: none;
    padding: 14px var(--cd-pad);
    border-bottom: 1px solid var(--cd-border);
}

/* Checkout (under the Livraison choice) and the cart summary, with the checkout's own tokens (dark mode included). */
.shipping-progress--checkout,
.shipping-progress--cart {
    --sp-text: var(--co-text);
    --sp-icon: var(--co-primary);
    --sp-track: var(--co-border);
    margin: 16px 0 0;
}

.shipping-progress--cart {
    margin: 0 0 16px;
}

/* Product page: above the add-to-cart form, updated in place while the product is configured. */
.shipping-progress--product {
    margin: 0 0 16px;
}

.shipping-progress--product .shipping-progress__fill {
    transition: width 0.3s ease, background-color 0.25s ease;
}

/* Thank-you page. */
.shipping-progress--order {
    margin: 0 0 24px;
}
