/*
 * Variation labels on the single product page.
 * Fills each column from top to bottom, at most ten labels, then the next column.
 * Category cards use .cfvsw-shop-container and are not affected.
 */

.single-product div.summary {
	container-type: inline-size;
	container-name: product-summary;
}

.single-product table.variations {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
}

.single-product table.variations th.label {
	width: 8em;
	white-space: nowrap;
}

.single-product table.variations td.value {
	width: auto;
	max-width: 100%;
	min-width: 0;
}

.single-product .cfvsw-product-container {
	display: grid;
	grid-auto-flow: row;
	grid-template-columns: fit-content(220px);
	grid-template-rows: none;
	justify-content: start;
	justify-items: stretch;
	column-gap: 10px;
	row-gap: 7px;
	width: max-content;
	max-width: 100%;
	min-width: 0;
}

.single-product .cfvsw-product-container:has(.cfvsw-swatches-option:nth-child(11)) {
	grid-auto-flow: column;
	grid-template-columns: none;
	grid-template-rows: repeat(10, auto);
	grid-auto-columns: fit-content(220px);
}

.single-product .cfvsw-product-container .cfvsw-swatches-option {
	box-sizing: border-box;
	width: auto;
	min-width: 72px;
	max-width: 220px;
	height: auto;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid #d7dee8;
	border-radius: 4px !important;
	background: #fff;
	color: #17345c;
	white-space: normal;
	text-align: left;
	justify-content: flex-start;
	line-height: 1.3;
}

.single-product .cfvsw-product-container .cfvsw-swatch-inner {
	width: 100%;
	height: auto;
	white-space: normal;
	overflow-wrap: break-word;
	text-align: left;
	justify-content: flex-start;
	color: inherit;
}

.single-product .cfvsw-product-container .cfvsw-label-option:not(.cfvsw-selected-swatch):not(.cfvsw-swatches-disabled):not(.cfvsw-swatches-out-of-stock):hover {
	background: rgba(233, 45, 43, 0.1);
	border-color: #f0b4b3;
	color: #17345c;
}

.single-product .cfvsw-product-container .cfvsw-selected-swatch,
.single-product .cfvsw-product-container .cfvsw-selected-swatch:hover {
	background: #e92d2b;
	border-color: #e92d2b !important;
	color: #fff;
}

.single-product .cfvsw-product-container .cfvsw-swatches-disabled,
.single-product .cfvsw-product-container .cfvsw-swatches-disabled:hover,
.single-product .cfvsw-product-container .cfvsw-swatches-out-of-stock,
.single-product .cfvsw-product-container .cfvsw-swatches-out-of-stock:hover {
	background: #f4f5f7;
	border-color: #e1e5ea !important;
	color: #8a94a0;
	text-decoration: line-through;
	cursor: not-allowed;
}

@container product-summary (max-width: 420px) {
	.single-product .cfvsw-product-container,
	.single-product .cfvsw-product-container:has(.cfvsw-swatches-option:nth-child(11)),
	.single-product .cfvsw-product-container:has(.cfvsw-swatches-option:nth-child(21)),
	.single-product .cfvsw-product-container:has(.cfvsw-swatches-option:nth-child(31)) {
		grid-auto-flow: row;
		grid-template-columns: fit-content(220px);
		grid-template-rows: none;
		grid-auto-columns: unset;
		width: max-content;
		max-width: 100%;
	}
}

.single-product .cfvsw-product-container.sdp-swatches-numeric,
.single-product .cfvsw-product-container.sdp-swatches-numeric:has(.cfvsw-swatches-option:nth-child(11)),
.single-product .cfvsw-product-container.sdp-swatches-numeric:has(.cfvsw-swatches-option:nth-child(21)),
.single-product .cfvsw-product-container.sdp-swatches-numeric:has(.cfvsw-swatches-option:nth-child(31)) {
	display: flex;
	flex-flow: row wrap;
	align-items: stretch;
	justify-content: flex-start;
	column-gap: 8px;
	row-gap: 8px;
	grid-auto-flow: unset;
	grid-template-columns: none;
	grid-template-rows: none;
	grid-auto-columns: unset;
	width: 100%;
	max-width: 100%;
}

.single-product .cfvsw-product-container.sdp-swatches-numeric .cfvsw-swatches-option {
	flex: 0 0 auto;
	width: auto;
	min-width: 72px !important;
	max-width: none;
	white-space: nowrap;
	text-align: center;
	justify-content: center;
}

.single-product .cfvsw-product-container.sdp-swatches-numeric .cfvsw-swatch-inner {
	width: auto;
	white-space: nowrap;
	text-align: center;
	justify-content: center;
}

@container product-summary (min-width: 421px) and (max-width: 680px) {
	.single-product .cfvsw-product-container:has(.cfvsw-swatches-option:nth-child(21)) {
		grid-template-rows: repeat(15, auto);
	}

	.single-product .cfvsw-product-container:has(.cfvsw-swatches-option:nth-child(31)) {
		grid-template-rows: repeat(20, auto);
	}
}
