/* aieo/free-shipping-pdp — bar styling.
 *
 * Reads the same CSS variables that AIEO_DMM_Free_Shipping->enqueue_css_vars()
 * sets at :root from the operator's appearance settings (DMM →
 * Free Shipping Display tab). Falls back to sensible defaults so
 * the bar is always visible even before vars resolve.
 */
.aieo-fs-pdp {
    box-sizing: border-box;
    display: block;
    margin: 12px 0;
    padding: var(--om-fs-card-p, 12px);
    background: var(--om-fs-card-bg, #ffffff);
    border: 1px solid var(--om-fs-card-b, #e0e0e0);
    border-radius: var(--om-fs-card-r, 8px);
    color: var(--om-fs-text, #333);
    font-size: var(--om-fs-font, 14px);
    line-height: 1.4;
}

.aieo-fs-pdp__msg {
    margin: 0 0 8px;
}

.aieo-fs-pdp__msg .amount,
.aieo-fs-pdp__msg .woocommerce-Price-amount {
    color: var(--om-fs-amount, var(--wp--preset--color--accent-text, #bf4300)); /* the theme's (11.3.3); #bf4300 is 5.2:1 on white */
    font-weight: 600;
}

.aieo-fs-pdp--qualified .aieo-fs-pdp__msg {
    color: var(--om-fs-success, var(--aieo-color-success, #2e7d32));
    font-weight: 600;
}

.aieo-fs-pdp__bar {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: var(--om-fs-bar-h, 8px);
    background: var(--om-fs-bar-bg, #e0e0e0);
    border-radius: var(--om-fs-bar-r, 4px);
}

.aieo-fs-pdp__fill {
    display: block;
    height: 100%;
    background: var(--om-fs-bar-fg, #4caf50);
    border-radius: inherit;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.aieo-fs-pdp--qualified .aieo-fs-pdp__fill {
    background: var(--om-fs-success, var(--aieo-color-success, #2e7d32));
}

/* Words on the bar (11.3.5, the owner, 4 Nov 2026: the product page's bar as the side cart draws its own; Side cart >
 * Progress bars, "Words on the bar, centred, in glass", the default since 28 Oct). render.php adds
 * aieo-fs-pdp--on-bar unless the operator chose words above a thin bar. The card loses its frame: the pill is the
 * element. The bar is a pill as tall as the capsule on it, its track the tone's tint; the fill its tone with a soft
 * sheen; the words sit centred on it in a frosted capsule of the page's colour, the fill crisp around it and softened
 * through it. The recipe and its values are the side cart's (assets/css/aieo-side-cart.css, "Progress bars, words on
 * the bar"), restated here because a block's own sheet carries its whole look and the side cart's sheet is not on
 * every page that shows this bar. The tone is the operator's progress colour, else the theme's success; reached, the
 * operator's success colour. The capsule's rim and highlight are white light in both schemes, as the side cart's. */
.aieo-fs-pdp--on-bar {
    --aieo-fs-pdp-tone: var(--om-fs-bar-fg, var(--wp--preset--color--success, #1f7a4a));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    border: 0;
    background: none;
}

.aieo-fs-pdp--on-bar.aieo-fs-pdp--qualified {
    --aieo-fs-pdp-tone: var(--om-fs-success, var(--wp--preset--color--success, #1f7a4a));
}

/* The words and the bar share the one cell. */
.aieo-fs-pdp--on-bar > :is(.aieo-fs-pdp__msg, .aieo-fs-pdp__bar) {
    grid-area: 1 / 1;
}

.aieo-fs-pdp--on-bar .aieo-fs-pdp__bar {
    align-self: stretch;
    height: auto;
    min-height: 24px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--aieo-fs-pdp-tone) 16%, var(--wp--preset--color--bg, #ffffff));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--aieo-fs-pdp-tone) 32%, transparent);
}

.aieo-fs-pdp--on-bar .aieo-fs-pdp__fill,
.aieo-fs-pdp--on-bar.aieo-fs-pdp--qualified .aieo-fs-pdp__fill {
    height: 100%;
    border-radius: inherit;
    background-color: var(--aieo-fs-pdp-tone);
    background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0));
}

.aieo-fs-pdp--on-bar .aieo-fs-pdp__msg,
.aieo-fs-pdp--on-bar.aieo-fs-pdp--qualified .aieo-fs-pdp__msg {
    position: relative;
    z-index: 1;
    justify-self: center;
    align-self: center;
    box-sizing: border-box;
    max-inline-size: calc(100% - 4px);
    margin: 2px;
    padding: 1px 10px;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 999px;
    background: color-mix(in srgb, var(--wp--preset--color--bg, #ffffff) 58%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.6);
    backdrop-filter: blur(10px) saturate(1.6);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.4), 0 1px 3px rgb(0 0 0 / 0.14);
    color: var(--om-fs-text, var(--wp--preset--color--fg, #1a1a1a));
    font-size: var(--wp--preset--font-size--xs, 12px);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

/* On the glass the amount is the words' own ink, as in the side cart: the accent on the fill's tint would not read. */
.aieo-fs-pdp--on-bar .aieo-fs-pdp__msg :is(.amount, .woocommerce-Price-amount) {
    color: inherit;
    font-weight: inherit;
}
