/* Hook-rendered sidebar on shop archives: float left so the WoodMart product
   grid flows beside it. The sidebar is output via woocommerce_before_shop_loop. */
.woocommerce-archive .wdpf-sidebar.wdpf-layout-sidebar,
.woodmart-archive-shop .wdpf-sidebar.wdpf-layout-sidebar,
.archive .wdpf-sidebar.wdpf-layout-sidebar {
	float: left;
	width: 260px;
	margin: 0 1.5em 1.5em 0;
	position: relative;
	max-height: none;
	overflow: visible;
}
/* On shop archives, constrain the product grid to the remaining space. */
.archive.woocommerce ul.products,
.woodmart-archive-shop ul.products {
	clear: none;
}
@media (max-width: 768px) {
	.woocommerce-archive .wdpf-sidebar.wdpf-layout-sidebar,
	.woodmart-archive-shop .wdpf-sidebar.wdpf-layout-sidebar,
	.archive .wdpf-sidebar.wdpf-layout-sidebar {
		float: none;
		width: 100%;
		margin: 0 0 1.5em;
	}
	.archive.woocommerce ul.products,
	.woodmart-archive-shop ul.products {
		clear: both;
	}
}

/* Woo Dynamic Product Filters — frontend styles */

.wdpf-sidebar {
	box-sizing: border-box;
	font-size: 0.9em;
	line-height: 1.5;
}

.wdpf-layout-sidebar {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0);
	align-self: start;
	max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
	overflow-y: auto;
	padding: 1em;
	border: 1px solid #eaeaea;
	border-radius: 4px;
	background: #fff;
}

.wdpf-layout-horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
	padding: 1em;
	border: 1px solid #eaeaea;
	border-radius: 4px;
	background: #fff;
}
.wdpf-layout-horizontal .wdpf-facet {
	flex: 1 1 180px;
	min-width: 160px;
}

.wdpf-filters {
	margin: 0;
}

.wdpf-facet {
	margin: 0 0 1.25em;
	padding: 0 0 1em;
	border-bottom: 1px solid #f0f0f0;
}
.wdpf-facet:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}
.wdpf-facet[hidden] {
	display: none;
}

.wdpf-facet-title {
	margin: 0 0 0.5em;
	font-size: 0.95em;
	font-weight: 600;
	text-transform: none;
	color: #222;
}

.wdpf-facet-body ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.wdpf-facet-body li {
	margin: 0.2em 0;
}
.wdpf-facet-body label {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	cursor: pointer;
}
.wdpf-count {
	color: #888;
	font-size: 0.85em;
}

.wdpf-empty {
	margin: 0;
	color: #888;
	font-style: italic;
}

/* Price slider */
.wdpf-price-slider {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	position: relative;
	padding-top: 0.25em;
}
.wdpf-price-slider input[type="range"] {
	width: 100%;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	background: #e0e0e0;
	border-radius: 2px;
	outline: none;
}
.wdpf-price-slider input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--wc-primary, #7f54b3);
	cursor: pointer;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.wdpf-price-slider input[type="range"]::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--wc-primary, #7f54b3);
	cursor: pointer;
	border: 2px solid #fff;
}
.wdpf-price-display {
	display: flex;
	justify-content: space-between;
	font-size: 0.85em;
	color: #444;
	margin-top: 0.25em;
}

.wdpf-price-inputs {
	display: flex;
	gap: 0.5em;
}
.wdpf-price-inputs label {
	display: flex;
	flex-direction: column;
	font-size: 0.8em;
	flex: 1;
}
.wdpf-price-inputs input[type="number"] {
	width: 100%;
}

/* Rating stars */
.wdpf-facet-rating .wdpf-facet-body li label {
	letter-spacing: 1px;
}

/* Responsive: collapse sidebar to horizontal on small screens */
@media (max-width: 768px) {
	.wdpf-layout-sidebar {
		position: static;
		max-height: none;
		overflow: visible;
		display: flex;
		flex-wrap: wrap;
		gap: 1.5em;
	}
	.wdpf-layout-sidebar .wdpf-facet {
		flex: 1 1 180px;
		min-width: 160px;
		border-bottom: none;
	}
}