.furniture-swatches {
	display: flex;
	flex-direction: column;
	gap: var(--f-space-2);
}

.furniture-swatches__label {
	font-size: var(--f-fs-sm);
	font-weight: 600;
}

.furniture-swatches__current {
	font-weight: 400;
	color: var(--f-color-text-soft);
}

.furniture-swatches__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--f-space-2);
}

.furniture-swatches--card {
	flex-direction: row;
	align-items: center;
	gap: var(--f-space-2);
}

.furniture-swatches--card .furniture-swatches__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.furniture-swatches--card .furniture-swatches__list {
	gap: 6px;
}

.furniture-swatch {
	--swatch-size: 36px;
	--swatch-ring: var(--f-color-border);
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--swatch-size);
	height: var(--swatch-size);
	padding: 3px;
	border-radius: var(--f-radius-pill);
	border: 1px solid var(--swatch-ring);
	background: var(--f-color-surface);
	cursor: pointer;
	transition: border-color var(--f-dur) var(--f-ease), box-shadow var(--f-dur) var(--f-ease), transform var(--f-dur) var(--f-ease);
}

.furniture-swatches--card .furniture-swatch {
	--swatch-size: 24px;
	padding: 2px;
}

.furniture-swatch:hover {
	--swatch-ring: var(--f-color-text-soft);
}

.furniture-swatch:focus-visible {
	outline: none;
	box-shadow: var(--f-focus);
}

.furniture-swatch[aria-checked="true"],
.furniture-swatch.is-selected {
	--swatch-ring: var(--f-color-primary);
	box-shadow: 0 0 0 1px var(--f-color-primary);
}

.furniture-swatch[aria-checked="true"]::after {
	content: "";
	position: absolute;
	right: -3px;
	bottom: -3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--f-color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12 10 17 19 7'/%3E%3C/svg%3E") center / 8px no-repeat;
	border: 1px solid #fff;
}

.furniture-swatches--card .furniture-swatch[aria-checked="true"]::after {
	width: 10px;
	height: 10px;
	background-size: 6px;
}

.furniture-swatch__inner {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--swatch-color, var(--f-color-muted));
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

.furniture-swatch__inner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.furniture-swatch--color,
.furniture-swatch--image {
	width: var(--swatch-size);
}

.furniture-swatch--label {
	padding-inline: var(--f-space-3);
	border-radius: var(--f-radius-sm);
}

.furniture-swatch__text {
	font-size: var(--f-fs-sm);
	font-weight: 500;
	white-space: nowrap;
}

.furniture-swatches--card .furniture-swatch__text {
	font-size: var(--f-fs-xs);
}

.furniture-swatch.is-oos,
.furniture-swatch[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: 0.45;
}

.furniture-swatch.is-oos::before,
.furniture-swatch[aria-disabled="true"]::before {
	content: "";
	position: absolute;
	left: 50%;
	top: -2px;
	bottom: -2px;
	width: 1.5px;
	background: var(--f-color-primary);
	transform: translateX(-50%) rotate(45deg);
	z-index: 1;
}

.furniture-swatch--label.is-oos .furniture-swatch__text,
.furniture-swatch--label[aria-disabled="true"] .furniture-swatch__text {
	text-decoration: line-through;
}

.furniture-swatch--label.is-oos::before,
.furniture-swatch--label[aria-disabled="true"]::before {
	display: none;
}

.furniture-swatches__more {
	font-size: var(--f-fs-xs);
	font-weight: 600;
	color: var(--f-color-text-soft);
	text-decoration: none;
	padding: 2px 4px;
	border-radius: var(--f-radius-sm);
}

.furniture-swatches__more:hover {
	color: var(--f-color-primary);
}

.furniture-swatch-field {
	display: flex;
	flex-direction: column;
	gap: var(--f-space-2);
}

.furniture-swatch-field select[data-furniture-swatch-select] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	opacity: 0;
	pointer-events: none;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.variations tr:has(.furniture-swatch-field) th.label {
	display: none;
}

.variations tr:has(.furniture-swatch-field) td.value {
	display: block;
	width: 100%;
}

.furniture-swatch-field .furniture-swatches--form {
	order: -1;
}

.furniture-swatch-filter__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--f-space-2) var(--f-space-3);
}

.furniture-swatch-filter {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--f-space-2);
	min-height: 40px;
	cursor: pointer;
	font-size: var(--f-fs-sm);
}

.furniture-swatch-filter__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.furniture-swatch-filter .furniture-swatch {
	--swatch-size: 28px;
	flex-shrink: 0;
	width: var(--swatch-size);
	min-width: var(--swatch-size);
	padding: 2px;
}

.furniture-swatch__inner--empty {
	background: repeating-linear-gradient(45deg, var(--f-color-muted), var(--f-color-muted) 3px, #fff 3px, #fff 6px);
}

.furniture-swatch-filter__input:checked + .furniture-swatch {
	--swatch-ring: var(--f-color-primary);
	box-shadow: 0 0 0 1px var(--f-color-primary);
}

.furniture-swatch-filter__input:checked + .furniture-swatch::after {
	content: "";
	position: absolute;
	right: -3px;
	bottom: -3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid #fff;
	background: var(--f-color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12 10 17 19 7'/%3E%3C/svg%3E") center / 8px no-repeat;
}

.furniture-swatch-filter__input:checked ~ .furniture-swatch-filter__name {
	font-weight: 600;
}

.furniture-swatch-filter__input:focus-visible + .furniture-swatch {
	box-shadow: var(--f-focus);
}
