/**
 * You Save — Quick Badge storefront styles.
 *
 * Two rendering contexts:
 *
 *   Loop  — badge inside .ys-qb-wrap (added by PHP in inject_badge()).
 *   Gallery — badge inside .woocommerce-product-gallery__image (added by
 *             PHP in inject_badge_in_gallery()).  That element gets
 *             position: relative below.
 *
 * Colors are set via inline style="" from PHP; these rules handle layout
 * and positioning only.
 *
 * Pro coexistence (M4.3):
 *   Pro's .thp-yspro-badge-overlay has z-index: 100.  QB badges are at
 *   z-index: 10, intentionally below Pro.  Same-edge collisions (both Top or
 *   both Bottom) are resolved by the CSS :has() rules at the end of this file,
 *   which automatically reposition the QB badge to the opposite edge when Pro
 *   occupies the same position.  Requires Chrome 105+, Safari 15.4+,
 *   Firefox 121+.  Older browsers: Pro paints on top, no QB suppression.
 */

/* ============================================================
   LOOP — positioning container (.ys-qb-wrap)
   ============================================================ */

/*
 * Wraps the WooCommerce product image in the loop to provide a
 * self-contained positioning context for the badge.
 *
 * overflow: hidden — clips badge to image bounds and establishes a
 * stacking context so z-index on .ys-qb-badge is scoped here.
 *
 * line-height: 0 — eliminates the default inline-block gap that would
 * otherwise add whitespace below the <img>.
 *
 * NOTE: No width or height overrides are applied to children.  Theme-defined
 * product image dimensions (set via width/height HTML attributes or CSS) are
 * intentionally preserved.  The wrapper sizes itself to its image content.
 */
.ys-qb-wrap {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
}

/*
 * Remove the inline-block baseline gap on the image without overriding the
 * theme's width/height.  The original Phase 3 rule forced width: 100%;
 * height: auto; which could override theme-defined pixel dimensions.
 */
.ys-qb-wrap img {
	display: block;
	line-height: normal;
}

/* ============================================================
   GALLERY — positioning context
   ============================================================ */

/*
 * Provides the position: relative parent for badges injected inside the
 * WooCommerce product gallery image wrapper on single-product pages.
 *
 * Scoped to .woocommerce-product-gallery to avoid affecting any other
 * element that might carry the same class in a third-party context.
 *
 * overflow is NOT set here — the gallery wrapper must not clip zoom or
 * lightbox UI elements (e.g. WC Zoom attaches to the <a> inside this div).
 */
.woocommerce-product-gallery .woocommerce-product-gallery__image {
	position: relative;
}

/*
 * Positioning context for the gallery ribbon overlay on themes (e.g. Blocksy) whose main
 * gallery image is wrapped in a <figure> rather than .woocommerce-product-gallery__image.
 * Scoped to figures that actually contain our overlay so unrelated figures are untouched.
 */
.woocommerce-product-gallery figure:has(> .ys-qb-runtime),
.woocommerce div.product figure:has(> .ys-qb-runtime),
.woocommerce-product-gallery figure:has(> .ys-qb-gallery-ribbon),
.woocommerce div.product figure:has(> .ys-qb-gallery-ribbon) {
	position: relative;
}

/* ============================================================
   BADGE — shared by loop and gallery
   ============================================================ */

/*
 * In the loop the badge is positioned within .ys-qb-wrap.
 * In the gallery it is positioned within .woocommerce-product-gallery__image.
 */
.ys-qb-badge {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 7px 10px;
	line-height: 1.2;
	pointer-events: none; /* Decorative — must not block product link clicks. */
}

/* Vertical position variants. */
.ys-qb-pos-top {
	top: 0;
}

.ys-qb-pos-bottom {
	bottom: 0;
}

/*
 * On loop-card hover, lower the badge z-index so theme quick-view overlays
 * (which typically use z-index 9–20) can appear above it.
 * Not applied in the gallery (no .ys-qb-wrap ancestor there).
 */
.ys-qb-wrap:hover .ys-qb-badge {
	z-index: 8;
}

/* ============================================================
   BLOCKS — wc-block-components-product-image positioning context
   ============================================================ */

/*
 * Provides the position: relative parent for badges injected inside
 * woocommerce/product-image blocks (woocommerce/product-collection context).
 *
 * The outer element is a <div class="wc-block-components-product-image ...">
 * (verified against WC 11.1.2).  WC Blocks applies aspect-ratio CSS to this
 * element, so overflow: hidden is intentionally omitted — adding it would
 * collapse height on aspect-ratio-constrained images.
 */
.wc-block-components-product-image {
	position: relative;
	/* Establish a size container so badges inside small block cards (e.g. On Sale
	   Products / Product Collection grids with narrow thumbnails) can scale relative
	   to the actual image width instead of a fixed rem. Scoped strictly to the block
	   image wrapper — normal archive/single-product badges are unaffected. */
	container-type: inline-size;
	container-name: ys-qb-img;
}

/* Woo On Sale block only: a confirmed empty <p> artifact inside the ribbon-bearing
   .ys-qb-wrap picks up the theme's paragraph bottom-margin (~28px in Astra), making the
   clip box taller than the visible image so the lower ribbon end escaped below it. Zero
   that empty paragraph's layout contribution so .ys-qb-wrap's height matches the image.
   Narrowly scoped to empty <p> only — Blocksy and other themes pass a real media link
   (e.g. <a class="ct-media-container">) through this wrapper and MUST retain their natural
   dimensions, so arbitrary non-image children are no longer collapsed. */
.ys-qb-wrap:has(.ys-qb-design-corner-ribbon) > p:empty {
	margin: 0;
	padding: 0;
	height: 0;
	min-height: 0;
	line-height: 0;
	overflow: hidden;
}

/* Classic Shop/archive only: Astra sets `ul.products li.product a img { margin-bottom: 0.8em }`
   (~12.8px). Because .ys-qb-wrap shrink-wraps its content, that bottom margin is counted in the
   wrapper height, so the ribbon-bearing wrap is ~12.8px taller than the visible image and the
   lower ribbon end is clipped against the taller box instead of the image edge. Zero the margin
   on the direct <img> ONLY inside a ribbon-bearing wrap so the clip rectangle equals the image,
   then re-add the identical spacing BELOW the wrapper (outside the clip context) to preserve grid
   spacing. Scoped to ribbon wraps + their direct img — Clean Pill, Outline, Single Product, Woo
   blocks and the On Sale block (wrapper already equals image) are untouched. */
.woocommerce ul.products li.product a .ys-qb-wrap:has(.ys-qb-design-corner-ribbon) > img,
.woocommerce-page ul.products li.product a .ys-qb-wrap:has(.ys-qb-design-corner-ribbon) > img {
	margin-bottom: 0;
}

.woocommerce ul.products li.product a .ys-qb-wrap:has(.ys-qb-design-corner-ribbon),
.woocommerce-page ul.products li.product a .ys-qb-wrap:has(.ys-qb-design-corner-ribbon) {
	margin-bottom: 0.8em;
}

/* Scale corner-design badges proportionally to the block image width. Only engages
   when the card is narrow; wide images keep the normal rem-based size via max().
   Limited to the corner designs used by Quick Badge Pro types (Clean Pill, Outline,
   Ribbon Tag) so Free horizontal-strip badges are untouched. */
@container ys-qb-img (max-width: 220px) {
	.wc-block-components-product-image .ys-qb-design-clean-pill,
	.wc-block-components-product-image .ys-qb-design-outline {
		font-size: max(0.5rem, 5.2cqi);
		padding: max(2px, 1.6cqi) max(6px, 3.4cqi);
	}
	/* Ribbon geometry is percentage-based (scales with the image already); only its
	   text size needs the container-query bump. Vertical band thickness stays em-based. */
	.wc-block-components-product-image .ys-qb-design-corner-ribbon {
		font-size: max(0.5rem, 5.2cqi);
	}
}

/* ============================================================
   PRO COEXISTENCE — M4.3 same-edge collision prevention
   ============================================================ */

/*
 * When Pro Savings Badge and Quick Badge are configured to the same vertical
 * edge, the QB badge is repositioned to the opposite edge via CSS :has().
 *
 * Detection relies on Pro's badge-position modifier classes:
 *   Top:    .thp-yspro-badge-slanted-topleft / topright / horizontal-top
 *   Bottom: .thp-yspro-badge-slanted-bottomleft / bottomright / horizontal-bottom
 *
 * Loop context (Astra theme):
 *   Both Pro overlay and QB-wrapped image are siblings inside
 *   .astra-shop-thumbnail-wrap.  The :has() selector reaches into the wrapper.
 *
 * Gallery context (single-product page):
 *   QB badge is inside .woocommerce-product-gallery__image.  Pro badge is
 *   appended as a subsequent sibling of that element (Pro at priority 10,
 *   QB at priority 15).  The :has(~ ...) relative selector detects this.
 *
 * Move QB, never Pro — preserves existing merchant Pro configuration.
 * No JavaScript required; no layout shift after paint.
 * Blocks context excluded: Pro's woocommerce_sale_flash hook does not fire
 * for WC Blocks React-rendered product cards, so no collision exists there.
 *
 * Browser support: Chrome 105+, Safari 15.4+, Firefox 121+.
 * Older browsers: badges overlap; Pro (z-index 100) paints above QB (z-index 10).
 */

/* ---- Loop — Pro top badge → QB top moves to bottom ---- */
/*
 * Two selectors: Astra theme (astra-shop-thumbnail-wrap wraps both badges
 * as siblings) and the standard WC product card (li.product) for other themes.
 * Both resolve to the same QB badge inside the same product card.
 */
.astra-shop-thumbnail-wrap:has(
	.thp-yspro-badge-slanted-topleft,
	.thp-yspro-badge-slanted-topright,
	.thp-yspro-badge-horizontal-top
) .ys-qb-badge.ys-qb-pos-top,
li.product:has(
	.thp-yspro-badge-slanted-topleft,
	.thp-yspro-badge-slanted-topright,
	.thp-yspro-badge-horizontal-top
) .ys-qb-badge.ys-qb-pos-top {
	top: auto;
	bottom: 0;
}

/* ---- Loop — Pro bottom badge → QB bottom moves to top ---- */
.astra-shop-thumbnail-wrap:has(
	.thp-yspro-badge-slanted-bottomleft,
	.thp-yspro-badge-slanted-bottomright,
	.thp-yspro-badge-horizontal-bottom
) .ys-qb-badge.ys-qb-pos-bottom,
li.product:has(
	.thp-yspro-badge-slanted-bottomleft,
	.thp-yspro-badge-slanted-bottomright,
	.thp-yspro-badge-horizontal-bottom
) .ys-qb-badge.ys-qb-pos-bottom {
	bottom: auto;
	top: 0;
}

/* ---- Gallery — Pro top (sibling) → QB top moves to bottom ---- */
.woocommerce-product-gallery__image:has(
	~ .thp-yspro-badge-overlay .thp-yspro-badge-slanted-topleft,
	~ .thp-yspro-badge-overlay .thp-yspro-badge-slanted-topright,
	~ .thp-yspro-badge-overlay .thp-yspro-badge-horizontal-top
) .ys-qb-badge.ys-qb-pos-top {
	top: auto;
	bottom: 0;
}

/* ---- Gallery — Pro bottom (sibling) → QB bottom moves to top ---- */
.woocommerce-product-gallery__image:has(
	~ .thp-yspro-badge-overlay .thp-yspro-badge-slanted-bottomleft,
	~ .thp-yspro-badge-overlay .thp-yspro-badge-slanted-bottomright,
	~ .thp-yspro-badge-overlay .thp-yspro-badge-horizontal-bottom
) .ys-qb-badge.ys-qb-pos-bottom {
	bottom: auto;
	top: 0;
}

/* ============================================================
   PRO DESIGNS (M4.4)
   ============================================================ */

/* SVG icon inside Pro type badges. */
.ys-qb-badge-icon {
	width: 0.9em;
	height: 0.9em;
	vertical-align: middle;
	flex-shrink: 0;
}

/* ---- Clean Pill ----
 * Pill-shaped badge anchored to a corner of the image.
 * Overrides the base .ys-qb-badge full-width stretch (left:0;right:0) to
 * auto-width.  top:8px is intentionally set here as a safe default so the
 * badge is never invisible: .ys-qb-badge has no top, and if the corner-
 * specific rules haven't loaded yet (first-paint / stale cache), the badge
 * would land at its static-position Y (after the image content) and be
 * clipped by overflow:hidden on .ys-qb-wrap.  Starburst, Outline and Premium
 * avoid this because their design classes each hardcode top:8px; Clean Pill
 * resets both horizontal edges to auto so it must also carry the vertical
 * anchor.  The pos-bottom and bottom-corner two-class rules below override
 * this with top:auto when the badge should appear at the bottom edge.
 */
.ys-qb-design-clean-pill {
	width: auto;
	left: auto;
	right: auto;
	top: 8px;
	border-radius: 100px;
	padding: 5px 12px;
	gap: 5px;
	text-transform: none;
	font-size: 0.8rem;
}

.ys-qb-design-clean-pill.ys-qb-pos-top {
	top: 8px;
	left: 50%;
	right: auto;
	transform: translateX(-50%);
}

.ys-qb-design-clean-pill.ys-qb-pos-bottom {
	bottom: 8px;
	left: 50%;
	right: auto;
	top: auto;
	transform: translateX(-50%);
}

/* Clean Pill corner variants (specificity 0-2-0 — overrides the base .ys-qb-design-clean-pill
 * left:auto;right:auto reset that would otherwise cancel the generic corner class offsets). */
.ys-qb-design-clean-pill.ys-qb-pos-top_left {
	top: 8px;
	left: 8px;
	right: auto;
	bottom: auto;
}

.ys-qb-design-clean-pill.ys-qb-pos-top_right {
	top: 8px;
	right: 8px;
	left: auto;
	bottom: auto;
}

.ys-qb-design-clean-pill.ys-qb-pos-bottom_left {
	bottom: 8px;
	left: 8px;
	right: auto;
	top: auto;
}

.ys-qb-design-clean-pill.ys-qb-pos-bottom_right {
	bottom: 8px;
	right: 8px;
	left: auto;
	top: auto;
}

/* ---- Corner Ribbon ----
 * The single-class rule sets the default top-left geometry.  Two-class rules
 * (0,2,0) below override the generic .ys-qb-pos-* corner classes (0,1,0) so
 * each corner gets the correct rotation and anchor offsets.  Top and Bottom
 * positions are not supported for Corner Ribbon; the position select is
 * restricted to corner positions in the builder (PHP + JS). */
/* Diagonal corner ribbon — enters one image edge, crosses the corner, exits the
 * adjacent edge, with BOTH ends sliced off by the image wrapper's overflow:hidden.
 *
 * Geometry (top-left, mirrored for the other corners): the band's CENTRE is pinned
 * exactly on the corner diagonal at 20% in from the corner, via
 * `top/left:20% + translate(-50%,-50%)` — translate-centering keeps the centre on the
 * diagonal independent of the band's own height (an earlier top-edge offset pushed the
 * centre off-diagonal, so one end reached its edge while the other floated). A 45° line
 * through (20%,20%) meets the two adjacent edges ~28% out along the band; width:66%
 * (half-length 33% > 28%) makes BOTH ends overshoot, so the WRAPPER slices both ends
 * exactly at the two edges — no free end-cap. Every offset is a percentage of the image
 * wrapper, so the proportions hold at every size: design thumbnail, live preview
 * (Desktop/Tablet/Mobile) and storefront. overflow:visible lets the full coloured band
 * show; only the text is centred/clipped for long messages. Thickness (padding/width) is
 * PO-approved and unchanged. Colours come from the inline style (--ys-qb-accent / vars). */
.ys-qb-design-corner-ribbon {
	left: auto;
	right: auto;
	top: auto;
	bottom: auto;
	width: 66%;
	box-sizing: border-box;
	border-radius: 0;
	padding: 0.4em 0;
	justify-content: center;
	text-align: center;
	white-space: nowrap;
	overflow: visible;
}

.ys-qb-design-corner-ribbon.ys-qb-pos-top_left {
	top: 20%;
	left: 20%;
	transform: translate(-50%, -50%) rotate(-45deg);
	transform-origin: center;
}

.ys-qb-design-corner-ribbon.ys-qb-pos-top_right {
	top: 20%;
	right: 20%;
	transform: translate(50%, -50%) rotate(45deg);
	transform-origin: center;
}

.ys-qb-design-corner-ribbon.ys-qb-pos-bottom_left {
	bottom: 20%;
	left: 20%;
	transform: translate(-50%, 50%) rotate(45deg);
	transform-origin: center;
}

.ys-qb-design-corner-ribbon.ys-qb-pos-bottom_right {
	bottom: 20%;
	right: 20%;
	transform: translate(50%, 50%) rotate(-45deg);
	transform-origin: center;
}

/* ------------------------------------------------------------
   Ribbon Tag — minimum-size guard (container-aware)
   ------------------------------------------------------------
 * Ribbon Tag requires ~115px of image/container width to render at its approved
 * proportions with readable text (below that, matching the normal band/font ratios
 * would force ~4.7px text). Auxiliary thumbnails such as Storefront's previous/next
 * product pagination (~90-112px) are too small. Below the supported minimum, hide the
 * Ribbon Tag ONLY — the native image and Clean Pill / Outline are untouched.
 *
 * The size container is a dedicated, zero-impact inner wrapper (.ys-qb-ribbon-guard)
 * that holds only the ribbon, so containment never touches the <img> or .ys-qb-wrap
 * box (making .ys-qb-wrap itself a container previously collapsed Storefront's image).
 * The guard element has no size of its own (inset:0 overlay), so it inherits the
 * image's rendered width, letting @container key off the actual small context rather
 * than the viewport. */
.ys-qb-ribbon-guard {
	position: absolute;
	inset: 0;
	pointer-events: none;
	container-type: inline-size;
	container-name: ys-qb-ribbon-guard;
}

@container ys-qb-ribbon-guard (max-width: 114px) {
	.ys-qb-design-corner-ribbon {
		display: none;
	}
}

/* ============================================================
   SINGLE-PRODUCT GALLERY — corner-ribbon square positioning frame
   ============================================================ */

/*
 * On single-product galleries the image container belongs to the theme (a <div> in
 * standard WC, a <figure> in Blocksy) and the image may be portrait/landscape. The
 * corner-ribbon geometry is percentage-based and assumes a SQUARE positioning context,
 * so on a non-square image a percentage box would skew the diagonal and the ends would
 * not meet the corner edges.
 *
 * The overlay (.ys-qb-gallery-ribbon) stretches to the full image rectangle and clips,
 * so the clipping boundary equals the visible image. The inner square frame sizes to the
 * image's SHORTER side (min of width/height) via aspect-ratio + max constraints and pins
 * to the selected corner, giving the ribbon the square coordinate system its approved
 * geometry needs — without resizing or cropping the product image itself.
 */
.ys-qb-gallery-ribbon {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 10;
}

.ys-qb-gallery-ribbon__frame {
	position: absolute;
	/* Square frame sized to the container's SHORTER side, so the diagonal is a true 45°
	   and both ends reach the corner edges regardless of image orientation:
	   - portrait  (H > W): width:100% wins, aspect-ratio keeps height = width  → W×W
	   - landscape (W > H): max-height:100% caps height, aspect-ratio keeps width = height → H×H
	   The ribbon's percentage offsets resolve against THIS square box. */
	width: 100%;
	max-height: 100%;
	aspect-ratio: 1 / 1;
}

/* Pin the square frame to the ribbon's selected corner so the diagonal sits in that
   corner of the (possibly non-square) image. */
.ys-qb-gallery-ribbon__frame--top_left {
	top: 0;
	left: 0;
}

.ys-qb-gallery-ribbon__frame--top_right {
	top: 0;
	right: 0;
}

.ys-qb-gallery-ribbon__frame--bottom_left {
	bottom: 0;
	left: 0;
}

.ys-qb-gallery-ribbon__frame--bottom_right {
	bottom: 0;
	right: 0;
}

/* ---- Starburst ---- */
.ys-qb-design-starburst {
	width: 52px;
	height: 52px;
	left: 8px;
	right: auto;
	top: 8px;
	border-radius: 50%;
	clip-path: polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
	font-size: 0.6rem;
	text-align: center;
	padding: 4px;
}

/* ---- Outline ----
 * Custom-Text-only design (no Free type emits bare ys-qb-design-outline — Free uses
 * ys-qb-clearance-outline / ys-qb-sp-outline). The presentation background color is
 * supplied as --ys-qb-accent so the outline/border + a light tint of the fill derive
 * from it, while remaining a transparent outline treatment (not a filled pill). Text
 * color still comes from the inline `color`. Falls back to currentColor when the
 * accent property is absent. */
.ys-qb-design-outline {
	width: auto;
	left: 8px;
	right: auto;
	top: 8px;
	border-radius: 4px;
	padding: 4px 10px;
	border: 2px solid var(--ys-qb-accent, currentColor);
	/* Light wash derived from the accent; keeps text readable and the badge legible
	   over busy product images. Falls back to the prior neutral wash when either the
	   accent property or color-mix() is unavailable. */
	background: rgba(0,0,0,0.05) !important;
}
.ys-qb-design-outline[style*="--ys-qb-accent"] {
	background: color-mix(in srgb, var(--ys-qb-accent) 12%, transparent) !important;
}

/* ---- Premium ---- */
.ys-qb-design-premium {
	width: auto;
	left: 8px;
	right: auto;
	top: 8px;
	border-radius: 4px;
	padding: 6px 14px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.20);
	font-size: 0.7rem;
	letter-spacing: 0.10em;
}

/*
 * Compact Pro designs at plain bottom position.
 *
 * Problem: .ys-qb-design-{name} sets top:8px; .ys-qb-pos-bottom sets bottom:0.
 * Both selectors share specificity (0,1,0) but design rules appear later in the
 * sheet, so top:8px + bottom:0 = badge stretches full image height.
 *
 * Fix: two-class rules (specificity 0,2,0) reset top:auto so the badge sits
 * flush to the bottom edge.  Clean Pill already has its own two-class rule.
 * Corner variants (.ys-qb-pos-bottom_left / bottom_right) already include
 * top:auto so they are unaffected.
 */
.ys-qb-design-starburst.ys-qb-pos-bottom,
.ys-qb-design-outline.ys-qb-pos-bottom,
.ys-qb-design-premium.ys-qb-pos-bottom {
	top: auto;
	bottom: 8px;
	left: 50%;
	right: auto;
	transform: translateX(-50%);
}

/* Center compact Pro designs at plain top position.
 * The single-class design rules above set left:8px; these two-class rules
 * (0,2,0) override that to horizontally center without changing the width. */
.ys-qb-design-starburst.ys-qb-pos-top,
.ys-qb-design-outline.ys-qb-pos-top,
.ys-qb-design-premium.ys-qb-pos-top {
	left: 50%;
	right: auto;
	transform: translateX(-50%);
}

/*
 * Corner position variants — placed AFTER all single-class design rules so that
 * these single-class corner rules take precedence over the hardcoded left:8px /
 * right:auto values found in Starburst, Outline and Premium.  Clean Pill corner
 * positions are handled by the higher-specificity two-class rules above; the
 * generic classes here serve Starburst, Outline and Premium.
 *
 * width is intentionally omitted: each design class already declares its own
 * width (52px for Starburst, auto for others) and that declaration remains
 * unaffected.  Adjusting left/right is sufficient to anchor the badge correctly.
 *
 * The Horizontal Strip renderer always outputs ys-qb-pos-top or ys-qb-pos-bottom
 * (never a corner class), so horizontal-strip badges are unaffected.
 */
.ys-qb-pos-top_left {
	top: 8px;
	left: 8px;
	right: auto;
	bottom: auto;
}

.ys-qb-pos-top_right {
	top: 8px;
	right: 8px;
	left: auto;
	bottom: auto;
}

.ys-qb-pos-bottom_left {
	bottom: 8px;
	left: 8px;
	right: auto;
	top: auto;
}

.ys-qb-pos-bottom_right {
	bottom: 8px;
	right: 8px;
	left: auto;
	top: auto;
}

/* ---- Countdown badge elements ---- */
.ys-qb-countdown-prefix {
	font-weight: 400;
	font-size: 0.75em;
	opacity: 0.9;
	letter-spacing: 0;
}

.ys-qb-countdown-timer {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
}

/* =========================================================================
   Quick Badge rotation (M4.5)
   =========================================================================
   PHP renders all same-priority candidates as siblings.  Only one is visible
   at a time; the JS controller (ys-qb-rotation.js) cycles the active class
   on a 3-second interval.  Transition fades between rotations.
   ========================================================================= */

.ys-qb-rotation-slot {
	display: none;
}

.ys-qb-rotation-slot.ys-qb-rotation-active {
	display: flex;
}

/* ============================================================
   FREE QB v2 DESIGNS — Phase 4 (9 designs)
   ============================================================ */

/*
 * Disc icon container — shared by clearance_premium and na_circle_icon.
 * Colors set via inline style from PHP.
 */
.ys-qbc-disc {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* Plain icon wrapper — aligns inline SVGs inside pill badges. */
.ys-qbc-icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 0;
}

/*
 * Shared base for all 9 Phase 4 pill/circle designs.
 *
 * The storefront .ys-qb-badge base sets left:0;right:0 (full-width strip
 * behaviour).  All Phase 4 designs are compact corner badges, so we reset
 * to auto-width.  The .ys-qb-pos-* corner classes supply actual offsets
 * and already set the unused edge to auto.
 */
.ys-qb-clearance-premium,
.ys-qb-clearance-clean-pill,
.ys-qb-clearance-outline,
.ys-qb-na-circle-icon,
.ys-qb-na-star-icon,
.ys-qb-na-clean-pill,
.ys-qb-sp-star-pill,
.ys-qb-sp-outline,
.ys-qb-sp-circle {
	width: auto;
	gap: 5px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0.03em;
	padding: 5px 10px 5px 7px;
	border-radius: 20px;
}

/* Clearance Premium — gradient pill with disc; reduced left padding for the disc. */
.ys-qb-clearance-premium {
	padding: 4px 12px 4px 5px;
}

/* Staff Pick Star Pill — pill with slightly rounded corner. */
.ys-qb-sp-star-pill {
	border-radius: 6px;
}

/*
 * Staff Pick Circle — 44 × 44 px circular badge, stacks icon above text.
 */
.ys-qb-sp-circle {
	border-radius: 50%;
	width: 44px;
	height: 44px;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	padding: 4px;
	font-size: 0.6rem;
	letter-spacing: 0;
}

/*
 * Bottom-position top-reset for Phase 4 compact designs.
 *
 * The shared base above doesn't set top, so without this rule a bottom_left
 * or bottom_right positioned badge would have top at its static paint position
 * (bottom of the image content) and potentially be invisible or clipped.
 * Clearing top:auto pins the badge to bottom:8px as intended.
 *
 * Not needed for top_left/top_right since top:8px is already set by the
 * corner class and there is no competing top from a shared base.
 */
.ys-qb-clearance-premium.ys-qb-pos-bottom_left,
.ys-qb-clearance-premium.ys-qb-pos-bottom_right,
.ys-qb-clearance-clean-pill.ys-qb-pos-bottom_left,
.ys-qb-clearance-clean-pill.ys-qb-pos-bottom_right,
.ys-qb-clearance-outline.ys-qb-pos-bottom_left,
.ys-qb-clearance-outline.ys-qb-pos-bottom_right,
.ys-qb-na-circle-icon.ys-qb-pos-bottom_left,
.ys-qb-na-circle-icon.ys-qb-pos-bottom_right,
.ys-qb-na-star-icon.ys-qb-pos-bottom_left,
.ys-qb-na-star-icon.ys-qb-pos-bottom_right,
.ys-qb-na-clean-pill.ys-qb-pos-bottom_left,
.ys-qb-na-clean-pill.ys-qb-pos-bottom_right,
.ys-qb-sp-star-pill.ys-qb-pos-bottom_left,
.ys-qb-sp-star-pill.ys-qb-pos-bottom_right,
.ys-qb-sp-outline.ys-qb-pos-bottom_left,
.ys-qb-sp-outline.ys-qb-pos-bottom_right,
.ys-qb-sp-circle.ys-qb-pos-bottom_left,
.ys-qb-sp-circle.ys-qb-pos-bottom_right {
	top: auto;
}
