/*
 * v1.5 uses WoodMart's own swatch design.
 * We only:
 *  - keep extra native rows visible
 *  - hide the fallback <select> when a swatch grid exists
 *  - fill WoodMart's native .wd-bg element with the variation image
 */

/* Extra attribute rows must be visible in Quick Shop. */
body .website-wrapper .wd-quick-shop-2:not(.wd-form-inited) table.variations tr:not(:first-child) .wd-swatches-grid {
	display: inline-flex;
}

/* The select caused the big dropdown shown in v1.4. Keep it in the DOM for
   WooCommerce/WoodMart logic, but do not display it when swatches exist. */
table.variations td.with-swatches > select.rks-wmvc-native-select,
table.variations td.with-swatches > select[name^="attribute_"] {
	display: none !important;
}

/* Use WoodMart's native image-swatch element and geometry. */
.rks-wmvc-image-ready.wd-bg .wd-swatch-bg {
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

/* Never hide an OOS swatch; WoodMart's wd-disabled style can cross/blur it. */
table.variations .wd-swatch.wd-disabled {
	visibility: visible !important;
}


/* Keep the native WoodMart swatch label available for its tooltip JS,
   but hide it visually inside image swatches. */
.rks-wmvc-image-ready .wd-swatch-text.rks-wmvc-visually-hidden-label {
	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;
}


/* v1.5.2: the same native WoodMart image-swatch treatment is also applied
   on the single-product variations table. Size stays native text. */
.single-product table.variations .rks-wmvc-image-ready.wd-bg .wd-swatch-bg {
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}


/* v1.5.4 single-product hardening:
   if WoodMart re-adds wd-text during initialization, our JS immediately restores
   wd-bg; this rule ensures the native background layer remains visible. */
.single-product .wd-swatch.rks-wmvc-image-ready.wd-bg > .wd-swatch-bg {
	display: block !important;
	opacity: 1 !important;
}
