/* WC Advanced Product Filters - frontend */

.wcaf-wrap { position: relative; }

.wcaf-filters {
	position: relative;
	font-family: var(--wcaf-font, inherit);
	font-size: var(--wcaf-font-size, 14px);
	color: var(--wcaf-text, inherit);
	line-height: 1.5;
}
.wcaf-filters.is-loading { opacity: .55; pointer-events: none; }

.wcaf-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wcaf-head__title { margin: 0; font-size: 16px; font-weight: 600; color: var(--wcaf-heading, inherit); }
.wcaf-close { display: none; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; }

/* Chips ------------------------------------------------------------------ */
.wcaf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wcaf-chip {
	display: inline-flex; align-items: center; gap: 6px;
	background: #f2f4f7; border: 1px solid #e2e6ea; border-radius: 999px;
	padding: 4px 10px; font-size: 12px; cursor: pointer; color: #333;
}
.wcaf-chip:hover { background: #e8ebee; }
.wcaf-chip span { font-size: 14px; line-height: 1; opacity: .6; }

/* Blocks ----------------------------------------------------------------- */
.wcaf-block { border-bottom: 1px solid #ececec; padding: 14px 0; }
.wcaf-block:last-of-type { border-bottom: 0; }
.wcaf-block__title {
	display: flex; align-items: center; justify-content: space-between;
	width: 100%; background: none; border: 0; padding: 2px 0 6px;
	font-size: var(--wcaf-heading-size, 15px);
	font-weight: var(--wcaf-heading-weight, 700);
	letter-spacing: .01em;
	text-align: left; cursor: pointer; color: var(--wcaf-heading, inherit);
}
.wcaf-arrow {
	width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg); transition: transform .2s ease; margin-left: 8px; opacity: .55;
}
.wcaf-block.is-collapsed .wcaf-arrow { transform: rotate(-45deg); }
.wcaf-block__body { padding-top: 8px; }
.wcaf-block.is-collapsed .wcaf-block__body { display: none; }

/* Option lists ----------------------------------------------------------- */
.wcaf-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.wcaf-list--button, .wcaf-list--swatch { display: flex; flex-wrap: wrap; gap: 8px; max-height: none; }
.wcaf-item { margin: 0 0 6px; }
.wcaf-item.wcaf-hidden-item { display: none; }
.wcaf-list.is-expanded .wcaf-hidden-item { display: block; }
.wcaf-depth-1 { padding-left: 16px; }

.wcaf-choice, .wcaf-text, .wcaf-pill, .wcaf-swatch {
	display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0;
}
.wcaf-choice input, .wcaf-text input, .wcaf-pill input, .wcaf-swatch input {
	position: absolute; opacity: 0; width: 0; height: 0;
}
.wcaf-box {
	flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid #c9ced6; border-radius: 3px;
	background: #fff; position: relative; transition: all .15s ease;
}
.wcaf-list--radio .wcaf-box, .wcaf-choice input[type="radio"] + .wcaf-box { border-radius: 50%; }
.wcaf-choice input:checked + .wcaf-box { background: var(--wcaf-accent, #2b6cb0); border-color: var(--wcaf-accent, #2b6cb0); }
.wcaf-choice input:checked + .wcaf-box::after {
	content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px;
	border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.wcaf-choice input[type="radio"]:checked + .wcaf-box::after {
	left: 4px; top: 4px; width: 6px; height: 6px; border: 0; background: #fff; border-radius: 50%; transform: none;
}
.wcaf-choice input:focus-visible + .wcaf-box { outline: 2px solid var(--wcaf-accent, #2b6cb0); outline-offset: 2px; }

.wcaf-label { flex: 1 1 auto; }
.wcaf-count { color: #8a8f98; font-size: 12px; }
.wcaf-item.is-checked .wcaf-label { font-weight: 600; color: var(--wcaf-accent, #2b6cb0); }

.wcaf-text { padding: 2px 0; }
.wcaf-text input:checked ~ .wcaf-label { color: var(--wcaf-accent, #2b6cb0); font-weight: 600; }

.wcaf-pill {
	border: 1px solid #d8dde3; border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.wcaf-pill input:checked ~ .wcaf-label { color: #fff; }
.wcaf-item:has(.wcaf-pill input:checked) .wcaf-pill { background: var(--wcaf-accent, #2b6cb0); border-color: var(--wcaf-accent, #2b6cb0); color: #fff; }

/* Swatches --------------------------------------------------------------- */
.wcaf-swatch { flex-direction: column; gap: 4px; text-align: center; width: 56px; }
.wcaf-swatch__dot {
	width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15);
	box-shadow: 0 0 0 2px #fff inset; transition: box-shadow .15s ease;
}
.wcaf-swatch input:checked + .wcaf-swatch__dot {
	box-shadow: 0 0 0 2px #fff inset, 0 0 0 2px var(--wcaf-accent, #2b6cb0);
}
.wcaf-swatch__label { font-size: 11px; line-height: 1.2; }

/* Search + show more ----------------------------------------------------- */
.wcaf-search {
	width: 100%; margin-bottom: 8px; padding: 6px 10px;
	border: 1px solid #d8dde3; border-radius: 4px; font-size: 13px;
}
.wcaf-toggle-more {
	background: none; border: 0; padding: 6px 0 0; color: var(--wcaf-accent, #2b6cb0);
	font-size: 13px; cursor: pointer; text-decoration: underline;
}

/* Dropdown --------------------------------------------------------------- */
.wcaf-select { width: 100%; padding: 7px 8px; border: 1px solid #d8dde3; border-radius: 4px; }

/* Price -------------------------------------------------------------------
 * Clean, flat slider: thin centred track, solid accent-colour fill, and a
 * round thumb that sits exactly on the track's centre line - no shadows,
 * no gradients, nothing floating above the fill.
 */
.wcaf-slider { position: relative; height: 24px; margin: 10px 0 6px; }
.wcaf-slider__track {
	position: absolute; top: 50%; left: 2px; right: 2px; height: 4px;
	margin-top: -2px; /* half of height, keeps it dead-centre */
	background: #e5e7eb; border-radius: 999px;
	box-shadow: none;
}
.wcaf-slider__range {
	position: absolute; top: 0; left: 0; height: 100%; border-radius: 999px;
	background: var(--wcaf-accent, #2b6cb0);
	box-shadow: none;
}
.wcaf-slider__input {
	position: absolute; top: 0; left: 0; width: 100%; height: 24px; margin: 0;
	-webkit-appearance: none; appearance: none; pointer-events: none;
	background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.wcaf-slider__input::-webkit-slider-runnable-track {
	-webkit-appearance: none; height: 24px;
	background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.wcaf-slider__input::-moz-range-track {
	height: 4px;
	background: transparent !important; border: 0 !important; box-shadow: none !important;
}
.wcaf-slider__input::-webkit-slider-thumb {
	-webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
	margin-top: 3px; /* (24px track height - 18px thumb) / 2, centres it on the line above */
	background: #fff; border: 3px solid var(--wcaf-accent, #2b6cb0); cursor: grab;
	box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
	transition: box-shadow .15s ease, transform .15s ease;
}
.wcaf-slider__input::-moz-range-thumb {
	pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
	background: #fff; border: 3px solid var(--wcaf-accent, #2b6cb0); cursor: grab;
	box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
	transition: box-shadow .15s ease, transform .15s ease;
}
.wcaf-slider__input:hover::-webkit-slider-thumb,
.wcaf-slider__input:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 1px 3px rgba(16, 24, 40, .25), 0 0 0 6px color-mix(in srgb, var(--wcaf-accent, #2b6cb0) 18%, transparent);
}
.wcaf-slider__input:hover::-moz-range-thumb,
.wcaf-slider__input:focus-visible::-moz-range-thumb {
	box-shadow: 0 1px 3px rgba(16, 24, 40, .25), 0 0 0 6px color-mix(in srgb, var(--wcaf-accent, #2b6cb0) 18%, transparent);
}
.wcaf-slider__input:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.08); }
.wcaf-slider__input:active::-moz-range-thumb { cursor: grabbing; transform: scale(1.08); }
.wcaf-slider__input:focus-visible { outline: none; }

.wcaf-price__readout {
	display: flex; justify-content: space-between; font-size: 13px; font-weight: 600;
	color: var(--wcaf-text, #344054); margin-bottom: 10px;
}
.wcaf-price__readout span > span { color: var(--wcaf-accent, #2b6cb0); }
.wcaf-price__fields { display: flex; align-items: flex-end; gap: 8px; }
.wcaf-price__field { flex: 1 1 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #6b7280; }
.wcaf-price__field input {
	width: 100%; padding: 6px 8px; border: 1px solid #d8dde3; border-radius: 6px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.wcaf-price__field input:focus {
	outline: none; border-color: var(--wcaf-accent, #2b6cb0);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wcaf-accent, #2b6cb0) 15%, transparent);
}
.wcaf-price__go {
	padding: 7px 14px; border: 1px solid var(--wcaf-accent, #2b6cb0); background: var(--wcaf-accent, #2b6cb0); color: #fff;
	border-radius: 6px; cursor: pointer; font-size: 13px; transition: filter .15s ease;
}
.wcaf-price__go:hover { filter: brightness(0.92); }

/* Rating bars ------------------------------------------------------------ */
.wcaf-rating { list-style: none; margin: 0; padding: 0; }
.wcaf-rating__row { margin: 0 0 6px; }
.wcaf-rating__link {
	display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit;
	padding: 3px 4px; border-radius: 4px;
}
.wcaf-rating__link:hover { background: #f6f7f9; }
.wcaf-rating__row.is-active .wcaf-rating__link { background: #eef4fb; }
.wcaf-rating__stars {
	position: relative; flex: 0 0 auto; width: 78px; height: 15px;
	font-size: 15px; line-height: 1; color: #d6d9de;
}
.wcaf-rating__stars::before {
	content: "\2605\2605\2605\2605\2605"; letter-spacing: 1px;
}
.wcaf-rating__stars-fill {
	position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; white-space: nowrap; color: #f5a623;
}
.wcaf-rating__stars-fill::before {
	content: "\2605\2605\2605\2605\2605"; letter-spacing: 1px;
}
.wcaf-rating__bar {
	flex: 1 1 auto; height: 8px; background: #eceef1; border-radius: 4px; overflow: hidden; min-width: 40px;
}
.wcaf-rating__bar-fill { display: block; height: 100%; background: #f5a623; border-radius: 4px; transition: width .3s ease; }
.wcaf-rating__count { flex: 0 0 auto; min-width: 34px; text-align: right; font-size: 12px; color: #6b7280; }
.wcaf-rating__row.is-active .wcaf-rating__count { color: var(--wcaf-accent, #2b6cb0); font-weight: 600; }

/* Actions ---------------------------------------------------------------- */
.wcaf-actions { margin-top: 14px; }
.wcaf-actions--top { margin-top: 0; margin-bottom: 16px; }
.wcaf-apply { width: 100%; }
.wcaf-reset { font-size: 13px; text-decoration: underline; }

/* Spinner ---------------------------------------------------------------- */
.wcaf-spinner { display: none; position: absolute; top: 10px; right: 10px; width: 18px; height: 18px;
	border: 2px solid #d9dde2; border-top-color: var(--wcaf-accent, #2b6cb0); border-radius: 50%; animation: wcaf-spin .7s linear infinite; }
.wcaf-filters.is-loading .wcaf-spinner { display: block; }
@keyframes wcaf-spin { to { transform: rotate(360deg); } }

.wcaf-products-loading { opacity: .5; transition: opacity .2s ease; }

/* Mobile ----------------------------------------------------------------- */
.wcaf-mobile-toggle { display: none; }
@media (max-width: 768px) {
	.wcaf-mobile-toggle {
		display: inline-block; width: 100%; padding: 10px 14px; margin-bottom: 12px;
		border: 1px solid #d8dde3; background: #fff; border-radius: 4px; cursor: pointer; font-weight: 600;
	}
	.wcaf-wrap.has-mobile .wcaf-filters {
		position: fixed; top: 0; left: 0; bottom: 0; width: 86%; max-width: 340px; z-index: 99999;
		background: #fff; padding: 16px; overflow-y: auto; transform: translateX(-100%);
		transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.2);
	}
	.wcaf-wrap.has-mobile.is-open .wcaf-filters { transform: translateX(0); }
	.wcaf-wrap.has-mobile.is-open::after {
		content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99998;
	}
	.wcaf-close { display: block; }
}
