/* Colour variation swatches — vendipro-child
   Uses the theme's own design tokens so swatches look native:
     --hms-primary #7b9f35 / --hms-primary-dark #5d7c25
     --hms-border #e5e5e0 / --hms-border-strong #d0d0c8
     --hms-text #1a1a1a / --hms-text-muted #5a5a5a
   Radii 8px (controls) + 999px (pills); focus ring 0 0 0 3px rgba(123,159,53,.15);
   card hover 0 6px 18px -8px rgba(61,84,23,.28) + translateY(-2px). No dropdown shown. */

.vps-swatches {
	margin: 4px 0 2px;
}

/* "Farbe: [ Rot ]" chosen line */
.vps-chosen {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--hms-text-muted, #5a5a5a);
	margin-bottom: 12px;
}
.vps-chosen__label {
	font-weight: 600;
	color: var(--hms-text, #1a1a1a);
}
.vps-chosen__value {
	display: inline-flex;
	align-items: center;
	padding: 4px 14px;
	border-radius: 999px;
	background: var(--hms-primary, #7b9f35);
	color: #fff;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: .02em;
	line-height: 1.4;
	transition: background 150ms ease;
}
.vps-chosen__value.is-placeholder {
	background: #f3f3f0;
	color: #9a9a9a;
	font-weight: 500;
}

/* swatch grid */
.vps-swatch-list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* one swatch tile (mirrors the theme's card idiom) */
.vps-swatch {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 76px;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	-webkit-tap-highlight-color: transparent;
}

/* the tile (image or colour) */
.vps-swatch__media,
.vps-swatch__dot {
	width: 76px;
	height: 76px;
	border-radius: 8px;
	box-sizing: border-box;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #fff;
	border: 1px solid var(--hms-border, #e5e5e0);
	transition: border-color 150ms ease, box-shadow .2s ease, transform .2s ease;
}
.vps-swatch__dot {
	background-color: #e5e5e0;
}

/* hover — subtle border highlight only (no lift, no shadow) */
.vps-swatch:hover .vps-swatch__media,
.vps-swatch:hover .vps-swatch__dot {
	border-color: var(--hms-primary, #7b9f35);
}

/* keyboard focus — theme focus ring */
.vps-swatch:focus-visible {
	outline: none;
}
.vps-swatch:focus-visible .vps-swatch__media,
.vps-swatch:focus-visible .vps-swatch__dot {
	border-color: var(--hms-primary, #7b9f35);
	box-shadow: 0 0 0 3px rgba( 123, 159, 53, .15 );
}

/* selected — green border + ring (theme's selected idiom) */
.vps-swatch.is-active .vps-swatch__media,
.vps-swatch.is-active .vps-swatch__dot {
	border-color: var(--hms-primary, #7b9f35);
	box-shadow: 0 0 0 3px rgba( 123, 159, 53, .15 );
}
.vps-swatch.is-active .vps-swatch__name {
	color: var(--hms-primary-dark, #5d7c25);
	font-weight: 600;
}

/* check badge on the active tile */
.vps-swatch::after {
	content: "";
	position: absolute;
	top: -5px;
	right: 5px;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: var(--hms-primary, #7b9f35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, .25 );
	transform: scale( 0 );
	transition: transform .18s cubic-bezier( .2, 1.4, .4, 1 );
	pointer-events: none;
}
.vps-swatch.is-active::after {
	transform: scale( 1 );
}

.vps-swatch__name {
	font-size: 12.5px;
	color: var(--hms-text-muted, #5a5a5a);
	text-align: center;
	transition: color 150ms ease;
}

/* unavailable (filtered out by another chosen attribute) */
.vps-swatch.is-unavailable {
	cursor: not-allowed;
}
.vps-swatch.is-unavailable .vps-swatch__media,
.vps-swatch.is-unavailable .vps-swatch__dot {
	opacity: .4;
	filter: grayscale( 1 );
	transform: none;
	box-shadow: none;
}

/* our swatch block carries its own "Farbe:" label, so hide the redundant
   native table label cell on rows we've enhanced (class added by JS;
   :has() selector as a progressive enhancement). */
.variations tr.vps-row-enhanced th.label,
.variations tr:has( .vps-swatches ) th.label {
	display: none;
}
.variations tr.vps-row-enhanced td.value,
.variations tr:has( .vps-swatches ) td.value {
	display: block;
	padding-left: 0;
}

/* hide the native <select> entirely but keep it in the DOM so WooCommerce's
   variations form keeps driving price/image/availability/add-to-cart. */
.vps-hidden-select {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* keep the theme's "Clear" reset link tidy */
.variations .reset_variations {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
}

@media ( max-width: 480px ) {
	.vps-swatch,
	.vps-swatch__media,
	.vps-swatch__dot { width: 64px; }
	.vps-swatch__media,
	.vps-swatch__dot { height: 64px; }
	.vps-swatch__name { font-size: 11.5px; }
}
