/* StickIt Core - Swatches UI. Prefix: stkw- */

/* Hide native selects when our UI is active (gated by ?stickit_swatches). */
.stkw-active .variations_form .variations select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0) !important;
	overflow: hidden !important;
}

/* Container for one attribute row. */
.stkw-row {
	margin: 0 0 14px;
}

.stkw-row-label {
	display: block;
	font-weight: 600;
	margin: 0 0 6px;
}

.stkw-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

/* Base button reset. */
.stkw-swatch {
	box-sizing: border-box;
	cursor: pointer;
	background: #fff;
	border: 2px solid #ccc;
	border-radius: 6px;
	padding: 0;
	margin: 0;
	line-height: 1.2;
	font: inherit;
	color: inherit;
	transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
	position: relative;
}

.stkw-swatch:focus-visible {
	outline: 2px solid #1565c0;
	outline-offset: 2px;
}

/* Color circle. */
.stkw-swatch--color {
	width: 40px;
	height: 40px;
	min-width: 40px;
	border-radius: 50%;
	overflow: hidden;
}

.stkw-swatch--color .stkw-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
}

/* "Fara Scris" / none: white with red diagonal line. */
.stkw-swatch--none {
	width: 40px;
	height: 40px;
	min-width: 40px;
	border-radius: 50%;
	background:
		linear-gradient(
			to top left,
			rgba(0, 0, 0, 0) 0%,
			rgba(0, 0, 0, 0) calc(50% - 1.5px),
			#d32f2f calc(50% - 1.5px),
			#d32f2f calc(50% + 1.5px),
			rgba(0, 0, 0, 0) calc(50% + 1.5px),
			rgba(0, 0, 0, 0) 100%
		),
		#fff;
}

/* Pill (text) and toggle. */
.stkw-swatch--pill,
.stkw-swatch--toggle {
	min-height: 40px;
	min-width: 40px;
	padding: 8px 14px;
	border-radius: 6px;
	font-size: 14px;
}

.stkw-swatch--toggle {
	font-weight: 600;
}

/* Selected state. */
.stkw-swatch.is-selected {
	border-color: #1565c0;
	box-shadow: 0 0 0 2px rgba(21, 101, 192, .25);
}

/* Disabled (variation unavailable). */
.stkw-swatch.is-disabled {
	opacity: .4;
	cursor: not-allowed;
	pointer-events: none;
}

/* Light color circles need a visible ring. */
.stkw-swatch--color .stkw-fill[data-light="1"] {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

/* Tooltip via title attribute is native; keep label hidden-but-accessible on circles. */
.stkw-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	overflow: hidden;
}

/* Mobile: ensure wrap + comfortable targets. */
@media (max-width: 600px) {
	.stkw-options {
		gap: 10px;
	}
}

/* Hide the native th label - our row label replaces it (avoids doubles). */
.stkw-active .variations_form table.variations th.label {
	display: none;
}
