/* WC AJAX Product Filters — frontend. Override the variables in your theme to restyle. */
.wcaf-filters {
	--wcaf-title: #001F3F;
	--wcaf-text: #5b6170;
	--wcaf-muted: #9aa0ad;
	--wcaf-line: #e3e5ea;
	--wcaf-box: #a7acb8;
	--wcaf-accent: #001F3F;
	--wcaf-track: #E4E8EF;
	--wcaf-fill: transparent;
	--wcaf-fill-range: rgba(0, 31, 63, .14);
	--wcaf-thumb: #fff;
	font-size: 15px;
	color: var(--wcaf-text);
}
.wcaf-filters [hidden] { display: none !important; }
.wcaf-filters.is-loading { cursor: progress; }

/* Group */
.wcaf-group { padding: 22px 0; border-bottom: 1px solid var(--wcaf-line); }
.wcaf-group:first-child { padding-top: 0; }
.wcaf-group:last-of-type { border-bottom: 0; }

.wcaf-group-head {
	display: flex; align-items: center; gap: 10px;
	margin: 0 0 14px; padding: 0;
	font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--wcaf-title);
}

.wcaf-icon { display: inline-flex; width: 20px; height: 20px; flex: 0 0 20px; color: var(--wcaf-title); }
.wcaf-icon svg { width: 100%; height: 100%; display: block; }
.wcaf-title { flex: 1 1 auto; font-size: 14px; font-weight: 600; color: var(--wcaf-title); line-height: 1.4; }

/* Checkbox list */
.wcaf-list { list-style: none; margin: 0; padding: 0; }
.wcaf-item { margin: 0; padding: 0; padding-inline-start: calc(var(--wcaf-depth, 0) * 18px); }
.wcaf-item label {
	display: flex; align-items: center; gap: 8px;
	padding: 5px 0; margin: 0; cursor: pointer; line-height: 1.4; color: var(--wcaf-text);
}
.wcaf-item input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.wcaf-box {
	flex: 0 0 14px; width: 14px; height: 14px; box-sizing: border-box;
	border: 1.5px solid var(--wcaf-box); border-radius: 3px; background: #fff;
	position: relative; transition: background .15s, border-color .15s;
}
.wcaf-item input:checked + .wcaf-box { background: var(--wcaf-accent); border-color: var(--wcaf-accent); }
.wcaf-item input:checked + .wcaf-box::after {
	content: ""; position: absolute; left: 3.5px; top: 0.5px; width: 4px; height: 8px;
	border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.wcaf-item input:focus-visible + .wcaf-box { outline: 2px solid var(--wcaf-accent); outline-offset: 2px; }
.wcaf-item label:hover .wcaf-box { border-color: var(--wcaf-accent); }
.wcaf-name { flex: 1 1 auto; }
.wcaf-count { margin-inline-start: auto; color: var(--wcaf-text); font-variant-numeric: tabular-nums; }
.wcaf-item.is-empty label { cursor: default; opacity: .45; }
.wcaf-item.is-empty label:hover .wcaf-box { border-color: var(--wcaf-box); }

/* Price */
.wcaf-price-value { color: var(--wcaf-title); font-weight: 500; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.wcaf-slider { position: relative; height: 22px; }
.wcaf-track {
	position: absolute; inset: 0; border-radius: 999px; background: var(--wcaf-track); overflow: hidden;
}
.wcaf-fill { position: absolute; top: 0; bottom: 0; background: var(--wcaf-fill); border-radius: 999px; }
.wcaf-price.is-range .wcaf-fill { background: var(--wcaf-fill-range); }
.wcaf-slider input[type=range] {
	-webkit-appearance: none; appearance: none;
	position: absolute; inset: 0; width: 100%; height: 22px; margin: 0; padding: 0 2px; box-sizing: border-box;
	background: transparent; outline: none; border: 0; z-index: 3;
}
.wcaf-price.is-range .wcaf-slider input[type=range] { pointer-events: none; }
.wcaf-slider input[type=range]::-webkit-slider-runnable-track { height: 22px; background: transparent; border: 0; }
.wcaf-slider input[type=range]::-moz-range-track { height: 22px; background: transparent; border: 0; }
.wcaf-slider input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
	width: 28px; height: 16px; margin-top: 3px; border-radius: 999px; border: 0;
	background: var(--wcaf-thumb); box-shadow: 0 1px 3px rgba(20, 30, 60, .25);
}
.wcaf-slider input[type=range]::-moz-range-thumb {
	pointer-events: auto; cursor: grab;
	width: 28px; height: 16px; border-radius: 999px; border: 0;
	background: var(--wcaf-thumb); box-shadow: 0 1px 3px rgba(20, 30, 60, .25);
}
.wcaf-slider input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(0, 31, 63, .3); }
.wcaf-slider input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(0, 31, 63, .3); }
.wcaf-price-bounds {
	display: flex; justify-content: space-between; margin-top: 8px;
	font-size: 12px; color: var(--wcaf-muted); font-variant-numeric: tabular-nums;
}

/* Actions */
.wcaf-actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.wcaf-actions:empty { display: none; }
.wcaf-apply { flex: 1 1 auto; }
.wcaf-clear { font-size: 14px; color: var(--wcaf-title); text-decoration: underline; cursor: pointer; }
.wcaf-clear:hover, .wcaf-clear:focus { color: var(--wcaf-accent); }

/* Results loading state */
.wcaf-loading { opacity: .4; pointer-events: none; transition: opacity .2s; }
html.wcaf-busy { cursor: progress; }

/* ---------- Infinite loading / Load more (works on every product listing) ---------- */
html.wcaf-has-more .woocommerce-pagination,
html.wcaf-has-more .wp-block-query-pagination { display: none !important; }
.wcaf-more {
	--wcaf-accent: #001F3F;
	clear: both; display: flex; flex-direction: column; align-items: center; gap: 10px;
	padding: 24px 0 8px; min-height: 1px; text-align: center;
}
.wcaf-spinner {
	display: none; width: 28px; height: 28px; border-radius: 50%;
	border: 3px solid #E4E8EF; border-top-color: var(--wcaf-accent);
	animation: wcaf-spin .7s linear infinite;
}
.wcaf-more[data-state="loading"] .wcaf-spinner { display: block; }
.wcaf-more[data-state="loading"] .wcaf-more-btn,
.wcaf-more.is-done .wcaf-more-btn { display: none; }
.wcaf-more-status { font-size: 14px; color: #6b7280; }
.wcaf-more-status:empty { display: none; }
.wcaf-more-btn { min-width: 200px; }
@keyframes wcaf-spin { to { transform: rotate(360deg); } }

.wcaf-appear { opacity: 0; transform: translateY(10px); transition: opacity .35s ease, transform .35s ease; }
.wcaf-appear.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.wcaf-appear { transition: none; transform: none; }
	.wcaf-spinner { animation-duration: 2s; }
}
