/* ==========================================================================
   IEW Variation Swatches Widget
   ========================================================================== */

/* Hide native WooCommerce variation selects immediately (no JS flash) */
form.variations_form .variations {
	display: none;
}

/* Wrapper */
.iew-vs {
	width: 100%;
}

/* Attribute group */
.iew-vs__group {
	display: flex;
	flex-direction: column;
}

/* Label row */
.iew-vs__label-wrap {
	margin-bottom: 8px;
}

.iew-vs__label {
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.iew-vs__label-value {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

/* Swatch row */
.iew-vs__items {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

/* ── Base swatch button ───────────────────────────────────────────────────── */
.iew-vs__swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 2px solid transparent;
	background: none;
	padding: 0;
	transition: border-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
	position: relative;
	outline: none;
	flex-shrink: 0;
}

.iew-vs__swatch:focus-visible {
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

/* ── Color swatches ──────────────────────────────────────────────────────── */
.iew-vs__items {
	--iew-vs-ring-color: #1a1a1a;
}

.iew-vs__swatch--color {
	width: 32px;
	height: 32px;
	border: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 2px transparent;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Shapes */
.iew-vs__swatch--color--circle {
	border-radius: 50%;
}

.iew-vs__swatch--color--square {
	border-radius: 2px;
}

.iew-vs__swatch--color--round {
	border-radius: 6px;
}

/* Active */
.iew-vs__swatch--color.is-active {
	transform: scale(1.1);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--iew-vs-ring-color);
}

/* Hover */
.iew-vs__swatch--color:not(.is-oos):not(.is-active):hover {
	transform: scale(1.1);
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,0.25);
}

/* ── Text chips ──────────────────────────────────────────────────────────── */
.iew-vs__swatch--text {
	padding: 6px 14px;
	font-size: 0.875rem;
	font-weight: 500;
	background-color: #f5f5f5;
	border-color: #e0e0e0;
	color: inherit;
	white-space: nowrap;
	line-height: 1.4;
}

/* Shapes */
.iew-vs__swatch--text--square {
	border-radius: 2px;
}

.iew-vs__swatch--text--round {
	border-radius: 6px;
}

.iew-vs__swatch--text--pill {
	border-radius: 999px;
}

/* Active */
.iew-vs__swatch--text.is-active {
	background-color: #000;
	border-color: #000;
	color: #fff;
}

/* Hover */
.iew-vs__swatch--text:not(.is-oos):not(.is-active):hover {
	border-color: #999;
}

/* ── Out of stock ─────────────────────────────────────────────────────────── */
.iew-vs__swatch.is-oos {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Diagonal strikethrough line */
.iew-vs__swatch--text.is-oos::after,
.iew-vs__swatch--color.is-oos::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top right,
		transparent calc(50% - 1px),
		rgba(0, 0, 0, 0.4) 50%,
		transparent calc(50% + 1px)
	);
	pointer-events: none;
	border-radius: inherit;
}
