/**
 * Product card variation swatches (includes/buldog-loop-variation-swatches.php).
 * Alignment and gap: the widget's style controls (they target .buldog-loop-variations .variable-items-wrapper).
 */
.buldog-loop-variations-widget {
	display: block;
	width: 100%;
}

.buldog-loop-swatches {
	--bd-swatch-size: 32px;
	--bd-swatch-border: #d6d6d6;
	--bd-swatch-active: #000;
	width: 100%;
	margin: 0;
	/* Padding, not margin: the templates' widget has a -7/-8px mobile margin (set for Pro's markup). */
	padding: 8px 0;
}

.buldog-loop-swatches .variable-items-wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Reset the theme's global button styles (Hello / Elementor kit) — every property set here. */
.buldog-loop-swatches .buldog-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: var(--bd-swatch-size);
	height: var(--bd-swatch-size);
	min-height: 0;
	margin: 0;
	padding: 0 10px;
	overflow: hidden;
	border: 1px solid var(--bd-swatch-border);
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	color: #222;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: normal;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.buldog-loop-swatches--images .buldog-swatch:not(.buldog-swatch--more) {
	width: var(--bd-swatch-size);
	padding: 0;
}

.buldog-loop-swatches .buldog-swatch__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: inherit;
	object-fit: cover;
}

.buldog-loop-swatches .buldog-swatch__text {
	display: block;
	max-width: 9em;
	overflow: hidden;
	text-overflow: ellipsis;
}

.buldog-loop-swatches .buldog-swatch:hover,
.buldog-loop-swatches .buldog-swatch:focus {
	border-color: var(--bd-swatch-active);
	background: #fff;
	color: #222;
}

.buldog-loop-swatches .buldog-swatch:focus {
	outline: none;
}

.buldog-loop-swatches .buldog-swatch:focus-visible {
	outline: 2px solid var(--bd-swatch-active);
	outline-offset: 2px;
}

.buldog-loop-swatches .buldog-swatch[aria-checked="true"] {
	border-color: var(--bd-swatch-active);
	box-shadow: inset 0 0 0 1px var(--bd-swatch-active);
	font-weight: 600;
}

.buldog-loop-swatches--images .buldog-swatch[aria-checked="true"] {
	box-shadow: 0 0 0 1px #fff inset, 0 0 0 2px var(--bd-swatch-active);
}

/* Out of stock: shown, crossed out, not selectable. */
.buldog-loop-swatches .buldog-swatch--unavailable {
	cursor: not-allowed;
	opacity: 0.45;
}

.buldog-loop-swatches .buldog-swatch--unavailable::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top left, transparent calc(50% - 1px), #727272 50%, transparent calc(50% + 1px));
	pointer-events: none;
}

.buldog-loop-swatches .buldog-swatch--unavailable:hover,
.buldog-loop-swatches .buldog-swatch--unavailable:focus {
	border-color: var(--bd-swatch-border);
}

.buldog-loop-swatches .buldog-swatch--more {
	direction: ltr;
	unicode-bidi: isolate;
	padding: 0 8px;
	border-style: dashed;
	color: #555;
	font-size: 12px;
}

/* Card image while the picked variation's photo loads. */
.buldog-loop-swatch-img-loading {
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

@media (max-width: 767px) {
	.buldog-loop-swatches {
		--bd-swatch-size: 30px;
	}

	.buldog-loop-swatches .variable-items-wrapper {
		gap: 5px;
	}
}
