/* ==========================================================================
   JLAB Colour Variation Swatches
   ========================================================================== */

/* Hide the native <select> once swatches are injected */
.jlab-hidden-select {
	display: none !important;
}

/* Swatch row */
.jlab-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 6px 0 4px;
	align-items: center;
}

/* Base swatch button — circular */
.jlab-swatch {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 2px solid #beb9b9;
	cursor: pointer;
	padding: 0;
	position: relative;
	flex-shrink: 0;
	overflow: hidden;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	outline: none;
}

.jlab-swatch:hover {
	border-color: #444;
	transform: scale(1.15);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	z-index: 1;
}

/* Active / selected */
.jlab-swatch--active {
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.35), 0 1px 4px rgba(0, 0, 0, 0.3);
	transform: scale(1.08);
}

.jlab-swatch--active:hover {
	transform: scale(1.15);
}

/* Very light swatches (e.g. White, Silver) get a visible default border */
.jlab-swatch[data-light="true"] {
	border-color: #c0c0c0;
}

.jlab-swatch[data-light="true"].jlab-swatch--active {
	border-color: #0073aa;
}

/* Disabled / unavailable swatch */
.jlab-swatch--disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* Diagonal strike-through overlay for disabled */
.jlab-swatch--disabled::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: 50%;
	background: repeating-linear-gradient(
		-45deg,
		transparent,
		transparent 4px,
		rgba(0, 0, 0, 0.35) 4px,
		rgba(0, 0, 0, 0.35) 5px
	);
}

/* Text fallback for unmapped colour names */
.jlab-swatch--text {
	border-radius: 4px;
	width: auto;
	min-width: 36px;
	padding: 0 10px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	background: #f0eff0;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	border: 2px solid #c8c8c8;
	border-radius: 4px;
}

.jlab-swatch--text.jlab-swatch--active {
	background: #e6f3f9;
	border-color: #0073aa;
	color: #0073aa;
}

/* Tooltip (shown on hover, not shown for text swatches) */
.jlab-swatch:not(.jlab-swatch--text)[title]::before {
	content: attr(title);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background: rgba(0, 0, 0, 0.82);
	color: #fff;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.3;
	white-space: nowrap;
	padding: 4px 8px;
	border-radius: 3px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s, transform 0.15s;
	z-index: 999;
}

.jlab-swatch:not(.jlab-swatch--text)[title]:hover::before {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Responsive: slightly smaller swatches on mobile */
@media (max-width: 480px) {
	.jlab-swatch {
		width: 32px;
		height: 32px;
	}
}
