/* ============================================================
   Catalog Split — variation image thumbnails on grid
   ============================================================ */

.wcsac-grid-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 8px 0 4px;
	justify-content: flex-start;
	text-align: left;
}

/* Square image swatch */
.wcsac-grid-swatch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 42px;
	border-radius: 3px;
	border: 1px solid #e0e0e0;
	background: none;
	cursor: pointer;
	transition: border-color 0.2s;
	text-decoration: none !important;
	box-sizing: border-box;
	overflow: hidden;
	padding: 0;
}

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

.wcsac-grid-swatch:hover {
	transform: scale(1.08);
}

.wcsac-grid-swatch.wcsac-active {
	border-color: #eee;
}

/* Fallback swatch without image (colour dot or text) */
.wcsac-grid-swatch.wcsac-no-image {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
}

.wcsac-sw-color {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 2px;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.wcsac-sw-img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 2px;
	background-size: cover;
	background-position: center;
}

.wcsac-sw-text {
	font-size: 9px;
	font-weight: 600;
	line-height: 1;
	color: #555;
	text-transform: uppercase;
}

/* Hide WoodMart's own grid swatches on split cards to avoid duplicates */
.wd-product:has(.wcsac-split-data) .wd-swatches-grid {
	display: none !important;
}
