/* aieo/free-shipping-pdp: the free-delivery bar on a product page.
 *
 * The designer's bar, every shop's default since 10 Nov 2026 (the owner: "It ought to be the new default in every
 * site!"): the words first, the threshold at the end of their line in the muted ink, then a thin bar, between two
 * hairlines; reached, the words and the fill in the success colour. Colours, sizes and type come from the theme's
 * tokens through the bar's own properties, unset unless the shop chose a value (Free shipping > Appearance prints
 * them, AIEO_DMM_Free_Shipping::enqueue_css_vars()):
 *   --rooster-free-delivery-ink     the words (the text colour)
 *   --rooster-free-delivery-amount  the amount in the words (inherits the words' colour)
 *   --rooster-free-delivery-track   the bar's track (the line colour)
 *   --rooster-free-delivery-fill    the bar's fill (the text colour)
 *   --rooster-free-delivery-done    the words and the fill once reached (the success colour)
 *   --rooster-free-delivery-rule    the two hairlines (the line colour)
 *   --rooster-free-delivery-bar     the bar's height (3px)
 *   --rooster-free-delivery-radius  the bar's corners (none)
 *   --rooster-free-delivery-size    the words' size (the small step)
 * No colour of our own: every fallback ends in a theme token, then currentColor. */
.aieo-fs-pdp {
	box-sizing: border-box;
	display: grid;
	gap: var(--wp--preset--spacing--2, 0.5rem);
	margin: 0;
	padding-block: var(--wp--preset--spacing--3, 0.75rem);
	border-block: 1px solid var(--rooster-free-delivery-rule, var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent)));
	color: var(--rooster-free-delivery-ink, var(--wp--preset--color--fg, currentColor));
	font-size: var(--rooster-free-delivery-size, var(--wp--preset--font-size--sm, 0.875rem));
	line-height: 1.4;
}

.aieo-fs-pdp__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem var(--wp--preset--spacing--3, 0.75rem);
	margin: 0;
}

.aieo-fs-pdp__msg :is(.amount, .woocommerce-Price-amount) {
	color: var(--rooster-free-delivery-amount, inherit);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.aieo-fs-pdp__goal {
	color: var(--wp--preset--color--muted, color-mix(in srgb, currentColor 70%, transparent));
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.aieo-fs-pdp__goal :is(.amount, .woocommerce-Price-amount) {
	font-weight: inherit;
}

.aieo-fs-pdp--qualified .aieo-fs-pdp__msg {
	color: var(--rooster-free-delivery-done, var(--wp--preset--color--success, currentColor));
	font-weight: 600;
}

.aieo-fs-pdp__bar {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: var(--rooster-free-delivery-bar, 3px);
	border-radius: var(--rooster-free-delivery-radius, 0);
	background: var(--rooster-free-delivery-track, var(--wp--preset--color--line, color-mix(in srgb, currentColor 16%, transparent)));
}

.aieo-fs-pdp__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--rooster-free-delivery-fill, var(--wp--preset--color--fg, currentColor));
	transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.aieo-fs-pdp--qualified .aieo-fs-pdp__fill {
	background: var(--rooster-free-delivery-done, var(--wp--preset--color--success, currentColor));
}

@media (prefers-reduced-motion: reduce) {
	.aieo-fs-pdp__fill {
		transition: none;
	}
}

/* Glass (Side cart > Progress bars, "Words on the bar, in glass"; the owner, 4 Nov 2026): the words sit on the bar,
 * centred, in a frosted capsule of the page's colour, the fill crisp around it and softened through it; no hairlines.
 * The recipe is the side cart's (assets/css/aieo-side-cart.css, "Progress bars, glass"), restated here because a
 * block's own sheet carries its whole look. The tone is the shop's fill, else the theme's success; reached, the shop's
 * success colour. The capsule's rim and highlight are the page's colour, as the side cart's. */
.aieo-fs-pdp--on-bar {
	--aieo-fs-pdp-tone: var(--rooster-free-delivery-fill, var(--wp--preset--color--success, currentColor));
	grid-template-columns: minmax(0, 1fr);
	gap: 0;
	padding: 0;
	border: 0;
}

.aieo-fs-pdp--on-bar.aieo-fs-pdp--qualified {
	--aieo-fs-pdp-tone: var(--rooster-free-delivery-done, var(--wp--preset--color--success, currentColor));
}

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

.aieo-fs-pdp--on-bar .aieo-fs-pdp__goal {
	display: none;
}

.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, Canvas));
	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, color-mix(in srgb, var(--wp--preset--color--bg, Canvas) 22%, transparent), transparent);
}

.aieo-fs-pdp--on-bar .aieo-fs-pdp__head {
	position: relative;
	z-index: 1;
	justify-self: center;
	align-self: center;
	justify-content: center;
}

.aieo-fs-pdp--on-bar .aieo-fs-pdp__msg,
.aieo-fs-pdp--on-bar.aieo-fs-pdp--qualified .aieo-fs-pdp__msg {
	box-sizing: border-box;
	max-inline-size: calc(100% - 4px);
	margin: 2px;
	padding: 1px 10px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--bg, Canvas) 30%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--bg, Canvas) 58%, transparent);
	-webkit-backdrop-filter: blur(10px) saturate(1.6);
	backdrop-filter: blur(10px) saturate(1.6);
	box-shadow: inset 0 1px 0 color-mix(in srgb, var(--wp--preset--color--bg, Canvas) 40%, transparent), var(--wp--preset--shadow--sm, 0 0 transparent);
	color: var(--rooster-free-delivery-ink, var(--wp--preset--color--fg, currentColor));
	font-size: var(--wp--preset--font-size--xs, 0.75rem);
	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;
}
