.xtool-loop-filter {
	width: 100%;
	box-sizing: border-box;
}

.xtool-loop-filter__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.xtool-loop-filter__title {
	font-weight: 700;
	font-size: 20px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.xtool-loop-filter__count {
	font-size: 13px;
}

.xtool-loop-filter__divider {
	border: none;
	border-top: 1px solid #E5E0D8;
	margin: 16px 0;
}

.xtool-loop-filter__notice {
	padding: 16px;
	border: 1px dashed #D4CEC7;
	border-radius: 6px;
	color: #8A8680;
	font-size: 13px;
}

/* ── Group / disclosure ─────────────────────────────────────────── */

.xtool-loop-filter__group {
	margin-bottom: 4px;
}

.xtool-loop-filter__group-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	list-style: none;
	padding: 4px 0;
}

.xtool-loop-filter__group-header::-webkit-details-marker {
	display: none;
}

.xtool-loop-filter__group-header::after {
	content: "";
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-135deg);
	transition: transform 0.15s ease;
	flex: 0 0 auto;
}

.xtool-loop-filter__group[open] > .xtool-loop-filter__group-header::after {
	transform: rotate(45deg);
}

.xtool-loop-filter__group-label {
	font-weight: 700;
	font-size: 15px;
}

.xtool-loop-filter__group-body {
	padding-top: 14px;
}

.xtool-loop-filter__group-body--checkbox {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.xtool-loop-filter__option {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.xtool-loop-filter__option input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #1C1C1E;
}

.xtool-loop-filter__option span {
	font-size: 14px;
}

/* ── Pills ───────────────────────────────────────────────────────── */

.xtool-loop-filter__group-body--pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.xtool-loop-filter__pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	box-sizing: border-box;
	border: 1px solid #D4CEC7;
	border-radius: 4px;
	cursor: pointer;
}

.xtool-loop-filter__pill input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.xtool-loop-filter__pill span {
	font-size: 13px;
	color: #4A4742;
	pointer-events: none;
}

.xtool-loop-filter__pill input:checked + span {
	color: #ffffff;
}

.xtool-loop-filter__pill:has(input:checked) {
	background: #1C1C1E;
	border-color: #1C1C1E;
}

/* ── Swatches ────────────────────────────────────────────────────── */

.xtool-loop-filter__group-body--swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.xtool-loop-filter__swatch {
	position: relative;
	display: inline-flex;
	width: 44px;
	height: 44px;
	cursor: pointer;
}

.xtool-loop-filter__swatch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.xtool-loop-filter__swatch-ring {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	box-sizing: border-box;
}

.xtool-loop-filter__swatch-color {
	width: calc(100% - 6px);
	height: calc(100% - 6px);
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.xtool-loop-filter__swatch-ring--text {
	border: 1px solid #D4CEC7;
	border-radius: 4px;
	font-size: 11px;
	color: #4A4742;
	padding: 0 4px;
	text-align: center;
}

.xtool-loop-filter__swatch input:checked ~ .xtool-loop-filter__swatch-ring--text {
	border-color: #1C1C1E;
	color: #1C1C1E;
	font-weight: 600;
}

/*
 * A real color ring's own selected-state border is otherwise driven
 * ENTIRELY by the "Selected Color" Elementor control's own generated
 * selectors=CSS (see class-loop-filter.php) — this static default
 * exists so a checked color swatch always shows a visible ring even
 * before/without that per-post generated CSS being present, matching
 * this codebase's own established "never rely solely on Elementor's
 * separate per-post CSS cache for a control's default appearance"
 * convention. The control's own rule (same specificity, loads after
 * this stylesheet) still wins whenever a custom color is actually set.
 */
.xtool-loop-filter__swatch input:checked ~ .xtool-loop-filter__swatch-ring {
	border-color: #1C1C1E;
}

/* ── Price Range (two overlapping native range inputs) ──────────── */

.xtool-loop-filter__price-labels {
	display: flex;
	justify-content: space-between;
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 16px;
}

.xtool-loop-filter__price-slider {
	position: relative;
	/*
	 * Handle Size (--xtool-loop-filter-handle-size, set by the Elementor
	 * control on this same element) always gets exactly 4px of breathing
	 * room above/below it - the +4px keeps the DEFAULT 16px handle giving
	 * exactly the same 20px box height this was always hardcoded to, so
	 * nothing changes in appearance until Handle Size is actually touched,
	 * while a custom size stays correctly centered too (see the thumb's
	 * own margin-top below, which relies on this exact +4px relationship
	 * to stay a constant 2px regardless of what size is chosen).
	 */
	height: calc(var(--xtool-loop-filter-handle-size, 16px) + 4px);
}

.xtool-loop-filter__price-track,
.xtool-loop-filter__price-fill {
	position: absolute;
	top: 50%;
	height: var(--xtool-loop-filter-track-h, 2px);
	transform: translateY(-50%);
	border-radius: 2px;
}

.xtool-loop-filter__price-track {
	left: 0;
	right: 0;
	background: #E5E0D8;
}

.xtool-loop-filter__price-fill {
	background: #1C1C1E;
}

.xtool-loop-filter__price-input {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	width: 100%;
	margin: 0;
	background: transparent;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.xtool-loop-filter__price-input::-webkit-slider-runnable-track {
	-webkit-appearance: none;
	background: transparent;
	height: calc(var(--xtool-loop-filter-handle-size, 16px) + 4px);
}

.xtool-loop-filter__price-input::-moz-range-track {
	background: transparent;
	height: calc(var(--xtool-loop-filter-handle-size, 16px) + 4px);
}

.xtool-loop-filter__price-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: var(--xtool-loop-filter-handle-size, 16px);
	height: var(--xtool-loop-filter-handle-size, 16px);
	border-radius: 50%;
	background: #1C1C1E;
	cursor: pointer;
	/* Always exactly (track height - handle size) / 2 = 2px, thanks to
	   the runnable-track's own height being handle-size + 4px above -
	   stays correctly centered for any Handle Size, not just the 16px
	   default. */
	margin-top: 2px;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.xtool-loop-filter__price-input::-moz-range-thumb {
	pointer-events: auto;
	width: var(--xtool-loop-filter-handle-size, 16px);
	height: var(--xtool-loop-filter-handle-size, 16px);
	border-radius: 50%;
	background: #1C1C1E;
	cursor: pointer;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* ── Apply button ────────────────────────────────────────────────── */

.xtool-loop-filter__apply {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 16px 20px;
	background: #1C1C1E;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.xtool-loop-filter__apply:hover {
	background: #3A3A3C;
}

.xtool-loop-filter__apply.is-loading {
	opacity: 0.6;
	cursor: default;
}
