/*
 * FreeShippingProgressBar (WI 26900) — BEM.
 *
 * Every cross-placement visual difference is a custom property so hosts can
 * retheme per placement (web cart = flat fill, web checkout = static two-tone
 * stripes, header = white-on-brand) without touching this file. Defaults:
 * Full mode = the approved mobile spec; Compact mode = the approved web header
 * spec (compact only exists on the brand-green header in the approved design).
 */

:root {
    /* Full mode */
    --free-shipping-progress-bar-bar-height: 14px;
    --free-shipping-progress-bar-track-color: var(--light-grey, #F2F2F2);
    --free-shipping-progress-bar-fill-color: #83C53F;
    --free-shipping-progress-bar-fill-color-reached: var(--brand-color, #67AD2B);
    --free-shipping-progress-bar-fill-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.30) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.30) 50%, rgba(255, 255, 255, 0.30) 75%, transparent 75%, transparent);
    --free-shipping-progress-bar-fill-size: 26px 26px;
    --free-shipping-progress-bar-fill-animation: free-shipping-progress-bar-stripes 0.7s linear infinite;
    --free-shipping-progress-bar-marker-size: 34px;
    --free-shipping-progress-bar-marker-border: none;
    --free-shipping-progress-bar-marker-icon-color: #8A94A0;
    --free-shipping-progress-bar-marker-animation: free-shipping-progress-bar-glow 1.6s ease-in-out infinite;
    --free-shipping-progress-bar-message-color: #252525;
    --free-shipping-progress-bar-message-color-reached: var(--brand-color, #67AD2B);

    /* Compact mode (web header: white-on-brand-green) */
    --free-shipping-progress-bar-compact-bar-width: 150px;
    --free-shipping-progress-bar-compact-bar-height: 7px;
    --free-shipping-progress-bar-compact-track-color: rgba(255, 255, 255, 0.28);
    --free-shipping-progress-bar-compact-fill-color: #FFFFFF;
    --free-shipping-progress-bar-compact-fill-color-reached: #CFFC57;
}

/* ---------- Base / Full mode ---------- */

.free-shipping-progress-bar {
    /* Root intentionally NOT overflow:hidden — the marker overhangs the track
       at 0%/100% (approved mockup behavior); host padding must be >= half the
       marker size. */
    font-family: inherit;
}

.free-shipping-progress-bar__message {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--free-shipping-progress-bar-message-color);
}

.free-shipping-progress-bar--message-below .free-shipping-progress-bar__message {
    margin: 8px 0 0;
}

.free-shipping-progress-bar--reached .free-shipping-progress-bar__message {
    color: var(--free-shipping-progress-bar-message-color-reached);
}

.free-shipping-progress-bar__check {
    display: inline-block;
    vertical-align: -2px;
    margin-right: 4px;
}

.free-shipping-progress-bar__bar {
    position: relative;
    display: flex;
    align-items: center;
    min-height: var(--free-shipping-progress-bar-marker-size);
}

.free-shipping-progress-bar__track {
    position: relative;
    width: 100%;
    height: var(--free-shipping-progress-bar-bar-height);
    border-radius: 999px;
    background: var(--free-shipping-progress-bar-track-color);
    overflow: hidden;
}

.free-shipping-progress-bar__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    /* No min-width: the sliver/dot at ~1% is the approved mockup behavior. */
    width: var(--free-shipping-progress-bar-progress, 0%);
    border-radius: 999px;
    background-color: var(--free-shipping-progress-bar-fill-color);
    background-image: var(--free-shipping-progress-bar-fill-image);
    background-size: var(--free-shipping-progress-bar-fill-size);
    animation: var(--free-shipping-progress-bar-fill-animation);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.free-shipping-progress-bar--reached .free-shipping-progress-bar__fill {
    background-color: var(--free-shipping-progress-bar-fill-color-reached);
}

.free-shipping-progress-bar__marker {
    position: absolute;
    top: 50%;
    left: var(--free-shipping-progress-bar-progress, 0%);
    transform: translate(-50%, -50%);
    width: var(--free-shipping-progress-bar-marker-size);
    height: var(--free-shipping-progress-bar-marker-size);
    border-radius: 50%;
    border: var(--free-shipping-progress-bar-marker-border);
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(20, 30, 26, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--free-shipping-progress-bar-marker-icon-color);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.free-shipping-progress-bar--reached .free-shipping-progress-bar__marker {
    background: radial-gradient(circle at 50% 40%, #8FD24A, var(--brand-color, #67AD2B));
    color: #FFFFFF;
    animation: var(--free-shipping-progress-bar-marker-animation);
}

.free-shipping-progress-bar__caption {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-color, #67AD2B);
}

/* ---------- Compact mode ---------- */

.free-shipping-progress-bar--compact {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.free-shipping-progress-bar--compact .free-shipping-progress-bar__icon {
    flex-shrink: 0;
}

.free-shipping-progress-bar--compact .free-shipping-progress-bar__track {
    width: var(--free-shipping-progress-bar-compact-bar-width);
    height: var(--free-shipping-progress-bar-compact-bar-height);
    background: var(--free-shipping-progress-bar-compact-track-color);
    flex-shrink: 0;
}

.free-shipping-progress-bar--compact .free-shipping-progress-bar__fill {
    background-color: var(--free-shipping-progress-bar-compact-fill-color);
    background-image: none;
    animation: none;
}

.free-shipping-progress-bar--compact.free-shipping-progress-bar--reached .free-shipping-progress-bar__fill {
    background-color: var(--free-shipping-progress-bar-compact-fill-color-reached);
}

.free-shipping-progress-bar--compact .free-shipping-progress-bar__text {
    font-size: 12.5px;
    font-weight: 500;
    /* The real copy (backend-localized) is longer than the mockups'
       placeholder and doesn't fit this column on one line. Wrap onto a
       second line instead of ellipsizing — the host row has the vertical
       room and a truncated message reads worse than a two-line one
       (WI 27159). */
    white-space: normal;
    min-width: 0;
}

/* ---------- Card mode (mobile checkout) ---------- */

.free-shipping-progress-bar--card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(103, 173, 43, 0.35);
    border-radius: 14px;
    background: linear-gradient(180deg, #F4FAEE, #FFFFFF);
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-color, #67AD2B);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__body {
    flex: 1;
    min-width: 0;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__eyebrow {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-color, #67AD2B);
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__message {
    margin: 0 0 10px;
    font-weight: 700;
    text-align: left;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__bar {
    min-height: 0;
    margin-bottom: 8px;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__track {
    height: 12px;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__helper {
    margin: 0;
    font-size: 12px;
    color: #8A94A0;
}

.free-shipping-progress-bar--card.free-shipping-progress-bar--reached {
    background: linear-gradient(135deg, #5B9926, #67AD2B);
    border-color: transparent;
    color: #FFFFFF;
    overflow: hidden;
    padding-bottom: 22px;
}

.free-shipping-progress-bar--card.free-shipping-progress-bar--reached .free-shipping-progress-bar__card-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.18);
    animation: free-shipping-progress-bar-pulse 2s ease-in-out infinite;
}

.free-shipping-progress-bar--card.free-shipping-progress-bar--reached .free-shipping-progress-bar__eyebrow {
    color: rgba(255, 255, 255, 0.85);
}

.free-shipping-progress-bar--card.free-shipping-progress-bar--reached .free-shipping-progress-bar__message {
    margin: 0 0 3px;
    color: #FFFFFF;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__subtitle {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--brand-color, #67AD2B);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
}

.free-shipping-progress-bar--card .free-shipping-progress-bar__lime-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    background: #CFFC57;
}

/* ---------- Animations ---------- */

@keyframes free-shipping-progress-bar-stripes {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 26px 0;
    }
}

/* Replaces the marker's base shadow while animating (per the approved mockup). */
@keyframes free-shipping-progress-bar-glow {
    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(143, 210, 74, 0.35), 0 3px 8px rgba(0, 0, 0, 0.18);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(143, 210, 74, 0.18), 0 3px 8px rgba(0, 0, 0, 0.18);
    }
}

/* Scale pulse for non-translated elements (card icon circle). */
@keyframes free-shipping-progress-bar-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.14);
    }
}

/* Scale pulse that preserves the marker's centering translate — select it on
   the marker via --free-shipping-progress-bar-marker-animation (web spec:
   1.1s). */
@keyframes free-shipping-progress-bar-marker-pulse {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.14);
    }
}

@media (prefers-reduced-motion: reduce) {
    .free-shipping-progress-bar__fill,
    .free-shipping-progress-bar__marker,
    .free-shipping-progress-bar__card-icon {
        animation: none !important;
        transition: none !important;
    }
}
