/* Courteous Product Filter. Colours fall back to the theme's Bootstrap variables. */
.spf-filter {
	--spf-accent: var(--bs-primary, #111);
	--spf-border: var(--bs-border-color, #d9d9d9);
	--spf-text: inherit;
	--spf-muted: var(--bs-secondary-color, #777);
	font-size: inherit;
}

.spf-hidden { display: none !important; }

/* ---------- option lists ---------- */
.spf-list { list-style: none; margin: 0; padding: 0; }
.spf-list .spf-children { padding-left: 1.4em; margin-top: .25em; }
.spf-item { margin: 0 0 .4em; padding: 0; }

.spf-option {
	display: inline-flex;
	align-items: center;
	gap: .55em;
	color: var(--spf-text);
	text-decoration: none;
	cursor: pointer;
	line-height: 1.3;
}
.spf-option:hover .spf-label { text-decoration: underline; }
.spf-option:focus-visible { outline: 2px solid var(--spf-accent); outline-offset: 2px; }

.spf-box {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	border: 1.5px solid var(--spf-border);
	border-radius: 3px;
	background: transparent;
	position: relative;
	transition: background-color .15s, border-color .15s;
}
.spf-option.is-active .spf-box { background: var(--spf-accent); border-color: var(--spf-accent); }
.spf-option.is-active .spf-box::after {
	content: "";
	position: absolute;
	left: 34%;
	top: 12%;
	width: 28%;
	height: 56%;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.spf-option.is-active .spf-label { font-weight: 600; }
.spf-count { color: var(--spf-muted); font-size: .85em; }

/* ---------- pills ---------- */
.spf-style-pills .spf-list { display: flex; flex-wrap: wrap; gap: .5em; }
.spf-style-pills .spf-item { margin: 0; }
.spf-style-pills .spf-box { display: none; }
.spf-style-pills .spf-option {
	padding: .35em .85em;
	border: 1px solid var(--spf-border);
	border-radius: 999px;
	transition: background-color .15s, color .15s, border-color .15s;
}
.spf-style-pills .spf-option:hover { border-color: var(--spf-accent); }
.spf-style-pills .spf-option:hover .spf-label { text-decoration: none; }
.spf-style-pills .spf-option.is-active { background: var(--spf-accent); border-color: var(--spf-accent); color: #fff; }
.spf-style-pills .spf-count { display: none; }

/* ---------- colour swatches ---------- */
.spf-style-swatches .spf-list { display: flex; flex-wrap: wrap; gap: .6em; }
.spf-style-swatches .spf-item { margin: 0; }
.spf-style-swatches .spf-option.has-swatch { gap: 0; }
.spf-style-swatches .spf-option.has-swatch .spf-label,
.spf-style-swatches .spf-option.has-swatch .spf-count {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.spf-style-swatches .spf-option.has-swatch .spf-box {
	width: 1.9em;
	height: 1.9em;
	border-radius: 50%;
	background: var(--spf-swatch, #ccc);
	border: 1px solid rgba(0, 0, 0, .18);
	box-shadow: 0 0 0 2px #fff inset;
}
.spf-style-swatches .spf-option.has-swatch.is-active .spf-box {
	background: var(--spf-swatch, #ccc);
	box-shadow: 0 0 0 2px #fff inset, 0 0 0 2px var(--spf-accent);
	border-color: var(--spf-accent);
}
.spf-style-swatches .spf-option.has-swatch.is-active .spf-box::after { display: none; }

/* ---------- dropdown ---------- */
.spf-select { width: 100%; }

/* ---------- price ---------- */
.spf-price { padding: .25em .5em 0; }
.spf-range { position: relative; height: 22px; margin-bottom: .9em; }
.spf-range-track {
	position: absolute; left: 0; right: 0; top: 50%;
	height: 4px; margin-top: -2px;
	background: var(--spf-border); border-radius: 4px;
}
.spf-range-fill { position: absolute; top: 0; bottom: 0; background: var(--spf-accent); border-radius: 4px; }
.spf-range input[type="range"] {
	position: absolute; left: 0; top: 0;
	width: 100%; height: 22px; margin: 0;
	background: none; pointer-events: none;
	-webkit-appearance: none; appearance: none;
}
.spf-range input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 22px; }
.spf-range input[type="range"]::-moz-range-track { background: transparent; height: 22px; }
.spf-range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none;
	pointer-events: auto; cursor: grab;
	width: 18px; height: 18px; margin-top: 2px;
	background: #fff; border: 2px solid var(--spf-accent); border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.spf-range input[type="range"]::-moz-range-thumb {
	pointer-events: auto; cursor: grab;
	width: 14px; height: 14px;
	background: #fff; border: 2px solid var(--spf-accent); border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.spf-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--spf-accent); outline-offset: 2px; }

.spf-price-fields { display: flex; align-items: center; gap: .5em; }
.spf-price-fields label { position: relative; flex: 1 1 0; margin: 0; min-width: 0; }
.spf-price-fields .spf-currency {
	position: absolute; left: .6em; top: 50%; transform: translateY(-50%);
	color: var(--spf-muted); pointer-events: none; font-size: .9em;
}
.spf-price-fields input[type="number"] { width: 100%; padding-left: 1.8em; -moz-appearance: textfield; }
.spf-price-fields input[type="number"]::-webkit-outer-spin-button,
.spf-price-fields input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- active filters ---------- */
.spf-chips { list-style: none; margin: 0 0 .6em; padding: 0; display: flex; flex-wrap: wrap; gap: .4em; }
.spf-chip {
	display: inline-flex; align-items: center; gap: .4em;
	padding: .25em .7em; border-radius: 999px;
	border: 1px solid var(--spf-border); color: inherit;
	text-decoration: none; font-size: .9em;
}
.spf-chip:hover { border-color: var(--spf-accent); }
.spf-reset { font-size: .9em; text-decoration: underline; color: inherit; }
.spf-active-wrap.is-empty { display: none; }

/* ---------- results, loading ---------- */
.spf-results { position: relative; }
.spf-results .themeshawk-woo-product-list-wrapper { transition: opacity .2s; }
.spf-results.spf-loading .themeshawk-woo-product-list-wrapper,
.spf-results.spf-loading ul.products { opacity: .45; pointer-events: none; }
.spf-results.spf-loading::after {
	content: "";
	position: absolute; left: 50%; top: 120px;
	width: 34px; height: 34px; margin-left: -17px;
	border: 3px solid var(--bs-border-color, #ddd);
	border-top-color: var(--bs-primary, #111);
	border-radius: 50%;
	animation: spf-spin .7s linear infinite;
	z-index: 5;
}
@keyframes spf-spin { to { transform: rotate(360deg); } }

/* ---------- pagination ---------- */
.spf-pagination { margin-top: 1.5rem; }
.spf-pagination:empty { display: none; }
.spf-pagination.is-loading .spf-load-more { opacity: .7; pointer-events: none; }
.spf-sentinel { min-height: 48px; display: flex; align-items: center; justify-content: center; width: 100%; }
.spf-spinner {
	width: 26px; height: 26px; border-radius: 50%;
	border: 3px solid var(--bs-border-color, #ddd);
	border-top-color: var(--bs-primary, #111);
	animation: spf-spin .7s linear infinite;
}
.spf-end { margin: 0; text-align: center; width: 100%; color: var(--bs-secondary-color, #777); font-size: .9em; }

@media (prefers-reduced-motion: reduce) {
	.spf-results.spf-loading::after, .spf-spinner { animation-duration: 2s; }
}

/* ---------- grouped attributes ---------- */
.spf-attr + .spf-attr { margin-top: 1.1em; }
.spf-attr-title { margin: 0 0 .5em; font-size: .95em; font-weight: 600; }
.spf-attr.spf-style-pills .spf-list, .spf-attr.spf-style-swatches .spf-list { }
.spf-hint { margin: 0; padding: .5em .7em; font-size: .85em; border: 1px dashed var(--bs-border-color, #ccc); border-radius: 4px; }

/* ---------- filter panel (shop sidebar set to None) ---------- */
.spf-panel { margin: 0 0 1.5rem; border: 1px solid var(--bs-border-color, #ddd); border-radius: 6px; }
.spf-panel-toggle { display: block; padding: .6rem 1rem; cursor: pointer; border: 0; border-radius: 6px; font-weight: 600; list-style: none; }
.spf-panel-toggle::-webkit-details-marker { display: none; }
.spf-panel-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem 2rem; padding: 1rem; border-top: 1px solid var(--bs-border-color, #ddd); }
.spf-panel-body .widget { margin: 0; }
.spf-panel-body .widget-title { font-size: 1rem; margin: 0 0 .6rem; }

/* ---------- show more / less ---------- */
.spf-list .spf-extra { display: none; }
.spf-list.is-expanded .spf-extra { display: list-item; }
.spf-style-pills .spf-list.is-expanded .spf-extra,
.spf-style-swatches .spf-list.is-expanded .spf-extra { display: list-item; }
.spf-more {
	display: inline-block; margin: .4em 0 0; padding: 0;
	background: none; border: 0; cursor: pointer;
	color: var(--spf-accent); font-size: .9em; font-weight: 600; text-decoration: underline;
}
.spf-more:focus-visible { outline: 2px solid var(--spf-accent); outline-offset: 2px; }
