/* Values match the settings previously used on the site (rounded, 60px / 45px, #a8a8a8 border). */

.fc-vs-single,
.fc-vs-archive {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.variations th.label .woo-selected-variation-item-name {
	display: inline-block;
	margin-left: 2px;
}

.fc-vs-archive-wrapper {
	margin-top: 10px;
}

.fc-vs-archive {
	justify-content: center;
}

.fc-vs-single .variable-item,
.fc-vs-archive .variable-item {
	position: relative;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 4px;
	padding: 2px;
	list-style: none;
	border-radius: 100%;
	background-color: #fff;
	color: #000;
	box-shadow: 0 0 0 1px #a8a8a8;
	cursor: pointer;
	transition: box-shadow 0.2s ease;
}

.fc-vs-archive .variable-item {
	width: 45px;
	height: 45px;
}

.fc-vs-single .variable-item:hover,
.fc-vs-archive .variable-item:hover {
	box-shadow: 0 0 0 3px #000;
}

.fc-vs-single .variable-item.selected,
.fc-vs-archive .variable-item.selected {
	box-shadow: 0 0 0 2px #000;
}

.fc-vs-single .variable-item:focus-visible,
.fc-vs-archive .variable-item:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

.fc-vs-single .variable-item.disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.fc-vs-single .variable-item-contents,
.fc-vs-archive .variable-item-contents {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: inherit;
}

.fc-vs-single .variable-item-image,
.fc-vs-archive .variable-item-image {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border-radius: inherit;
}

/* Fallback for options without any image: text button. */
.fc-vs-single .button-variable-item,
.fc-vs-archive .button-variable-item {
	width: auto;
	min-width: 60px;
	padding: 0 10px;
	border-radius: 30px;
}

.variable-item-span-button {
	font-size: 16px;
	white-space: nowrap;
}

/* Tick on the selected image swatch. */
.fc-vs-single .image-variable-item.selected .variable-item-contents::after,
.fc-vs-archive .image-variable-item.selected .variable-item-contents::after {
	content: "";
	position: absolute;
	inset: 0;
	background: center / 55% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' stroke='%23000' stroke-width='5'/%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' stroke='%23fff' stroke-width='2.5'/%3E%3C/svg%3E");
	pointer-events: none;
}

/* Tooltip with the option name. */
.fc-vs-single [data-fc-vs-tooltip]::before,
.fc-vs-archive [data-fc-vs-tooltip]::before,
.fc-vs-single [data-fc-vs-tooltip]::after,
.fc-vs-archive [data-fc-vs-tooltip]::after {
	position: absolute;
	left: 50%;
	z-index: 999;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.fc-vs-single [data-fc-vs-tooltip]::before,
.fc-vs-archive [data-fc-vs-tooltip]::before {
	content: attr(data-fc-vs-tooltip);
	bottom: calc(100% + 8px);
	transform: translateX(-50%);
	width: max-content;
	max-width: 260px;
	padding: 4px 10px;
	border-radius: 3px;
	background-color: #333;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.3);
}

.fc-vs-single [data-fc-vs-tooltip]::after,
.fc-vs-archive [data-fc-vs-tooltip]::after {
	content: "";
	bottom: calc(100% + 2px);
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-bottom-width: 0;
	border-top-color: #333;
}

.fc-vs-single [data-fc-vs-tooltip]:hover::before,
.fc-vs-archive [data-fc-vs-tooltip]:hover::before,
.fc-vs-single [data-fc-vs-tooltip]:hover::after,
.fc-vs-archive [data-fc-vs-tooltip]:hover::after {
	visibility: visible;
	opacity: 1;
}
