/* Copyright (c) 2026, ibrahim and contributors */
/* Phase 6 — storefront hex swatches (webshop variant selector enhancement). */

.pd-swatch-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 8px;
}

.pd-swatch {
	display: inline-flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	cursor: pointer;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
	transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.pd-swatch:hover {
	transform: scale(1.06);
}

.pd-swatch:focus-visible {
	outline: 2px solid var(--primary, #2490ef);
	outline-offset: 2px;
}

.pd-swatch-active {
	box-shadow: 0 0 0 2px var(--primary, #2490ef);
}

.pd-swatch-label {
	font-size: 10px;
	line-height: 1;
	padding: 2px 3px;
	margin-bottom: 2px;
	background: rgba(255, 255, 255, 0.8);
	border-radius: 3px;
	color: #1f272e;
	white-space: nowrap;
}

/* Out-of-stock / invalid styles, driven by Settings.oos_swatch_style. */
.pd-swatch-oos-dim {
	opacity: 0.35;
	cursor: not-allowed;
}

.pd-swatch-oos-strike {
	position: relative;
	cursor: not-allowed;
}

.pd-swatch-oos-strike::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top right,
		transparent calc(50% - 1px),
		rgba(220, 53, 69, 0.9) 50%,
		transparent calc(50% + 1px)
	);
	border-radius: 6px;
}

.pd-swatch-oos-hide {
	display: none;
}

/* Native select kept for a11y / JS-off fallback, hidden once chips render. */
.pd-native-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}
