.balf-facet {
	position: relative;
	width: max-content;
	max-width: 100%;
	color: inherit;
}

.balf-facet.balf-is-empty {
	opacity: .7;
}

.balf-facet.balf-is-empty .balf-select-button {
	cursor: default;
	pointer-events: none;
}

.balf-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Client-side filtering: hidden loop items */
.balf-hidden {
	display: none !important;
}

/* Chained loops: hide a parent group (e.g. a date block) when all of its
   filtered child items are hidden, so empty date headers disappear too. */
.balf-group-hidden {
	display: none !important;
}

/* Builder-only hint listing the live detected values */
.balf-builder-hint {
	margin-top: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	background: color-mix(in srgb, currentColor 8%, transparent);
	font-size: 12px;
	line-height: 1.45;
	opacity: .85;
}

.balf-builder-placeholder {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px dashed currentColor;
	color: inherit;
	opacity: .68;
}

.balf-facet fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.balf-select-facet {
	--balf-controls-width: 44px;
	position: relative;
	display: grid;
	width: max-content;
	max-width: 100%;
}

/* Invisible longest label sizes the control to the widest option text. */
.balf-select-sizer {
	grid-area: 1 / 1;
	overflow: hidden;
	height: 0;
	padding: 0 var(--balf-controls-width) 0 14px;
	white-space: nowrap;
	visibility: hidden;
	pointer-events: none;
}

.balf-select-sizer span {
	display: inline-block;
	white-space: nowrap;
}

.balf-select-button {
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-width: 0;
	min-height: 44px;
	padding: 0 var(--balf-controls-width) 0 14px;
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
	border-radius: var(--radius-s, 6px);
	background: color-mix(in srgb, currentColor 8%, transparent);
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.balf-select-value {
	flex: 1 1 auto;
	min-width: 0;
	color: inherit;
	white-space: nowrap;
}

.balf-select-button .balf-select-controls {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--balf-controls-width);
	height: 100%;
	flex-shrink: 0;
	color: inherit;
}

.balf-select-button .balf-select-toggle {
	flex-shrink: 0;
	font-size: 14px;
	line-height: 1;
	color: var(--white, #fff);
}

.balf-select-popover {
	position: absolute;
	z-index: 50;
	top: calc(100% + 6px);
	left: 0;
	display: none;
	width: 100%;
	min-width: 100%;
	max-height: min(260px, 50vh);
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	border-radius: var(--radius-s, 4px);
	background: var(--base, #2f2f2f);
	color: inherit;
	box-shadow: 0 14px 35px rgba(0, 0, 0, .45);
}

.balf-facet.is-open .balf-select-popover {
	display: block;
}

.balf-select-option {
	display: block;
	width: 100%;
	padding: 11px 14px;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
}

.balf-select-option:hover,
.balf-select-option:focus,
.balf-select-option[aria-selected="true"] {
	background: color-mix(in srgb, currentColor 12%, transparent);
	outline: none;
}

@media (max-width: 480px) {
	.balf-facet,
	.balf-select-facet {
		width: 100%;
	}

	.balf-select-popover {
		max-width: 100%;
	}
}
