/* Fixed Bundle · Stacked — matches the React FixedBundleCard. Uses --wffn-bundles-* tokens. */

.wffn-bundles-fb--stacked.wffn-bundles-fb--stacked .wffn-bundles-fb-stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Every element in this block declares its own `line-height`, so the widget's
   vertical rhythm no longer depends on the theme's. 1.35 matches the design. */
.wffn-bundles-fb-name.wffn-bundles-fb-name {
	font-size: var(--wffn-bundles-title-size);
	color: var(--wffn-bundles-title-color);
	font-weight: 500;
	line-height: 1.35;
	/* `overflow-wrap`, not `word-break`: Chrome computes `word-break: break-word`
	   as `overflow-wrap: anywhere`, which makes min-content one character wide. */
	overflow-wrap: break-word;
}

/* A name may never be narrower than its longest word, and `min-content` only says
   so if nothing made the word breakable — Twenty Twenty's `*` rule matches the inner span directly, which is why the descendant half of this selector exists. */
.wffn-bundles.wffn-bundles .wffn-bundles-fb-name,
.wffn-bundles.wffn-bundles .wffn-bundles-fb-name * {
	overflow-wrap: break-word;
	word-break: normal;
}

.wffn-bundles-fb-qty.wffn-bundles-fb-qty {
	margin-right: 4px;
}

.wffn-bundles-fb-sub.wffn-bundles-fb-sub {
	font-size: var(--wffn-bundles-desc-size);
	color: var(--wffn-bundles-desc-color);
	line-height: 1.35;
}

.wffn-bundles-fb-prices.wffn-bundles-fb-prices {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	/* Shrinkable, floored at one price token: `flex: 0 0 auto` makes the basis
	   max-content and unshrinkable, so a variable member overhung the widget. */
	flex: 0 1 auto;
	min-width: min-content;
	/* Stay in the price column even when the row wraps: an auto start-margin absorbs
	   the free space on whichever line it lands on. Logical, so RTL mirrors. */
	margin-inline-start: auto;
	/* A variable member prices as a range, and the final price is flex:0 0 auto, so
	   all the shrinkage landed on the struck original. Wrap between the two prices. */
	flex-wrap: wrap;
	justify-content: flex-end;
}

.wffn-bundles-fb-price-original.wffn-bundles-fb-price-original {
	font-size: var(--wffn-bundles-price-size);
	color: var(--wffn-bundles-regular-price-color);
	text-decoration: line-through;
	line-height: 1.35;
	/* A price is one token — never break it across lines. */
	white-space: nowrap;
}

.wffn-bundles-fb-price-final.wffn-bundles-fb-price-final {
	font-size: var(--wffn-bundles-price-size);
	color: var(--wffn-bundles-sale-price-color);
	font-weight: 600;
	line-height: 1.35;
	flex: 0 0 auto;
	white-space: nowrap;
}

.wffn-bundles-fb-thumb.wffn-bundles-fb-thumb {
	flex: 0 0 auto;
	background: var(--wffn-bundles-thumb-bg);
	border-radius: var(--wffn-bundles-image-radius);
	overflow: hidden;
	display: inline-block;
}

.wffn-bundles-fb-thumb.wffn-bundles-fb-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wffn-bundles-fb-thumb--lg.wffn-bundles-fb-thumb--lg {
	width: var(--wffn-bundles-offer-image-size, 56px);
	height: var(--wffn-bundles-offer-image-size, 56px);
}

/* A flat bundle's rows are its items, drawn at the large size. */
.wffn-bundles-fb-flat-row .wffn-bundles-fb-thumb--lg.wffn-bundles-fb-thumb--lg {
	width: var(--wffn-bundles-item-image-size, 56px);
	height: var(--wffn-bundles-item-image-size, 56px);
}

.wffn-bundles-fb-thumb--sm.wffn-bundles-fb-thumb--sm {
	width: var(--wffn-bundles-item-image-size, 32px);
	height: var(--wffn-bundles-item-image-size, 32px);
	/* Follows "Image radius", scaled for the smaller thumb: 6px at the default 8px. */
	border-radius: calc(var(--wffn-bundles-image-radius, 8px) * 0.75);
}

/* Radio, reusing the shared dot look. */
.wffn-bundles-fb-single.wffn-bundles-fb-single,
.wffn-bundles-fb-card.wffn-bundles-fb-card {
	position: relative;
	display: block;
	background: var(--wffn-bundles-bg);
	border: var(--wffn-bundles-border-width) var(--wffn-bundles-border-style) var(--wffn-bundles-border);
	border-radius: var(--wffn-bundles-corner);
	padding: var(--wffn-bundles-pad-t) var(--wffn-bundles-pad-r) var(--wffn-bundles-pad-b) var(--wffn-bundles-pad-l);
	cursor: pointer;
}

.wffn-bundles-fb-single--selected.wffn-bundles-fb-single--selected,
.wffn-bundles-fb-card--selected.wffn-bundles-fb-card--selected {
	background: var(--wffn-bundles-bg-active);
	border-color: var(--wffn-bundles-border-active);
	box-shadow: inset 0 0 0 var(--wffn-bundles-ring-active) var(--wffn-bundles-border-active);
}

/* Scoped through `.wffn-bundles`: a theme's `input[type="radio"]` reset is (0,1,1) and
   beats a bare `.wffn-bundles-fb-input`. It must stay out of flow; `.wffn-bundles-radio` is what is seen. */
.wffn-bundles.wffn-bundles .wffn-bundles-fb-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: var(--wffn-bundles-radio-size);
	height: var(--wffn-bundles-radio-size);
	margin: 0;
}

.wffn-bundles-radio.wffn-bundles-radio {
	position: relative;
	flex: 0 0 auto;
	width: var(--wffn-bundles-radio-size);
	height: var(--wffn-bundles-radio-size);
	border: 2px solid var(--wffn-bundles-radio);
	border-radius: 50%;
	display: var(--wffn-bundles-radio-display, inline-block);
}

.wffn-bundles-fb-single--selected.wffn-bundles-fb-single--selected .wffn-bundles-radio,
.wffn-bundles-fb-card--selected.wffn-bundles-fb-card--selected .wffn-bundles-radio {
	border-color: var(--wffn-bundles-radio-active);
}

/* The native input is visually hidden; surface its focus-visible state on the radio it replaces. */
.wffn-bundles-fb-single:has(.wffn-bundles-fb-input:focus-visible) .wffn-bundles-radio,
.wffn-bundles-fb-card:has(.wffn-bundles-fb-input:focus-visible) .wffn-bundles-radio {
	outline: 2px solid var(--wffn-bundles-radio-active);
	outline-offset: 2px;
}

/* With the radio off, the card shows the focus instead. */
.wffn-bundles-fb-single.wffn-bundles-fb-single:has(.wffn-bundles-fb-input:focus-visible),
.wffn-bundles-fb-card.wffn-bundles-fb-card:has(.wffn-bundles-fb-input:focus-visible) {
	outline: var(--wffn-bundles-card-focus, 0) solid var(--wffn-bundles-radio-active);
	outline-offset: 2px;
}

.wffn-bundles-fb-single--selected.wffn-bundles-fb-single--selected .wffn-bundles-radio::after,
.wffn-bundles-fb-card--selected.wffn-bundles-fb-card--selected .wffn-bundles-radio::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: calc(var(--wffn-bundles-radio-size) * 0.5);
	height: calc(var(--wffn-bundles-radio-size) * 0.5);
	border-radius: 50%;
	background: var(--wffn-bundles-radio-active);
}

/* Single-product option. */
.wffn-bundles-fb-single.wffn-bundles-fb-single {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wffn-bundles-fb-single-meta.wffn-bundles-fb-single-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1 1 auto;
	min-width: 0;
}

/* Bundle card. */
.wffn-bundles-fb-badge.wffn-bundles-fb-badge {
	position: absolute;
	top: 0;
	right: 16px;
	transform: translateY(-50%);
	background: var(--wffn-bundles-badge-bg);
	color: var(--wffn-bundles-badge-fg);
	font-size: var(--wffn-bundles-badge-size);
	line-height: 1;
	padding: 4px 8px;
	border-radius: var(--wffn-bundles-badge-radius);
	white-space: nowrap;
}

.wffn-bundles-fb-card-row.wffn-bundles-fb-card-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.wffn-bundles-fb-card-body.wffn-bundles-fb-card-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
	/* Every row's start and end inset; a boxed row's border plus padding equals it. */
	--wffn-bundles-fb-row-inset: 12px;
}

.wffn-bundles-fb-lead.wffn-bundles-fb-lead {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wffn-bundles-fb-lead-top.wffn-bundles-fb-lead-top {
	display: flex;
	align-items: center;
	gap: 12px;
	/* The summary column takes the slack the thumb and radio leave, and may shrink
	   to nothing rather than push the row wide. */
	flex: 1 1 auto;
	min-width: 0;
	/* Wrap stays, as a last resort. It only ever fired too early because
	   `.wffn-bundles-fb-name` had a one-character min-content; see the note there. */
	flex-wrap: wrap;
}
/* The bundle total sits on the end edge of the header row in both layouts — see
   the note on `.wffn-bundles-fb-flat-head`. */
.wffn-bundles-fb-lead-top.wffn-bundles-fb-lead-top .wffn-bundles-fb-prices,
.wffn-bundles-fb-flat-head.wffn-bundles-fb-flat-head .wffn-bundles-fb-prices {
	margin-inline-start: auto;
}

/* Title and subtitle as one column beside the price: a one-line title centred in
   a two-line row dumped the surplus between the title and the subtitle under it. */
.wffn-bundles-fb-lead-copy.wffn-bundles-fb-lead-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wffn-bundles-fb-lead-top.wffn-bundles-fb-lead-top .wffn-bundles-fb-lead-copy,
.wffn-bundles-fb-flat-head.wffn-bundles-fb-flat-head .wffn-bundles-fb-flat-head-text {
	/* Basis 0, not auto: a flex container assigns items to lines by their
	   hypothetical main size, so `auto` declared the line full before the price. */
	flex: 1 1 0;
	min-width: min-content;
}

.wffn-bundles-fb-lead-top.wffn-bundles-fb-lead-top .wffn-bundles-fb-price-final,
.wffn-bundles-fb-flat-head.wffn-bundles-fb-flat-head .wffn-bundles-fb-price-final {
	font-size: var(--wffn-bundles-price-size);
}

/* Phones stack the total's two prices, old above new, as they do the item rows'; desktop
   keeps them on one line like the items, wrapping only when a price range has no room. */
@media (max-width: 600px) {
	.wffn-bundles-fb-lead-top.wffn-bundles-fb-lead-top .wffn-bundles-fb-prices,
	.wffn-bundles-fb-flat-head.wffn-bundles-fb-flat-head .wffn-bundles-fb-prices {
		flex-direction: column;
		align-items: flex-end;
		gap: 0;
	}
}

/* The radio lives inside `.wffn-bundles-fb-lead`, so the lead's own `align-items: center`
   centres it against the thumb at any height. `:has(.wffn-bundles-radio)` reclaims the indent. */
.wffn-bundles-fb-card-body.wffn-bundles-fb-card-body:has(.wffn-bundles-radio) > .wffn-bundles-fb-members,
.wffn-bundles-fb-card-body.wffn-bundles-fb-card-body:has(.wffn-bundles-radio) > .wffn-bundles-fb-empty {
	padding-inline-start: var(--wffn-bundles-radio-indent, calc(var(--wffn-bundles-radio-size) + 12px));
}

.wffn-bundles-fb-divider.wffn-bundles-fb-divider {
	display: block;
	height: 1px;
	width: 100%;
	background: var(--wffn-bundles-control-border);
}

.wffn-bundles-fb-members.wffn-bundles-fb-members {
	display: flex;
	flex-direction: column;
	/* 10px is not enough once a row grows: in a narrow summary column a member's
	   name and price each wrap and the list reads as one dense paragraph. */
	gap: 12px;
}

.wffn-bundles-fb-member.wffn-bundles-fb-member {
	display: flex;
	/* Thumb, name and price all start on the thumb's top line. */
	align-items: flex-start;
	gap: 12px;
	/* Start inset only: the prices end on the card's edge, with the total and the gift rows. */
	padding-inline: var(--wffn-bundles-fb-row-inset, 12px) 0;
	/* No wrap. The price now lives inside the summary column's head row, so there is
	   nothing left to wrap — and wrapping was itself the reported defect. */
	flex-wrap: nowrap;
}

/* The member's first line: name on the start edge, price on the end edge, both from the top. */
.wffn-bundles-fb-member-head.wffn-bundles-fb-member-head {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	/* Span the summary column: `.wffn-bundles-fb-member-main` is `align-items: flex-start`,
	   so its children are shrink-to-fit and this row would strand the price mid-row. */
	align-self: stretch;
	min-width: 0;
}

/* The name yields to the price, but only down to its longest word — see the
   `.wffn-bundles-fb-member .wffn-bundles-fb-name` rule below, which owns the floor. */
.wffn-bundles-fb-member-head.wffn-bundles-fb-member-head .wffn-bundles-fb-name {
	flex: 1 1 auto;
}

/* The picker gets the column's full width now the price has left the row:
   `.wffn-bundles-fb-member-main` is `align-items: flex-start`, so it stays shrink-to-fit. */
.wffn-bundles-fb-member-main.wffn-bundles-fb-member-main .wffn-bundles-variant {
	align-self: stretch;
}

/* One even width that fits a long option name; `>` skips pickers moved into a variant popup. */
.wffn-bundles.wffn-bundles .wffn-bundles-fb-card-body .wffn-bundles-variant > .wffn-bundles-variant-axis {
	width: 100%;
	max-width: min(240px, 100%);
}
/* Desktop only: a phone keeps the shared 16px text that stops iOS zooming on focus. */
@media (min-width: 601px) {
	.wffn-bundles.wffn-bundles .wffn-bundles-fb-card-body .wffn-bundles-variant > .wffn-bundles-variant-axis {
		height: 30px;
		font-size: 12px;
		padding-inline-start: 10px;
	}
}

.wffn-bundles-fb-member-main.wffn-bundles-fb-member-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	/* Separates the name/price line from the picker below it: at 4px the first
	   dropdown sat against the price and the two read as one block. */
	gap: 7px;
}

.wffn-bundles-fb-member.wffn-bundles-fb-member .wffn-bundles-fb-name {
	/* Floored at the longest word, not at zero: a member priced as two ranges left
	   the name 35px, which rendered "Hoodie" as "Hood / ie". */
	min-width: min-content;
	font-size: calc(var(--wffn-bundles-title-size) - 2px);
}

/* Outlined, as the selected card's tint matches the thumb's own background. */
.wffn-bundles-fb-member.wffn-bundles-fb-member .wffn-bundles-fb-thumb {
	box-shadow: 0 0 0 1px var(--wffn-bundles-control-border);
}

/* The struck price one step under the live one, the size boxed rows' prices take. */
.wffn-bundles-fb-member.wffn-bundles-fb-member .wffn-bundles-fb-price-original {
	font-size: calc(var(--wffn-bundles-price-size) - 2px);
}

/* Phones: prices stack old above new, spaced as the bundle total is, leaving the
   name and picker the width a pair took inline. */
@media (max-width: 600px) {
	.wffn-bundles-fb-member.wffn-bundles-fb-member .wffn-bundles-fb-prices {
		flex-direction: column;
		align-items: flex-end;
		gap: 0;
	}
}


.wffn-bundles-fb-empty.wffn-bundles-fb-empty {
	font-size: var(--wffn-bundles-control-size);
	color: var(--wffn-bundles-control-muted);
}

/* Flat list (single option off). */
.wffn-bundles-fb-flat.wffn-bundles-fb-flat {
	display: flex;
	flex-direction: column;
	/* Flat mode is the bundle offered alone, so it is always the picked option and
	   takes the `--selected` treatment; the active-state tokens are only reachable there. */
	background: var(--wffn-bundles-bg-active);
	border: var(--wffn-bundles-border-width) var(--wffn-bundles-border-style) var(--wffn-bundles-border-active);
	box-shadow: inset 0 0 0 var(--wffn-bundles-ring-active) var(--wffn-bundles-border-active);
	border-radius: var(--wffn-bundles-corner);
	/* Anchor for the badge, which is absolutely positioned. */
	position: relative;
	/* Horizontal padding only: the vertical tokens sit on the head and on whichever
	   block ends the list, so a container padding would add to them, not replace them. */
	padding: 0 var(--wffn-bundles-pad-r) 0 var(--wffn-bundles-pad-l);
}

/* Half the badge sits above the container's top edge, and flat mode is the first
   case where it can reach the widget's own top. Reserve exactly the overhang. */
.wffn-bundles-fb-flat.wffn-bundles-fb-flat:has(.wffn-bundles-fb-badge) {
	margin-top: calc((var(--wffn-bundles-badge-size) + 8px) / 2);
}

/* Bundle title/subtitle/total. Flat mode has no card, so they head the list. The
   total is carried here in both layouts rather than closing the flat list. */
.wffn-bundles-fb-flat-head.wffn-bundles-fb-flat-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: var(--wffn-bundles-pad-t) 0 14px;
}

.wffn-bundles-fb-flat-head-text.wffn-bundles-fb-flat-head-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wffn-bundles-fb-flat-row.wffn-bundles-fb-flat-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-block: 14px;
	padding-inline: 30px 0;
}

.wffn-bundles-fb-flat-row.wffn-bundles-fb-flat-row + .wffn-bundles-fb-flat-row {
	border-top: var(--wffn-bundles-border-width) var(--wffn-bundles-border-style) var(--wffn-bundles-border);
}

/* Separate the header from the list it heads. Stated on the head rather than on
   `.wffn-bundles-fb-flat-head + .wffn-bundles-fb-flat-row`, so it holds whatever follows first. */
.wffn-bundles-fb-flat-head.wffn-bundles-fb-flat-head {
	border-bottom: var(--wffn-bundles-border-width) var(--wffn-bundles-border-style) var(--wffn-bundles-border);
}

.wffn-bundles-fb-flat-info.wffn-bundles-fb-flat-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 7 1 0;
	min-width: 0;
}

/* Name vs price columns share the row 70:30. */
.wffn-bundles-fb-flat-row.wffn-bundles-fb-flat-row .wffn-bundles-fb-prices {
	flex: 3 1 0;
	justify-content: flex-end;
	text-align: right;
}

/* Close the list on `--wffn-bundles-pad-b`, whichever block ends it. The other half of the
   container's `padding: 0 …`: it replaces the last block's own bottom spacing. */
.wffn-bundles-fb-flat.wffn-bundles-fb-flat > :last-child {
	padding-bottom: var(--wffn-bundles-pad-b);
}

/* Out of stock: a member cannot supply its quantity, so the all-or-nothing pack
   cannot be bought. The single-product option stays interactive. */
.wffn-bundles-fb-oos.wffn-bundles-fb-oos {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0 10px;
	padding: 8px 12px;
	border-radius: 8px;
	background: rgba(220, 38, 38, 0.08);
	color: #b91c1c;
	font-size: var(--wffn-bundles-control-size);
	font-weight: 500;
}
.wffn-bundles-fb-oos.wffn-bundles-fb-oos[hidden] {
	display: none;
}
.wffn-bundles-fb-oos.wffn-bundles-fb-oos::before {
	content: "⚠";
	line-height: 1;
}
.wffn-bundles-fb--oos.wffn-bundles-fb--oos .wffn-bundles-fb-flat,
.wffn-bundles-fb--oos.wffn-bundles-fb--oos .wffn-bundles-fb-card {
	opacity: 0.55;
	filter: grayscale(0.35);
	pointer-events: none;
}

/* Per-member stock label, naming the exact member that blocks the pack. Sits
   under the member name. */
.wffn-bundles-fb-oos-tag.wffn-bundles-fb-oos-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #b91c1c;
	white-space: normal;
}

/* Strike the name of the unavailable member so the blocker is obvious even
   though the whole pack is already dimmed by .wffn-bundles-fb--oos. */
.wffn-bundles-fb-member--oos.wffn-bundles-fb-member--oos .wffn-bundles-fb-name {
	text-decoration: line-through;
	text-decoration-color: rgba(0, 0, 0, 0.25);
}

/* While the behavior layer holds the native Add button, let the pointer fall
   through to form.cart: a disabled button dispatches no click, so attemptHint needs it. */
.single_add_to_cart_button.single_add_to_cart_button.wffn-bundles-add-disabled {
	pointer-events: none;
}
