/* Structural: hide native select, keep it in DOM for WooCommerce JS. */
.mo-swatches-field {
	position: relative;
}

.mo-swatches-field select,
.mo-swatches-field .select,
.mo-swatches-field .select-wrapper {
	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;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Hide Flatsome / third-party swatches if they still render. */
.variations .ux-swatches,
.variations .flatsome-swatches,
.variations .woo-variation-swatches {
	display: none !important;
}

/* Visual styles (override via theme Customizer Additional CSS). */
.mo-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem;
	margin: 0.25rem 0 0;
	position: relative;
	z-index: 2;
}

.mo-swatch {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	margin: 0;
	cursor: pointer;
	background: #fff;
	color: #1d2327;
	border: 1px solid #1d2327;
	border-radius: 0;
	padding: 0.4rem 0.85rem;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
	transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.mo-swatch:hover,
.mo-swatch:focus-visible {
	background: #1d2327;
	color: #fff;
	outline: none;
}

.mo-swatch.is-selected {
	background: #1d2327;
	color: #fff;
}

.mo-swatch.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

.mo-swatch--color {
	width: 44px;
	height: 44px;
	min-height: 44px;
	padding: 0;
	border-radius: 50%;
	border-width: 2px;
	background: var(--mo-swatch-color, #f0f0f1);
}

.mo-swatch--color .mo-swatch__text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

.mo-swatch--color .mo-swatch__face {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--mo-swatch-color, #f0f0f1);
}

.mo-swatch--color:hover,
.mo-swatch--color:focus-visible,
.mo-swatch--color.is-selected {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1d2327;
	background: var(--mo-swatch-color, #f0f0f1);
	color: inherit;
}

.mo-swatch--label .mo-swatch__face {
	display: none;
}

@media (max-width: 782px) {
	.mo-swatch {
		min-height: 48px;
		font-size: 15px;
	}

	.mo-swatch--color {
		width: 48px;
		height: 48px;
	}
}
