.ilo-color-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 4px 0 2px;
	padding: 0;
}

.ilo-color-swatches-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.ilo-color-swatches-select select,
td.value select[name*="color" i].ilo-hidden-by-swatches {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.ilo-color-swatch {
	position: relative;
	display: inline-flex;
	cursor: pointer;
	margin: 0;
	padding: 0;
}

/* Visually hide the native radio (keep it accessible / focusable). */
.ilo-color-swatch__input {
	position: absolute;
	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;
}

/* Color circle. */
.ilo-color-swatch__circle {
	display: block;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--swatch-color, #ccc);
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.12);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Hover: gentle lift + emphasized ring. */
.ilo-color-swatch:hover .ilo-color-swatch__circle {
	transform: translateY(-2px);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* Selected / focused: bold double ring so the choice is unmistakable.
   Driven by BOTH the native :checked radio (works with zero JS) and the
   .is-selected class (set when syncing from WooCommerce). */
.ilo-color-swatch.is-selected .ilo-color-swatch__circle,
.ilo-color-swatch__input:checked ~ .ilo-color-swatch__circle,
.ilo-color-swatch__input:focus-visible + .ilo-color-swatch__circle {
	border-color: #fff;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a1a1a, 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ilo-color-swatch.is-selected .ilo-color-swatch__circle,
.ilo-color-swatch__input:checked ~ .ilo-color-swatch__circle {
	transform: translateY(-1px);
}

/* Checkmark badge on the selected swatch. */
.ilo-color-swatch__check {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 18px;
	transform: translate(-50%, -50%) scale(0.3);
	opacity: 0;
	pointer-events: none;
	color: #fff;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
	transition: opacity 0.16s ease, transform 0.16s ease;
}

.ilo-color-swatch__check svg {
	display: block;
	width: 100%;
	height: 100%;
}

.ilo-color-swatch.is-selected .ilo-color-swatch__check,
.ilo-color-swatch__input:checked ~ .ilo-color-swatch__check {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* Hover tooltip with the color name. Hidden until hover/focus. */
.ilo-color-swatch__tooltip {
	position: absolute;
	bottom: calc(100% + 11px);
	left: 50%;
	transform: translateX(-50%) translateY(5px);
	z-index: 10;
	padding: 6px 10px;
	border-radius: 7px;
	background: #1f2024;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.ilo-color-swatch__tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1f2024;
}

.ilo-color-swatch:hover .ilo-color-swatch__tooltip,
.ilo-color-swatch__input:focus-visible ~ .ilo-color-swatch__tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

table.variations tr.ilo-color-row td.value {
	vertical-align: middle;
}

/* =========================================================================
   Button pills for non-color attributes (Size, Weaver, …)
   ========================================================================= */
.ilo-variation-buttons {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	max-width: 100%;
	margin: 4px 0 2px;
	padding: 0;
}

.ilo-variation-button {
	position: relative;
	display: flex;
	width: 100%;
	margin: 0;
	cursor: pointer;
}

/* Visually hide the native radio (keep it accessible / focusable). */
.ilo-variation-button__input {
	position: absolute;
	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;
}

.ilo-variation-button__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 8px;
	background: #fff;
	border: 1.5px solid #d7d2c8;
	color: #2b2b2b;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
	transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ilo-variation-button:hover .ilo-variation-button__label {
	border-color: #1a1a1a;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Selected — solid fill so the choice is unmistakable. Driven by the native
   :checked radio (no JS needed) and the .is-selected class (sync from WC). */
.ilo-variation-button.is-selected .ilo-variation-button__label,
.ilo-variation-button__input:checked ~ .ilo-variation-button__label {
	background: #1a1a1a;
	border-color: #1a1a1a;
	color: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

/* Keyboard focus ring. */
.ilo-variation-button__input:focus-visible ~ .ilo-variation-button__label {
	outline: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a1a1a;
}

/* Currently unavailable with the other chosen options — dimmed, but still
   clickable (clicking re-filters the other attributes). */
.ilo-variation-button.is-unavailable .ilo-variation-button__label {
	color: #b3aea4;
	border-color: #ece8e0;
	background: #faf9f6;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.ilo-variation-button.is-unavailable:hover .ilo-variation-button__label {
	border-color: #c9c3b8;
	box-shadow: none;
}

/* =========================================================================
   Variation group titles (Color, Size, Weaver) — consistent label style.
   ========================================================================= */
form.variations_form table.variations th.label,
form.variations_form table.variations th.label label,
form.variations_form .variations .label label {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 600;
	font-size: 13px;
	color: #2b2b2b;
	margin-bottom: 6px;
}
