/*
 * Vi Feerie — Attribute variation swatches
 *
 * Thay dropdown <select> variation của WooCommerce bằng dãy swatch.
 * Priority: image > color > text (quyết định ở PHP, class --image/--color/--text).
 */

.vfr-swatches {
	margin: 6px 0 14px;
}

/* Giữ <select> tồn tại trong DOM để WC variation.js hoạt động, chỉ ẩn visually. */
.vfr-swatches__select {
	position: absolute !important;
	opacity: 0;
	pointer-events: none;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.vfr-swatches__select[hidden] {
	display: none !important;
	width: 1px !important;
	min-width: 0 !important;
	max-width: 1px !important;
}

.vfr-swatches__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vfr-swatches__item {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	padding: 0;
	border: 2px solid var(--line, #ece3e7);
	background: transparent;
	border-radius: 999px;
	transition: border-color 0.2s var(--ease, ease), transform 0.2s var(--ease, ease), box-shadow 0.2s var(--ease, ease);
	position: relative;
	overflow: hidden;
}

.vfr-swatches__item:hover {
	border-color: var(--brand, #c9abbd);
}

.vfr-swatches__item.is-active {
	border-color: var(--brand-deep, #8f6b84);
	box-shadow: 0 0 0 2px rgba(143, 107, 132, 0.18);
}

/* ---------- Mode: image ---------- */
.vfr-swatches__item--image {
	width: 48px;
	height: 48px;
}
.vfr-swatches__item--image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 999px;
}

/* ---------- Mode: color ---------- */
.vfr-swatches__item--color {
	width: 36px;
	height: 36px;
	background-color: var(--swatch-color, #eee);
	background-clip: padding-box;
}

/* ---------- Mode: text ---------- */
.vfr-swatches__item--text {
	min-width: 48px;
	height: 36px;
	padding: 0 14px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 500;
	color: var(--ink, #382213);
	background: var(--bg-soft, #fdf8fa);
}
.vfr-swatches__item--text.is-active {
	background: var(--brand-soft, #ffe9f1);
	color: var(--brand-deep, #8f6b84);
}

.vfr-swatches__text {
	line-height: 1;
	white-space: nowrap;
}

/* Hide the native WC "Clear" link right after swatches when nothing selected. */
.vfr-swatches + .reset_variations {
	display: inline-block;
	margin-left: 6px;
	font-size: 12px;
}
