/**
 * Orpat — colour / variant options on product-listing tiles.
 *
 * Sits directly under the tile image. Deliberately thin: the swatch face itself
 * is WoodMart's own .wd-swatch (round, bordered, tooltip), so the row inherits
 * the theme's shape and colour tokens and stays consistent with the swatches on
 * the product page. Only layout, sizing and the "+N" chip are defined here.
 *
 * Rollback: this file is loaded only by inc/orpat-listing-variants.php.
 */

.opg-lv {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 8px;
	min-height: 26px;
}

/* Row is decoration for the tile: never let it steal the tile's own click area. */
.opg-lv__swatch {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	overflow: hidden;
	position: relative;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
	transition: transform .18s ease, box-shadow .18s ease;
}

/*
 * The colour NAME is an accessible label, never a visible one: the chip is the
 * colour. WoodMart already hides it via
 * `.wd-swatch.wd-bg .wd-swatch-text{display:none}` in parts/woo-mod-swatches-base,
 * but that part is conditionally loaded, and when it is absent the label becomes
 * a flex sibling of the fill and squashes the chip into clipped text ("Blac",
 * "Whit"). Repeating it here makes the row self-contained.
 * The name is still announced: the <a> carries title + aria-label.
 * Rollback plan: delete this rule.
 */
.opg-lv__swatch .wd-swatch-text {
	display: none;
}

.opg-lv__swatch .wd-swatch-bg {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
}

.opg-lv__swatch img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.opg-lv__swatch:hover,
.opg-lv__swatch:focus-visible {
	transform: translateY(-1px) scale(1.08);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .16);
	z-index: 2;
}

.opg-lv__swatch:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* The colour currently on the tile. */
.opg-lv__swatch.is-current {
	box-shadow: inset 0 0 0 1px #fff, 0 0 0 2px currentColor;
}

/* "+3" chip — same round footprint, typographic instead of photographic. */
.opg-lv__more {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 6px;
	border-radius: 13px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
	transition: box-shadow .18s ease;
}

.opg-lv__more:hover,
.opg-lv__more:focus-visible {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .34);
}

/* While a swatch is being previewed, calm the tile image transition. */
.opg-lv-previewing .wd-product-thumb img {
	transition: opacity .18s ease;
	opacity: .96;
}

/* Touch / small screens: bigger targets, no hover-preview affordance. */
@media (max-width: 767px) {
	.opg-lv {
		gap: 8px;
		margin-bottom: 6px;
	}

	.opg-lv__swatch,
	.opg-lv__more {
		width: 28px;
		height: 28px;
		min-width: 28px;
	}
}

/* List view puts the row under a wider column — keep it on one line. */
.product-list-item .opg-lv {
	margin-top: 4px;
}
