/**
 * BBD Product Filter styles.
 *
 * Everything is scoped under .bbdf-root with low-specificity selectors and
 * driven by custom properties, so the settings page can restyle the whole
 * sidebar by overriding variables. The plugin never loads fonts.
 */

/*
 * Accent pairing rule: --bbdf-accent (#ff9e0b, the BBD brand orange) is only
 * 2.1:1 against white, so it is reserved for borders, fills, highlights and
 * active-state backgrounds - never under white text. Text on the accent uses
 * --bbdf-text (8.1:1); accent-colored text/outlines on white use
 * --bbdf-accent-dark (5.4:1).
 */
/* These tokens live on :root (not .bbdf-root) because elements OUTSIDE or
 * ABOVE the sidebar read them: the page body reserves space beneath the
 * fixed mobile bar, and the sticky rule targets an Elementor ancestor. */
:root {
	--bbdf-bar-h: 56px;
	--bbdf-sticky-top: 96px;
}

/* .bbdf-grid-empty shares the token scope: it renders in the product area,
 * outside the .bbdf-root sidebar tree. */
.bbdf-root,
.bbdf-grid-empty {
	--bbdf-accent: #ff9e0b;
	--bbdf-accent-dark: #9a5b00;
	--bbdf-accent-soft: #fff3e0;
	--bbdf-bg: #ffffff;
	--bbdf-border: #e8e2d8;
	--bbdf-text: #221d15;
	--bbdf-muted: #6f6a60;
	--bbdf-radius: 4px;
	--bbdf-gap: 16px;

	/* Typography scale. Filters are supporting UI: labels sit below product-
	 * title sizes and recede. All type derives from these tokens. */
	--bbdf-font-size: 14px;
	--bbdf-font-size-sm: 12px;
	--bbdf-heading-size: 15px;
	--bbdf-line-height: 1.4;

	/* Density. Row padding is the only knob the mobile breakpoint overrides
	 * (larger padding there yields >= 40px tap targets without layout tricks). */
	--bbdf-row-pad-y: 4px;
	--bbdf-row-pad-x: 6px;
	--bbdf-checkbox-size: 16px;
	--bbdf-checkbox-border: #cfc7ba;
	--bbdf-options-max-h: 280px;
	--bbdf-fade-h: 28px;
	--bbdf-preset-min: 108px;
	--bbdf-drawer-max-h: 85vh;
	--bbdf-z-drawer: 990;

	box-sizing: border-box;
	max-width: 100%;
	font-family: inherit;
	font-size: var(--bbdf-font-size);
	line-height: var(--bbdf-line-height);
	color: var(--bbdf-text);
}

.bbdf-root *,
.bbdf-root *::before,
.bbdf-root *::after,
.bbdf-grid-empty *,
.bbdf-grid-empty *::before,
.bbdf-grid-empty *::after {
	box-sizing: inherit;
}

.bbdf-root a,
.bbdf-grid-empty a {
	color: inherit;
}

.bbdf-root :focus-visible,
.bbdf-grid-empty :focus-visible {
	outline: 2px solid var(--bbdf-accent-dark);
	outline-offset: 2px;
	border-radius: var(--bbdf-radius);
}

/* Screen-reader-only text (self-contained; no dependency on theme classes). */
.bbdf-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * Sticky sidebar (settings toggle, off by default).
 *
 * position: sticky cannot live on .bbdf-root itself: its parent (the
 * Elementor widget wrapper) is only as tall as the sidebar, leaving zero
 * travel room, so it fails silently. The workable target is the CLOSEST
 * Elementor container around the widget - its parent is the sidebar
 * column, which flex-stretches to the full row height, and that height
 * difference is the travel. :has() selects it without any template change;
 * both e-con child arrangements (direct and boxed .e-con-inner) are
 * covered. No align-self is needed (the column parent is flex-column, so
 * the container keeps content height and full width by default).
 */
.e-con:has(> .elementor-widget .bbdf-root.bbdf-sticky),
.e-con:has(> .e-con-inner > .elementor-widget .bbdf-root.bbdf-sticky) {
	position: sticky;
	top: var(--bbdf-sticky-top);
}

/* Fallback for non-Elementor placements whose parent is naturally taller.
 * Inside Elementor it is a harmless no-op (the parent is content-height). */
.bbdf-root.bbdf-sticky {
	position: sticky;
	top: var(--bbdf-sticky-top);
}

/* ---------- Groups (accordion) ---------- */

.bbdf-groups {
	display: flex;
	flex-direction: column;
	gap: calc(var(--bbdf-gap) * 0.75);
}

/*
 * Specificity policy (the checkbox lesson, applied everywhere): every rule
 * that decides a color, background, border or outline is prefixed with
 * .bbdf-root (>= 0,2,0) and declares its colors explicitly, so it beats the
 * theme's generic element rules - Astra styles bare button/input/a selectors
 * at up to (0,1,1) statically and (0,2,1) on focus - on merit rather than by
 * load order or by Elementor accidentally breaking Astra's variables.
 */
.bbdf-root .bbdf-group {
	background: var(--bbdf-bg);
	border: 1px solid var(--bbdf-border);
	border-radius: calc(var(--bbdf-radius) * 2);
	box-shadow: 0 1px 3px rgba(34, 29, 21, 0.05);
}

.bbdf-root .bbdf-group__summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px var(--bbdf-gap);
	cursor: pointer;
	color: var(--bbdf-text);
	background: transparent;
	font-size: var(--bbdf-heading-size);
	font-weight: 600;
	list-style: none;
	user-select: none;
}

.bbdf-root .bbdf-group__summary::-webkit-details-marker {
	display: none;
}

.bbdf-root .bbdf-group__summary:hover {
	color: var(--bbdf-accent-dark);
}

.bbdf-group__label {
	flex: 1;
	min-width: 0;
}

.bbdf-root .bbdf-group__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--bbdf-accent);
	color: var(--bbdf-text);
	font-size: 0.75em;
	font-weight: 600;
	line-height: 1;
}

.bbdf-root .bbdf-group__chevron {
	flex: none;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--bbdf-muted);
	border-bottom: 2px solid var(--bbdf-muted);
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.bbdf-root .bbdf-group[open] > .bbdf-group__summary .bbdf-group__chevron {
	transform: rotate(225deg);
}

.bbdf-root .bbdf-group__body {
	padding: 4px var(--bbdf-gap) 12px;
	border-top: 1px solid var(--bbdf-border);
}

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

.bbdf-root .bbdf-options {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: var(--bbdf-options-max-h);
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--bbdf-border) transparent;
}

.bbdf-root .bbdf-options::-webkit-scrollbar {
	width: 6px;
}

.bbdf-root .bbdf-options::-webkit-scrollbar-thumb {
	background: var(--bbdf-border);
	border-radius: 999px;
}

.bbdf-root .bbdf-options::-webkit-scrollbar-track {
	background: transparent;
}

/* Long lists (10+ options) get a deliberate bottom fade. The list's own
 * bottom padding equals the fade height, so at full scroll the fade covers
 * only padding and the last option stays readable. */
.bbdf-options:has(> .bbdf-options__item:nth-child(10)) {
	padding-bottom: var(--bbdf-fade-h);
	mask-image: linear-gradient(to bottom, #000 calc(100% - var(--bbdf-fade-h)), transparent);
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--bbdf-fade-h)), transparent);
}

.bbdf-options__item {
	margin: 0;
}

/* Rows top-align their flex items so on wrapped labels the checkbox and the
 * count stay on the first text line instead of centering across the block. */
.bbdf-root .bbdf-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: var(--bbdf-row-pad-y) var(--bbdf-row-pad-x);
	border-radius: var(--bbdf-radius);
	color: var(--bbdf-text);
	background: transparent;
	cursor: pointer;
}

.bbdf-root .bbdf-option:hover {
	background: var(--bbdf-accent-soft);
}

.bbdf-root .bbdf-option.is-checked .bbdf-option__label {
	font-weight: 600;
}

/*
 * Checkbox selectors are deliberately over-qualified: Astra's dynamic CSS
 * paints input[type="checkbox"]:checked (up to 0,3,1 with :hover:checked)
 * with the theme palette, and its WooCommerce CSS overrides checkbox margin
 * and position. These rules must win on specificity - no !important.
 */
.bbdf-root .bbdf-option input.bbdf-option__checkbox {
	flex: none;
	width: var(--bbdf-checkbox-size);
	height: var(--bbdf-checkbox-size);
	/* Optically center on the label's first line. */
	margin: calc((var(--bbdf-font-size) * var(--bbdf-line-height) - var(--bbdf-checkbox-size)) / 2) 0 0;
	padding: 0;
	position: static;
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--bbdf-checkbox-border);
	border-radius: calc(var(--bbdf-radius) - 1px);
	background: var(--bbdf-bg) center / 12px no-repeat;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

.bbdf-root .bbdf-option:hover input.bbdf-option__checkbox {
	border-color: var(--bbdf-accent);
}

.bbdf-root .bbdf-option input.bbdf-option__checkbox:checked {
	border-color: var(--bbdf-accent);
	background-color: var(--bbdf-accent);
	/* Dark checkmark on the accent fill (accent pairing rule; a url() cannot
	 * read custom properties, so the stroke mirrors --bbdf-text). */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 4.8 9.2 10 3.5' fill='none' stroke='%23221d15' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.bbdf-root .bbdf-option input.bbdf-option__checkbox:focus-visible {
	outline: 2px solid var(--bbdf-accent-dark);
	outline-offset: 2px;
}

.bbdf-option__label {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Plain muted number, secondary to the label. Its line box matches the
 * label's first line so it top-aligns on wrapped labels. */
.bbdf-root .bbdf-option__count {
	flex: none;
	color: var(--bbdf-muted);
	font-size: var(--bbdf-font-size-sm);
	font-variant-numeric: tabular-nums;
	line-height: calc(var(--bbdf-font-size) * var(--bbdf-line-height));
}

/* Touch devices get roomier rows: the padding token alone lifts every row
 * to a >= 40px tap target (min-height backstops sub-pixel rounding). */
@media (max-width: 1024px) {
	.bbdf-root {
		--bbdf-row-pad-y: 10px;
	}

	.bbdf-option {
		min-height: 40px;
	}
}

/* ---------- Chips ---------- */

.bbdf-chips {
	margin-bottom: var(--bbdf-gap);
}

.bbdf-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bbdf-chips__item {
	margin: 0;
}

.bbdf-root .bbdf-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	border: 1px solid var(--bbdf-accent);
	border-radius: 999px;
	background: var(--bbdf-accent-soft);
	color: var(--bbdf-text);
	font-size: 0.9em;
	text-decoration: none;
	line-height: 1.5;
}

.bbdf-root .bbdf-chip:hover {
	border-color: var(--bbdf-accent-dark);
	background: var(--bbdf-accent);
	color: var(--bbdf-text);
}

.bbdf-root .bbdf-chip__x {
	font-weight: 600;
}

/* Both scopes: the Clear link also renders inside the grid-area empty state.
 * The .bbdf-root/.bbdf-grid-empty prefix is load-bearing here twice over -
 * it also outranks our own "a { color: inherit }" baseline (0,1,1), which
 * used to swallow this link color. */
.bbdf-root .bbdf-clear,
.bbdf-grid-empty .bbdf-clear {
	color: var(--bbdf-accent-dark);
	background: transparent;
	font-size: 0.9em;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bbdf-root .bbdf-clear:hover,
.bbdf-grid-empty .bbdf-clear:hover {
	color: var(--bbdf-text);
}

/* ---------- Empty states ---------- */

/* Grid-area version: rendered where the products would have been, centered
 * with generous padding so it reads as an intentional state. */
.bbdf-grid-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: var(--bbdf-gap) auto;
	padding: calc(var(--bbdf-gap) * 3) var(--bbdf-gap);
	max-width: 560px;
	text-align: center;
	background: var(--bbdf-accent-soft);
	border: 1px dashed var(--bbdf-accent);
	border-radius: calc(var(--bbdf-radius) * 2);
}

.bbdf-grid-empty__text {
	margin: 0;
	font-size: calc(var(--bbdf-font-size) + 1px);
}

/* Sidebar version: pure fallback for pages where the grid area offered no
 * anchor. Hidden whenever the grid-area version rendered, so the message
 * can never appear twice. */
.bbdf-root .bbdf-empty {
	margin-bottom: var(--bbdf-gap);
	padding: var(--bbdf-gap);
	border: 1px dashed var(--bbdf-accent);
	border-radius: calc(var(--bbdf-radius) * 2);
	background: var(--bbdf-accent-soft);
	color: var(--bbdf-text);
}

body:has(.bbdf-grid-empty) .bbdf-empty {
	display: none;
}

.bbdf-root .bbdf-empty__text {
	margin: 0 0 8px;
}

/* ---------- Price group ---------- */

/*
 * Two equal-width inputs joined by a dash. There is no "Go" button anymore:
 * the sidebar's Apply button covers no-JS submits and the JS layer applies
 * price edits on a debounce. Presets render as a uniform auto-fit grid so
 * every chip shares the same width and height in every row.
 */
.bbdf-price-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	padding-top: 2px;
}

.bbdf-price-field {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.bbdf-root .bbdf-price-field__label {
	font-size: var(--bbdf-font-size-sm);
	color: var(--bbdf-muted);
}

/*
 * Astra styles input[type="number"] directly at (0,1,1) - its own height,
 * padding, text color and box-shadow - and forces a literal blue border on
 * :focus at (0,2,1). The input tag in these selectors lifts us to (0,2,1) /
 * (0,3,1) so every declaration wins on specificity.
 */
.bbdf-root input.bbdf-price-field__input {
	width: 100%;
	height: auto;
	padding: 9px 12px;
	border: 1px solid var(--bbdf-border);
	border-radius: var(--bbdf-radius);
	background-color: var(--bbdf-bg);
	color: var(--bbdf-text);
	box-shadow: none;
	font: inherit;
	font-size: var(--bbdf-font-size);
	line-height: var(--bbdf-line-height);
}

.bbdf-root input.bbdf-price-field__input:focus {
	border-color: var(--bbdf-accent);
	box-shadow: none;
	color: var(--bbdf-text);
}

.bbdf-root input.bbdf-price-field__input:focus-visible {
	outline: 2px solid var(--bbdf-accent-dark);
	outline-offset: 2px;
}

/* Astra sets a universal ::placeholder color with a literal fallback
 * (#9CA3AF, ~2.6:1 on white); reclaim it at readable contrast. */
.bbdf-root input.bbdf-price-field__input::placeholder,
.bbdf-root .bbdf-group-search input::placeholder {
	color: var(--bbdf-muted);
	opacity: 1;
}

.bbdf-root .bbdf-price-sep {
	flex: none;
	padding-bottom: 11px;
	color: var(--bbdf-muted);
}

.bbdf-presets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(var(--bbdf-preset-min), 1fr));
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.bbdf-presets__item {
	margin: 0;
	display: flex;
}

.bbdf-root .bbdf-preset {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 7px 10px;
	border: 1px solid var(--bbdf-border);
	border-radius: var(--bbdf-radius);
	background: var(--bbdf-bg);
	color: var(--bbdf-text);
	font-size: var(--bbdf-font-size-sm);
	line-height: var(--bbdf-line-height);
	text-align: center;
	text-decoration: none;
}

.bbdf-root .bbdf-preset:hover {
	border-color: var(--bbdf-accent);
	background: var(--bbdf-accent-soft);
	color: var(--bbdf-text);
}

.bbdf-root .bbdf-preset.is-active {
	border-color: var(--bbdf-accent);
	background: var(--bbdf-accent);
	color: var(--bbdf-text);
	font-weight: 600;
}

/* ---------- Elementor editor placeholder ---------- */

.bbdf-root.bbdf-editor-placeholder {
	padding: var(--bbdf-gap);
	border: 1px dashed var(--bbdf-border);
	border-radius: calc(var(--bbdf-radius) * 2);
	background: var(--bbdf-accent-soft);
	color: var(--bbdf-muted);
	text-align: center;
}

/* ---------- Form actions (Apply / Clear all) ---------- */

.bbdf-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: var(--bbdf-gap);
}

.bbdf-root .bbdf-apply {
	flex: 1;
	padding: 11px 16px;
	border: 1px solid var(--bbdf-accent);
	border-radius: var(--bbdf-radius);
	background: var(--bbdf-accent);
	color: var(--bbdf-text);
	box-shadow: none;
	font: inherit;
	font-size: var(--bbdf-font-size);
	font-weight: 600;
	line-height: var(--bbdf-line-height);
	cursor: pointer;
}

.bbdf-root .bbdf-apply:hover {
	background: var(--bbdf-text);
	border-color: var(--bbdf-text);
	color: #ffffff;
}

/* The Apply/Clear row is only needed where changes batch (the drawer) or
 * where no JS runs at all; with instant auto-apply it is noise. */
.bbdf-root.bbdf-js:not(.bbdf-mobile) .bbdf-actions {
	display: none;
}

.bbdf-root.bbdf-js.bbdf-mobile:not(.bbdf-drawer) .bbdf-actions {
	display: none;
}

/* ---------- Filter-internal search ---------- */

/* Hidden until JS activates it: a dead search box would only confuse the
 * no-JS baseline. */
.bbdf-group-search {
	display: none;
	margin: 4px 0 8px;
}

.bbdf-root.bbdf-js .bbdf-group-search {
	display: block;
}

/* Astra forces box-sizing: content-box and its own form styling on
 * input[type="search"] at (0,1,1); (0,2,1) reclaims every declaration. */
.bbdf-root .bbdf-group-search input {
	box-sizing: border-box;
	width: 100%;
	height: auto;
	padding: 7px 10px;
	border: 1px solid var(--bbdf-border);
	border-radius: var(--bbdf-radius);
	background-color: var(--bbdf-bg);
	color: var(--bbdf-text);
	box-shadow: none;
	font: inherit;
	font-size: var(--bbdf-font-size);
	line-height: var(--bbdf-line-height);
}

.bbdf-root .bbdf-group-search input:focus {
	border-color: var(--bbdf-accent);
	box-shadow: none;
	color: var(--bbdf-text);
}

.bbdf-root .bbdf-group-search input:focus-visible {
	outline: 2px solid var(--bbdf-accent-dark);
	outline-offset: 2px;
}

/* ---------- Loading state (applied to the product grid) ---------- */

/* The overlay attaches to the grid, OUTSIDE the token scope, so the two
 * variables its spinner consumes are declared here (and the settings inline
 * style overrides them together with the root scope). Without this the
 * var() references resolve to nothing and the spinner falls back to
 * currentColor. Only variables - no inherited styling leaks onto the grid. */
.bbdf-loading {
	--bbdf-accent: #ff9e0b;
	--bbdf-accent-soft: #fff3e0;

	position: relative;
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.bbdf-loading::after {
	content: "";
	position: absolute;
	top: 32px;
	left: 50%;
	width: 28px;
	height: 28px;
	margin-left: -14px;
	border: 3px solid var(--bbdf-accent-soft);
	border-top-color: var(--bbdf-accent);
	border-radius: 50%;
	animation: bbdf-spin 0.7s linear infinite;
}

.bbdf-root.bbdf-busy .bbdf-groups {
	opacity: 0.8;
}

@keyframes bbdf-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Mobile drawer ---------- */

/* All drawer chrome is inert by default: without JS (no .bbdf-js class) the
 * bottom bar and panel head stay hidden and the panel renders as the normal
 * inline sidebar at every width - the graceful-degradation baseline. */
.bbdf-bar {
	display: none;
}

.bbdf-root .bbdf-panel__head {
	display: none;
	align-items: center;
	justify-content: space-between;
	padding: 14px var(--bbdf-gap);
	border-bottom: 1px solid var(--bbdf-border);
	color: var(--bbdf-text);
	background: transparent;
	font-size: var(--bbdf-heading-size);
	font-weight: 600;
}

/* A bare <button>: Astra's generic button rules paint it with the theme
 * button colors, radius and shadow, so every one of those properties is
 * explicitly reclaimed here. */
.bbdf-root .bbdf-panel__close {
	border: 0;
	border-radius: var(--bbdf-radius);
	background: transparent;
	padding: 4px 10px;
	color: var(--bbdf-muted);
	box-shadow: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.bbdf-root .bbdf-panel__close:hover {
	background: transparent;
	color: var(--bbdf-text);
}

.bbdf-overlay {
	display: none;
}

body.bbdf-lock {
	overflow: hidden;
}

/*
 * Drawer chrome is gated on classes the JS manages - bbdf-js (script ran),
 * bbdf-drawer (the mobile_drawer setting is on) and bbdf-mobile (viewport is
 * below the configured breakpoint, tracked via matchMedia) - instead of a
 * CSS media query, so the breakpoint setting works without regenerating
 * this stylesheet. Without JS none of the classes exist and the sidebar
 * stays inline with its Apply button.
 */

/* Full-width bottom bar: white chrome (border + soft upward shadow) with
 * an accent-filled button inside, so it reads as deliberate UI without
 * out-shouting the shop's own accent CTAs. */
.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile .bbdf-bar {
	display: flex;
	align-items: center;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--bbdf-z-drawer);
	height: calc(var(--bbdf-bar-h) + env(safe-area-inset-bottom, 0px));
	padding: 8px var(--bbdf-gap) calc(8px + env(safe-area-inset-bottom, 0px));
	background: var(--bbdf-bg);
	border-top: 1px solid var(--bbdf-border);
	box-shadow: 0 -4px 16px rgba(34, 29, 21, 0.12);
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile .bbdf-pill {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 100%;
	border: 1px solid var(--bbdf-accent);
	border-radius: var(--bbdf-radius);
	background: var(--bbdf-accent);
	color: var(--bbdf-text);
	font: inherit;
	font-size: var(--bbdf-font-size);
	font-weight: 600;
	box-shadow: none;
	cursor: pointer;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile .bbdf-panel {
	display: none;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-bar {
	display: none;
}

/* Reserve the bar's space below the page content so the bar can never
 * cover the last product row or the footer. */
body:has(.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile) {
	padding-bottom: calc(var(--bbdf-bar-h) + env(safe-area-inset-bottom, 0px));
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-overlay {
	display: block;
	position: fixed;
	inset: 0;
	z-index: calc(var(--bbdf-z-drawer) + 1);
	background: rgba(34, 29, 21, 0.5);
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-panel {
	display: flex;
	flex-direction: column;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: calc(var(--bbdf-z-drawer) + 2);
	max-height: var(--bbdf-drawer-max-h);
	background: var(--bbdf-bg);
	border-radius: 12px 12px 0 0;
	box-shadow: 0 -8px 30px rgba(34, 29, 21, 0.25);
	overflow: hidden;
	animation: bbdf-slide-up 0.25s ease;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-panel__head {
	display: flex;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-chips {
	margin: 12px var(--bbdf-gap) 0;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-empty {
	margin: 12px var(--bbdf-gap) 0;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-form {
	flex: 1;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-groups {
	padding: 12px var(--bbdf-gap) 0;
}

/* Sticky footer inside the scrolling form: Apply + Clear all. */
.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-actions {
	position: sticky;
	bottom: 0;
	margin: var(--bbdf-gap) 0 0;
	padding: 12px var(--bbdf-gap);
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	background: var(--bbdf-bg);
	border-top: 1px solid var(--bbdf-border);
}

@keyframes bbdf-slide-up {
	from {
		transform: translateY(100%);
	}

	to {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bbdf-root.bbdf-js.bbdf-drawer.bbdf-mobile.bbdf-open .bbdf-panel {
		animation: none;
	}

	.bbdf-loading::after {
		animation: none;
	}

	.bbdf-group__chevron {
		transition: none;
	}
}
