/* Zest Swatches – front-end */
.zsw-swatches {
	--zsw-size: 22px;
	--zsw-gap: 10px;
	--zsw-radius: 50%;
	--zsw-btn-radius: 999px;
	--zsw-accent: #111;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--zsw-gap);
	margin: 12px 0 0;
	padding: 0;
	line-height: 1;
}
.zsw-swatches.zsw-loop { justify-content: center; position: relative; z-index: 3; }
.zsw-swatches.zsw-single { --zsw-size: var(--zsw-single-size, 34px); justify-content: flex-start; margin: 4px 0; }

/* ---- Base swatch -------------------------------------------------- */
.zsw-swatch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--zsw-size);
	height: var(--zsw-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--zsw-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
	-webkit-tap-highlight-color: transparent;
}
.zsw-swatch:focus-visible { outline: 2px solid var(--zsw-accent); outline-offset: 3px; }

/* Colour dot */
.zsw-color .zsw-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background: var(--zsw-c, #ccc);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
	overflow: hidden;
}
.zsw-color.zsw-two .zsw-fill {
	background: linear-gradient(135deg, var(--zsw-c) 0 50%, var(--zsw-c2) 50% 100%);
}

/* Image swatch */
.zsw-image .zsw-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	overflow: hidden;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
}
.zsw-image .zsw-fill img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Label / button swatch */
.zsw-button {
	width: auto;
	min-width: var(--zsw-size);
	height: auto;
	min-height: var(--zsw-size);
	padding: 6px 12px;
	border-radius: var(--zsw-btn-radius);
	background: #fff;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22);
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}
.zsw-button:hover { box-shadow: inset 0 0 0 1px var(--zsw-accent); }
.zsw-loop .zsw-button { padding: 4px 9px; font-size: 12px; }

/* ---- States ------------------------------------------------------- */
/* Selected ring: white gap + accent ring, like the pro swatch plugins */
.zsw-swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--zsw-accent); }
.zsw-button.is-selected { background: var(--zsw-accent); color: #fff; box-shadow: inset 0 0 0 1px var(--zsw-accent); }

.zsw-hover-grow .zsw-color:not(.is-disabled):hover,
.zsw-hover-grow .zsw-image:not(.is-disabled):hover { transform: scale(1.18); }

/* Out of stock / unavailable */
.zsw-swatch.is-disabled { opacity: .35; cursor: not-allowed; }
.zsw-oos-blur .zsw-swatch.zsw-oos { opacity: .35; }
.zsw-oos-cross .zsw-swatch.zsw-oos { opacity: .6; }
.zsw-swatch.is-disabled::after,
.zsw-oos-cross .zsw-swatch.zsw-oos::after {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(0, 0, 0, .55) calc(50% - 1px), rgba(0, 0, 0, .55) calc(50% + 1px), transparent calc(50% + 1px));
	pointer-events: none;
}

/* Tooltip */
.zsw-tooltips .zsw-swatch[data-tip]:hover::before,
.zsw-tooltips .zsw-swatch[data-tip]:focus-visible::before {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 9px);
	left: 50%;
	transform: translateX(-50%);
	padding: 5px 9px;
	border-radius: 5px;
	background: #111;
	color: #fff;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
	z-index: 20;
}
.zsw-tooltips .zsw-swatch[data-tip]:hover .zsw-fill { position: relative; }

/* "+N more" */
.zsw-more {
	font-size: 12px;
	font-weight: 600;
	color: inherit;
	opacity: .65;
	text-decoration: none;
}
.zsw-more:hover { opacity: 1; }

/* Native select hidden on product page, kept in DOM for WooCommerce */
.zsw-native-select { display: none !important; }
.variations td.value .zsw-swatches { margin-bottom: 0; }

/* ---- Card image zoom + fade ---------------------------------------- */
.zsw-thumb { position: relative; overflow: hidden; display: block; }
.zsw-card-zoom .zsw-thumb img,
.zsw-card-zoom .wc-block-components-product-image,
.zsw-card-zoom .wc-block-components-product-image img,
.zsw-card-zoom li.product a img.attachment-woocommerce_thumbnail {
	transition: transform .55s cubic-bezier(.2, .7, .2, 1), opacity .25s ease;
}
.zsw-card-zoom .wc-block-components-product-image,
.zsw-card-zoom .wc-block-grid__product-image { overflow: hidden; }
.zsw-card-zoom li.product:hover .zsw-thumb img,
.zsw-card-zoom .wc-block-product:hover .wc-block-components-product-image img,
.zsw-card-zoom .wc-block-grid__product:hover .wc-block-grid__product-image img {
	transform: scale(var(--zsw-zoom, 1.06));
}
img.zsw-fade { opacity: .25; }

@media (prefers-reduced-motion: reduce) {
	.zsw-swatch, .zsw-card-zoom .zsw-thumb img { transition: none !important; }
}
