/*
 * TopWatchDeals Product Manager — variation image swatches.
 * WooCommerce's native select remains the variation source of truth.
 */

.twd-variation-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 8px 0 4px;
}

.twd-variation-swatch {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 72px;
	padding: 5px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition:
		border-color .15s ease,
		box-shadow .15s ease,
		transform .15s ease;
}

.twd-variation-swatch:hover {
	border-color: #9ca3af;
	transform: translateY(-1px);
}

.twd-variation-swatch.is-selected {
	border-color: #111827;
	box-shadow: 0 0 0 1px #111827;
}

.twd-variation-swatch.is-disabled {
	opacity: .38;
	cursor: not-allowed;
	transform: none;
}

.twd-variation-swatch img {
	display: block;
	width: 58px;
	height: 58px;
	margin: 0 0 5px;
	border-radius: 5px;
	object-fit: cover;
}

.twd-variation-swatch__name {
	display: block;
	width: 100%;
	overflow: hidden;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.twd-has-image-swatches select[name="attribute_color"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	border: 0 !important;
	white-space: nowrap !important;
}

@media (max-width: 600px) {
	.twd-variation-swatches {
		gap: 8px;
	}

	.twd-variation-swatch {
		width: 64px;
	}

	.twd-variation-swatch img {
		width: 50px;
		height: 50px;
	}
}
