/* Visually hide native select while preserving WooCommerce JS events */
.wcvvs-hidden-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.wcvvs-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	list-style: none !important;
	margin: 4px 0 !important;
	padding: 0 !important;
}

.wcvvs-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	background-color: #ffffff;
	transition: all 0.18s ease;
	user-select: none;
	box-sizing: border-box;
}

.wcvvs-swatch:hover,
.wcvvs-swatch:focus-visible {
	border-color: #4b5563;
	outline: none;
}

.wcvvs-swatch.selected {
	border-color: #111827;
	box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #111827;
}

/* Out-of-stock / unavailable combination state */
.wcvvs-swatch.disabled {
	opacity: 0.38;
	cursor: not-allowed;
}

.wcvvs-swatch.disabled::after {
	content: "";
	position: absolute;
	top: 50%;
	left: -4px;
	right: -4px;
	height: 2px;
	background-color: #ef4444;
	transform: rotate(-32deg);
	pointer-events: none;
}

/* Colour Swatches */
.wcvvs-swatch-color {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	padding: 2px;
}

.wcvvs-swatch-color-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Image Swatches */
.wcvvs-swatch-image {
	width: 48px;
	height: 48px;
	padding: 2px;
	overflow: hidden;
}

.wcvvs-swatch-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

/* Button Swatches */
.wcvvs-swatch-button {
	min-width: 40px;
	height: 38px;
	padding: 0 14px;
	font-size: 13px;
	font-weight: 600;
	color: #1f2937;
}

.wcvvs-swatch-button.selected {
	background-color: #111827;
	color: #ffffff;
	box-shadow: none;
}

/* Hover Tooltip */
.wcvvs-tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background-color: #111827;
	color: #ffffff;
	font-size: 12px;
	line-height: 1.2;
	white-space: nowrap;
	padding: 5px 9px;
	border-radius: 4px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 20;
}

.wcvvs-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -4px;
	border-width: 4px;
	border-style: solid;
	border-color: #111827 transparent transparent transparent;
}

.wcvvs-swatch:hover .wcvvs-tooltip,
.wcvvs-swatch:focus-visible .wcvvs-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}
