select.wac-select-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.wac-swatches {
	display: flex;
	flex-wrap: wrap;
	justify-content: var( --wac-sw-justify, flex-start );
	gap: var( --wac-sw-gap, 8px );
	list-style: none;
	margin: 0;
	padding: 0;
}

.wac-swatches li {
	margin: 0;
}

.wac-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	background: #fff;
	padding: 0;
	border-style: solid;
	border-width: var( --wac-sw-border-w, 2px );
	border-color: var( --wac-sw-border-c, #ddd );
	border-radius: var( --wac-sw-radius, 6px );
	transition: border-color 0.15s ease;
}

.wac-swatch:hover:not( :disabled ) {
	border-color: var( --wac-sw-hover-border-c, #999 );
}

.wac-swatch.selected {
	border-color: var( --wac-sw-selected-border-c, #333 );
	border-width: var( --wac-sw-selected-border-w, 2px );
}

.wac-swatches--checkmark .wac-swatch.selected::after {
	content: '\2713';
	position: absolute;
	top: -6px;
	right: -6px;
	width: 16px;
	height: 16px;
	line-height: 16px;
	font-size: 10px;
	text-align: center;
	background: var( --wac-sw-selected-border-c, #333 );
	color: #fff;
	border-radius: 50%;
}

.wac-swatches--tooltip .wac-swatch[data-tooltip]:hover::before {
	content: attr( data-tooltip );
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX( -50% );
	margin-bottom: 6px;
	padding: 4px 8px;
	background: var( --wac-sw-tooltip-bg, #222 );
	color: var( --wac-sw-tooltip-text, #fff );
	font-size: var( --wac-sw-tooltip-fs, 11px );
	line-height: 1.4;
	white-space: nowrap;
	border-radius: 3px;
	z-index: 10;
}

/* JS-built tooltip popup used for "name + description" and "image" tooltip
   modes, since CSS attr() content cannot render an <img> or long text. */
.wac-swatch-tooltip-popup {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX( -50% );
	margin-bottom: 6px;
	padding: 6px 10px;
	background: var( --wac-sw-tooltip-bg, #222 );
	color: var( --wac-sw-tooltip-text, #fff );
	font-size: var( --wac-sw-tooltip-fs, 11px );
	line-height: 1.4;
	white-space: nowrap;
	border-radius: 3px;
	z-index: 11;
	pointer-events: none;
}

.wac-swatch-tooltip-popup strong {
	display: block;
}

.wac-swatch-tooltip-popup img {
	display: block;
	max-width: 120px;
	max-height: 120px;
	border-radius: 3px;
}

.wac-swatch-button,
.wac-swatch-radio {
	min-width: var( --wac-sw-width, 36px );
	height: var( --wac-sw-height, 36px );
	padding: var( --wac-sw-padding-y, 0 ) var( --wac-sw-padding-x, 12px );
	font-size: var( --wac-sw-font-size, 13px );
	font-weight: var( --wac-sw-font-weight, normal );
	font-family: var( --wac-sw-font-family, inherit );
	color: var( --wac-sw-font-color, #333 );
}

.wac-swatch-radio {
	border-radius: 999px;
}

.wac-swatch-color {
	width: var( --wac-sw-width, 36px );
	height: var( --wac-sw-height, 36px );
}

.wac-swatch-image {
	width: var( --wac-sw-width, 36px );
	height: var( --wac-sw-height, 36px );
	overflow: hidden;
}

.wac-swatch-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wac-swatch:disabled,
.wac-swatch-disabled {
	opacity: var( --wac-sw-disabled-opacity, 0.35 );
	cursor: not-allowed;
	pointer-events: none;
}

.wac-swatch-crossed-out {
	position: relative;
	opacity: var( --wac-sw-disabled-opacity, 0.35 );
	cursor: not-allowed;
	pointer-events: none;
}

.wac-swatch-crossed-out::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	border-top: 1px solid currentColor;
	transform: rotate( -8deg );
}

.wac-swatch-hidden {
	display: none !important;
}

.wac-swatch-blur-cross {
	position: relative;
	filter: blur( 1.5px );
	opacity: var( --wac-sw-disabled-opacity, 0.35 );
	cursor: not-allowed;
	pointer-events: none;
}

.wac-swatch-blur-cross::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	border-top: 1px solid currentColor;
	transform: rotate( -8deg );
	filter: none;
}

.wac-swatch-oos-marked::after {
	content: '';
	position: absolute;
	top: 2px;
	right: 2px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.6;
}

.wac-swatch-low-stock-badge {
	position: absolute;
	top: -8px;
	right: -8px;
	padding: 2px 6px;
	font-size: 10px;
	line-height: 1.4;
	white-space: nowrap;
	color: #fff;
	background: var( --wac-sw-low-stock-badge-c, #d63638 );
	border-radius: 3px;
	z-index: 5;
}

.wac-swatch-more-wrap {
	display: flex;
	align-items: center;
}

.wac-swatch-more {
	background: none;
	border: 0;
	padding: 0;
	color: var( --wac-sw-selected-border-c, #333 );
	font-size: var( --wac-sw-font-size, 13px );
	font-family: var( --wac-sw-font-family, inherit );
	text-decoration: underline;
	cursor: pointer;
}

.wac-selected-variation-name {
	margin-left: 8px;
	font-size: 0.55em;
	font-weight: 400;
	color: #666;
	vertical-align: middle;
}

/* Resets theme/WooCommerce styling on the attribute row now that swatches
   visually replace the dropdown - opt-in via "Disable default WooCommerce
   dropdown styling". */
body.wac-swatches-no-default-css table.variations th,
body.wac-swatches-no-default-css table.variations td {
	border: 0;
	padding: 4px 0;
	background: none;
}

/* Non-interactive swatch preview shown on shop/category/tag archive loops. */
.wac-loop-swatches {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 6px 0;
}

.wac-loop-swatch {
	display: inline-block;
	width: 18px;
	height: 18px;
	border-radius: var( --wac-sw-radius, 50% );
	border: 1px solid var( --wac-sw-border-c, #ddd );
	overflow: hidden;
	background: #eee;
}

.wac-loop-swatch-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wac-loop-swatch-more {
	font-size: 11px;
	color: #666;
}
