/**
 * VNR Boutique — filtres latéraux
 * Scoped under .vnrbf / .vnrbf-* so nothing leaks into the rest of the theme.
 */

:root {
	--vnrbf-ink: #000;
	--vnrbf-muted: #8a8a8a;
	--vnrbf-line: #e4e4e4;
	--vnrbf-accent: var(--main-pink, #ece1eb);
	--vnrbf-radius: 999px;
}

/* The Gecko theme hides its own filter drawer behind a "Filter" link and keeps
   the sidebar column empty. The filters now live in the sidebar, so retire both. */
.vnrbf-active #jas-filter,
.vnrbf-active .jas-top-sidebar {
	display: none !important;
}

/* ------------------------------------------------------------------ panel */

.vnrbf {
	font-family: inherit;
	text-align: left;
}

.vnrbf__head {
	display: none; /* only used in the mobile drawer */
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--vnrbf-line);
}

.vnrbf__head-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.vnrbf__close {
	appearance: none;
	border: 0;
	background: none;
	padding: 0 4px;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	color: var(--vnrbf-ink);
}

.vnrbf__reset {
	display: inline-block;
	margin-bottom: 22px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: underline;
	color: var(--vnrbf-muted);
}

.vnrbf__reset:hover {
	color: var(--vnrbf-ink);
}

/* ------------------------------------------------------------------ groups */

.vnrbf__group {
	margin-bottom: 26px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--vnrbf-line);
}

.vnrbf__group:last-of-type {
	border-bottom: 0;
}

.vnrbf__group-title {
	margin: 0 0 14px;
	padding: 0;
	font-size: 13px;
}

.vnrbf__group-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0;
	appearance: none;
	border: 0;
	background: none;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--vnrbf-ink);
}

.vnrbf__chevron {
	width: 8px;
	height: 8px;
	margin-left: 10px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

/* The toggle button sits inside the <h3>, so the list is a sibling of the
   heading rather than of the button — collapse via a class on the group. */
.vnrbf__group.is-collapsed .vnrbf__chevron {
	transform: rotate(-135deg);
}

.vnrbf__group.is-collapsed .vnrbf__list,
.vnrbf__group.is-collapsed .vnrbf__price {
	display: none;
}

/* ------------------------------------------------------------------- lists */

.vnrbf__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vnrbf__item {
	margin: 0 0 2px;
	padding: 0;
	list-style: none;
	border: 0;
}

.vnrbf__item.is-empty {
	opacity: 0.35;
	pointer-events: none;
}

.vnrbf__option,
.vnrbf__option:hover,
.vnrbf__option:focus {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
	font-size: 14px;
	line-height: 1.3;
	color: var(--vnrbf-ink);
	/* Themes commonly underline sidebar links with high specificity; the checkbox
	   is the affordance here, so this one declaration is forced. */
	text-decoration: none !important;
	box-shadow: none;
	transition: opacity 0.15s ease;
}

.vnrbf__option:hover {
	opacity: 0.6;
}

.vnrbf__box {
	position: relative;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 1.5px solid var(--vnrbf-ink);
	background: #fff;
	transition: background 0.15s ease;
}

.vnrbf__option.is-checked .vnrbf__box {
	background: var(--vnrbf-ink);
}

.vnrbf__option.is-checked .vnrbf__box::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 4px;
	width: 5px;
	height: 9px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

.vnrbf__label {
	flex: 1 1 auto;
}

.vnrbf__option.is-checked .vnrbf__label {
	font-weight: 700;
}

.vnrbf__count {
	flex: 0 0 auto;
	font-size: 12px;
	color: var(--vnrbf-muted);
}

/* ------------------------------------------------------------------- price */

.vnrbf__price {
	margin: 0;
}

.vnrbf__price-fields {
	display: flex;
	align-items: center;
	gap: 6px;
}

.vnrbf__price-fields input[type="number"] {
	width: 100%;
	min-width: 0;
	height: 38px;
	padding: 0 8px;
	border: 1px solid var(--vnrbf-line);
	border-radius: 0;
	background: #fff;
	font-size: 13px;
	text-align: center;
	box-shadow: none;
}

.vnrbf__price-fields input[type="number"]:focus {
	border-color: var(--vnrbf-ink);
	outline: none;
}

.vnrbf__dash {
	color: var(--vnrbf-muted);
}

.vnrbf__price-go {
	flex: 0 0 auto;
	height: 38px;
	padding: 0 14px;
	appearance: none;
	border: 0;
	border-radius: 0;
	background: var(--vnrbf-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.vnrbf__price-go:hover {
	background: #333;
	color: #fff;
}

.vnrbf__price-hint {
	margin: 8px 0 0;
	font-size: 12px;
	color: var(--vnrbf-muted);
}

.vnrbf__price-hint .amount,
.vnrbf__price-hint bdi {
	color: inherit;
	font-size: inherit;
}

.vnrbf__noscript {
	font-size: 12px;
	color: var(--vnrbf-muted);
}

/* Sorting is retired in favour of the sidebar filters. Belt and braces: the
   remove_action handles the standard hook, this covers themes (Gecko) that
   print the control from their own template. */
.vnrbf-no-sort .woocommerce-ordering {
	display: none !important;
}

/* ------------------------------------------------------- chips above grid */

.vnrbf-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 24px;
}

.vnrbf-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	border: 1px solid var(--vnrbf-ink);
	border-radius: var(--vnrbf-radius);
	background: var(--vnrbf-accent);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--vnrbf-ink);
	text-decoration: none;
}

.vnrbf-chip:hover {
	background: var(--vnrbf-ink);
	color: #fff;
}

.vnrbf-chip__x {
	font-size: 15px;
	line-height: 1;
}

.vnrbf-chips__clear {
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: underline;
	color: var(--vnrbf-muted);
}

.vnrbf-chips__clear:hover {
	color: var(--vnrbf-ink);
}

/* --------------------------------------------------- mobile drawer trigger */

.vnrbf-open {
	display: none; /* shown under 992px */
	align-items: center;
	gap: 9px;
	padding: 11px 20px;
	appearance: none;
	border: 1px solid var(--vnrbf-ink);
	border-radius: var(--vnrbf-radius);
	background: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--vnrbf-ink);
	cursor: pointer;
}

.vnrbf-open__icon,
.vnrbf-open__icon::before,
.vnrbf-open__icon::after {
	display: block;
	width: 15px;
	height: 1.5px;
	background: currentColor;
}

.vnrbf-open__icon {
	position: relative;
}

.vnrbf-open__icon::before,
.vnrbf-open__icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.vnrbf-open__icon::before {
	top: -4.5px;
	width: 10px;
}

.vnrbf-open__icon::after {
	top: 4.5px;
	width: 7px;
}

.vnrbf-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.vnrbf-drawer-open .vnrbf-backdrop {
	opacity: 1;
	visibility: visible;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 991px) {
	/* Turn the sidebar column into an off-canvas drawer.
	   Gated on .vnrbf-sidebar-col, which only JavaScript adds: without JS the
	   button could never reopen the drawer, so the column must stay in flow. */
	body.vnrbf-active .vnrbf-sidebar-col {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 99999;
		width: 86vw;
		max-width: 340px;
		height: 100%;
		margin: 0;
		padding: 22px 20px 40px;
		overflow-y: auto;
		background: #fff;
		box-shadow: 2px 0 24px rgba(0, 0, 0, 0.16);
		transform: translateX(-102%);
		transition: transform 0.28s ease;
	}

	/* .vnrbf-active sits on <body> itself, so it must not be a descendant step. */
	body.vnrbf-drawer-open.vnrbf-active .vnrbf-sidebar-col {
		transform: translateX(0);
	}

	/* The close button only means something once the column is a drawer. */
	.vnrbf-sidebar-col .vnrbf__head {
		display: flex;
	}

	/* Likewise, the "Filtrer" button is inert without JS. */
	.vnrbf-open {
		display: none;
	}

	body.vnrbf-has-js .vnrbf-open {
		display: inline-flex;
	}

	body.vnrbf-drawer-open {
		overflow: hidden;
	}
}

@media (min-width: 992px) {
	.vnrbf-backdrop {
		display: none;
	}
}
