/**
 * DEV-2559 — Custom productcategorie-facetfilters.
 * Hoort bij inc/product-filters.php + woocommerce/archive-product.php.
 */

:root {
	--hps-accent: #3caf66;       /* Handystairs merk-groen (Elementor global accent) */
	--hps-accent-dark: #339a57;
	--hps-accent-soft: #e9f6ee;
	--hps-border: #e6e6e6;
	--hps-ink: #1d1d1b;
	--hps-ink-soft: #5a5a57;
	--hps-muted: #8a8a86;
}

/* ── Archief-layout (sidebar + producten) ──────────────────────────────── */
.hps-archive { margin-top: 10px; }
.hps-archive__sidebar { margin-bottom: 24px; }

/* ── Filterpaneel ──────────────────────────────────────────────────────── */
.hps-filters {
	font-family: inherit;
	color: var(--hps-ink);
}
.hps-filters__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding-bottom: 12px;
	margin-bottom: 18px;
	border-bottom: 2px solid var(--hps-ink);
}
.hps-filters__heading {
	font-size: 20px;
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
}
.hps-filters__reset {
	font-size: 13px;
	color: var(--hps-muted);
	text-decoration: underline;
}
.hps-filters__reset:hover { color: var(--hps-accent); }

/* ── Actieve filters (chips) ───────────────────────────────────────────── */
.hps-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}
.hps-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	font-size: 13px;
	line-height: 1.2;
	color: var(--hps-ink);
	background: var(--hps-accent-soft);
	border: 1px solid var(--hps-accent);
	border-radius: 999px;
	transition: background-color .15s ease;
}
.hps-chip:hover { background: #e2efdb; color: var(--hps-ink); }
.hps-chip__remove { font-size: 15px; line-height: 1; color: var(--hps-accent); }

/* ── Facetgroep: ruim uit elkaar ───────────────────────────────────────── */
.hps-facet { margin-bottom: 30px; }
.hps-facet:last-child { margin-bottom: 0; }
.hps-facet__title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hps-ink);
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--hps-border);
}
.hps-facet__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.hps-facet__item { margin: 0; }

/* ── Optie-rij ─────────────────────────────────────────────────────────── */
.hps-facet__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	margin: 0 -8px;
	border-radius: 6px;
	color: var(--hps-ink-soft);
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.hps-facet__link:hover {
	background: var(--hps-accent-soft);
	color: var(--hps-ink);
}
.hps-facet__check {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 2px solid #c4c4c0;
	border-radius: 4px;
	background: #fff;
	position: relative;
	transition: border-color .15s ease, background-color .15s ease;
}
.hps-facet__link:hover .hps-facet__check { border-color: var(--hps-accent); }
.hps-facet__link.is-selected .hps-facet__check {
	background: var(--hps-accent);
	border-color: var(--hps-accent);
}
.hps-facet__link.is-selected .hps-facet__check::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 4px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.hps-facet__label {
	flex: 1 1 auto;
	font-size: 15px;
	line-height: 1.45;
}
.hps-facet__link.is-selected .hps-facet__label {
	color: var(--hps-ink);
	font-weight: 600;
}
.hps-facet__count {
	flex: 0 0 auto;
	font-size: 13px;
	color: var(--hps-muted);
	white-space: nowrap;
}

/* ── Mobiele filter-knop + drawer ──────────────────────────────────────── */
.hps-filters-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	width: 100%;
	justify-content: center;
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--hps-accent);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}
.hps-filters__close {
	display: none;
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	font-size: 24px;
	line-height: 1;
	background: none;
	border: 0;
	color: var(--hps-ink);
	cursor: pointer;
}
.hps-filters-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 1040;
}

@media (max-width: 991.98px) {
	.hps-filters-toggle { display: inline-flex; }
	.hps-filters__close { display: block; }

	.hps-archive__sidebar .hps-filters {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 88%;
		max-width: 360px;
		padding: 56px 20px 24px;
		background: #fff;
		box-shadow: 2px 0 18px rgba(0, 0, 0, .15);
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform .25s ease;
		z-index: 1050;
	}
	body.hps-filters-open .hps-archive__sidebar .hps-filters { transform: translateX(0); }
	body.hps-filters-open .hps-filters-backdrop { display: block; }
	body.hps-filters-open { overflow: hidden; }
}

/* ── Prijsfilter (WooCommerce-slider) ─────────────────────────────────── */
.hps-facet--price { margin-bottom: 30px; }
.hps-facet--price .price_slider_wrapper { margin-top: 4px; }
.hps-facet--price .ui-slider {
	background: #e6e6e6;
	height: 5px;
	border-radius: 3px;
	position: relative;
	margin: 12px 8px 0;
}
.hps-facet--price .ui-slider .ui-slider-range { background: var(--hps-accent); height: 5px; position: absolute; }
.hps-facet--price .ui-slider .ui-slider-handle {
	width: 16px; height: 16px;
	background: #fff;
	border: 2px solid var(--hps-accent);
	border-radius: 50%;
	top: -6px; margin-left: -8px;
	position: absolute; cursor: pointer;
}
.hps-facet--price .price_slider_amount {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	font-size: 13px;
}
.hps-facet--price .price_slider_amount .price_label { order: 2; color: var(--hps-ink-soft); flex: 1 1 100%; }
.hps-facet--price .price_slider_amount .button {
	order: 3;
	background: var(--hps-accent);
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.hps-facet--price .price_slider_amount .button:hover { background: var(--hps-accent-dark); }

/* ── Resultaten-header (telling + sortering) ──────────────────────────── */
.hps-archive__main .woocommerce-result-count { color: var(--hps-ink-soft); font-size: 14px; margin: 0 0 14px; }
.hps-archive__main .woocommerce-ordering { margin-bottom: 18px; }

/* ── Productgrid-kaarten (naar de referentie) ─────────────────────────── */
.hps-archive__main ul.products li.product {
	border: 1px solid var(--hps-border);
	border-radius: 8px;
	padding: 14px;
	background: #fff;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s ease, border-color .15s ease;
}
.hps-archive__main ul.products li.product:hover {
	border-color: #d2d2d0;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}
.hps-archive__main ul.products li.product img { margin: 0 auto 12px; }
.hps-archive__main ul.products li.product .woocommerce-loop-product__title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--hps-ink);
	padding: 0;
	margin: 0 0 8px;
}
.hps-archive__main ul.products li.product .price {
	display: block;
	color: var(--hps-ink);
	font-weight: 700;
	font-size: 17px;
	margin: 0 0 12px;
}
.hps-archive__main ul.products li.product .price .woocommerce-price-suffix {
	font-size: 12px;
	font-weight: 400;
	color: var(--hps-muted);
}

/* Sale-prijs: oude prijs klein/grijs doorgestreept, nieuwe prijs prominent. */
.hps-archive__main ul.products li.product .price del {
	display: inline-block;
	margin: 0 8px 0 0;
	font-size: 13px;
	font-weight: 400;
	color: var(--hps-muted);
	text-decoration: line-through;
	opacity: 1;
}
.hps-archive__main ul.products li.product .price del .woocommerce-price-suffix { display: none; }
.hps-archive__main ul.products li.product .price ins {
	background: none;
	text-decoration: none;
	font-weight: 700;
	color: var(--hps-ink);
}

/* "Aanbieding!"-badge: nette pill i.p.v. de grote ovaal. */
.hps-archive__main ul.products li.product { position: relative; }
.hps-archive__main ul.products li.product .onsale {
	position: absolute;
	top: 14px;
	right: 14px;
	left: auto;
	z-index: 2;
	margin: 0;
	min-width: 0;
	min-height: 0;
	padding: 4px 12px;
	border: 0;
	border-radius: 4px;
	background: #e0523f;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	text-transform: none;
}
.hps-stock {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--hps-accent);
	margin: 0 0 8px;
}

/* ── USP-regels (ACF usp_1 / usp_2) ───────────────────────────────────── */
.hps-usps {
	list-style: none;
	margin: 10px 0 14px;
	padding: 0;
}
.hps-usps__item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--hps-ink-soft);
	margin-bottom: 6px;
}
.hps-usps__item:last-child { margin-bottom: 0; }
.hps-usps__item i {
	flex: 0 0 auto;
	color: var(--hps-muted);
	font-size: 15px;
}
.hps-archive__main ul.products li.product .add-to-cart-container { margin-top: auto; }
.hps-archive__main ul.products li.product .button,
.hps-archive__main ul.products li.product .add_to_cart_button {
	display: block;
	width: 100%;
	padding: 10px 14px;
	font-weight: 600;
	text-align: center;
	color: #fff;
	background: var(--hps-accent);
	border: 1px solid var(--hps-accent);
	border-radius: 6px;
	transition: background-color .15s ease, border-color .15s ease;
}
.hps-archive__main ul.products li.product .button:hover,
.hps-archive__main ul.products li.product .add_to_cart_button:hover {
	background: var(--hps-accent-dark);
	border-color: var(--hps-accent-dark);
	color: #fff;
}

/* ── Full-width archief: wat ademruimte aan de randen ─────────────────── */
.tax-product_cat #woocommerce-wrapper > .container-fluid,
.post-type-archive-product #woocommerce-wrapper > .container-fluid {
	padding-left: 30px;
	padding-right: 30px;
}
@media (max-width: 575.98px) {
	.tax-product_cat #woocommerce-wrapper > .container-fluid,
	.post-type-archive-product #woocommerce-wrapper > .container-fluid {
		padding-left: 15px;
		padding-right: 15px;
	}
}

/* ── Categorie-banner (full-width, groen + patroon) ───────────────────── */
.hps-archive-banner {
	position: relative;
	overflow: hidden;
	margin-bottom: 26px;
	background-color: rgba( 60, 175, 102, 0.15 ); /* #3CAF66 @ 15% */
}
.hps-archive-banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url( /wp-content/uploads/2024/10/markerAsset-12s.png );
	background-repeat: repeat;
	background-position: top right;
	background-size: 26%;
	opacity: 0.4;
	pointer-events: none;
}
.hps-archive-banner__inner {
	position: relative;
	z-index: 1;
	padding: 42px 30px;
}
.hps-archive-banner__title {
	margin: 0 0 6px;
	color: var(--hps-accent);
	font-size: 40px;
	font-weight: 800;
	line-height: 1.1;
}
.hps-archive-banner__crumbs {
	font-size: 14px;
	color: var(--hps-ink-soft);
	margin-bottom: 14px;
}
.hps-archive-banner__crumbs a { color: var(--hps-ink); }
.hps-archive-banner__crumbs a:hover { color: var(--hps-accent); }
.hps-archive-banner__intro {
	max-width: 1100px;
	color: var(--hps-ink-soft);
	font-size: 15px;
	line-height: 1.6;
}
.hps-archive-banner__intro p:last-child { margin-bottom: 0; }
@media (max-width: 575.98px) {
	.hps-archive-banner__inner { padding: 28px 15px; }
	.hps-archive-banner__title { font-size: 30px; }
}

/* ── Gelijke kolommen (grid) + knoppen op één lijn ───────────────────── */
.hps-archive__main ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
	margin: 0 0 30px;
	padding: 0;
}
.hps-archive__main ul.products::before,
.hps-archive__main ul.products::after {
	content: none !important;
	display: none !important;
}
.hps-archive__main ul.products li.product {
	width: auto !important;
	margin: 0 !important;
	float: none !important;
	clear: none !important;
}
@media (max-width: 1399.98px) {
	.hps-archive__main ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767.98px) {
	.hps-archive__main ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479.98px) {
	.hps-archive__main ul.products { grid-template-columns: 1fr; }
}

/* Productnaam: op tablet/desktop max 2 regels (zodat status/prijs/knop uitlijnen);
   op mobiel de volledige titel. De volledige titel staat als title-attribuut,
   dus bij muis-over verschijnt 'ie als tooltip. */
@media (min-width: 768px) {
	.hps-archive__main ul.products li.product .woocommerce-loop-product__title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		min-height: 2.7em;
	}
}

/* -------------------------------------------------------------------------
 *  Categorie SEO-content + FAQ (onder het productgrid)
 * ---------------------------------------------------------------------- */
.hps-archive-seo {
	margin: 44px 0 10px;
}
.hps-archive-seo__inner {
	display: grid;
	grid-template-columns: 7fr 3fr; /* 70% tekst links, 30% FAQ rechts */
	gap: 40px;
	align-items: start;
}
.hps-archive-seo__col {
	grid-column: 1;
	min-width: 0;
}
.hps-archive-seo__col:only-child { grid-column: 1 / -1; } /* geen FAQ: volle breedte */
.hps-archive-seo__content {
	color: var(--hps-ink);
	font-size: 16px;
	line-height: 1.7;
}
.hps-archive-seo__content h2 {
	color: var(--hps-ink);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.2;
	margin: 32px 0 12px;
}
.hps-archive-seo__content h2:first-child { margin-top: 0; }
.hps-archive-seo__content h3 {
	font-size: 20px;
	font-weight: 700;
	margin: 24px 0 10px;
}
.hps-archive-seo__content p { margin: 0 0 16px; }
.hps-archive-seo__content a { color: var(--hps-accent); text-decoration: underline; }
.hps-archive-seo__content a:hover { color: var(--hps-accent-dark); }
.hps-archive-seo__content ul,
.hps-archive-seo__content ol { margin: 0 0 16px 20px; }
.hps-archive-seo__content li { margin-bottom: 6px; }
.hps-archive-seo__content img { max-width: 100%; height: auto; }

/* Lees meer / lees minder (JS voegt .is-clamped + de knop toe) */
.hps-archive-seo__content.is-clamped {
	max-height: 300px;
	overflow: hidden;
	position: relative;
}
.hps-archive-seo__content.is-clamped::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 90px;
	background: linear-gradient( to bottom, rgba( 255, 255, 255, 0 ), #fff );
	pointer-events: none;
}
.hps-readmore {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 14px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	color: var(--hps-accent);
}
.hps-readmore::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}
.hps-readmore[aria-expanded="true"]::after {
	transform: translateY(2px) rotate(-135deg);
}
.hps-readmore:hover { color: var(--hps-accent-dark); }

.hps-archive-faq {
	grid-column: 2;
}
.hps-archive-faq__heading {
	color: var(--hps-ink);
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 16px;
}
.hps-archive-faq__item {
	background: var(--hps-accent-soft);
	border-radius: 24px;
	margin-bottom: 12px;
	overflow: hidden;
}
.hps-archive-faq__q {
	list-style: none;
	cursor: pointer;
	padding: 15px 58px 15px 22px;
	position: relative;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--hps-ink);
}
.hps-archive-faq__q::-webkit-details-marker { display: none; }
.hps-archive-faq__q::after {
	content: "+";
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--hps-ink);
	color: #fff;
	font-size: 18px;
	font-weight: 400;
	line-height: 28px;
	text-align: center;
}
.hps-archive-faq__item[open] .hps-archive-faq__q::after {
	content: "\2212"; /* minus-teken */
}
.hps-archive-faq__q:hover { color: var(--hps-accent-dark); }
.hps-archive-faq__a {
	padding: 0 22px 18px;
	color: var(--hps-ink-soft);
	font-size: 14px;
	line-height: 1.6;
}
.hps-archive-faq__a p { margin: 0 0 12px; }
.hps-archive-faq__a p:last-child { margin-bottom: 0; }
.hps-archive-faq__a a { color: var(--hps-accent); text-decoration: underline; }

@media (max-width: 991.98px) {
	.hps-archive-seo { margin-top: 30px; }
	.hps-archive-seo__inner {
		grid-template-columns: 1fr; /* stapelen op tablet/mobiel */
		gap: 28px;
	}
	.hps-archive-seo__col,
	.hps-archive-seo__col:only-child,
	.hps-archive-faq { grid-column: 1; }
	.hps-archive-seo__content h2 { font-size: 22px; }
}
