/**
 * Promotional Visuals — frontend stylesheet.
 *
 * Renderers set --vis-* CSS custom properties on the wrapper; this stylesheet
 * styles each template's distinctive shape. Honors prefers-reduced-motion for
 * the optional animations.
 */

.wsscd-visual {
	display: inline-block;
	background: var(--vis-bg, #d63638);
	color: var(--vis-text, #fff);
	font-weight: var(--vis-weight, 700);
	font-size: var(--vis-size, 13px);
	box-shadow: var(--vis-shadow, none);
	border-radius: var(--vis-radius);
	padding: var(--vis-pad, 5px 10px);
	line-height: 1.2;
}

/* Icon inside any visual — sized relative to the text. SVG uses
 * currentColor so it inherits the visual's text color. */
.wsscd-visual--has-icon {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.wsscd-visual__icon {
	display: inline-flex;
	align-items: center;
	width: 1em;
	height: 1em;
	flex-shrink: 0;
	/* SVGs use stroke="currentColor" / fill="currentColor"; this rule lets
	   the merchant override the inherited text color via the optional
	   `icon_color` schema field (writes --vis-icon-color on the wrapper).
	   Empty / unset → falls through to currentColor (text color). */
	color: var(--vis-icon-color, currentColor);
}

.wsscd-visual__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* -------------------------------------------------- Image badges */

.wsscd-visual--image-badge {
	position: absolute;
	z-index: 5;
	/* Merchant-controlled border via schema border_width / border_color.
	   Default width is 0 → no visible border unless the merchant opts in. */
	border: var(--vis-border-w, 0) var(--vis-border-style, solid) var(--vis-border-color, currentColor);
}

/*
 * Position is selected via a real modifier class instead of a `[style*=...]`
 * attribute substring match. JS sets the class with element.classList; the
 * server emits the same class in the partial. Both paths agree, so the
 * designer's live preview no longer drops the anchor while the debounced
 * server pass is in flight.
 */
.wsscd-visual--image-badge.wsscd-visual--pos-tr { top: 10px; right: 10px; }
.wsscd-visual--image-badge.wsscd-visual--pos-tl { top: 10px; left: 10px; }
.wsscd-visual--image-badge.wsscd-visual--pos-br { bottom: 10px; right: 10px; }
.wsscd-visual--image-badge.wsscd-visual--pos-bl { bottom: 10px; left: 10px; }

/*
 * Image-badge structural modifiers — orthogonal axes (cutout, fill, width)
 * compose freely as separate modifier classes on the wrapper.
 */

/* Ribbon tail — deeper V-notch on the right edge so the flag shape is
   actually recognizable at typical badge sizes. */
.wsscd-visual--cutout-ribbon_tail {
	clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%);
	padding-right: 18px;
}

/* Corner cut — clips ONE top-right corner off a rectangle. Five vertices,
   not three (three vertices clips the whole badge into a triangle and the
   text overflows). */
.wsscd-visual--cutout-corner_diagonal {
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

/* Tag notch — pointed left edge plus a small circular "punch" hole that
   reads as a price-tag string-hole. The hole rides the badge's text
   color at low opacity so it stays visible on light / dark fills alike. */
.wsscd-visual--cutout-tag_notch {
	clip-path: polygon(0 50%, 8% 0, 100% 0, 100% 100%, 8% 100%);
	padding-left: 16px;
}
.wsscd-visual--cutout-tag_notch::before {
	content: '';
	position: absolute;
	left: 4px;
	top: 50%;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.5;
	transform: translateY(-50%);
}

/* Starburst — a spiky sale "seal". 16-point clip-path star; the badge is
   forced square and centered so short copy (e.g. "20% OFF") sits inside the
   spikes, with generous padding keeping text clear of the points. */
.wsscd-visual--image-badge.wsscd-visual--cutout-starburst {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 1.25em;
	border-radius: 0;
	text-align: center;
	line-height: 1.05;
	clip-path: polygon(
		100% 50%, 90.2% 42%, 96.2% 30.8%, 84.1% 27.2%, 85.4% 14.6%,
		72.8% 15.9%, 69.2% 3.8%, 58% 9.8%, 50% 0, 42% 9.8%,
		30.8% 3.8%, 27.2% 15.9%, 14.6% 14.6%, 15.9% 27.2%, 3.8% 30.8%,
		9.8% 42%, 0 50%, 9.8% 58%, 3.8% 69.2%, 15.9% 72.8%,
		14.6% 85.4%, 27.2% 84.1%, 30.8% 96.2%, 42% 90.2%, 50% 100%,
		58% 90.2%, 69.2% 96.2%, 72.8% 84.1%, 85.4% 85.4%, 84.1% 72.8%,
		96.2% 69.2%, 90.2% 58%
	);
}

/* Circle stamp — round badge with a faint inner ring for a "rubber stamp"
   feel. Square aspect + centered text keeps the circle a circle. */
.wsscd-visual--image-badge.wsscd-visual--cutout-circle_stamp {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	padding: 0.9em;
	border-radius: 50%;
	text-align: center;
	line-height: 1.1;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

/* Outline fill — text + border take the merchant's bg_color choice; the
   fill becomes transparent. Stacks with any cutout / width / corner.
   Double-class selector lifts specificity above `.wsscd-visual` and any
   single-class theme override, so we avoid `!important` while still
   reliably winning the cascade. */
.wsscd-visual.wsscd-visual--fill-outline {
	background: transparent;
	color: var(--vis-bg, #d63638);
	border: 1.5px solid var(--vis-bg, #d63638);
}

/* Full-width strip — keeps --vis-pad so the Padding control still applies.
   `left: 0; right: 0; width: auto;` nullifies the corner-position offsets
   (top:10px right:10px etc.) so the banner spans the container edge-to-edge
   instead of overflowing by the offset amount. Top/bottom anchoring still
   honors the merchant's `position` pick. */
.wsscd-visual--image-badge.wsscd-visual--width-full {
	display: block;
	left: 0;
	right: 0;
	width: auto;
	background-image: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.08) 100%);
}

/* ----------------------------------------------------- Animations
 *
 * Each animation's duration multiplies the merchant's `animation_speed`
 * choice (--vis-anim-speed: 0.5 fast | 1 normal | 1.5 slow) against the
 * animation's natural base duration via `calc()`.
 */

@keyframes wsscd-visual-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.05); }
}

@keyframes wsscd-visual-shake {
	0%, 100% { transform: translateX(0); }
	25%      { transform: translateX(-2px); }
	75%      { transform: translateX(2px); }
}

@keyframes wsscd-visual-sweep {
	0%   { background-position: -100% 0; }
	100% { background-position: 200% 0; }
}

@keyframes wsscd-visual-slide {
	0%, 100% { transform: translateX(0); }
	50%      { transform: translateX(4px); }
}

@keyframes wsscd-visual-fade {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.55; }
}

.wsscd-visual--anim-pulse { animation: wsscd-visual-pulse calc(1.6s * var(--vis-anim-speed, 1)) ease-in-out infinite; }
.wsscd-visual--anim-shake { animation: wsscd-visual-shake calc(0.6s * var(--vis-anim-speed, 1)) ease-in-out infinite; }
.wsscd-visual--anim-sweep {
	animation: wsscd-visual-sweep calc(2.5s * var(--vis-anim-speed, 1)) linear infinite;
	background-size: 200% 100%;
}
.wsscd-visual--anim-slide { animation: wsscd-visual-slide calc(1.8s * var(--vis-anim-speed, 1)) ease-in-out infinite; }
.wsscd-visual--anim-fade  { animation: wsscd-visual-fade  calc(2s   * var(--vis-anim-speed, 1)) ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
	.wsscd-visual--anim-pulse,
	.wsscd-visual--anim-shake,
	.wsscd-visual--anim-sweep,
	.wsscd-visual--anim-slide,
	.wsscd-visual--anim-fade {
		animation: none;
	}
}

/* ------------------------------------------------- Summary badges */

.wsscd-visual--summary-badge {
	background: transparent;
	color: inherit;
	box-shadow: none;
	padding: 0;
	border: var(--vis-border-w, 0) var(--vis-border-style, solid) var(--vis-border-color, currentColor);
}

.wsscd-visual--summary-badge.wsscd-visual--layout-highlighted_row {
	display: flex;
	justify-content: space-between;
	background: var(--vis-bg, #d63638);
	/* Hex fallback — frontend doesn't load theme-colors. */
	color: var(--wsscd-color-white, #fff);
	padding: 8px 12px;
	margin: 6px 0;
	border-radius: var(--wsscd-radius-sm);
}

/* Right-anchor the amount so the partial can skip empty label spans. */
.wsscd-visual--summary-badge.wsscd-visual--layout-highlighted_row .wsscd-visual__amount {
	margin-left: auto;
}

.wsscd-visual--summary-badge.wsscd-visual--layout-inline_pill {
	display: inline-flex;
	gap: 6px;
	background: var(--vis-bg, #d63638);
	color: var(--wsscd-color-white, #fff);
	border-radius: var(--wsscd-radius-pill);
	padding: 2px 10px;
	font-size: 11px;
}

.wsscd-visual--summary-badge.wsscd-visual--layout-side_note {
	color: var(--vis-color, #d63638);
	font-style: italic;
	font-size: 12px;
	padding-left: 10px;
	border-left: 2px solid var(--vis-color, #d63638);
}

.wsscd-visual--summary-badge.wsscd-visual--layout-strikethrough .wsscd-visual__amount {
	text-decoration: line-through;
	color: var(--vis-color, #d63638);
}

/* Density — compact shrinks padding + font on the row/pill variants. */
.wsscd-visual--summary-badge.wsscd-visual--density-compact.wsscd-visual--layout-highlighted_row {
	padding: 4px 8px;
	font-size: 12px;
}
.wsscd-visual--summary-badge.wsscd-visual--density-compact.wsscd-visual--layout-inline_pill {
	padding: 1px 8px;
	font-size: 10px;
}
.wsscd-visual--summary-badge.wsscd-visual--density-compact.wsscd-visual--layout-side_note,
.wsscd-visual--summary-badge.wsscd-visual--density-compact.wsscd-visual--layout-strikethrough {
	font-size: 11px;
}

/* ----------------------------------------------------- Tier panel */

.wsscd-visual--tier-panel {
	display: block;
	background: var(--vis-bg, #fff);
	color: var(--vis-text, #1d2327);
	padding: var(--vis-pad, 14px 16px);
	border: var(--vis-border-w, 1px) var(--vis-border-style, solid) var(--vis-border-color, #dcdcde);
	border-radius: var(--vis-radius);
	box-shadow: none;
}

.wsscd-visual--tier-panel .wsscd-visual__header {
	margin: 0 0 6px;
	font-size: var(--vis-header-size, 14px);
	font-weight: 600;
}

/* Header alignment — driven by a modifier class so the partial markup is
   identical across templates; only the `text-align` differs. */
/* Header / footer alignment — type-agnostic. Any visual carrying a
   `.wsscd-visual--header-align-{X}` modifier aligns its header (and
   footer, when present) accordingly. */
.wsscd-visual--header-align-left   .wsscd-visual__header,
.wsscd-visual--header-align-left   .wsscd-visual__footer { text-align: left; }
.wsscd-visual--header-align-center .wsscd-visual__header,
.wsscd-visual--header-align-center .wsscd-visual__footer { text-align: center; }
.wsscd-visual--header-align-right  .wsscd-visual__header,
.wsscd-visual--header-align-right  .wsscd-visual__footer { text-align: right; }

/* Footer note — secondary copy beneath the tiers. Lighter weight, subdued
   color so it doesn't compete with tier rows. */
.wsscd-visual--tier-panel .wsscd-visual__footer {
	margin: 6px 0 0;
	font-size: 11px;
	opacity: 0.75;
}

.wsscd-visual--tier-panel .wsscd-visual__tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wsscd-visual--tier-panel.wsscd-visual--layout-pills .wsscd-visual__tier {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	/* `flex: 1 1 130px` lets pills fill row evenly — never leaves an orphan
	   pill alone on a wrap row. Fits on one row when there's space; wraps
	   to balanced multi-row when there isn't; stacks one-per-row in very
	   narrow contexts. Each row's pills always share the row's full width. */
	flex: 1 1 130px;
	padding: 6px 12px;
	border-radius: var(--wsscd-radius-pill);
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
}

/* Inactive-only fill; lets the `--active` modifier win without a specificity battle. */
.wsscd-visual--tier-panel.wsscd-visual--layout-pills .wsscd-visual__tier:not(.wsscd-visual__tier--active) {
	background: rgba( 0, 0, 0, 0.06 );
	color: inherit;
}

/* Subtle separator between qty and discount inside each pill so the two
   values read as a labelled pair rather than a smushed compound. */
.wsscd-visual--tier-panel.wsscd-visual--layout-pills .wsscd-visual__tier-pct::before {
	content: '·';
	margin-right: 6px;
	opacity: 0.45;
	font-weight: 700;
}

.wsscd-visual--tier-panel .wsscd-visual__tier--active {
	background: var(--vis-accent, #2271b1);
	color: var(--vis-active-text, #fff);
	font-weight: 700;
}

/* Next-to-unlock tier — a quiet dashed outline in the accent color marks the
   shopper's immediate goal, distinct from the solid-filled active tier. Uses
   box-shadow (not border) so it never shifts layout between states. The pills
   layout overrides the inactive-fill background so the outline reads. */
.wsscd-visual--tier-panel .wsscd-visual__tier--next:not(.wsscd-visual__tier--active) {
	box-shadow: inset 0 0 0 1.5px color-mix( in srgb, var(--vis-accent, #2271b1) 55%, transparent );
}
.wsscd-visual--tier-panel.wsscd-visual--layout-pills .wsscd-visual__tier--next:not(.wsscd-visual__tier--active) {
	background: color-mix( in srgb, var(--vis-accent, #2271b1) 10%, transparent );
}
/* compact_table cells carry their own backgrounds, so paint the outline on the
   row's cells and lift the zebra stripe underneath it. */
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier--next:not(.wsscd-visual__tier--active) > * {
	background: color-mix( in srgb, var(--vis-accent, #2271b1) 9%, transparent );
}

/* "Add N more to save X%" nudge — a compact tinted strip under the ladder.
   Accent-tinted background + accent text keeps it on-brand and reads as a
   call-to-action without shouting. A small arrow glyph leads the line. */
.wsscd-visual--tier-panel .wsscd-visual__nudge {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	padding: 7px 10px;
	border-radius: var(--wsscd-radius-md, 6px);
	background: color-mix( in srgb, var(--vis-accent, #2271b1) 12%, transparent );
	color: color-mix( in srgb, var(--vis-accent, #2271b1), #000 18% );
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
}

.wsscd-visual--tier-panel .wsscd-visual__nudge-icon {
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	/* Inline up-right arrow (cart momentum) tinted via currentColor mask. */
	background: currentColor;
	-webkit-mask: var(--wsscd-nudge-arrow) center / contain no-repeat;
	mask: var(--wsscd-nudge-arrow) center / contain no-repeat;
	--wsscd-nudge-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

/* Compact density tightens the nudge to match the rest of the panel. */
.wsscd-visual--tier-panel.wsscd-visual--density-compact .wsscd-visual__nudge {
	margin-top: 6px;
	padding: 5px 8px;
	font-size: 11px;
}

/* Rows / cards — vertical stack of flex rows. compact_table uses a
   distinct grid layout below for true column alignment. */
.wsscd-visual--tier-panel.wsscd-visual--layout-rows .wsscd-visual__tiers,
.wsscd-visual--tier-panel.wsscd-visual--layout-cards .wsscd-visual__tiers {
	display: block;
}

.wsscd-visual--tier-panel.wsscd-visual--layout-rows .wsscd-visual__tier,
.wsscd-visual--tier-panel.wsscd-visual--layout-cards .wsscd-visual__tier {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 8px;
	border-radius: var(--wsscd-radius-sm);
}

/* Cards: each tier is a real card — visible border + drop shadow so the
   "stacked cards" identity reads even at small sizes. */
.wsscd-visual--tier-panel.wsscd-visual--layout-cards .wsscd-visual__tier {
	padding: 10px 14px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: var(--wsscd-radius-lg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.wsscd-visual--tier-panel.wsscd-visual--layout-cards .wsscd-visual__tier + .wsscd-visual__tier {
	margin-top: 8px;
}

/* Rows: slim divider-separated list, no per-row border. Divider sits at 1.5px
   so the row-list identity survives shrinking to gallery thumbnail scale. */
.wsscd-visual--tier-panel.wsscd-visual--layout-rows .wsscd-visual__tier {
	border-radius: 0;
	padding: 8px 4px;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-rows .wsscd-visual__tier + .wsscd-visual__tier {
	border-top: 1.5px solid var(--vis-divider, rgba(0, 0, 0, 0.12));
}

/* Compact table — real CSS grid so all columns align across every row
   regardless of content length. `display: contents` on each <li> lifts
   its child cells into the parent grid. Column count adapts to which
   optional cells (savings, you_pay) the merchant has turned on — without
   this, hidden cells leave gaps and rows wrap across the wrong columns. */
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tiers {
	display: grid;
	grid-template-columns: auto 1fr;
	font-size: 12px;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table:has(.wsscd-visual__tier-savings) .wsscd-visual__tiers,
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table:has(.wsscd-visual__tier-you-pay) .wsscd-visual__tiers {
	grid-template-columns: auto auto 1fr;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table:has(.wsscd-visual__tier-savings):has(.wsscd-visual__tier-you-pay) .wsscd-visual__tiers {
	grid-template-columns: auto auto 1fr 1fr;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier {
	display: contents;
}
/* Inner padding instead of grid column-gap so per-row backgrounds
   (zebra stripes, active highlight) span contiguously across columns. */
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier > * {
	padding: 6px 8px;
	font-variant-numeric: tabular-nums;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier > *:first-child {
	padding-left: 0;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier > *:last-child {
	padding-right: 0;
}
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier-savings,
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier-you-pay {
	text-align: right;
}

/* The header row is rendered for every tier_panel layout so the DOM is
   stable across template switches (no flash during the designer's
   instant-class-swap → server-render gap). Hide it for every layout
   except compact_table, where it forms the table column headers. */
.wsscd-visual--tier-panel:not(.wsscd-visual--layout-compact_table) .wsscd-visual__tier--head {
	display: none;
}

/* Header row — uppercase micro-label, bottom-bordered to separate from data. */
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier--head > * {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.6;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--vis-divider, rgba(0, 0, 0, 0.12));
}

/* Zebra striping; active row excluded so the accent highlight isn't masked. */
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier:not(.wsscd-visual__tier--head):not(.wsscd-visual__tier--active):nth-of-type(odd) > * {
	background: rgba(0, 0, 0, 0.03);
}

/* Active-row highlight — same accent fill used by other layouts. */
.wsscd-visual--tier-panel.wsscd-visual--layout-compact_table .wsscd-visual__tier--active > * {
	background: var(--vis-accent, #2271b1);
	color: var(--vis-active-text, #fff);
	font-weight: 700;
}

/* Rows / cards default styling for the right-aligned columns. */
.wsscd-visual--tier-panel:not(.wsscd-visual--layout-compact_table) .wsscd-visual__tier-savings,
.wsscd-visual--tier-panel:not(.wsscd-visual--layout-compact_table) .wsscd-visual__tier-you-pay {
	margin-left: auto;
	font-size: 12px;
	color: inherit;
	opacity: 0.85;
}

.wsscd-visual--tier-panel:not(.wsscd-visual--layout-compact_table) .wsscd-visual__tier-savings + .wsscd-visual__tier-you-pay {
	margin-left: 12px;
}

/* Density compacts row spacing only; padding + header_size have their own controls. */
.wsscd-visual--tier-panel.wsscd-visual--density-compact .wsscd-visual__header {
	margin-bottom: 4px;
}
.wsscd-visual--tier-panel.wsscd-visual--density-compact .wsscd-visual__footer {
	margin-top: 4px;
}
.wsscd-visual--tier-panel.wsscd-visual--density-compact .wsscd-visual__tier {
	padding: 3px 6px;
	font-size: 11px;
}

/* Compact density inside the compact_table layout: the <li> has
   display:contents (no padding-bearing box), so tighten the actual
   grid cells instead. Without this override, density:compact has no
   effect on the table layout. */
.wsscd-visual--tier-panel.wsscd-visual--density-compact.wsscd-visual--layout-compact_table .wsscd-visual__tier > * {
	padding: 3px 6px;
	font-size: 11px;
}

/* ----------------------------------------------------- BOGO panel */

.wsscd-visual--bogo-panel {
	display: block;
	background: var(--vis-bg, #fff);
	color: var(--vis-text, #1d2327);
	padding: 14px 16px;
	border: var(--vis-border-w, 1px) var(--vis-border-style, solid) var(--vis-border-color, #dcdcde);
	border-radius: var(--wsscd-radius-md);
}

.wsscd-visual--bogo-panel .wsscd-visual__header {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
}

.wsscd-visual--bogo-panel .wsscd-visual__bogo {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wsscd-visual--bogo-panel .wsscd-visual__buy {
	padding: 4px 10px;
	background: var(--vis-buy, #2271b1);
	color: var(--vis-pill-text, #fff);
	border-radius: var(--wsscd-radius-pill);
	font-weight: 600;
	/* Subtle lift gives pills depth at thumbnail size where padding alone
	   doesn't read as a pill. */
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wsscd-visual--bogo-panel .wsscd-visual__free {
	padding: 4px 10px;
	background: var(--vis-free, #16a34a);
	color: var(--vis-pill-text, #fff);
	border-radius: var(--wsscd-radius-pill);
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.wsscd-visual--bogo-panel .wsscd-visual__sep {
	color: var(--wsscd-color-text-muted, #50575e);
	font-weight: 700;
}

/* Density — compact tightens the panel padding + inner gap. */
.wsscd-visual--bogo-panel.wsscd-visual--density-compact {
	padding: 10px 12px;
}
.wsscd-visual--bogo-panel.wsscd-visual--density-compact .wsscd-visual__header {
	margin-bottom: 6px;
	font-size: 13px;
}
.wsscd-visual--bogo-panel.wsscd-visual--density-compact .wsscd-visual__bogo {
	gap: 6px;
}
.wsscd-visual--bogo-panel.wsscd-visual--density-compact .wsscd-visual__buy,
.wsscd-visual--bogo-panel.wsscd-visual--density-compact .wsscd-visual__free {
	padding: 2px 8px;
	font-size: 12px;
}

/* ----- Layout variants ----------------------------------------------
 * Modifier classes; orthogonal to density / separator_icon / colors so any
 * combination composes freely.
 *
 *   inline   — default; small inline pills with subtle separator
 *   equation — larger pills, prominent separator (math-equation feel)
 *   stacked  — bordered cards side-by-side (presentational, featured deal)
 * ------------------------------------------------------------------ */

/* Equation: larger typography + dominant separator. The separator carries
   "=" sign visual weight rather than a thin glue glyph; pills go bolder so
   the layout reads as a featured promo, not just bigger pills. */
.wsscd-visual--bogo-panel.wsscd-visual--layout-equation .wsscd-visual__bogo {
	gap: 14px;
	justify-content: center;
}
.wsscd-visual--bogo-panel.wsscd-visual--layout-equation .wsscd-visual__buy,
.wsscd-visual--bogo-panel.wsscd-visual--layout-equation .wsscd-visual__free {
	padding: 8px 16px;
	font-size: 15px;
	font-weight: 700;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}
.wsscd-visual--bogo-panel.wsscd-visual--layout-equation .wsscd-visual__sep {
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
	color: var(--vis-text, #1d2327);
	opacity: 0.7;
}

/* Stacked: each term becomes a bordered card. The default pill background
   becomes a left-rule colored stripe (--vis-buy / --vis-free) so the
   merchant's color choice still drives the term's identity. */
.wsscd-visual--bogo-panel.wsscd-visual--layout-stacked .wsscd-visual__bogo {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 12px;
	align-items: stretch;
}
.wsscd-visual--bogo-panel.wsscd-visual--layout-stacked .wsscd-visual__buy,
.wsscd-visual--bogo-panel.wsscd-visual--layout-stacked .wsscd-visual__free {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 16px;
	background: transparent;
	color: inherit;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--wsscd-radius-md, 6px);
	font-size: 14px;
	font-weight: 600;
	/* Pills don't get their own shadow here — the box-shadow base rule above
	   targets `.__buy/.__free` selectors without `.--layout-stacked` so the
	   subtle drop carries over. */
}
/* Thicker colored stripe — at thumbnail size the 4px stripe disappears; 6px
   keeps the buy/free identity visible without overpowering the card. */
.wsscd-visual--bogo-panel.wsscd-visual--layout-stacked .wsscd-visual__buy {
	border-left: 6px solid var(--vis-buy, #2271b1);
}
.wsscd-visual--bogo-panel.wsscd-visual--layout-stacked .wsscd-visual__free {
	border-left: 6px solid var(--vis-free, #16a34a);
}
.wsscd-visual--bogo-panel.wsscd-visual--layout-stacked .wsscd-visual__sep {
	align-self: center;
	font-size: 18px;
	color: var(--vis-text, #1d2327);
	opacity: 0.5;
}

/* --------------------------------------------------- Bundle panel */

.wsscd-visual--bundle-panel {
	display: block;
	background: var(--vis-bg, #fff);
	color: var(--vis-text, #1d2327);
	padding: 14px 16px;
	border: var(--vis-border-w, 1px) var(--vis-border-style, solid) var(--vis-border-color, #dcdcde);
	border-radius: var(--wsscd-radius-md);
}

.wsscd-visual--bundle-panel .wsscd-visual__header {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 600;
}

.wsscd-visual--bundle-panel .wsscd-visual__items {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.wsscd-visual--bundle-panel .wsscd-visual__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	background: var(--wsscd-color-bg-subtle, #f6f7f7);
	border-radius: var(--wsscd-radius-sm);
	font-size: 12px;
}

.wsscd-visual--bundle-panel .wsscd-visual__thumb {
	width: 24px;
	height: 24px;
	object-fit: cover;
	border-radius: var(--wsscd-radius-sm);
}

.wsscd-visual--bundle-panel .wsscd-visual__savings {
	margin: 0;
	color: var(--vis-accent, #3858e9);
	font-weight: 600;
}

/* ----- Layout variants ----------------------------------------------
 * Modifier classes on the wrapper; orthogonal to show_item_thumbs /
 * show_savings / colors so any combination composes freely.
 *
 *   strip    — default; horizontal flex-wrap of chip-style items
 *   carousel — single horizontally-scrollable row with larger thumbs
 *   stack    — vertical list, thumbs on the left, full-width rows
 * ------------------------------------------------------------------ */

/* Carousel: single non-wrapping row that scrolls horizontally. Larger
   thumbs make the strip feel like an actual product carousel. */
.wsscd-visual--bundle-panel.wsscd-visual--layout-carousel .wsscd-visual__items {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 4px; /* breathing room for the scrollbar track */
}
.wsscd-visual--bundle-panel.wsscd-visual--layout-carousel .wsscd-visual__item {
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 8px;
	flex: 0 0 auto;
	min-width: 96px;
}
.wsscd-visual--bundle-panel.wsscd-visual--layout-carousel .wsscd-visual__thumb {
	width: 64px;
	height: 64px;
}
.wsscd-visual--bundle-panel.wsscd-visual--layout-carousel .wsscd-visual__item-title {
	text-align: center;
	font-size: 11px;
}

/* Stack: vertical column. Each row is full-width; thumb sits to the left
   of the title. Pure presentational style — no chip background. */
.wsscd-visual--bundle-panel.wsscd-visual--layout-stack .wsscd-visual__items {
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 6px;
}
.wsscd-visual--bundle-panel.wsscd-visual--layout-stack .wsscd-visual__item {
	display: flex;
	background: transparent;
	width: 100%;
	padding: 6px 0;
	/* Hex fallback — frontend doesn't load theme-colors. */
	border-bottom: 1px solid var(--wsscd-overlay-border, rgba(0, 0, 0, 0.08));
	border-radius: 0;
	font-size: 13px;
}
.wsscd-visual--bundle-panel.wsscd-visual--layout-stack .wsscd-visual__item:last-child {
	border-bottom: none;
}
.wsscd-visual--bundle-panel.wsscd-visual--layout-stack .wsscd-visual__thumb {
	width: 32px;
	height: 32px;
}

/* -------------------------------------------------- Threshold bar */

.wsscd-visual--threshold-bar {
	display: block;
	background: var(--vis-bg, #fff);
	color: var(--vis-text, #1d2327);
	padding: 10px 14px;
	border: var(--vis-border-w, 0) var(--vis-border-style, solid) var(--vis-border-color, #dcdcde);
	border-radius: var(--wsscd-radius-md);
	box-shadow: none;
}

.wsscd-visual--threshold-bar .wsscd-visual__message {
	margin: 0 0 8px;
	font-size: 13px;
}

.wsscd-visual--threshold-bar .wsscd-visual__track {
	position: relative;
	/* Driven by the Track height control. Recipes + schema default always
	   emit --vis-track-height, so no fallback is needed. */
	height: var(--vis-track-height);
	background: var(--vis-track, #f6f7f7);
	border-radius: var(--wsscd-radius-pill);
	overflow: hidden;
}

.wsscd-visual--threshold-bar .wsscd-visual__fill {
	display: block;
	height: 100%;
	background: var(--vis-fill, #2271b1);
	border-radius: var(--wsscd-radius-pill);
	transition: width 250ms ease;
}

/* ----- Layout variants ----------------------------------------------
 * Two structurally honest variants — the only orthogonal axis that
 * actually changes structure:
 *
 *   smooth  — continuous fill with no extra markers (default)
 *   stepped — track + 25/50/75% milestone tick marks
 *
 * Thickness was previously coupled to a `pill_bar` template; it now has
 * its own segmented control (Track height: thin / medium / thick).
 * ------------------------------------------------------------------ */

/* Stepped — 25 / 50 / 75% milestone marks rendered as 2px wide bars
   over the track. The PHP partial only emits the .wsscd-visual__tick
   spans when layout=stepped, so the rules below only cost CSS when
   they're actually visible. */
.wsscd-visual--threshold-bar .wsscd-visual__tick {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	/* Fallback hex — the frontend stylesheet only depends on wsscd-variables,
	   not wsscd-theme-colors, so --wsscd-overlay-light may be undefined here.
	   Without the fallback the ticks render transparent on the storefront. */
	background: var(--wsscd-overlay-light, rgba(0, 0, 0, 0.1));
	pointer-events: none;
	transform: translateX(-50%);
}

/* Segment dividers (segmented layout) — evenly spaced gaps that paint the
   track color over the fill so the progress reads as discrete blocks. */
.wsscd-visual--threshold-bar.wsscd-visual--layout-segmented .wsscd-visual__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--vis-track, #f6f7f7);
	pointer-events: none;
	transform: translateX(-50%);
}

/* ----- Gradient background (panels + bar) --------------------------
 * Opt-in via the schema's `bg_color_to` field. When set, the renderer
 * stamps wsscd-visual--gradient-bg on the wrapper. The compound class
 * selector (.wsscd-visual.wsscd-visual--gradient-bg) wins over each
 * type's single-class base rule so the gradient overrides solid bg. */
.wsscd-visual.wsscd-visual--gradient-bg {
	background: linear-gradient(135deg, var(--vis-bg), var(--vis-bg-to, var(--vis-bg)));
}
