/* Block: Listings filters (bh/listings-filters) */
.bh-filterbar {
	position: sticky; top: var(--bh-sticky-top, 0px); z-index: calc(var(--z-sticky) + 1);
	border-block: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--light);
	transition: box-shadow var(--wp--custom--duration);
}
.bh-filterbar.is-stuck { box-shadow: 0 8px 24px color-mix(in srgb, var(--wp--preset--color--primary) 6%, transparent); }

/* Desktop bar */
.bh-fb-desktop {
	display: grid; align-items: stretch;
	grid-template-columns: minmax(220px, 1.7fr) minmax(130px, 1fr) minmax(210px, 1.35fr) minmax(96px, .7fr) minmax(96px, .7fr) auto;
	min-height: 72px;
}
.bh-fb-cell {
	position: relative; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0;
	padding: 10px 18px;
	border-left: 1px solid var(--wp--preset--color--line);
	transition: background-color var(--wp--custom--duration);
}
.bh-fb-desktop > .bh-fb-cell:first-of-type { padding-left: 0; border-left: 0; }
.bh-fb-cell:not(:first-of-type):hover { background: color-mix(in srgb, var(--wp--preset--color--white) 50%, transparent); }
.bh-fb-cell:focus-within::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 2px; background: var(--wp--preset--color--accent); }
.bh-fb-desktop > .bh-fb-cell:first-of-type:focus-within::after { left: 0; }
.bh-fb-cell .bh-label { pointer-events: none; }
.bh-fb-cell select,
.bh-fb-cell input {
	width: 100%; min-height: 28px; padding: 0;
	border: 0; border-radius: 0; background-color: transparent;
	appearance: none; -webkit-appearance: none;
	font: 600 0.9375rem/1.2 var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--primary);
	text-overflow: ellipsis;
}
.bh-fb-cell select {
	padding-right: 18px; cursor: pointer;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 6px) 55%, 100% 55%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}
.bh-fb-cell select:focus-visible, .bh-fb-cell input:focus-visible { outline: none; }
.bh-fb-cell input::placeholder { color: var(--wp--preset--color--placeholder); font-weight: 500; }
.bh-fb-loc { display: flex; align-items: center; gap: 8px; }
.bh-fb-loc .bh-icon { color: var(--wp--preset--color--muted); }
.bh-fb-loc input { flex: 1; min-width: 0; }
.bh-fb-loc input::-webkit-search-cancel-button { display: none; }
.bh-fb-clear {
	display: grid; place-items: center; flex-shrink: 0;
	width: 28px; height: 28px; padding: 0;
	border: 0; border-radius: 50%;
	background: var(--wp--preset--color--linen); color: var(--wp--preset--color--primary);
	cursor: pointer;
}
.bh-fb-clear:hover { background: var(--wp--preset--color--stone); }
.bh-fb-clear .bh-icon { width: 12px; height: 12px; stroke-width: 2.2; }
.bh-fb-price { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.bh-fb-price > span { font-size: 0.75rem; color: var(--wp--preset--color--muted); }
.bh-fb-more { display: flex; align-items: center; gap: 8px; padding-left: 18px; border-left: 1px solid var(--wp--preset--color--line); }

/* Phone bar */
.bh-fb-mobile { display: none; grid-template-columns: 1fr auto auto; gap: 8px; padding-block: 10px; }
.bh-fb-mobile > .bh-btn { justify-content: center; }
.bh-fb-sort { display: flex; gap: 6px; }
.bh-fb-sort .bh-select { min-height: 48px; }
@media (max-width: 1023px) {
	.bh-fb-desktop { display: none; }
	.bh-fb-mobile { display: grid; }
}
@media (max-width: 479px) {
	.bh-fb-mobile { grid-template-columns: auto minmax(0, 1fr) auto; }
	.bh-fb-mobile > .bh-btn { padding: 0 14px; }
	.bh-fb-sort { min-width: 0; }
	.bh-fb-sort .bh-select { width: 100%; min-width: 0; padding: 0 28px 0 12px; }
	.bh-view-toggle--mini a { justify-content: center; min-width: 40px; padding: 0 8px; }
	.bh-view-toggle--mini .bh-vt-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Map view: the sort is in the list and the view toggle is the floating Map / List button. */
@media (max-width: 1023px) {
	.bh-filterbar.is-map .bh-fb-mobile { grid-template-columns: 1fr; }
	.bh-filterbar.is-map .bh-fb-sort, .bh-filterbar.is-map .bh-view-toggle--mini { display: none; }
	.bh-filterbar.is-map .bh-fb-mobile__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
/* Narrow phones: the Filters button keeps its icon and badge, so the sort fits. */
@media (max-width: 379px) {
	.bh-fb-mobile > .bh-btn { padding: 0 12px; }
	.bh-fb-mobile__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Filters drawer: anchor target without JS, modal with JS */
.bh-drawer { position: fixed; inset: 0; z-index: var(--z-modal); display: none; }
.bh-drawer:target, .bh-drawer.is-open { display: block; }
.bh-drawer[data-js]:not(.is-open) { display: none; }
.bh-drawer__backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--wp--preset--color--dark) 48%, transparent); animation: bhFadeIn 200ms ease; }
@keyframes bhFadeIn { from { opacity: 0; } }
.bh-drawer__panel {
	position: absolute; top: 0; right: 0; bottom: 0;
	display: flex; flex-direction: column;
	width: min(460px, 100%);
	background: var(--wp--preset--color--light);
	box-shadow: 0 24px 60px color-mix(in srgb, var(--wp--preset--color--primary) 16%, transparent);
	animation: bhDrawerIn 280ms var(--wp--custom--ease);
}
@keyframes bhDrawerIn { from { transform: translateX(40px); opacity: 0; } }
.bh-drawer__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--wp--preset--color--line); }
.bh-drawer__head h2 { font: 400 1.5rem/1.2 var(--wp--preset--font-family--display); letter-spacing: 0; color: var(--wp--preset--color--primary); }
.bh-icon-btn {
	display: grid; place-items: center; width: var(--wp--custom--tap); height: var(--wp--custom--tap); padding: 0;
	border: 1px solid var(--wp--preset--color--stone); border-radius: 50%;
	background: var(--wp--preset--color--white); color: var(--wp--preset--color--primary);
	cursor: pointer;
}
.bh-icon-btn:hover { border-color: var(--wp--preset--color--primary); }
.bh-icon-btn .bh-icon { width: 18px; height: 18px; }
.bh-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 24px; }
.bh-dsec { margin: 0; padding: 20px 0; border: 0; border-bottom: 1px solid var(--wp--preset--color--line); min-width: 0; }
.bh-dsec:last-child { border-bottom: 0; }
.bh-dsec > legend, .bh-dsec > .bh-label { float: left; width: 100%; margin-bottom: 12px; padding: 0; }
/* Everything after the floated legend clears it (a hidden input right after the legend must not break this). */
.bh-dsec > legend ~ *, .bh-dsec > .bh-label ~ * { clear: both; }
.bh-dsec--mobile { display: none; }
@media (max-width: 1023px) { .bh-dsec--mobile { display: block; } }
.bh-drow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bh-dfield { display: grid; gap: 6px; }
.bh-dfield label { font-size: 0.8125rem; font-weight: 600; color: var(--wp--preset--color--primary); }
.bh-select--block { width: 100%; min-height: 48px; }
.bh-pills { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.bh-pills label { position: relative; }
.bh-pills input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.bh-pills span {
	display: grid; place-items: center; min-height: var(--wp--custom--tap);
	border: 1px solid var(--wp--preset--color--stone); border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--white);
	font: 600 var(--wp--preset--font-size--small)/1 var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--slate);
	transition: background-color var(--wp--custom--duration), border-color var(--wp--custom--duration), color var(--wp--custom--duration);
}
.bh-pills input:hover + span { border-color: var(--wp--preset--color--slate); }
.bh-pills input:checked + span { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--white); }
.bh-pills input:focus-visible + span { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
/* Two columns when labels fit, one when they do not. */
.bh-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 4px 16px; }
.bh-check { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 0.9375rem; line-height: 1.3; cursor: pointer; }
.bh-checks--features.is-collapsed .bh-check.is-extra:not(:has(input:checked)) { display: none; }
.bh-features-toggle { margin-top: 12px; }

/* Listing status: one row of toggle chips, styled like the Beds pills */
.bh-toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.bh-toggles label { position: relative; flex: 1 1 auto; }
.bh-toggles input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bh-toggles span {
	display: grid; place-items: center; min-height: var(--wp--custom--tap); padding: 0 14px;
	border: 1px solid var(--wp--preset--color--stone); border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--white);
	font: 600 var(--wp--preset--font-size--small)/1.2 var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--slate); white-space: nowrap;
	transition: background-color var(--wp--custom--duration), border-color var(--wp--custom--duration), color var(--wp--custom--duration);
}
.bh-toggles input:hover + span { border-color: var(--wp--preset--color--slate); }
.bh-toggles input:checked + span { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--white); }
.bh-toggles input:focus-visible + span { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.bh-check input {
	appearance: none; -webkit-appearance: none;
	display: grid; place-items: center; flex-shrink: 0;
	width: 20px; height: 20px; margin: 0;
	border: 1.5px solid var(--wp--preset--color--slate); border-radius: 3px;
	background: var(--wp--preset--color--white);
	cursor: pointer;
	transition: background-color var(--wp--custom--duration), border-color var(--wp--custom--duration);
}
.bh-check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--wp--preset--color--white); border-top: 0; border-right: 0; opacity: 0; transform: rotate(-45deg) translate(1px, -1px); }
.bh-check input:checked { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.bh-check input:checked::after { opacity: 1; }
.bh-check input:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.bh-check-hint { margin-top: 8px !important; font-size: 0.8125rem; line-height: 1.4; color: var(--wp--preset--color--slate); }
.bh-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--wp--custom--tap); font-size: 0.9375rem; cursor: pointer; }
.bh-switch small { display: block; font-size: 0.8125rem; color: var(--wp--preset--color--slate); }
.bh-switch input {
	appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0;
	width: 46px; height: 28px; margin: 0;
	border-radius: 14px; background: var(--wp--preset--color--stone);
	cursor: pointer; transition: background-color var(--wp--custom--duration);
}
.bh-switch input::after {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 22px; height: 22px; border-radius: 50%;
	background: var(--wp--preset--color--white);
	box-shadow: 0 1px 2px color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);
	transition: transform var(--wp--custom--duration) var(--wp--custom--ease);
}
.bh-switch input:checked { background: var(--wp--preset--color--primary); }
.bh-switch input:checked::after { transform: translateX(18px); }
.bh-switch input:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.bh-drawer__foot {
	display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px;
	padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--white);
}
@media (max-width: 639px) {
	.bh-drawer__panel {
		top: auto; left: 0; width: 100%; max-height: min(92vh, 92dvh);
		border-radius: 14px 14px 0 0;
		animation-name: bhSheetIn;
	}
	@keyframes bhSheetIn { from { transform: translateY(48px); opacity: 0; } }
	.bh-drawer__head { padding: 14px 20px; }
	.bh-drawer__head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--wp--preset--color--stone); }
	.bh-drawer__body { padding-inline: 20px; }
	.bh-drawer__foot { padding-inline: 20px; }
	.bh-pills span { min-height: 46px; }
}
