/**
 * Colour swatch chips. Colour comes through the inline `--swatch` property;
 * image swatches fill the chip via `.tbb-chip--image img`.
 *
 * @package BlankBrandTheme
 */

.tbb-swatches {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 12px;
	margin: 1.5rem 0;
	padding: 0;
}

/* Single-product colour chips: no bottom margin. */
.tbb-swatches--chips {
	margin-bottom: 0;
}

/* Selected-colour label, e.g. "Colour: Army". */
.tbb-colour-label {
	margin: 1rem 0 0.4rem;
	font-weight: 600;
}

.tbb-colour-label .tbb-selected-colour {
	font-weight: 400;
}

.tbb-chip {
	appearance: none;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background-color: var(--swatch, #ccc);
	/* faint edge so pale/white swatches read, plus a soft drop shadow */
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	line-height: 0;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tbb-chip:hover {
	transform: translateY(-1px);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 9px rgba(0, 0, 0, 0.22);
}

.tbb-chip.is-active {
	box-shadow: 0 0 0 2px #111, 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Image swatch: the term's swatch image fills the chip inside the white ring. */
.tbb-chip--image {
	overflow: hidden;
	background-color: transparent;
}

.tbb-chip--image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: inherit;
}

/* No image/colour mapped yet: visible but not interactive. */
.tbb-chip--no-image {
	cursor: default;
}

/* Smaller chips under category-grid cards. */
.tbb-swatches--loop {
	gap: 10px;
	margin: 0.6rem 0 0;
	justify-content: flex-start;
}

.tbb-swatches--loop .tbb-chip {
	width: 28px;
	height: 28px;
	border-width: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tbb-swatches--loop .tbb-chip.is-active {
	box-shadow: 0 0 0 2px #111, 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tbb-swatches .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
