/*!
 * PlantShop.hk — Shop sidebar & catalog filters
 * Woodmart layered nav + top sort/price bar
 */

/* ── Sidebar shell ── */
.post-type-archive-product .wd-sidebar.sidebar-left,
.tax-product_cat .wd-sidebar.sidebar-left,
.tax-product_tag .wd-sidebar.sidebar-left {
	--ps-filter-radius: 12px;
	position: sticky;
	top: calc(var(--wd-header-sticky-h, 80px) + 24px);
	align-self: flex-start;
}

.post-type-archive-product .wd-sidebar.sidebar-left > .widget-area,
.tax-product_cat .wd-sidebar.sidebar-left > .widget-area,
.tax-product_tag .wd-sidebar.sidebar-left > .widget-area {
	background: #fff;
	border: 1px solid var(--ps-border-light, rgba(45, 41, 38, 0.08));
	border-radius: var(--ps-filter-radius);
	box-shadow: 0 10px 36px rgba(45, 41, 38, 0.04);
	padding: 6px 0 10px;
}

/* ── Section headings ── */
.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav .widget-title,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav .widget-title,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav .widget-title {
	font-family: var(--ps-font-title, "Playfair Display", "Noto Serif SC", serif);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--ps-text, #2d2926);
	margin: 0;
	padding: 16px 18px 10px;
	border: 0;
	position: relative;
}

.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav .widget-title::after,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav .widget-title::after,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav .widget-title::after {
	content: "";
	display: block;
	width: 28px;
	height: 2px;
	margin-top: 8px;
	background: linear-gradient(90deg, var(--ps-gold, #c9a96e), transparent);
	border-radius: 1px;
}

.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav {
	margin: 0;
	padding: 0 10px 6px;
	border-bottom: 1px solid var(--ps-border-light, rgba(45, 41, 38, 0.08));
}

.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav:last-child,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav:last-child,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav:last-child {
	border-bottom: 0;
	padding-bottom: 4px;
}

/* ── Scrollable groups ── */
.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll {
	max-height: 220px;
	overflow: auto;
	padding: 0 4px 4px;
	scrollbar-width: thin;
	scrollbar-color: rgba(201, 169, 110, 0.45) transparent;
	mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}

.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll::-webkit-scrollbar,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll::-webkit-scrollbar,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll::-webkit-scrollbar {
	width: 5px;
}

.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll::-webkit-scrollbar-thumb,
.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll::-webkit-scrollbar-thumb,
.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll::-webkit-scrollbar-thumb {
	background: rgba(201, 169, 110, 0.45);
	border-radius: 999px;
}

/* ── Filter chips ── */
.post-type-archive-product .wd-sidebar .wd-swatches-filter,
.tax-product_cat .wd-sidebar .wd-swatches-filter,
.tax-product_tag .wd-sidebar .wd-swatches-filter {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter > li,
.tax-product_cat .wd-sidebar .wd-swatches-filter > li,
.tax-product_tag .wd-sidebar .wd-swatches-filter > li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter .layered-nav-link,
.tax-product_cat .wd-sidebar .wd-swatches-filter .layered-nav-link,
.tax-product_tag .wd-sidebar .wd-swatches-filter .layered-nav-link {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	min-height: 38px;
	padding: 8px 12px;
	border: 1px solid var(--ps-border-light, rgba(45, 41, 38, 0.08));
	border-radius: 999px;
	background: var(--ps-row-alt, #faf9f7);
	color: var(--ps-text-secondary, #5c5855);
	text-decoration: none !important;
	font-family: var(--ps-font-body, "Inter", "Noto Sans SC", sans-serif);
	font-size: 13px;
	line-height: 1.35;
	letter-spacing: 0.01em;
	transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter > li:hover .layered-nav-link,
.tax-product_cat .wd-sidebar .wd-swatches-filter > li:hover .layered-nav-link,
.tax-product_tag .wd-sidebar .wd-swatches-filter > li:hover .layered-nav-link {
	border-color: rgba(201, 169, 110, 0.55);
	background: var(--ps-gold-light, rgba(201, 169, 110, 0.06));
	color: var(--ps-text, #2d2926);
	transform: translateX(2px);
	box-shadow: 0 4px 14px rgba(45, 41, 38, 0.05);
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter > li.wd-active .layered-nav-link,
.tax-product_cat .wd-sidebar .wd-swatches-filter > li.wd-active .layered-nav-link,
.tax-product_tag .wd-sidebar .wd-swatches-filter > li.wd-active .layered-nav-link {
	border-color: var(--ps-text, #2d2926);
	background: var(--ps-text, #2d2926);
	color: #fff;
	box-shadow: 0 6px 18px rgba(45, 41, 38, 0.12);
	transform: none;
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter .wd-filter-lable,
.tax-product_cat .wd-sidebar .wd-swatches-filter .wd-filter-lable,
.tax-product_tag .wd-sidebar .wd-swatches-filter .wd-filter-lable {
	flex: 1 1 auto;
	min-width: 0;
	white-space: normal;
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter .count,
.tax-product_cat .wd-sidebar .wd-swatches-filter .count,
.tax-product_tag .wd-sidebar .wd-swatches-filter .count {
	flex: 0 0 auto;
	min-width: 26px;
	height: 22px;
	padding: 0 7px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: rgba(45, 41, 38, 0.06);
	color: var(--ps-text-light, #8a8580);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter > li.wd-active .count,
.tax-product_cat .wd-sidebar .wd-swatches-filter > li.wd-active .count,
.tax-product_tag .wd-sidebar .wd-swatches-filter > li.wd-active .count {
	background: rgba(255, 255, 255, 0.16);
	color: rgba(255, 255, 255, 0.92);
}

.post-type-archive-product .wd-sidebar .wd-swatches-filter .layered-nav-link:hover .count,
.tax-product_cat .wd-sidebar .wd-swatches-filter .layered-nav-link:hover .count,
.tax-product_tag .wd-sidebar .wd-swatches-filter .layered-nav-link:hover .count,
.post-type-archive-product .wd-sidebar .wd-swatches-filter > li:hover .count,
.tax-product_cat .wd-sidebar .wd-swatches-filter > li:hover .count,
.tax-product_tag .wd-sidebar .wd-swatches-filter > li:hover .count {
	background: rgba(201, 169, 110, 0.18);
	color: var(--ps-text, #2d2926);
}

/* Override Woodmart pill bg on swatch labels */
.post-type-archive-product .wd-sidebar .wd-swatches-filter.wd-bg-style-4 .layered-nav-link,
.tax-product_cat .wd-sidebar .wd-swatches-filter.wd-bg-style-4 .layered-nav-link,
.tax-product_tag .wd-sidebar .wd-swatches-filter.wd-bg-style-4 .layered-nav-link {
	background: var(--ps-row-alt, #faf9f7);
}

/* ── Top toolbar: sort + price ── */
.post-type-archive-product .filters-area,
.tax-product_cat .filters-area,
.tax-product_tag .filters-area {
	margin-bottom: 18px;
}

.post-type-archive-product .filters-area .filters-inner-area,
.tax-product_cat .filters-area .filters-inner-area,
.tax-product_tag .filters-area .filters-inner-area {
	background: #fff;
	border: 1px solid var(--ps-border-light, rgba(45, 41, 38, 0.08));
	border-radius: 12px;
	padding: 14px 16px;
	box-shadow: 0 8px 28px rgba(45, 41, 38, 0.04);
}

.post-type-archive-product .filters-area .filter-widget .widget-title,
.tax-product_cat .filters-area .filter-widget .widget-title,
.tax-product_tag .filters-area .filter-widget .widget-title {
	font-family: var(--ps-font-title, "Playfair Display", "Noto Serif SC", serif);
	font-size: 14px;
	font-weight: 500;
	color: var(--ps-text, #2d2926);
	margin-bottom: 10px;
	padding-bottom: 0;
}

.post-type-archive-product .filters-area .woocommerce-ordering-list a,
.tax-product_cat .filters-area .woocommerce-ordering-list a,
.tax-product_tag .filters-area .woocommerce-ordering-list a,
.post-type-archive-product .filters-area .woodmart-price-filter a,
.tax-product_cat .filters-area .woodmart-price-filter a,
.tax-product_tag .filters-area .woodmart-price-filter a {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	margin: 0 6px 6px 0;
	border: 1px solid var(--ps-border-light, rgba(45, 41, 38, 0.08));
	border-radius: 999px;
	background: var(--ps-row-alt, #faf9f7);
	color: var(--ps-text-secondary, #5c5855);
	font-size: 13px;
	text-decoration: none !important;
	transition: all 0.22s ease;
}

.post-type-archive-product .filters-area .woocommerce-ordering-list a:hover,
.tax-product_cat .filters-area .woocommerce-ordering-list a:hover,
.tax-product_tag .filters-area .woocommerce-ordering-list a:hover,
.post-type-archive-product .filters-area .woodmart-price-filter a:hover,
.tax-product_cat .filters-area .woodmart-price-filter a:hover,
.tax-product_tag .filters-area .woodmart-price-filter a:hover {
	border-color: rgba(201, 169, 110, 0.55);
	background: var(--ps-gold-light, rgba(201, 169, 110, 0.06));
	color: var(--ps-text, #2d2926);
}

.post-type-archive-product .filters-area .woocommerce-ordering-list a.wd-active,
.tax-product_cat .filters-area .woocommerce-ordering-list a.wd-active,
.tax-product_tag .filters-area .woocommerce-ordering-list a.wd-active,
.post-type-archive-product .filters-area .woodmart-price-filter a.current-state,
.tax-product_cat .filters-area .woodmart-price-filter a.current-state,
.tax-product_tag .filters-area .woodmart-price-filter a.current-state {
	border-color: var(--ps-text, #2d2926);
	background: var(--ps-text, #2d2926);
	color: #fff;
}

/* Active filter chips above grid */
.post-type-archive-product .wd-active-filters,
.tax-product_cat .wd-active-filters,
.tax-product_tag .wd-active-filters {
	margin: 0 0 16px;
	padding: 12px 14px;
	background: var(--ps-gold-light, rgba(201, 169, 110, 0.06));
	border: 1px solid rgba(201, 169, 110, 0.22);
	border-radius: 12px;
}

.post-type-archive-product .wd-active-filters a,
.tax-product_cat .wd-active-filters a,
.tax-product_tag .wd-active-filters a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	margin: 0 8px 6px 0;
	border-radius: 999px;
	background: #fff;
	border: 1px solid rgba(201, 169, 110, 0.35);
	color: var(--ps-text, #2d2926) !important;
	font-size: 12px;
	text-decoration: none !important;
}

/* ── Mobile filter drawer ── */
@media (max-width: 1024px) {
	.post-type-archive-product .wd-sidebar.sidebar-left,
	.tax-product_cat .wd-sidebar.sidebar-left,
	.tax-product_tag .wd-sidebar.sidebar-left {
		position: static;
	}

	.post-type-archive-product .wd-sidebar.sidebar-left > .widget-area,
	.tax-product_cat .wd-sidebar.sidebar-left > .widget-area,
	.tax-product_tag .wd-sidebar.sidebar-left > .widget-area {
		box-shadow: none;
		border: 0;
		padding: 0;
	}

	.post-type-archive-product .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll,
	.tax-product_cat .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll,
	.tax-product_tag .wd-sidebar .woodmart-woocommerce-layered-nav .wd-scroll {
		max-height: none;
		mask-image: none;
	}
}

@media (max-width: 768px) {
	.post-type-archive-product .filters-area .filters-inner-area,
	.tax-product_cat .filters-area .filters-inner-area,
	.tax-product_tag .filters-area .filters-inner-area {
		padding: 12px;
	}
}

/* ── Mobile filter opener button (visible when sidebar is drawer) ── */
.post-type-archive-product .wd-filters-opener,
.tax-product_cat .wd-filters-opener,
.tax-product_tag .wd-filters-opener {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 18px;
	border: 1px solid var(--ps-border-light, rgba(45, 41, 38, 0.15));
	border-radius: 999px;
	background: #fff;
	color: var(--ps-text, #2d2926);
	font-size: 13px;
	font-family: var(--ps-font-body, "Inter", sans-serif);
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: border-color 0.22s, background 0.22s;
}

.post-type-archive-product .wd-filters-opener:hover,
.tax-product_cat .wd-filters-opener:hover,
.tax-product_tag .wd-filters-opener:hover {
	border-color: rgba(201, 169, 110, 0.6);
	background: rgba(201, 169, 110, 0.04);
}

/* Mobile: ensure product grid is 2-col on small screens */
@media (max-width: 599px) {
	.post-type-archive-product ul.products.columns-4,
	.post-type-archive-product ul.products.columns-3 {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 14px !important;
	}

	.post-type-archive-product .wd-products .product-name a {
		font-size: 13px !important;
	}

	.post-type-archive-product .wd-products .wd-product .price {
		font-size: 15px !important;
	}
}

/* Mobile: sort dropdown full-width */
@media (max-width: 599px) {
	.post-type-archive-product .wd-shop-tools,
	.tax-product_cat .wd-shop-tools {
		flex-wrap: wrap;
		gap: 8px;
	}

	.post-type-archive-product .woocommerce-ordering,
	.tax-product_cat .woocommerce-ordering {
		width: 100% !important;
		max-width: 100% !important;
	}

	.post-type-archive-product .woocommerce-ordering select,
	.tax-product_cat .woocommerce-ordering select {
		width: 100%;
		font-size: 13px;
	}
}
