/*
 * CreatorFlow Commerce — product swatches.
 * Every rule is scoped to the plugin's own classes (cfc-sw…), so nothing here reaches the theme
 * or Elementor; the automated checks refuse any selector without one.
 */

.cfc-sw-on select.cfc-sw-native,
.cfc-sw .cfc-sw__sr,
.cfc-sw-live.cfc-sw__sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	/* Themes give the variation dropdowns a minimum width (Kadence 1.6.0: 75%, or 240px in its
	   vertical layout), which would win over the width above. */
	min-width: 0 !important;
	max-width: 1px !important;
	min-height: 0 !important;
	max-height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.cfc-sw {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 2px 0 10px;
	padding: 0;
}

.cfc-sw[hidden] {
	display: none !important;
}

.cfc-sw .cfc-sw__item {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 6px 14px;
	border: 1px solid #8a8a8a;
	border-radius: 4px;
	background: #fff;
	color: #1e1e1e;
	font: inherit;
	font-size: 0.9375em;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cfc-sw .cfc-sw__item:hover {
	border-color: #1e1e1e;
	background: #fff;
	color: #1e1e1e;
}

.cfc-sw .cfc-sw__item[aria-checked="true"] {
	border-color: #1e1e1e;
	box-shadow: inset 0 0 0 1px #1e1e1e;
	font-weight: 600;
}

.cfc-sw .cfc-sw__item:focus {
	outline: none;
}

.cfc-sw .cfc-sw__item:focus-visible {
	outline: 2px solid #1e1e1e;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px #fff;
}

.cfc-sw .cfc-sw__item[aria-checked="true"]:focus-visible {
	box-shadow: inset 0 0 0 1px #1e1e1e, 0 0 0 4px #fff;
}

.cfc-sw .cfc-sw__item.is-out {
	color: #5c5c5c;
	border-style: dashed;
}

.cfc-sw .cfc-sw__item.is-out .cfc-sw__label {
	text-decoration: line-through;
}

.cfc-sw .cfc-sw__item[aria-disabled="true"] {
	opacity: 0.4;
	cursor: not-allowed;
	border-style: dashed;
}

.cfc-sw .cfc-sw__item[aria-disabled="true"] .cfc-sw__label {
	text-decoration: line-through;
}

.cfc-sw .cfc-sw__item--colour,
.cfc-sw .cfc-sw__item--image {
	padding: 3px;
	border-radius: 50%;
}

.cfc-sw .cfc-sw__item--image {
	border-radius: 6px;
}

.cfc-sw .cfc-sw__colour {
	display: block;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.cfc-sw .cfc-sw__image {
	display: block;
	width: 36px;
	height: 36px;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 4px;
}

.cfc-sw .cfc-sw__item--colour.is-out::after,
.cfc-sw .cfc-sw__item--image.is-out::after,
.cfc-sw .cfc-sw__item--colour[aria-disabled="true"]::after,
.cfc-sw .cfc-sw__item--image[aria-disabled="true"]::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 4px;
	right: 4px;
	height: 0;
	border-top: 2px solid #1e1e1e;
	transform: rotate(-45deg);
}

@media (forced-colors: active) {
	.cfc-sw .cfc-sw__item[aria-checked="true"] {
		outline: 2px solid Highlight;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cfc-sw .cfc-sw__item {
		transition: none;
	}
}
