/**
 * Product page variation picker (Figma: Product Detail — Variation Form 450:10003).
 *
 * Swatch boxes (size, border, radius, padding, colours, active state) are set on the Bricks
 * "Add to cart" element's native swatch controls. This only adds what Bricks has no control for:
 * the selected glow, the colour name under each photo, and the price under each bed size
 * (inserted by product-variations.js).
 */

/* The swatch box is the <li> (Bricks); its button just fills it. */
.variations_form .bricks-variation-swatches .bricks-swatch-button {
	padding: 0;
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
	text-transform: none;
	background: none;
	border: 0;
	cursor: pointer;
}

.variations_form .bricks-variation-swatches li.bricks-swatch-selected {
	box-shadow: 0 var(--gap-2) var(--space-4) var(--shadow-accent-40);
}

/* Colour: photo fills the tile; name shown underneath (Figma) instead of a hover tooltip. */
.variations_form .bricks-swatch-image li {
	position: relative;
	margin-bottom: calc(var(--lh-eyebrow) + var(--space-5));
	overflow: visible !important; /* Bricks clips swatches (ID-level rule); the name sits below the tile. */
}

.variations_form .bricks-swatch-image .bricks-swatch-button {
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
}

.variations_form .bricks-swatch-image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.variations_form .bricks-swatch-image li[data-balloon]::before {
	display: none;
}

.variations_form .bricks-swatch-image li[data-balloon]::after {
	position: absolute;
	top: calc(100% + var(--space-5));
	left: 50%;
	display: block;
	padding: 0;
	font-family: var(--font-body);
	font-size: var(--text-eyebrow);
	font-weight: 600;
	line-height: var(--lh-eyebrow);
	letter-spacing: var(--ls-eyebrow);
	text-transform: none;
	white-space: nowrap;
	color: var(--color-ink-soft);
	content: attr(data-balloon);
	background: none;
	border: 0;
	opacity: 1;
	transform: translateX(-50%);
	pointer-events: none;
}

/* Bed size: label with its price underneath. */
.variations_form .bricks-swatch-label .bricks-swatch-button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--gap-2);
}

.variations_form .sng-swatch-price {
	font-size: var(--text-eyebrow);
	font-weight: 600;
	line-height: var(--lh-eyebrow);
	letter-spacing: var(--ls-eyebrow);
	color: var(--color-ink-muted);
}

.variations_form .bricks-swatch-label .bricks-swatch-selected .sng-swatch-price {
	color: var(--color-brand-deep);
}

/* The main price shows the chosen size (product-variations.js); Figma has no second price or "Clear" link. */
.variations_form .woocommerce-variation-price,
.variations_form .reset_variations {
	display: none !important;
}

/* Quantity row: "QUANTITY" label above stepper + Add to cart + Buy it now (Figma). */
.brxe-product-add-to-cart .woocommerce-variation-add-to-cart,
.brxe-product-add-to-cart form.cart:not(.variations_form) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-10) var(--space-12);
}

.brxe-product-add-to-cart .woocommerce-variation-add-to-cart::before,
.brxe-product-add-to-cart form.cart:not(.variations_form)::before {
	flex-basis: 100%;
	font-family: var(--font-body);
	font-size: var(--text-eyebrow);
	font-weight: 600;
	line-height: var(--lh-eyebrow);
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--color-ink-muted);
	content: var(--sng-qty-label, "Quantity");
}

/* Figma: Add to cart is sized by its padding (141px), not the theme button's 200px minimum. */
.brxe-product-add-to-cart .single_add_to_cart_button {
	min-width: 0;
}

/* WooCommerce's small-screen table rule leaves the swatch cell at 50%, so tiles stack one per row. */
.variations_form table.variations td.value,
.variations_form table.variations th.label {
	display: block;
	width: 100%;
}
