.hx-swatch {
	display: inline-block;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(15, 23, 42, 0.18);
	box-shadow: inset 0 0 0 2px #fff;
	background-color: var(--hx-line);
	vertical-align: middle;
}

.hx-swatch-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.hx-swatch-list--loop { margin-block: 2px 4px; }
.hx-swatch-list--loop .hx-swatch { width: 18px; height: 18px; }
.hx-swatch-more {
	font-size: var(--hx-fs-xs);
	font-weight: 700;
	color: var(--hx-ink-muted);
	line-height: 1;
}

.hx-swatch-list--cat {
	display: inline-flex;
	margin-inline-start: 6px;
	vertical-align: middle;
}

.hx-swatch-field { position: relative; }
.hx-swatch-field.is-ready select[data-hx-swatch] {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	opacity: 0;
}
.hx-swatch-field:not(.is-ready) .hx-swatch-list--variation,
.hx-swatch-field:not(.is-ready) .hx-swatch-field__value { display: none; }

.hx-swatch-list--variation { gap: 10px; padding-block: 2px; }
.hx-swatch-list--variation .hx-swatch {
	position: relative;
	width: 34px;
	height: 34px;
	padding: 0;
	cursor: pointer;
	transition: transform var(--hx-dur) var(--hx-ease), box-shadow var(--hx-dur) var(--hx-ease);
}
.hx-swatch-list--variation .hx-swatch:hover { transform: scale(1.08); }
.hx-swatch-list--variation .hx-swatch:focus-visible {
	outline: 2px solid var(--hx-primary);
	outline-offset: 3px;
}
.hx-swatch-list--variation .hx-swatch.is-selected {
	box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--hx-primary);
	transform: scale(1.05);
}
.hx-swatch-list--variation .hx-swatch.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	transform: none;
}
.hx-swatch-list--variation .hx-swatch.is-disabled::after {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 140%;
	height: 2px;
	background: var(--hx-ink-muted);
	transform: translate(-50%, -50%) rotate(-45deg);
	border-radius: 2px;
}

/* Hide the redundant text label below the swatches */
.hx-swatch-field__value {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.hx-swatch-list--variation .hx-swatch { transition: none; }
}