/**
 * CartBoost – Progress Reward Bar
 * All colors/dimensions driven by CSS custom properties — zero theme conflicts.
 */

/* ==========================================================================
   Base wrapper
   ========================================================================== */

.cartboost-bar-wrap {
    --cb-bar-color: #2ecc71;
    --cb-bg-color: #f0f0f0;
    --cb-text-color: #333333;
    --cb-percent: 0%;
    --cb-height: 14px;
    --cb-radius: 999px;
    --cb-font-size: 0.95em;
    --cb-align: left;
    --cb-font-family: inherit;
    --cb-font-weight: 500;
    --cb-width: 100%;
    --cb-padding: 16px;
    --cb-gap: 10px;
    --cb-anim-speed: 0.8s;
    --cb-container-bg: transparent;

    box-sizing: border-box;
    width: 100%;
    padding: var(--cb-padding) calc(var(--cb-padding) + 4px);
    margin-bottom: 20px;
    font-family: var(--cb-font-family);
    line-height: 1.5;
    background-color: var(--cb-container-bg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Failsafe: the script normally reveals the bar (after refreshing it). If the
   script is blocked or broken, e.g. by a caching/optimisation plugin, show the
   bar anyway after a short delay instead of leaving it invisible. */
.cartboost-bar-wrap {
    animation: cartboost-failsafe-reveal 0.3s ease 2.5s forwards;
}

@keyframes cartboost-failsafe-reveal {
    to {
        opacity: 1;
    }
}

.cartboost-bar-wrap.cartboost-ready {
    opacity: 1;
    animation: none;
}

/* Message emphasis from the admin toolbar / "Highlight amounts" setting:
   <mark> shows as bold text in the bar color, not a yellow highlighter. */
.cartboost-bar-wrap mark {
    padding: 0;
    color: var(--cb-bar-color);
    background: none;
    font-weight: 700;
}

/* No container background: line the bar up with the page content instead of
   indenting it. Mini-cart and sticky bars keep their own padding. */
.cartboost-bar-wrap:not(.cartboost-boxed):not(.cartboost-context-minicart):not(.cartboost-sticky) {
    padding-left: 0;
    padding-right: 0;
}

/* ==========================================================================
   Message
   ========================================================================== */

.cartboost-message {
    margin: 0 0 var(--cb-gap) 0;
    padding: 0;
    font-size: var(--cb-font-size);
    font-weight: var(--cb-font-weight);
    color: var(--cb-text-color);
    text-align: var(--cb-align);
}

.cartboost-icon {
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.cartboost-icon-img {
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Bar above message — flip spacing */
.cartboost-bar-above .cartboost-message {
    margin: var(--cb-gap) 0 0 0;
}

/* ==========================================================================
   Progress track + fill
   ========================================================================== */

.cartboost-track {
    position: relative;
    max-width: var(--cb-width);
    height: var(--cb-height);
    background: var(--cb-bg-color);
    border-radius: var(--cb-radius);
    overflow: hidden;
}

.cartboost-fill {
    position: relative;
    height: 100%;
    width: var(--cb-percent);
    background-color: var(--cb-bar-color);
    background-image: none;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    border-radius: var(--cb-radius);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--cb-height);
}

/* Percentage text inside the fill */
.cartboost-percent {
    font-size: 0.65em;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Percentage above bar */
.cartboost-percent-above {
    text-align: var(--cb-align);
    margin-bottom: 4px;
}

.cartboost-percent-above .cartboost-percent {
    color: var(--cb-text-color);
    text-shadow: none;
    font-size: var(--cb-font-size);
}

/* Percentage after message */
.cartboost-percent-after-message .cartboost-message .cartboost-percent {
    color: var(--cb-text-color);
    text-shadow: none;
    font-size: 0.9em;
    opacity: 0.7;
}

/* Percentage beside the bar: one row, the label at the end. */
.cbpb-bar-beside {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cbpb-bar-beside .cartboost-track {
    flex: 1 1 auto;
    min-width: 0;
}

.cbpb-bar-beside > .cartboost-percent {
    flex: none;
    color: var(--cb-text-color);
    text-shadow: none;
    font-size: 0.85em;
    font-variant-numeric: tabular-nums;
}

/* Templates with no single bar put "beside" at the end of the line above. */
.cbpb-percent-end {
    text-align: end;
}

/* A percentage inside the fill needs room to be read, however thin the bar. */
.cartboost-percent-inside .cartboost-track:has(.cartboost-percent) {
    height: max(var(--cb-height), 16px);
}

/* ==========================================================================
   Multi-tier milestone markers
   ========================================================================== */

.cartboost-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.22);
    z-index: 2;
    pointer-events: none;
}

/* Once the cart passes a tier, its notch sits on the colored fill —
   switch to a light line so it stays visible. */
.cartboost-marker-unlocked {
    background: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   Gradient — applied via background (not background-image, to avoid conflict with stripes)
   ========================================================================== */

.cartboost-gradient .cartboost-fill {
    background-color: var(--cb-bar-color);
    background-image: var(--cb-gradient);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* ==========================================================================
   Bar styles — striped
   ========================================================================== */

.cartboost-style-striped .cartboost-fill {
    background-color: var(--cb-bar-color);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-repeat: repeat;
    background-size: 1rem 1rem;
}

/* Striped + gradient: stripes on top of gradient */
.cartboost-gradient.cartboost-style-striped .cartboost-fill {
    background-color: var(--cb-bar-color);
    background-image:
        linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.15) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 75%,
            transparent
        ),
        var(--cb-gradient);
    background-repeat: repeat, no-repeat;
    background-size: 1rem 1rem, 100% 100%;
}

/* Flat — no radius override (handled by --cb-radius: 0) */

/* ==========================================================================
   Bar shadow
   ========================================================================== */

.cartboost-shadow-subtle .cartboost-track {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cartboost-shadow-medium .cartboost-track {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cartboost-shadow-strong .cartboost-track {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Bar border
   ========================================================================== */

.cartboost-bordered .cartboost-track {
    border: var(--cb-border-width, 1px) solid var(--cb-border-color, #ddd);
}

/* ==========================================================================
   Animation — only on cart changes, not on initial page load
   ========================================================================== */

.cartboost-animated .cartboost-fill {
    transition: width var(--cb-anim-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Striped animation — only the stripe movement uses keyframes */
.cartboost-style-striped .cartboost-fill {
    animation: cartboost-stripe-move 1s linear infinite;
}

@keyframes cartboost-stripe-move {
    0%   { background-position: 0 0; }
    100% { background-position: 1rem 0; }
}

/* ==========================================================================
   States
   ========================================================================== */

.cartboost-state-empty .cartboost-message {
    opacity: 0.85;
}

.cartboost-state-reached .cartboost-fill {
    width: 100%;
}

.cartboost-state-reached .cartboost-message {
    font-weight: 600;
}

/* ==========================================================================
   Celebrations
   ========================================================================== */

/* Pulse */
.cartboost-celebrate-pulse .cartboost-fill {
    animation: cartboost-pulse 0.6s ease-out;
}

@keyframes cartboost-pulse {
    0%  { transform: scaleY(1); }
    50% { transform: scaleY(1.4); }
    100%{ transform: scaleY(1); }
}

/* Glow */
.cartboost-celebrate-glow .cartboost-fill {
    animation: cartboost-glow 1.2s ease-in-out infinite alternate;
}

@keyframes cartboost-glow {
    from { box-shadow: 0 0 4px var(--cb-bar-color); }
    to   { box-shadow: 0 0 16px var(--cb-bar-color), 0 0 24px var(--cb-bar-color); }
}

/* Bounce */
.cartboost-celebrate-bounce .cartboost-fill {
    animation: cartboost-bounce 0.6s ease-out;
}

@keyframes cartboost-bounce {
    0%   { transform: scaleX(0.95) scaleY(1); }
    30%  { transform: scaleX(1.02) scaleY(0.9); }
    50%  { transform: scaleX(0.98) scaleY(1.05); }
    70%  { transform: scaleX(1.01) scaleY(0.98); }
    100% { transform: scaleX(1) scaleY(1); }
}

/* Confetti — pseudo-element sparkle */
.cartboost-celebrate-confetti .cartboost-track {
    position: relative;
    overflow: visible;
}

.cartboost-celebrate-confetti .cartboost-track::after {
    content: '';
    position: absolute;
    inset: -8px -4px;
    background-image:
        radial-gradient(circle, #f1c40f 1px, transparent 1px),
        radial-gradient(circle, #e74c3c 1px, transparent 1px),
        radial-gradient(circle, #3498db 1px, transparent 1px),
        radial-gradient(circle, #2ecc71 1px, transparent 1px),
        radial-gradient(circle, #9b59b6 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 7px 12px, 14px 4px, 3px 16px, 18px 8px;
    animation: cartboost-confetti 1.5s ease-out forwards;
    pointer-events: none;
    border-radius: var(--cb-radius);
}

@keyframes cartboost-confetti {
    0%   { opacity: 1; transform: scale(1); }
    50%  { opacity: 0.8; }
    100% { opacity: 0; transform: scale(1.1) translateY(-4px); }
}

/* ==========================================================================
   RTL support
   ========================================================================== */

.cartboost-rtl {
    direction: rtl;
}

.cartboost-rtl .cartboost-icon {
    margin-right: 0;
    margin-left: 4px;
}

.cartboost-rtl .cartboost-fill {
    margin-left: auto;
    margin-right: 0;
}

/* ==========================================================================
   Dark mode
   ========================================================================== */

/* ==========================================================================
   Dark mode — custom overrides only, default respects CSS vars
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .cartboost-dark-custom .cartboost-fill {
        background-color: var(--cb-dark-bar-color);
    }
    .cartboost-dark-custom .cartboost-track {
        background: var(--cb-dark-bg-color);
    }
    .cartboost-dark-custom .cartboost-message {
        color: var(--cb-dark-text-color);
    }
    .cartboost-dark-custom.cartboost-gradient .cartboost-fill {
        background-color: var(--cb-dark-bar-color);
    }
    .cartboost-dark-custom .cartboost-marker {
        background: rgba(255, 255, 255, 0.3);
    }
}

/* ==========================================================================
   Context — Mini-cart compact
   ========================================================================== */

.cartboost-context-minicart {
    padding: 12px 14px;
    margin-bottom: 12px;
}

.cartboost-context-minicart .cartboost-message {
    font-size: 0.85em;
    margin-bottom: 8px;
}

.cartboost-context-minicart .cartboost-track {
    height: 10px;
}

/* Block Mini-Cart drawer: line up with the drawer title's 16px side padding. */
.wp-block-woocommerce-filled-mini-cart-contents-block > .cartboost-context-minicart {
    margin: 0 16px 12px;
}

.wp-block-woocommerce-filled-mini-cart-contents-block > .cartboost-context-minicart:not(.cartboost-boxed) {
    padding: 0;
}

/* ==========================================================================
   Accessibility — reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .cartboost-fill {
        transition: none;
    }
    .cartboost-animated .cartboost-fill {
        width: var(--cb-percent);
    }
    .cartboost-celebrate-pulse .cartboost-fill,
    .cartboost-celebrate-glow .cartboost-fill,
    .cartboost-celebrate-bounce .cartboost-fill {
        animation: none;
    }
    .cartboost-style-striped .cartboost-fill {
        animation: none;
    }
    .cartboost-celebrate-confetti .cartboost-track::after {
        animation: none;
        display: none;
    }
}

/* ==========================================================================
   Inline layout — message and track side by side (used by the sticky bar)
   ========================================================================== */

.cartboost-layout-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.cartboost-inline-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cartboost-layout-inline .cartboost-message {
    margin: 0;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cartboost-layout-inline .cartboost-track {
    flex: 1 1 160px;
    min-width: 120px;
}

.cartboost-layout-inline.cartboost-bar-above .cartboost-inline-body {
    flex-direction: row-reverse;
}

.cartboost-dismiss {
    flex: 0 0 auto;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--cb-text-color);
    opacity: 0.6;
    font-size: 20px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
}

.cartboost-dismiss:hover,
.cartboost-dismiss:focus-visible {
    opacity: 1;
    outline: 2px solid var(--cb-bar-color);
    outline-offset: 1px;
}

@media (max-width: 600px) {
    .cartboost-inline-body {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .cartboost-layout-inline .cartboost-message {
        white-space: normal;
        font-size: 0.85em;
    }
    .cartboost-layout-inline.cartboost-bar-above .cartboost-inline-body {
        flex-direction: column-reverse;
    }
}

/* ==========================================================================
   Sticky site-wide bar
   ========================================================================== */

.cartboost-sticky {
    position: fixed;
    left: 0;
    right: 0;
    z-index: var(--cb-sticky-z, 9990);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    padding-left: max(var(--cb-padding), env(safe-area-inset-left));
    padding-right: max(var(--cb-padding), env(safe-area-inset-right));
}

.cartboost-sticky-bottom {
    bottom: 0;
    padding-bottom: max(var(--cb-padding), env(safe-area-inset-bottom));
}

.cartboost-sticky-top {
    top: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Sit below the WordPress admin bar when it is present */
body.admin-bar .cartboost-sticky-top {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .cartboost-sticky-top {
        top: 46px;
    }
}

/* Hidden by rule (show_when / dismissed / device) — JS toggles this class */
.cartboost-sticky.cartboost-sticky-off {
    display: none;
}

@media (max-width: 782px) {
    .cartboost-sticky-desktop-only {
        display: none;
    }
}

@media (min-width: 783px) {
    .cartboost-sticky-mobile-only {
        display: none;
    }
}

/* Keep the sticky bar's slide subtle */
.cartboost-sticky.cartboost-ready {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   Product page bar
   ========================================================================== */

.cartboost-context-product {
    margin-bottom: 16px;
}

/* ==========================================================================
   Product suggestions — "add one of these to unlock"
   ========================================================================== */

.cartboost-suggestions {
    margin-top: var(--cb-gap);
    font-size: var(--cb-font-size);
    color: var(--cb-text-color);
}

.cartboost-suggestions-title {
    margin: 0 0 8px 0;
    font-weight: var(--cb-font-weight);
    opacity: 0.85;
}

/* Scoped under the wrapper so theme list styles (e.g. `.entry-content ul`
   margins) cannot indent the suggestions row. */
.cartboost-bar-wrap ul.cartboost-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.cartboost-suggestions-grid .cartboost-suggestions-list {
    flex-wrap: wrap;
    overflow: visible;
}

.cartboost-suggestion {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    max-width: 300px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: calc(var(--cb-radius) / 2 + 4px);
    background: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.cartboost-suggestions-grid .cartboost-suggestion {
    flex: 1 1 220px;
    max-width: none;
}

.cartboost-suggestion-img {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f3f3;
    display: block;
}

.cartboost-suggestion-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cartboost-suggestion-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.cartboost-suggestion-name {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cartboost-suggestion-price {
    font-size: 0.9em;
    opacity: 0.85;
}

.cartboost-suggestion-price del {
    opacity: 0.6;
    margin-right: 4px;
}

.cartboost-suggestion-add {
    flex: 0 0 auto;
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: var(--cb-bar-color);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.cartboost-suggestion-add:hover,
.cartboost-suggestion-add:focus-visible {
    filter: brightness(0.92);
    color: #fff;
    text-decoration: none;
}

.cartboost-suggestion-add[disabled],
.cartboost-suggestion-add.is-loading {
    opacity: 0.6;
    cursor: progress;
}

.cartboost-suggestion.is-added {
    border-color: var(--cb-bar-color);
}

.cartboost-context-minicart .cartboost-suggestion {
    min-width: 180px;
}

@media (prefers-color-scheme: dark) {
    .cartboost-dark-custom .cartboost-suggestion {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* ==========================================================================
   Free-gift chooser — prompt under the bar + modal
   ========================================================================== */

.cartboost-gift-prompt {
    margin-top: var(--cb-gap);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: var(--cb-font-size);
    color: var(--cb-text-color);
}

.cartboost-gift-prompt-text {
    font-weight: var(--cb-font-weight);
}

.cartboost-gift-choose,
.cartboost-gift-pick {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 6px 14px;
    font: inherit;
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    background: var(--cb-bar-color, #2ecc71);
    cursor: pointer;
    white-space: nowrap;
}

.cartboost-gift-choose:hover,
.cartboost-gift-pick:hover {
    filter: brightness(0.92);
}

.cartboost-gift-pick[disabled],
.cartboost-gift-pick.is-loading {
    opacity: 0.6;
    cursor: progress;
}

.cartboost-gift-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cartboost-gift-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.cartboost-gift-modal-box {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    color: #222;
    border-radius: 12px;
    padding: 22px 22px 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.cartboost-gift-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
}

.cartboost-gift-modal-close:hover {
    opacity: 1;
}

.cartboost-gift-modal-title {
    margin: 0 28px 4px 0;
    font-size: 1.2em;
}

.cartboost-gift-modal-sub {
    margin: 0 0 14px;
    opacity: 0.75;
}

.cartboost-gift-options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.cartboost-gift-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    margin: 0;
}

.cartboost-gift-option img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex: 0 0 auto;
}

.cartboost-gift-option-name {
    flex: 1 1 auto;
    font-weight: 600;
    min-width: 0;
}

html.cartboost-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Admin preview and design thumbnails (settings screen only)
   ========================================================================== */

.cbpb-preview .cartboost-bar-wrap {
    opacity: 1;
    animation: none;
    margin-bottom: 0;
}

/* ==========================================================================
   Ready-made designs (layouts from DesignLayouts.php)
   All colours come from the bar's CSS variables, so Appearance settings
   customize every design.
   ========================================================================== */

.cartboost-bar-wrap .cbpb-ic {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    flex: none;
}

.cartboost-bar-wrap .cbpb-ok {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cb-bar-color);
    font-weight: 600;
}

.cartboost-bar-wrap .cbpb-sep {
    margin: 0 6px;
    opacity: 0.5;
}

/* Shared reward list (Minimal, Ocean Ring) */
.cartboost-bar-wrap .cbpb-ladder {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.82em;
    color: var(--cb-text-color);
}

.cartboost-bar-wrap .cbpb-ladder li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    opacity: 0.7;
}

.cartboost-bar-wrap .cbpb-ladder li.is-done {
    opacity: 1;
    font-weight: 600;
    color: var(--cb-bar-color);
}

.cartboost-bar-wrap .cbpb-ladder li.is-next {
    opacity: 1;
}

.cartboost-bar-wrap .cbpb-ladder-mark {
    display: inline-grid;
    place-items: center;
    width: 12px;
    height: 12px;
    flex: none;
}

.cartboost-bar-wrap .cbpb-ladder li:not(.is-done) .cbpb-ladder-mark {
    width: 10px;
    height: 10px;
    margin: 0 1px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    box-sizing: border-box;
    opacity: 0.6;
}

.cartboost-bar-wrap .cbpb-ladder li.is-next .cbpb-ladder-mark {
    border-color: var(--cb-bar-color);
    border-width: 2px;
    opacity: 1;
}

/* --- Card --------------------------------------------------------------- */

.cartboost-design-card .cbpb-card {
    container-type: inline-size;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    align-items: center;
}

.cartboost-design-card.cartboost-boxed {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.cartboost-design-card .cbpb-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: var(--cb-bar-color);
    background: color-mix(in srgb, var(--cb-bar-color) 12%, transparent);
}

.cartboost-design-card .cartboost-message {
    margin: 0;
    font-size: calc(var(--cb-font-size) * 1.1);
}

.cartboost-design-card .cbpb-card-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 2px 0 0;
    font-size: 0.82em;
    color: var(--cb-text-color);
    opacity: 0.85;
}

.cartboost-design-card .cbpb-card > .cartboost-track,
.cartboost-design-card .cbpb-card > .cbpb-bar-box {
    grid-column: 1 / -1;
    margin-top: var(--cb-gap);
}

.cartboost-design-card.cartboost-bar-above .cbpb-card > :first-child {
    margin: 0 0 var(--cb-gap);
}

/* --- Steps -------------------------------------------------------------- */

.cartboost-design-steps .cbpb-steps-rail {
    position: relative;
    height: 96px;
    margin: 4px 62px 0;
}

.cartboost-design-steps .cbpb-step-label {
    white-space: nowrap;
}

/* Narrow spaces (phones, side carts, the admin preview): tighter nodes,
   labels may wrap. Sized by the bar's own width, not the screen. */
.cartboost-design-steps .cbpb-steps {
    container-type: inline-size;
}

@container (max-width: 480px) {
    .cartboost-design-steps .cbpb-steps-rail {
        margin-left: 38px;
        margin-right: 38px;
        height: 104px;
    }
    .cartboost-design-steps .cbpb-step {
        width: 76px;
    }
    .cartboost-design-steps .cbpb-step-dot {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .cartboost-design-steps .cbpb-steps-line {
        top: 16px;
    }
    .cartboost-design-steps .cbpb-step-label {
        white-space: normal;
    }
}

@container (max-width: 300px) {
    .cartboost-design-steps .cbpb-steps-rail {
        margin-left: 30px;
        margin-right: 30px;
    }
    .cartboost-design-steps .cbpb-step {
        width: 60px;
    }
    .cartboost-design-steps .cbpb-step-label {
        font-size: 0.72em;
    }
}

.cartboost-design-steps .cartboost-message {
    margin-bottom: 14px;
}

.cartboost-design-steps .cbpb-steps-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 19px;
    height: 4px;
    border-radius: 4px;
    background: var(--cb-bg-color);
    overflow: hidden;
}

.cartboost-design-steps .cbpb-steps-line-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--cbpb-fill, 0%);
    background: var(--cb-bar-color);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cartboost-design-steps .cbpb-steps-nodes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cartboost-design-steps .cbpb-step {
    position: absolute;
    top: 0;
    width: 124px;
    margin: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--cb-text-color);
}

.cartboost-design-steps .cbpb-step-dot {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: var(--cb-surface, #ffffff);
    border: 2px solid #d1d5db;
    color: #9ca3af;
    box-sizing: border-box;
}

.cartboost-design-steps .cbpb-step.is-done .cbpb-step-dot {
    background: var(--cb-bar-color);
    border-color: var(--cb-bar-color);
    color: var(--cb-on-bar, #ffffff);
}

.cartboost-design-steps .cbpb-step.is-next .cbpb-step-dot {
    border-color: var(--cb-bar-color);
    color: var(--cb-bar-color);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--cb-bar-color) 16%, transparent);
}

.cartboost-design-steps .cbpb-step-label {
    margin-top: 8px;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.25;
}

.cartboost-design-steps .cbpb-step-sub {
    font-size: 0.72em;
    opacity: 0.7;
}

.cartboost-design-steps .cbpb-step.is-done .cbpb-step-sub {
    color: var(--cb-bar-color);
    font-weight: 600;
    opacity: 1;
}

/* --- Minimal ------------------------------------------------------------ */

.cartboost-design-minimal .cbpb-minimal-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--cb-gap);
}

.cartboost-design-minimal .cbpb-minimal-head .cartboost-message {
    margin: 0;
}

.cartboost-design-minimal .cbpb-minimal-total {
    flex: none;
    font-size: 0.8em;
    color: var(--cb-text-color);
    opacity: 0.65;
    font-variant-numeric: tabular-nums;
}

.cartboost-design-minimal .cbpb-minimal-bar {
    position: relative;
}

.cartboost-design-minimal .cbpb-dot {
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    background: var(--cb-surface, #ffffff);
    border: 2px solid var(--cb-bg-color);
    box-sizing: border-box;
}

.cartboost-design-minimal .cbpb-dot.is-done {
    background: var(--cb-bar-color);
    border-color: var(--cb-bar-color);
}

.cartboost-design-minimal .cbpb-ladder li:not(.is-done) .cbpb-ladder-mark {
    display: none;
}

.cartboost-design-minimal .cbpb-dot:last-child {
    margin-left: -9px;
}

/* --- Banner ------------------------------------------------------------- */

.cartboost-design-banner.cartboost-boxed {
    border-radius: 12px;
}

.cartboost-design-banner .cbpb-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.cartboost-design-banner .cbpb-banner-icon {
    font-size: 20px;
    color: var(--cb-bar-color);
    display: inline-flex;
}

.cartboost-design-banner .cartboost-message {
    margin: 0;
    flex: 0 1 auto;
}

.cartboost-design-banner .cbpb-banner > .cartboost-track,
.cartboost-design-banner .cbpb-banner > .cbpb-bar-box {
    flex: 1 1 120px;
    min-width: 120px;
}

.cartboost-design-banner .cbpb-bar-beside > .cartboost-percent {
    font-weight: 700;
}

/* --- Ocean Ring --------------------------------------------------------- */

.cartboost-design-ring.cartboost-boxed {
    border-radius: 14px;
}

.cartboost-design-ring .cbpb-ring {
    display: flex;
    align-items: center;
    gap: 18px;
}

.cartboost-design-ring .cbpb-ring-dial {
    position: relative;
    flex: none;
    width: 110px;
    height: 110px;
    font-size: 14px;
}

.cartboost-design-ring .cbpb-ring-dial svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.cartboost-design-ring .cbpb-ring-track,
.cartboost-design-ring .cbpb-ring-fill {
    fill: none;
    stroke-width: 9;
}

.cartboost-design-ring .cbpb-ring-track {
    stroke: var(--cb-bg-color);
}

.cartboost-design-ring .cbpb-ring-face {
    fill: var(--cb-face, #ffffff);
    stroke: none;
}

/* Ring reward list: round status dots (filled ✓, next ring, locked ring). */
.cartboost-design-ring .cbpb-ladder li {
    opacity: 1;
    gap: 9px;
}

.cartboost-design-ring .cbpb-ladder .cbpb-ladder-mark,
.cartboost-design-ring .cbpb-ladder li:not(.is-done) .cbpb-ladder-mark {
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 50%;
    box-sizing: border-box;
    font-size: 11px;
    opacity: 1;
}

.cartboost-design-ring .cbpb-ladder li.is-done .cbpb-ladder-mark {
    background: var(--cb-bar-color);
    color: var(--cb-on-bar, #ffffff);
}

.cartboost-design-ring .cbpb-ladder li.is-done {
    color: var(--cb-text-color);
    font-weight: 500;
}

.cartboost-design-ring .cbpb-ladder li.is-next .cbpb-ladder-mark {
    border: 2px solid var(--cb-bar-color);
}

.cartboost-design-ring .cbpb-ladder li.is-locked {
    opacity: 0.75;
}

.cartboost-design-ring .cbpb-ladder li.is-locked .cbpb-ladder-mark {
    border: 2px solid color-mix(in srgb, var(--cb-bar-color) 40%, var(--cb-surface, #ffffff));
}

.cartboost-design-ring .cbpb-ring-fill {
    stroke: var(--cb-bar-color);
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cartboost-design-ring .cbpb-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    color: var(--cb-text-color);
}

.cartboost-design-ring .cbpb-ring-center strong {
    font-size: 1.6em;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--cb-bar-color);
}

.cartboost-design-ring .cbpb-ring-center small {
    font-size: 0.8em;
    opacity: 0.7;
}

.cartboost-design-ring .cbpb-ring-done {
    font-size: 30px;
    color: var(--cb-bar-color);
}

.cartboost-design-ring .cbpb-ring-body {
    min-width: 0;
}

.cartboost-design-ring .cbpb-ring-body .cartboost-message {
    margin: 0;
}

.cartboost-design-ring .cbpb-ladder {
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

/* Narrow spaces: the ring stacks above its text. */
.cartboost-context-minicart.cartboost-design-ring .cbpb-ring {
    gap: 12px;
}

.cartboost-context-minicart.cartboost-design-ring .cbpb-ring-dial {
    width: 84px;
    height: 84px;
    font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
    .cartboost-design-steps .cbpb-steps-line-fill,
    .cartboost-design-ring .cbpb-ring-fill {
        transition: none;
    }
}

/* --- Milestones: shared by Aurora, Candy Pop, Earth and Luxe Gold -------- */

.cartboost-bar-wrap .cbpb-ms {
    display: flex;
    flex-direction: column;
    container-type: inline-size;
}

.cartboost-bar-wrap .cbpb-ms-status {
    display: none;
    margin: 0;
}

.cartboost-bar-wrap .cbpb-ms .cartboost-message {
    margin-bottom: calc(var(--cb-gap) + 6px);
}

.cartboost-bar-wrap .cbpb-ms-bar {
    position: relative;
    margin: 0 16px;
}

.cartboost-bar-wrap .cbpb-ms-node {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    box-sizing: border-box;
    line-height: 1;
}

.cartboost-bar-wrap .cbpb-ms-labels {
    position: relative;
    min-height: 2.6em;
    margin: 12px 16px 0;
    font-size: 0.75em;
    color: var(--cb-text-color);
}

.cartboost-bar-wrap .cbpb-ms-label {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    max-width: 7.5em;
    width: max-content;
    text-align: center;
    line-height: 1.25;
    opacity: 0.7;
}

.cartboost-bar-wrap .cbpb-ms-label.is-end {
    transform: translateX(calc(-100% + 16px));
    text-align: right;
}

.cartboost-bar-wrap .cbpb-ms-label.is-done {
    opacity: 1;
    font-weight: 600;
    color: var(--cb-bar-color);
}

/* Aurora: dark glass card, glowing gradient fill, lit-up reward nodes. */
.cartboost-design-aurora.cartboost-boxed {
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--cb-bg-color) 75%, #ffffff);
    background: linear-gradient(160deg, color-mix(in srgb, var(--cb-container-bg) 88%, #ffffff 12%), var(--cb-container-bg));
}

.cartboost-design-aurora .cartboost-fill {
    box-shadow: 0 0 16px color-mix(in srgb, var(--cb-bar-color) 65%, transparent);
}

.cartboost-design-aurora .cartboost-track {
    overflow: visible;
}

.cartboost-design-aurora.cartboost-gradient mark {
    background: var(--cb-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cartboost-design-aurora .cbpb-ms-node {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    background: var(--cb-bg-color);
    border: 1.5px solid color-mix(in srgb, var(--cb-text-color) 30%, transparent);
    color: color-mix(in srgb, var(--cb-text-color) 75%, transparent);
}

.cartboost-design-aurora .cbpb-ms-node.is-done {
    background: color-mix(in srgb, var(--cb-bar-color) 35%, #ffffff);
    border-color: transparent;
    color: #3b0764;
    box-shadow: 0 0 14px color-mix(in srgb, var(--cb-bar-color) 80%, transparent);
}

.cartboost-design-aurora .cbpb-ms-node.is-next {
    border-color: var(--cb-bar-color);
    color: var(--cb-bar-color);
}

/* Candy Pop: chunky card with a soft drop shadow and emoji milestones. */
.cartboost-design-candy.cartboost-boxed {
    border-radius: 22px;
    border: 2px solid color-mix(in srgb, var(--cb-bar-color) 22%, var(--cb-surface, #ffffff));
    box-shadow: 0 6px 0 color-mix(in srgb, var(--cb-bar-color) 25%, var(--cb-surface, #ffffff));
}

.cartboost-design-candy .cartboost-track {
    border: 2px solid color-mix(in srgb, var(--cb-bar-color) 20%, var(--cb-surface, #ffffff));
    box-sizing: content-box;
}

.cartboost-design-candy .cbpb-ms-node {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cb-surface, #ffffff);
    border: 2px solid color-mix(in srgb, var(--cb-bar-color) 30%, var(--cb-surface, #ffffff));
    font-size: 18px;
}

.cartboost-design-candy .cbpb-ms-node.is-done {
    border-color: var(--cb-reached-color, var(--cb-bar-color));
    background: color-mix(in srgb, var(--cb-reached-color, var(--cb-bar-color)) 16%, var(--cb-surface, #ffffff));
}

/* The emoji say it all: no text labels under them. */
.cartboost-design-candy .cbpb-ms-labels {
    display: none;
}

.cartboost-design-candy .cbpb-ms-bar {
    margin-bottom: 8px;
}

/* Earth: leaf-shaped markers, the unlocked reward as a soft sub-line. */
.cartboost-design-earth.cartboost-boxed {
    border-radius: 14px;
}

.cartboost-design-earth .cbpb-ms-status {
    display: block;
    order: 2;
    margin: -4px 0 14px;
    font-size: 0.72em;
    color: var(--cb-text-color);
    opacity: 0.75;
}

.cartboost-design-earth .cartboost-message,
.cartboost-design-earth .cbpb-ms-status {
    order: 1;
}

.cartboost-design-earth .cbpb-ms-status {
    order: 2;
}

.cartboost-design-earth .cbpb-ms > .cartboost-percent-above,
.cartboost-design-earth .cbpb-ms-bar,
.cartboost-design-earth .cbpb-ms-labels {
    order: 3;
}

/* Bar Position "Above message": the bar group moves to the top. */
.cartboost-design-earth.cartboost-bar-above .cbpb-ms > .cartboost-percent-above,
.cartboost-design-earth.cartboost-bar-above .cbpb-ms-bar,
.cartboost-design-earth.cartboost-bar-above .cbpb-ms-labels {
    order: 0;
}

.cartboost-design-earth.cartboost-bar-above .cbpb-ms-labels {
    margin-bottom: var(--cb-gap);
}

.cartboost-design-earth .cbpb-ms-node {
    width: 28px;
    height: 28px;
    border-radius: 50% 0 50% 0;
    font-size: 13px;
    background: var(--cb-container-bg);
    border: 2px solid color-mix(in srgb, var(--cb-text-color) 30%, transparent);
    color: color-mix(in srgb, var(--cb-text-color) 65%, transparent);
}

.cartboost-design-earth .cbpb-ms-node.is-done {
    background: var(--cb-bar-color);
    border-color: var(--cb-bar-color);
    color: var(--cb-container-bg);
}

.cartboost-design-earth .cbpb-ms-labels {
    font-size: 0.68em;
}

.cartboost-design-earth .cbpb-ms-status,
.cartboost-design-earth .cbpb-ms-labels {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Amounts in terracotta, the design's second colour. */
.cartboost-design-earth mark {
    color: #b4532a;
}

/* Luxe Gold: eyebrow line, serif headline, hairline track, diamond markers. */
.cartboost-design-luxe .cbpb-ms {
    text-align: var(--cb-align);
}

.cartboost-design-luxe .cbpb-ms-status {
    display: block;
    margin-bottom: 10px;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.58em;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cb-bar-color);
}

.cartboost-design-luxe mark {
    font-style: italic;
    font-weight: inherit;
}

.cartboost-design-luxe .cbpb-ms .cartboost-message {
    margin-bottom: calc(var(--cb-gap) + 14px);
}

.cartboost-design-luxe .cbpb-ms-bar,
.cartboost-design-luxe .cbpb-ms-labels {
    margin-left: 24px;
    margin-right: 24px;
}

.cartboost-design-luxe .cbpb-ms-node {
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--cb-container-bg);
    border: 1px solid color-mix(in srgb, var(--cb-bar-color) 55%, transparent);
}

.cartboost-design-luxe .cbpb-ms-node .cbpb-ic {
    display: none;
}

.cartboost-design-luxe .cbpb-ms-node.is-done {
    background: var(--cb-bar-color);
    border-color: var(--cb-bar-color);
}

.cartboost-design-luxe .cbpb-ms-labels {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.55em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cartboost-design-luxe .cbpb-ms-label {
    max-width: 14em;
}

.cartboost-design-luxe .cbpb-ms-label.is-end {
    transform: translateX(calc(-100% + 24px));
}

/* --- Sunset Segments ---------------------------------------------------- */

.cartboost-design-sunset.cartboost-boxed {
    border-radius: 14px;
}

.cartboost-design-sunset .cbpb-seg-bars,
.cartboost-design-sunset .cbpb-seg-caps {
    display: grid;
    gap: 6px;
}

.cartboost-design-sunset .cbpb-seg-part {
    max-width: none;
}

/* Segments not started yet stay empty (no minimum nub). */
.cartboost-design-sunset .cbpb-seg-part .cartboost-fill {
    min-width: 0;
}

.cartboost-design-sunset .cbpb-seg-caps {
    margin-top: 9px;
    font-size: 0.76em;
    color: var(--cb-text-color);
}

.cartboost-design-sunset .cbpb-seg-cap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 4px;
    min-width: 0;
    line-height: 1.3;
}

.cartboost-design-sunset .cbpb-seg-cap.is-done {
    font-weight: 700;
    color: color-mix(in srgb, var(--cb-reached-color, var(--cb-bar-color)) 70%, #431407);
}

.cartboost-design-sunset .cbpb-seg-cap.is-locked {
    opacity: 0.55;
}

@media (max-width: 480px) {
    .cartboost-design-sunset .cbpb-seg-amt {
        display: none;
    }
}

/* --- Smart Nudge -------------------------------------------------------- */

.cartboost-design-nudge.cartboost-boxed {
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--cb-bar-color) 22%, transparent);
}

.cartboost-design-nudge .cbpb-nudge-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--cb-gap);
}

.cartboost-design-nudge .cbpb-nudge-head .cartboost-message {
    margin: 0;
}

.cartboost-design-nudge .cbpb-nudge-pct {
    flex: none;
    font-size: 0.78em;
    font-weight: 600;
    color: var(--cb-bar-color);
}

.cartboost-design-nudge .cbpb-nudge-item.cartboost-suggestion {
    margin-top: 14px;
    max-width: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px dashed color-mix(in srgb, var(--cb-bar-color) 40%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--cb-bar-color) 5%, transparent);
}

.cartboost-design-nudge .cbpb-nudge-img {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 9px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.cartboost-design-nudge .cbpb-nudge-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cartboost-design-nudge .cbpb-nudge-img-empty {
    font-size: 20px;
    color: var(--cb-bar-color);
    background: color-mix(in srgb, var(--cb-bar-color) 16%, transparent);
}

.cartboost-design-nudge .cbpb-nudge-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    font-size: 0.85em;
    color: var(--cb-text-color);
}

.cartboost-design-nudge .cbpb-nudge-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cartboost-design-nudge .cbpb-nudge-name {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.cartboost-design-nudge .cbpb-nudge-note {
    font-size: 0.88em;
    opacity: 0.7;
}

.cartboost-design-nudge .cbpb-nudge-add {
    flex: none;
    display: inline-block;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background: var(--cb-bar-color);
    color: var(--cb-on-bar, #ffffff);
    font: inherit;
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.cartboost-design-nudge .cbpb-nudge-add:hover,
.cartboost-design-nudge .cbpb-nudge-add:focus-visible {
    filter: brightness(0.92);
}

.cartboost-design-nudge .cbpb-nudge-add.is-loading {
    opacity: 0.6;
    cursor: progress;
}

/* Narrow bars (phones, side carts): milestone labels wrap instead of running
   together. Kept last so it wins over the base label rules above. */
@container (max-width: 520px) {
    .cartboost-bar-wrap .cbpb-ms-label {
        max-width: 5.2em;
    }
    .cartboost-design-luxe .cbpb-ms-label {
        max-width: 8em;
    }
}

/* ==========================================================================
   Smart touches
   ========================================================================== */

/* Almost there: the fill (in the alert colour, set by the renderer) breathes
   gently so the shopper notices how close the next reward is. */
.cbpb-almost .cartboost-fill,
.cbpb-almost .cbpb-steps-line-fill {
    animation: cbpb-almost-pulse 1.6s ease-in-out infinite;
}

@keyframes cbpb-almost-pulse {
    0%, 100% { filter: brightness(1); box-shadow: 0 0 0 0 transparent; }
    50%      { filter: brightness(1.12); box-shadow: 0 0 12px color-mix(in srgb, var(--cb-bar-color) 55%, transparent); }
}

/* Savings counter */
.cartboost-bar-wrap .cbpb-savings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.4;
    color: var(--cb-text-color);
    background: color-mix(in srgb, var(--cb-reached-color, var(--cb-bar-color)) 16%, transparent);
}

.cartboost-bar-wrap .cbpb-savings-mark {
    color: var(--cb-reached-color, var(--cb-bar-color));
    font-weight: 800;
}

.cartboost-bar-wrap .cbpb-savings mark {
    color: inherit;
}

/* Unlock celebration: toast + confetti (added to <body> by cartboost.js).
   Not ".cbpb-toast": the admin notifications use that class, and this file
   is loaded on the settings screen for the preview. */
.cbpb-unlock-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 100000;
    max-width: calc(100vw - 32px);
    padding: 11px 20px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font: 600 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.25);
    opacity: 0;
    transform: translate(-50%, 16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.cbpb-unlock-toast.is-in {
    opacity: 1;
    transform: translate(-50%, 0);
}

.cbpb-confetti {
    position: fixed;
    z-index: 99999; /* behind the toast text */
    width: 0;
    height: 0;
    pointer-events: none;
}

.cbpb-confetti i {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    animation: cbpb-confetti 1.2s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes cbpb-confetti {
    0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translate(var(--x), calc(var(--y) + 70px)) rotate(var(--r)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cbpb-almost .cartboost-fill,
    .cbpb-almost .cbpb-steps-line-fill {
        animation: none;
    }
    .cbpb-unlock-toast {
        transition: none;
    }
    .cbpb-confetti {
        display: none;
    }
}

/* Card in narrow spaces: the status parts stack instead of wrapping around
   a lone separator dot. */
@container (max-width: 420px) {
    .cartboost-design-card .cbpb-card-sub {
        flex-direction: column;
        align-items: flex-start;
    }
    .cartboost-design-card .cbpb-sep {
        display: none;
    }
}

/* Screen-reader-only text inside the bar. Not every theme defines WordPress's
   .screen-reader-text, so the bar hides it itself. */
.cartboost-bar-wrap .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
