/**
 * EK Variation Swatches — front-end styles.
 * Design rules: solid neutrals only (#333/#666/#999, #ddd/#eee), no gradients,
 * minimal shadow, 0.15s transitions, mobile-first 44px tap targets.
 */

.ek-vs {
	margin: 0 0 16px;
}

/* Hide the native select but keep it for WooCommerce's variation JS. */
.ek-vs__native {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
}

/* Selected-value label */
.ek-vs__selected {
	font-size: 13px;
	line-height: 1.4;
	margin: 0 0 8px;
}
.ek-vs__selected-attr {
	color: #999;
	margin-right: 4px;
}
.ek-vs__selected-val {
	color: #333;
	font-weight: 600;
}

/* Swatch row */
.ek-vs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.ek-vs__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Base swatch */
.ek-vs__swatch {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	min-width: 38px;
	min-height: 38px;
	padding: 3px;
	border: 1px solid #ddd;
	background: #fff;
	color: #333;
	cursor: pointer;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}
.ek-vs__swatch:hover {
	border-color: #999;
}
.ek-vs__swatch:focus-visible {
	border-color: #333;
	box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.25);
}

/* Shapes */
.ek-vs--shape-circle .ek-vs__swatch {
	border-radius: 50%;
}
.ek-vs--shape-rounded .ek-vs__swatch {
	border-radius: 6px;
}
.ek-vs--shape-square .ek-vs__swatch {
	border-radius: 0;
}

/* Color swatch */
.ek-vs__swatch--color {
	width: 38px;
	height: 38px;
}
.ek-vs__color {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); /* keeps light/white swatches visible */
}

/* Image swatch */
.ek-vs__swatch--image {
	width: 46px;
	height: 46px;
	padding: 2px;
	overflow: hidden;
}
.ek-vs__img-wrap,
.ek-vs__img-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}
.ek-vs__img-wrap img {
	object-fit: cover;
}

/* Button / label swatch */
.ek-vs__swatch--button {
	min-width: 44px;
	height: auto;
	padding: 9px 14px;
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
}

/* Selected */
.ek-vs__swatch.is-selected {
	border-color: #333;
	box-shadow: 0 0 0 1px #333;
}
.ek-vs__swatch--button.is-selected {
	background: #333;
	color: #fff;
	border-color: #333;
	box-shadow: none;
}

/* Unavailable: greyed + diagonal strike, still focusable/clickable for feedback */
.ek-vs__swatch--unavailable {
	opacity: 0.4;
}
.ek-vs__swatch--unavailable::after {
	content: "";
	position: absolute;
	left: 8%;
	top: 50%;
	width: 84%;
	height: 1px;
	background: #999;
	transform: rotate(-45deg);
	pointer-events: none;
}
.ek-vs__swatch--button.ek-vs__swatch--unavailable::after {
	left: 6%;
	width: 88%;
}

/* Tooltip (desktop hover only) */
@media (hover: hover) and (pointer: fine) {
	.ek-vs__swatch[data-tooltip]:hover::before {
		content: attr(data-tooltip);
		position: absolute;
		bottom: calc(100% + 8px);
		left: 50%;
		transform: translateX(-50%);
		background: #333;
		color: #fff;
		font-size: 12px;
		line-height: 1;
		white-space: nowrap;
		padding: 6px 8px;
		border-radius: 4px;
		z-index: 5;
		pointer-events: none;
	}
}

/* Mobile-first comfort: enforce 44px tap targets */
@media (max-width: 768px) {
	.ek-vs__list {
		gap: 10px;
	}
	.ek-vs__swatch {
		min-width: 44px;
		min-height: 44px;
	}
	.ek-vs__swatch--color {
		width: 44px;
		height: 44px;
	}
	.ek-vs__swatch--image {
		width: 52px;
		height: 52px;
	}
	.ek-vs__swatch--button {
		padding: 12px 16px;
		font-size: 14px;
	}
	.ek-vs__selected {
		font-size: 14px;
	}
}
