/**
 * Variation Pills — styles for radio-button variation selectors.
 *
 * Used on single WooCommerce product pages. The actual <select> is visually
 * hidden (screen-reader-only) while the radio pills provide the user-facing UI.
 *
 * @package MpwnBlocks
 */

/* ── Screen-reader-only: hide the native <select> ── */
select.mpwn-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* ── Pill container ── */
.mpwn-variation-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	margin: 0;
	border: none;
}

/* ── Hide the radio input visually ── */
.mpwn-variation-pills__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* ── Pill label (the visible button) ── */
.mpwn-variation-pills__label {
	display: inline-block;
	padding: 8px 18px;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.3;
	color: #333;
	cursor: pointer;
	background: #f5f5f5;
	border: 2px solid #ddd;
	border-radius: 6px;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	user-select: none;
}

.mpwn-variation-pills__label:hover {
	background: #e8e8e8;
	border-color: #bbb;
}

/* ── Active / checked state ── */
.mpwn-variation-pills__input:checked + .mpwn-variation-pills__label {
	color: #fff;
	background: #333;
	border-color: #333;
}

/* ── Focus ring for keyboard navigation ── */
.mpwn-variation-pills__input:focus-visible + .mpwn-variation-pills__label {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* ── Disabled / out-of-stock variation (future use) ── */
.mpwn-variation-pills__input:disabled + .mpwn-variation-pills__label {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ── Clean up WC's default table styling ── */
.variations .mpwn-variation-pills {
	margin-top: 4px;
}
