/* Shop filters (inc/filters.php). Loaded on category, tag and shop pages that show products. */

.bb-filters { align-self: start; }
@media (min-width: 901px) {
	.bb-filters { position: sticky; top: 130px; max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
	.bb-filters__head, .bb-filters__close, .bb-filters__done { display: none !important; }
}
.bb-filters__head { display: flex; align-items: center; justify-content: space-between; }
.bb-filters__title { margin: 0; font-size: 1.15rem; text-transform: uppercase; }
.bb-filters__foot { margin-top: 8px; }
.bb-filters__foot .bb-clear-filters { margin: 0; }

/* ---------- Selected filters: removable chips ---------- */
.bb-chips ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.bb-chips li { margin: 0; }
.bb-chips a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 6px 14px;
	border: 2px solid var(--bb-purple);
	border-radius: 999px;
	background: var(--bb-tint);
	color: var(--bb-purple-dark);
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}
.bb-chips a::before, .bb-chips a::after { content: none; }
.bb-chips a::after { content: "\00d7"; font-size: 1.3em; line-height: 1; }
.bb-chips a:hover, .bb-chips a:focus-visible { background: var(--bb-purple); color: #fff; }
.bb-chips .woocommerce-widget-layered-nav-list__item--chosen a { padding: 6px 14px; }

/* ---------- A group: always open (a heading and its choices) ---------- */
.bb-fgroup { margin: 0 0 6px !important; padding: 0 0 6px; border-bottom: 1px solid var(--bb-border); }
.bb-fgroup__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 48px;
	margin: 0 !important;
	color: var(--bb-night);
	font-family: var(--bb-heading-font);
	font-size: 1.2rem !important;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

/* ---------- Choices: 44px rows with a checkbox, or a swatch for colors ---------- */
.bb-fgroup .woocommerce-widget-layered-nav-list { margin: 0 0 8px; padding: 0; list-style: none; }
.bb-fgroup .woocommerce-widget-layered-nav-list li { position: relative; display: flex; align-items: center; margin: 0; min-height: 44px; padding: 0; border: 0; }
.bb-fgroup .woocommerce-widget-layered-nav-list li > a {
	display: inline-flex !important;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-height: 44px;
	padding: 0 !important;
	color: var(--bb-text);
	text-decoration: none;
}
.bb-fgroup .woocommerce-widget-layered-nav-list li > a::before {
	content: "";
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	box-sizing: border-box;
	border: 2px solid #8f8696;
	border-radius: 6px;
	background: #fff;
	position: static;
	margin: 0 !important;
	transition: background-color .15s, border-color .15s;
}
.bb-fgroup .woocommerce-widget-layered-nav-list li > a:hover { color: var(--bb-purple-dark); }
.bb-fgroup .woocommerce-widget-layered-nav-list li > a:focus-visible { outline: 3px solid var(--bb-purple); outline-offset: 2px; border-radius: 6px; }
.bb-fgroup .woocommerce-widget-layered-nav-list__item--chosen > a { color: var(--bb-purple-dark); font-weight: 700; }
.bb-fgroup .woocommerce-widget-layered-nav-list__item--chosen > a::before {
	border-color: var(--bb-purple);
	background: var(--bb-purple) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.bb-fgroup .woocommerce-widget-layered-nav-list .count { flex: 0 0 auto; margin-left: auto; padding-left: 8px; color: var(--bb-muted); font-size: .9rem; }
/* Color: the swatch replaces the checkbox (the theme's .bb-swatch dot is printed before the link) */
.bb-fgroup .woocommerce-widget-layered-nav-list li:has(.bb-swatch) { gap: 0; }
.bb-fgroup .woocommerce-widget-layered-nav-list li .bb-swatch { flex: 0 0 24px; width: 24px; height: 24px; margin: 0 10px 0 0; }
.bb-fgroup .woocommerce-widget-layered-nav-list li:has(.bb-swatch) > a::before { display: none; }
.bb-fgroup .woocommerce-widget-layered-nav-list li:has(.bb-swatch) > a { padding-left: 0 !important; }
.bb-fgroup .woocommerce-widget-layered-nav-list__item--chosen .bb-swatch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bb-purple); }

/* No counts: WooCommerce keeps them in a cache that can lag behind a bulk change, so a wrong number is worse than none.
   (Choices with no products here are still left out.) */
.bb-fgroup .woocommerce-widget-layered-nav-list .count { display: none; }

/* Color: round swatches side by side. The whole 44px square is the link; its name is kept for screen readers (aria-label)
   and shows as a tooltip (title), and the chosen color is also in the chips above. */
.bb-fgroup--color .woocommerce-widget-layered-nav-list { display: flex; flex-wrap: wrap; gap: 4px 6px; max-height: none; margin: 0 0 8px; padding: 6px 2px 8px; overflow: visible; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list li { position: relative; display: block; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; margin: 0; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list li .bb-swatch { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; pointer-events: none; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list li > a { position: absolute; inset: 0; display: block !important; min-height: 0; overflow: hidden; border-radius: 50%; color: transparent; font-size: 0 !important; line-height: 0; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list li > a::before { display: none !important; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list li > a:focus-visible { outline: 3px solid var(--bb-purple); outline-offset: -2px; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list li:hover .bb-swatch { transform: scale(1.08); }
.bb-fgroup--color .woocommerce-widget-layered-nav-list__item--chosen .bb-swatch { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--bb-purple); }
.bb-fgroup--color .woocommerce-widget-layered-nav-list__item--chosen::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.bb-fgroup--color .woocommerce-widget-layered-nav-list__item--chosen .bb-swatch:not(.bb-swatch--light):not(.bb-swatch--clear) ~ a { color: transparent; }
@media (prefers-reduced-motion: no-preference) { .bb-fgroup--color .bb-swatch { transition: transform .12s; } }

/* ---------- Category: a plain list of links (the current one marked); on a search, how many results each has ---------- */
.bb-cats { margin: 0 0 8px; padding: 0; list-style: none; } /* no scroll of its own: the filter column scrolls, so there is one scrollbar, not two */
.bb-cats__item { margin: 0; }
.bb-cats__item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 44px;
	padding: 6px 10px;
	border-left: 3px solid transparent;
	border-radius: 0 8px 8px 0;
	color: var(--bb-text);
	line-height: 1.25;
	text-decoration: none;
}
.bb-cats__item a:hover, .bb-cats__item a:focus-visible { background: var(--bb-cream); color: var(--bb-purple-dark); }
.bb-cats__item a:focus-visible { outline: 3px solid var(--bb-purple); outline-offset: -2px; }
.bb-cats__item.is-current a { border-left-color: var(--bb-purple); background: var(--bb-tint); color: var(--bb-purple-dark); font-weight: 700; }
.bb-cats__n { flex: 0 0 auto; color: var(--bb-muted); font-size: .85rem; font-weight: 400; }

/* ---------- Price: a two-handle slider made of two plain range inputs ---------- */
.bb-price { margin: 0 0 8px; }
.bb-price p { margin: 0; }
.bb-price__out { margin: 0 0 4px !important; color: var(--bb-night); font-size: 1.05rem; font-weight: 700; }
.bb-price__ends { display: flex; justify-content: space-between; margin-top: 2px !important; color: var(--bb-muted); font-size: .85rem; }
.bb-range { --h: 28px; position: relative; height: var(--h); margin: 6px 0; }
.bb-range__track { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: linear-gradient(to right, var(--bb-tint) 0 var(--a), var(--bb-purple) var(--a) var(--z), var(--bb-tint) var(--z) 100%); }
.bb-range input[type="range"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: var(--h);
	margin: 0;
	padding: 0;
	min-height: 0;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	pointer-events: none; /* only the handles take the pointer, so two sliders can share one track */
	-webkit-appearance: none;
	appearance: none;
}
.bb-range input[type="range"]::-webkit-slider-runnable-track { height: var(--h); background: transparent; border: 0; }
.bb-range input[type="range"]::-moz-range-track { height: var(--h); background: transparent; border: 0; }
.bb-range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: var(--h); height: var(--h); border: 3px solid #fff; border-radius: 50%; background: var(--bb-purple); box-shadow: 0 1px 4px rgba(42, 22, 48, .45); cursor: grab; }
.bb-range input[type="range"]::-moz-range-thumb { pointer-events: auto; box-sizing: border-box; width: var(--h); height: var(--h); border: 3px solid #fff; border-radius: 50%; background: var(--bb-purple); box-shadow: 0 1px 4px rgba(42, 22, 48, .45); cursor: grab; }
.bb-range input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.bb-range input[type="range"]:focus-visible { outline: none; }
.bb-range input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--bb-yellow); outline-offset: 1px; background: var(--bb-purple-dark); }
.bb-range input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--bb-yellow); outline-offset: 1px; background: var(--bb-purple-dark); }
.bb-range.bb-range--minTop .bb-range__min { z-index: 2; } /* when both handles sit at the far end, the one that can still move is on top */
.bb-price__go {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	margin-top: 10px;
	border: 2px solid var(--bb-purple);
	border-radius: 999px;
	background: var(--bb-purple);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.bb-price__go:hover, .bb-price__go:focus-visible { background: #fff; color: var(--bb-purple); }
.bb-fjs .bb-price__go { display: none; } /* the slider applies itself; the button is for no-JavaScript */

/* ---------- Phones and tablets: a "Filters" button and a full-screen sheet (JavaScript adds .bb-fjs to <html>) ---------- */
@media (max-width: 900px) {
	.bb-fjs .bb-filter-link { margin: 0 0 14px; }
	.bb-filter-link__n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--bb-purple); color: #fff; font-size: .8rem; }
	.bb-fjs .bb-filters {
		position: fixed;
		inset: 0;
		height: 100vh;
		height: 100dvh;
		z-index: 100001;
		display: none;
		flex-direction: column;
		width: 100% !important;
		max-height: 100dvh;
		margin: 0 !important;
		padding: 0;
		background: #fff;
		overflow: hidden;
	}
	.bb-fjs.bb-filters-open .bb-filters { display: flex; }
	.bb-fjs.bb-filters-open { overflow: hidden; }
	.bb-fjs .bb-filters__head { padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--bb-border); }
	.bb-fjs .bb-filters__close { display: inline-flex !important; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent !important; box-shadow: none !important; color: var(--bb-night); font-size: 2rem; line-height: 1; cursor: pointer; }
	.bb-fjs .bb-filters__close[hidden] { display: inline-flex !important; }
	.bb-fjs .bb-filters__body { flex: 1 1 auto; padding: 8px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
	.bb-fjs .bb-filters__foot { display: flex; gap: 12px; margin: 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--bb-border); background: #fff; }
	.bb-fjs .bb-filters__done { display: inline-flex !important; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 48px; border: 2px solid var(--bb-yellow); border-radius: 999px; background: var(--bb-yellow); color: var(--bb-night); font: inherit; font-weight: 800; cursor: pointer; }
	.bb-fjs .bb-filters__done[hidden] { display: inline-flex !important; }
	.bb-fjs .bb-filters .bb-fgroup .woocommerce-widget-layered-nav-list { max-height: none; }
}
@media (prefers-reduced-motion: no-preference) {
	.bb-fjs.bb-filters-open .bb-filters { animation: bb-sheet .22s ease-out; }
	@keyframes bb-sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- Desktop with a mouse: tighter rows and smaller text so more filters fit (touch screens keep 44px targets) ---------- */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
	.bb-fgroup { margin-bottom: 2px !important; padding-bottom: 2px; }
	.bb-fgroup__title { min-height: 36px; font-size: 1.05rem !important; }
	.bb-fgroup .woocommerce-widget-layered-nav-list { margin-bottom: 4px; }
	.bb-fgroup .woocommerce-widget-layered-nav-list li, .bb-fgroup .woocommerce-widget-layered-nav-list li > a { min-height: 32px; }
	.bb-fgroup .woocommerce-widget-layered-nav-list li > a { font-size: .9rem; gap: 8px; }
	.bb-fgroup .woocommerce-widget-layered-nav-list .count { font-size: .8rem; }
	.bb-cats { margin-bottom: 4px; }
	.bb-cats__item a { min-height: 32px; padding: 3px 10px; font-size: .9rem; line-height: 1.2; }
	.bb-cats__n { font-size: .8rem; }
}

/* White (and other very light) color swatches need a visible edge on the white panel. */
.bb-fgroup .bb-swatch { border: 1px solid rgba(0, 0, 0, .28); }
.bb-fgroup .bb-swatch--light { border: 2px solid #8d8394; background-color: #fff; box-shadow: inset 0 0 0 2px #f1edf2; }

/* Long category lists: the first few, then "Show N more" (a <details>; works without JavaScript). */
.bb-cats__more { margin: 0 0 8px; }
.bb-cats__more > .bb-cats { margin-bottom: 0; }
.bb-cats__more summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px 6px 13px; color: var(--bb-purple-dark); font-weight: 700; cursor: pointer; list-style: none; }
.bb-cats__more summary::-webkit-details-marker { display: none; }
.bb-cats__more summary::after { content: ""; width: 8px; height: 8px; margin-left: 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.bb-cats__more[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.bb-cats__more summary:hover { text-decoration: underline; }
.bb-cats__more summary:focus-visible { outline: 3px solid var(--bb-purple); outline-offset: -2px; border-radius: 8px; }
.bb-cats__hide, .bb-cats__more[open] .bb-cats__show { display: none; }
.bb-cats__more[open] .bb-cats__hide { display: inline; }
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) { .bb-cats__more summary { min-height: 32px; padding: 3px 10px 3px 13px; font-size: .9rem; } }

/* Color swatches are always round, whichever list they come from (attribute colors or colors read from product names). */
.bb-fgroup--color .bb-swatch { border-radius: 50%; box-sizing: border-box; }

/* The check on the chosen color swatch is white (with a faint shadow so it still shows on yellow and gold); on the white and clear swatches it stays gray. */
.bb-fgroup--color .woocommerce-widget-layered-nav-list__item--chosen::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, .55));
}
.bb-fgroup--color .woocommerce-widget-layered-nav-list__item--chosen:has(.bb-swatch--light)::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5' fill='none' stroke='%23555' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	filter: none;
}

/* Ticked filter box: one centered white check. Another stylesheet puts a small text "✓" at the top-left of the box
   (content: "✓"), which hid the drawn check. */
.bb-fgroup .woocommerce-widget-layered-nav-list__item--chosen > a::before,
.bb-fgroup .woocommerce-widget-layered-nav-list__item--chosen > a:hover::before,
.bb-fgroup .woocommerce-widget-layered-nav-list__item--chosen > a:focus::before {
	content: "" !important;
	border-color: var(--bb-purple) !important;
	background-color: var(--bb-purple) !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	background-size: 80% !important;
}
