/* =========================================================================
 * Single product — Owala-style variant (SKU) selectors.
 *
 * Color  -> round image swatches + All / Customizable / Patterns chips
 * Size   -> pill group on a grey rounded track
 * Others -> radio row with a colour dot
 *
 * The native <select> stays in the DOM for WooCommerce's variation JS and is
 * visually hidden here.
 * ====================================================================== */

/* Hide the dropdowns, keep them focusable/usable for the JS contract. */
.single-product .wplife-native-select {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	opacity: 0;
	pointer-events: none;
}

/* Drop the default variation table chrome; our controls carry the layout. */
.single-product .variations {
	width: 100%;
	margin: 0 0 4px;
	border-collapse: separate;
	border-spacing: 0;
}

.single-product .variations th.label,
.single-product .variations td.value {
	display: block;
	width: 100%;
	padding: 0;
	text-align: left;
}

.single-product .variations tr + tr th.label {
	margin-top: 22px;
}

.single-product .variations th.label label {
	display: block;
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--wplife-text-primary);
}

.single-product .variations td.value {
	padding-bottom: 2px;
}

/* -------------------------------------------------------------------------
 * Color — heading + group chips + image swatches
 * ---------------------------------------------------------------------- */
.wplife-swatch-heading {
	margin: 0 0 10px;
	font-size: 16px;
	line-height: 1.2;
	color: var(--wplife-text-primary);
}

.wplife-swatch-heading__label {
	font-weight: 700;
}

.wplife-swatch-heading__value {
	color: var(--wplife-text-secondary);
}

.wplife-swatch-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 14px;
}

.wplife-chip {
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--wplife-radius-pill);
	background: var(--wplife-surface-secondary);
	color: var(--wplife-text-primary);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wplife-chip:hover {
	background: #e4e9ec;
}

.wplife-chip.is-active {
	background: var(--wplife-text-primary);
	color: var(--wplife-text-reversed);
}

.wplife-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 6px;
}

.wplife-swatch {
	position: relative;
	flex: 0 0 auto;
	width: 54px;
	height: 54px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.wplife-swatch[hidden] {
	display: none;
}

.wplife-swatch::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wplife-swatch-color, #d7dbdf);
	box-shadow: inset 0 0 0 1px rgba(45, 54, 64, 0.1);
	transition: box-shadow 0.15s ease;
}

.wplife-swatch img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.wplife-swatch:hover::before {
	box-shadow: inset 0 0 0 2px rgba(45, 54, 64, 0.35);
}

.wplife-swatch.is-selected::before {
	box-shadow: inset 0 0 0 2px var(--wplife-text-primary);
}

.wplife-swatch.is-selected::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 2px solid var(--wplife-text-primary);
	border-radius: 50%;
}

.wplife-swatch:focus-visible {
	outline: 2px solid var(--wplife-water-deep);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
 * Size — pills on a grey track
 * ---------------------------------------------------------------------- */
.wplife-pills {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0;
	padding: 4px;
	border-radius: var(--wplife-radius-pill);
	background: rgba(45, 54, 64, 0.08);
}

.wplife-pill {
	flex: 1 1 auto;
	min-width: 76px;
	height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: var(--wplife-radius-pill);
	background: transparent;
	color: var(--wplife-text-primary);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.wplife-pill:hover {
	background: rgba(45, 54, 64, 0.06);
}

.wplife-pill.is-selected {
	background: var(--wplife-text-primary);
	color: var(--wplife-text-reversed);
}

.wplife-pill:focus-visible {
	outline: 2px solid var(--wplife-water-deep);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Material — radio row with a colour dot
 * ---------------------------------------------------------------------- */
.wplife-radios {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
}

.wplife-radio {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px 8px 8px;
	border: 0;
	border-radius: var(--wplife-radius-pill);
	background: transparent;
	color: var(--wplife-text-secondary);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wplife-radio:hover {
	background: var(--wplife-surface-secondary);
}

.wplife-radio__dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--wplife-radio-color, #d7dbdf);
	box-shadow: inset 0 0 0 1px rgba(45, 54, 64, 0.15);
}

.wplife-radio.is-selected {
	color: var(--wplife-text-primary);
}

.wplife-radio.is-selected .wplife-radio__dot {
	box-shadow: inset 0 0 0 1px rgba(45, 54, 64, 0.15), 0 0 0 2px var(--wplife-text-primary);
}

.wplife-radio:focus-visible {
	outline: 2px solid var(--wplife-water-deep);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Reset link + spacing tidy up
 * ---------------------------------------------------------------------- */
.single-product .variations_form .reset_variations {
	display: inline-block;
	margin-top: 14px;
	font-size: 14px;
}

.single-product .single_variation_wrap .woocommerce-variation-price {
	margin: 18px 0 6px;
}

/* Legacy table styling can leak in from Storefront; neutralise it. */
.single-product .variations tr,
.single-product .variations td {
	background: transparent;
	border: 0;
}

@media (max-width: 767px) {
	.wplife-swatch {
		width: 46px;
		height: 46px;
	}

	.wplife-pill {
		min-width: 64px;
		padding: 0 14px;
		font-size: 15px;
	}

	.wplife-pills {
		display: flex;
		width: 100%;
	}
}
