.apf-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.apf-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 28px;
	width: 100%;
	max-width: none;
	border-bottom: 1px solid #e5e5e5;
	padding-bottom: 20px;
	margin-bottom: 24px;
}

.apf-filter-group {
	margin-bottom: 0;
	border-bottom: none;
	padding-bottom: 0;
	flex: 0 0 auto;
	min-width: 150px;
}

.apf-filter-group h4 {
	margin: 0 0 10px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #888;
}

.apf-checkbox-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.apf-checkbox-list li {
	margin-bottom: 0;
}

/* Chip-style option: the native checkbox is hidden (still fully functional,
   just visually removed) and the surrounding label becomes a bordered box
   that highlights when its checkbox is checked. */
.apf-checkbox-list .apf-label {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 13px;
	border: 2px solid #e2e2e2;
	border-radius: 6px;
	padding: 6px 12px;
	transition: border-color 0.15s, background 0.15s;
}

.apf-checkbox-list .apf-label:hover {
	border-color: #bbb;
}

.apf-checkbox-list input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.apf-checkbox-list .apf-label.is-selected,
.apf-checkbox-list .apf-label:has(input:checked) {
	border-color: var(--apf-spinner-color, #333);
	background: rgba(0, 0, 0, 0.04);
}

.apf-count {
	color: #999;
	font-size: 12px;
}

.apf-term-thumb {
	width: 22px;
	height: 22px;
	object-fit: cover;
	border-radius: 4px;
	box-shadow: 0 0 0 1px #ddd;
}

.apf-range-values {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: #444;
	margin-bottom: 10px;
}

.apf-range-slider {
	position: relative;
	height: 28px;
	width: 200px;
	margin: 0 10px;
}

.apf-range-base {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 4px;
	background: #ddd;
	border-radius: 2px;
	transform: translateY(-50%);
}

.apf-range-track {
	position: absolute;
	top: 50%;
	height: 4px;
	background: var(--apf-spinner-color, #333);
	border-radius: 2px;
	transform: translateY(-50%);
}

.apf-range-handle {
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-left: -8px;
	border-radius: 50%;
	background: var(--apf-spinner-color, #333);
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
	cursor: grab;
	transform: translateY(-50%);
	touch-action: none;
	z-index: 1;
}

.apf-range-handle:active {
	cursor: grabbing;
	z-index: 2;
}

.apf-range-handle:focus-visible {
	outline: 2px solid var(--apf-spinner-color, #333);
	outline-offset: 2px;
}

.apf-reset {
	align-self: flex-end;
	margin-left: auto;
}

.apf-results {
	position: relative;
}

.apf-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.apf-result-count {
	font-size: 13px;
	color: #666;
}

.apf-loading-overlay {
	display: none;
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.6);
	z-index: 5;
	align-items: center;
	justify-content: center;
}

.apf-loading-overlay.is-active {
	display: flex;
}

.apf-spinner {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--apf-spinner-color, #333);
	animation: apf-spin 0.7s linear infinite;
}

@keyframes apf-spin {
	to {
		transform: rotate(360deg);
	}
}

.apf-products-container ul.products {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.apf-products-container ul.products.columns-2 { grid-template-columns: repeat(2, 1fr); }
.apf-products-container ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }
.apf-products-container ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }
.apf-products-container ul.products.columns-5 { grid-template-columns: repeat(5, 1fr); }

.apf-no-products {
	padding: 40px 0;
	text-align: center;
	color: #777;
}

.apf-pagination-container {
	margin-top: 24px;
}

.apf-pagination {
	display: flex;
	gap: 6px;
	list-style: none;
	padding: 0;
	justify-content: center;
}

.apf-pagination a,
.apf-pagination span {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
}

.apf-pagination .current {
	background: #333;
	color: #fff;
	border-color: #333;
}

@media (max-width: 782px) {
	.apf-filters {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}
	.apf-filter-group {
		min-width: 0;
	}
	.apf-reset {
		align-self: stretch;
		margin-left: 0;
	}
	.apf-products-container ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
}
