/* GridOps variation swatches — storefront. The native select stays in the
   DOM for WooCommerce's variation logic; chips are its visible face.

   Geometry carries !important throughout: chips are <button> elements,
   and themes style buttons aggressively (padding, radius, min-widths) —
   without the hard reset a 32px circle becomes the theme's pill. */

/* Hide the select AND anything a theme or dropdown library renders in
   its place (select2 / niceSelect clones, styled wrappers) — they're
   all injected beside the select, inside this wrapper. The chips are
   the only visible control. */
.slvgridops-swatch-wrap select {
	display: none !important;
}

.slvgridops-swatch-wrap > *:not(.slvgridops-swatches):not(.slvgridops-swatch-current) {
	display: none !important;
}

.slvgridops-swatch-wrap {
	display: block;
}

/* The value-name readout: selected value's name, hover previews. The
   line is always reserved so previewing never shifts the layout. */
.slvgridops-swatch-current {
	display: block !important;
	margin: 0 0 6px !important;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	min-height: 1.3em;
}

.slvgridops-swatches {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	vertical-align: middle;
}

.slvgridops-swatches .slvgridops-swatch {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 32px !important;
	min-width: 32px !important;
	height: 32px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 2px solid rgba(0, 0, 0, 0.15) !important;
	border-radius: 50% !important;
	background-color: #fff;
	background-size: cover !important;
	background-position: center !important;
	cursor: pointer;
	font-size: 12px !important;
	line-height: 1 !important;
	transition: transform 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}

.slvgridops-swatches .slvgridops-swatch:hover {
	transform: scale(1.12);
	border-color: rgba(0, 0, 0, 0.45) !important;
}

.slvgridops-swatches .slvgridops-swatch-on {
	border-color: #111 !important;
	box-shadow: 0 0 0 2px #fff inset, 0 0 0 1px #111 !important;
}

.slvgridops-swatches .slvgridops-swatch-off {
	opacity: 0.25;
	cursor: not-allowed;
	transform: none;
}

/* Text chips hold words, so they can't be circles: in circle mode they
   render as pills; rounded and square modes restyle them below. Their
   colors stay the theme's button colors on purpose — text chips should
   look native to the site. Long names are capped with an ellipsis —
   the readout above (and the tooltip) always carries the full name. */
.slvgridops-swatches .slvgridops-swatch-label {
	display: inline-block !important;
	width: auto !important;
	max-width: 180px !important;
	padding: 0 12px !important;
	border-radius: 16px !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	line-height: 28px !important;
}

@media (max-width: 600px) {
	.slvgridops-swatches .slvgridops-swatch-label {
		max-width: 38vw !important;
	}
}

/* The gallery tile matching the selected variation (Elementor gallery
   adapter): a quiet ring, no layout shift. */
.slvgridops-gallery-hit {
	outline: 3px solid rgba(17, 17, 17, 0.85) !important;
	outline-offset: 2px;
	border-radius: 2px;
	transition: outline-color 0.15s ease;
}

/* Shape variants (set on the attribute-values page): circle is the
   default above; rounded and square restyle every chip, labels too. */
.slvgridops-swatches-rounded .slvgridops-swatch,
.slvgridops-swatches-rounded .slvgridops-swatch-label {
	border-radius: 8px !important;
}

.slvgridops-swatches-square .slvgridops-swatch,
.slvgridops-swatches-square .slvgridops-swatch-label {
	border-radius: 2px !important;
}
