/* CHUCHI – variation colour swatches */

.chuchi-has-swatches select.chuchi-swatch-hidden-select,
select.chuchi-swatch-hidden-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden !important;
}

.chuchi-swatches {
	/* NOTE: do not redeclare --chuchi-swatch-* here. This div sits *between*
	 * the element root (which sets these via inline style) and .chuchi-swatch__dot
	 * (which reads them) — a fixed value here would shadow the inherited one for
	 * every ancestor below, and the element's size/gap/shape controls would look
	 * like they do nothing. Keep fallbacks only in the var() calls at the point
	 * of use (below). */
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--chuchi-swatch-gap, 10px);
	margin: 6px 0 2px;
}

.chuchi-swatch {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	line-height: 1;
	color: inherit;
	font: inherit;
}

.chuchi-swatch__dot {
	width: var(--chuchi-swatch-size, 30px);
	height: var(--chuchi-swatch-size, 30px);
	border-radius: var(--chuchi-swatch-radius, 999px);
	background: var(--chuchi-swatch-c, #cccccc);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chuchi-swatch__txt {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.25);
	font-size: 0.85em;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chuchi-swatch__label {
	font-size: 0.75em;
	opacity: 0.8;
}

.chuchi-swatch:hover .chuchi-swatch__dot {
	transform: scale(1.08);
}

.chuchi-swatch.is-selected .chuchi-swatch__dot {
	box-shadow:
		inset 0 0 0 1px rgba(0, 0, 0, 0.18),
		0 0 0 2px var(--chuchi-swatch-bg, #fff),
		0 0 0 4px var(--chuchi-swatch-ring, currentColor);
}

.chuchi-swatch.is-selected .chuchi-swatch__txt {
	border-color: var(--chuchi-swatch-ring, currentColor);
	box-shadow: 0 0 0 1px var(--chuchi-swatch-ring, currentColor) inset;
}

.chuchi-swatch.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
}
.chuchi-swatch.is-disabled .chuchi-swatch__dot {
	position: relative;
	overflow: hidden;
}
.chuchi-swatch.is-disabled .chuchi-swatch__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top left,
		transparent 46%,
		rgba(0, 0, 0, 0.45) 46%,
		rgba(0, 0, 0, 0.45) 54%,
		transparent 54%
	);
}

/* Bricks element wrapper */
.brxe-chuchi-variation-swatches .chuchi-swatches {
	margin: 0;
}
.brxe-chuchi-variation-swatches .chuchi-swatches + .chuchi-swatches {
	margin-top: var(--chuchi-swatch-gap, 10px);
}

/* Variation Swatches – optional section title (matches the Size element head) */
.chuchi-swatches-wrap__head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px;
	margin-bottom: 8px;
}
.chuchi-swatches-wrap__label {
	font-weight: 600;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
}
.chuchi-swatches-wrap__value {
	font-size: 0.85rem;
	opacity: 0.75;
}
.chuchi-swatches-wrap__value::before {
	content: var(--chuchi-title-sep, ": ");
	white-space: pre;
}
.chuchi-swatches-wrap.is-upper .chuchi-swatches-wrap__head {
	text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * Size Swatches element  (chuchi-size-swatches)
 * ---------------------------------------------------------------------- */
.chuchi-size {
	--chuchi-size-min: 48px;
	--chuchi-size-h: 44px;
	--chuchi-size-gap: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.chuchi-size__head {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 8px;
}
.chuchi-size__label {
	font-weight: 600;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
}
.chuchi-size__value {
	font-size: 0.85rem;
	opacity: 0.75;
}
.chuchi-size__value::before {
	content: var(--chuchi-title-sep, ": ");
	white-space: pre;
}
.chuchi-size.is-upper .chuchi-size__head {
	text-transform: uppercase;
}
.chuchi-size__guide {
	margin-left: auto;
	font-size: 0.78rem;
	text-decoration: underline;
}
.chuchi-size__hint {
	font-size: 0.78rem;
	opacity: 0.8;
	min-height: 1em;
}

.chuchi-swatches--size {
	flex-wrap: nowrap;
	width: 100%;
	gap: var(--chuchi-size-gap, 12px);
}
.chuchi-swatches--size .chuchi-swatch {
	flex: 1 1 0;
	min-width: 0;
	flex-direction: row;
}
.chuchi-swatches--size .chuchi-swatch__txt {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--chuchi-size-h, 44px);
	padding: 0 10px;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.28);
	box-sizing: border-box;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chuchi-swatches--size .chuchi-swatch:hover .chuchi-swatch__txt {
	border-color: currentColor;
}
.chuchi-swatches--size .chuchi-swatch.is-selected .chuchi-swatch__txt {
	background: var(--chuchi-swatch-ring, #1c1c19);
	border-color: var(--chuchi-swatch-ring, #1c1c19);
	color: #fff;
	box-shadow: none;
}
.chuchi-swatches--size .chuchi-swatch.is-disabled .chuchi-swatch__txt {
	text-decoration: line-through;
}
