/* =========================================================================
   Sabeny Filters — horizontal filter bar above product loop grids.
   Uses CSS custom properties so brand colours can be retuned in one place.
   ========================================================================= */

.sbnf {
	--sbnf-teal:       #0E6B6B;
	--sbnf-teal-dark:  #0A5454;
	--sbnf-ink:        #0F172A;
	--sbnf-mute:       #6B7280;
	--sbnf-line:       #E5E7EB;
	--sbnf-soft:       #F3F4F6;
	--sbnf-radius:     10px;
	--sbnf-radius-sm:  8px;
	font-family: inherit;
	color: var(--sbnf-ink);
}

/* ----- Categories toggle (lives in the bar with Hescher / Sort) -----
   Looks like the dropdown toggles for visual consistency. */
.sbnf .sbnf__subcats-toggle {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	height: 38px !important;
	padding: 0 14px !important;
	margin: 0 !important;
	background: #fff !important;
	border: 1px solid var(--sbnf-line) !important;
	border-radius: var(--sbnf-radius-sm) !important;
	box-shadow: none !important;
	outline: 0 !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	font-family: inherit !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: var(--sbnf-ink) !important;
	line-height: 1 !important;
	cursor: pointer !important;
	transition: border-color .15s ease, color .15s ease, background .15s ease !important;
}
.sbnf .sbnf__subcats-toggle:hover { border-color: var(--sbnf-teal) !important; }
.sbnf .sbnf__subcats-toggle.has-active {
	border-color: var(--sbnf-teal) !important;
	color: var(--sbnf-teal) !important;
}
.sbnf .sbnf__subcats-toggle svg { transition: transform .15s ease; }
.sbnf .sbnf__subcats-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ----- Categories chip panel ----------------------------------------
   Default state by viewport, JS adds .is-open or .is-closed to override. */
.sbnf__subcats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 0;
}
.sbnf__subcats.is-open  { display: flex !important; }
.sbnf__subcats.is-closed { display: none !important; }
.sbnf__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #fff;
	border: 1px solid var(--sbnf-line);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	color: var(--sbnf-ink);
	text-decoration: none;
	line-height: 1.2;
	transition: border-color .15s ease, color .15s ease, background .15s ease;
	white-space: nowrap;
}
.sbnf__chip:hover {
	border-color: var(--sbnf-teal);
	color: var(--sbnf-teal);
}
.sbnf__chip.is-active {
	border-color: var(--sbnf-teal);
	background: var(--sbnf-teal);
	color: #fff;
}
.sbnf__chip.is-active:hover {
	background: var(--sbnf-teal-dark);
	border-color: var(--sbnf-teal-dark);
	color: #fff;
}
.sbnf__chip-x {
	font-size: 16px;
	line-height: 1;
	font-weight: 400;
	margin-right: -2px;
}

/* When Reset has nothing to clear, fade it so it doesn't grab attention. */
.sbnf__reset.is-empty {
	opacity: 0.4;
	pointer-events: none;
}

/* ----- Filter bar (controls row) ------------------------------------ */
.sbnf__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 0;
	border-top: 1px solid var(--sbnf-line);
	border-bottom: 1px solid var(--sbnf-line);
	margin-bottom: 12px;
}
.sbnf__group {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.sbnf__reset {
	color: var(--sbnf-mute);
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color .15s ease;
}
.sbnf__reset:hover { color: var(--sbnf-teal); }

/* ----- Dropdown (shared) -------------------------------------------- */
.sbnf-dd {
	position: relative;
	display: inline-block;
}
.sbnf .sbnf-dd__toggle {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	height: 38px !important;
	padding: 0 14px !important;
	margin: 0 !important;
	background: #fff !important;
	border: 1px solid var(--sbnf-line) !important;
	border-radius: var(--sbnf-radius-sm) !important;
	box-shadow: none !important;
	outline: 0 !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	font-family: inherit !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: var(--sbnf-ink) !important;
	line-height: 1 !important;
	cursor: pointer !important;
	transition: border-color .15s ease, background .15s ease !important;
}
.sbnf-dd__toggle:hover { border-color: var(--sbnf-teal); }
.sbnf-dd.is-open .sbnf-dd__toggle,
.sbnf-dd.has-active .sbnf-dd__toggle {
	border-color: var(--sbnf-teal);
	color: var(--sbnf-teal);
}
.sbnf-dd__toggle svg {
	transition: transform .15s ease;
}
.sbnf-dd.is-open .sbnf-dd__toggle svg { transform: rotate(180deg); }

.sbnf-dd__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 200;
	width: 300px;
	background: #fff;
	border: 1px solid var(--sbnf-line);
	border-radius: var(--sbnf-radius);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
	display: none;
	overflow: hidden;
}
.sbnf-dd.is-open .sbnf-dd__panel { display: block; }

.sbnf-dd__panel--simple { width: 220px; }

/* ----- Search box inside panel -------------------------------------- */
.sbnf-dd__search {
	padding: 10px;
	border-bottom: 1px solid var(--sbnf-line);
	background: var(--sbnf-soft);
}
.sbnf-dd__search-input {
	width: 100%;
	height: 34px;
	padding: 0 10px;
	border: 1px solid var(--sbnf-line);
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
}
.sbnf-dd__search-input:focus {
	outline: none;
	border-color: var(--sbnf-teal);
	box-shadow: 0 0 0 3px rgba(14, 107, 107, 0.12);
}

/* ----- Multi-select option list ------------------------------------- */
.sbnf-dd__options {
	max-height: 280px;
	overflow-y: auto;
	padding: 4px 0;
}
.sbnf-dd__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	font-size: 13px;
	cursor: pointer;
	user-select: none;
}
.sbnf-dd__opt:hover { background: var(--sbnf-soft); }
.sbnf-dd__opt.sbnf-hidden { display: none; }
.sbnf-dd__opt input[type="checkbox"] {
	margin: 0;
	width: 16px;
	height: 16px;
	accent-color: var(--sbnf-teal);
	cursor: pointer;
	flex-shrink: 0;
}
.sbnf-dd__opt-label { flex: 1; }
.sbnf-dd__opt-count {
	color: var(--sbnf-mute);
	font-size: 12px;
}

/* ----- Sort options (single-pick, click-to-apply) -------------------
   Aggressive resets to defeat Elementor's button kit & theme button
   styling that otherwise gives each option a pill border + spacing. */
.sbnf .sbnf-dd__opt-radio,
.sbnf-dd__panel .sbnf-dd__opt-radio {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 11px 16px !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	color: var(--sbnf-ink) !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	font-family: inherit !important;
	line-height: 1.4 !important;
	letter-spacing: 0 !important;
	text-align: left !important;
	text-transform: none !important;
	cursor: pointer !important;
	transition: background .15s ease !important;
}
.sbnf .sbnf-dd__opt-radio + .sbnf-dd__opt-radio {
	border-top: 1px solid var(--sbnf-line) !important;
}
.sbnf .sbnf-dd__opt-radio:hover {
	background: var(--sbnf-soft) !important;
}
.sbnf .sbnf-dd__opt-radio.is-active {
	background: var(--sbnf-soft) !important;
	color: var(--sbnf-teal) !important;
	font-weight: 700 !important;
}

/* ----- Apply / Clear actions ---------------------------------------- */
.sbnf-dd__actions {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid var(--sbnf-line);
	background: var(--sbnf-soft);
}
.sbnf .sbnf-dd__clear,
.sbnf .sbnf-dd__apply {
	-webkit-appearance: none !important;
	appearance: none !important;
	flex: 1 !important;
	height: 36px !important;
	margin: 0 !important;
	padding: 0 12px !important;
	border-radius: 6px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	line-height: 1 !important;
	box-shadow: none !important;
	outline: 0 !important;
	cursor: pointer !important;
	transition: background .15s ease !important;
}
.sbnf .sbnf-dd__clear {
	background: #fff !important;
	border: 1px solid var(--sbnf-line) !important;
	color: var(--sbnf-ink) !important;
}
.sbnf .sbnf-dd__clear:hover { background: var(--sbnf-soft) !important; }
.sbnf .sbnf-dd__apply {
	background: var(--sbnf-teal) !important;
	border: 1px solid var(--sbnf-teal) !important;
	color: #fff !important;
}
.sbnf .sbnf-dd__apply:hover { background: var(--sbnf-teal-dark) !important; border-color: var(--sbnf-teal-dark) !important; }

/* ----- Active filter chips ------------------------------------------ */
.sbnf__active {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 4px;
}
.sbnf__active-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: var(--sbnf-soft);
	border: 1px solid var(--sbnf-line);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	color: var(--sbnf-ink);
	text-decoration: none;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sbnf__active-chip:hover {
	background: #FEE2E2;
	border-color: #FECACA;
	color: #B91C1C;
}
.sbnf__active-x {
	font-size: 16px;
	line-height: 1;
	font-weight: 400;
}

/* ----- Mobile ------------------------------------------------------- */
@media (max-width: 600px) {
	/*
	 * Detach the dropdown panel from the button's left edge and pin it to
	 * the viewport instead. Previously it was `position: absolute; left: 0`
	 * which meant a panel anchored to the right-most filter button (Sort)
	 * extended off the right of the viewport on iPhone 15 / 16. Centering
	 * to the viewport keeps every dropdown fully on-screen regardless of
	 * which trigger fired it.
	 */
	.sbnf-dd__panel,
	.sbnf-dd__panel--simple {
		position: fixed !important;
		left: 12px !important;
		right: 12px !important;
		top: auto;
		width: auto !important;
		max-width: none !important;
		max-height: 70vh;
		overflow-y: auto;
		/* The JS sets `top` per-trigger so the panel still appears beneath
		 * the bar. Provide a sensible default in case the JS hasn't run yet. */
	}
	.sbnf__bar {
		gap: 8px;
	}

	/* Default: chip panel is closed on mobile */
	.sbnf__subcats {
		display: none;
	}
}

/* ----- Contextual count badges ------------------------------------- */
/* Small count pip next to each sub-category chip — reflects how many
 * products in that child cat match the current hescher selection. */
.sbnf__chip-count {
	display: inline-block;
	min-width: 18px;
	padding: 0 6px;
	margin-left: 6px;
	background: rgba(15, 23, 42, 0.08);
	color: rgba(15, 23, 42, 0.7);
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
}
.sbnf__chip.is-active .sbnf__chip-count {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

/* A hescher option that's currently in the user's selection but has 0
 * matching products in the current context — faded so it's still tickable
 * but visually de-emphasised. */
.sbnf-dd__opt.is-empty {
	opacity: 0.5;
}
