/* Soleman Popup Filter */

.spf-filter {
	position: relative;
	width: 100%;
}

.spf-filter__items {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.spf-layout-vertical .spf-filter__items {
	flex-direction: column;
	align-items: stretch;
}

.spf-layout-horizontal .spf-filter__items {
	flex-direction: row;
	align-items: center;
}

.spf-filter__item {
	position: relative;
}

.spf-filter__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	background: #fff;
	color: var(--spf-trigger-color, #344054);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, background-color 0.2s;
	white-space: nowrap;
}

.spf-filter__trigger:hover,
.spf-filter__trigger:focus {
	border-color: #98a2b3;
	color: var(--spf-trigger-hover-color, var(--spf-trigger-color, #344054));
}

.spf-filter__trigger--active,
.spf-filter__item--open .spf-filter__trigger {
	border-color: #1570ef;
	color: var(--spf-trigger-active-color, #1570ef);
	box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

.spf-filter__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: #1570ef;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
}

.spf-filter__count[hidden] {
	display: none !important;
}

.spf-filter__arrow {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform 0.2s;
}

.spf-filter__item--open .spf-filter__arrow {
	transform: rotate(180deg);
}

.spf-filter__popup {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 2147483001;
	min-width: 260px;
	max-width: 360px;
	max-height: 400px;
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
	overflow: hidden;
}

.spf-filter__popup[hidden] {
	display: none !important;
}

.spf-layout-vertical .spf-filter__popup {
	position: relative;
	top: 6px;
	width: 100%;
	max-width: none;
}

.spf-filter__popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	border-bottom: 1px solid #f2f4f7;
	background: #f9fafb;
}

.spf-filter__popup-title {
	font-size: 14px;
	font-weight: 600;
	color: #101828;
}

.spf-filter__clear {
	padding: 4px 10px;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: #1570ef;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.spf-filter__clear:hover {
	background: rgba(21, 112, 239, 0.08);
}

.spf-filter__clear[hidden] {
	display: none !important;
}

.spf-filter__popup-body {
	max-height: 320px;
	overflow-y: auto;
	padding: 8px 0;
}

.spf-filter__popup-body--split {
	max-height: none;
	overflow: hidden;
	padding: 0;
}

.spf-filter__item--split_pane .spf-filter__popup {
	min-width: 460px;
	max-width: 560px;
	max-height: 440px;
}

/* Location hub: 區域 / 港鐵站, region tabs, district chip grid (LeasingHub). */
.spf-filter__item--location .spf-filter__popup {
	min-width: 540px;
	width: min(620px, calc(100vw - 24px));
	max-width: min(620px, calc(100vw - 24px));
	max-height: min(72vh, 560px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.spf-filter__item--location .spf-filter__count {
	min-width: 0;
	height: auto;
	padding: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-size: inherit;
	font-weight: 600;
}

.spf-filter__hub-tabs {
	display: flex;
	align-items: flex-end;
	gap: 18px;
	padding: 4px 8px 0 16px;
	border-bottom: 1px solid #eaecf0;
	flex: 0 0 auto;
	background: #fff;
}

.spf-filter__hub-tab,
.spf-filter__hub-tab:hover,
.spf-filter__hub-tab:focus,
.spf-filter__hub-tab:focus-visible,
.spf-filter__hub-tab.is-active {
	margin: 0;
	padding: 12px 0 10px;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #344054 !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.spf-filter__hub-tab.is-active {
	border-bottom-color: var(--spf-confirm-bg, #6941c6) !important;
}

.spf-filter__hub-tabs .spf-filter__close {
	margin-left: auto;
	margin-bottom: 6px;
	color: #667085;
	width: 32px;
	height: 32px;
}

.spf-filter__hub-tabs .spf-filter__close:hover {
	background: #f2f4f7;
	color: #101828;
}

.spf-filter__hub-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}

.spf-filter__hub-panel.spf-filter__section {
	margin: 0;
	padding: 0;
	border: none;
}

.spf-filter__hub-panel[hidden],
.spf-filter__region-panel[hidden] {
	display: none !important;
}

.spf-filter__region-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	padding: 4px 16px 0;
	border-bottom: 1px solid #f2f4f7;
	flex: 0 0 auto;
}

.spf-filter__region-tab,
.spf-filter__region-tab:hover,
.spf-filter__region-tab:focus,
.spf-filter__region-tab:focus-visible,
.spf-filter__region-tab.is-active {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	margin: 0;
	padding: 10px 0 8px;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #344054 !important;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
}

.spf-filter__region-tab.is-active {
	font-weight: 700;
	border-bottom-color: var(--spf-confirm-bg, #6941c6) !important;
}

.spf-filter__region-count {
	font-weight: 700;
	color: inherit;
}

.spf-filter__region-count[hidden] {
	display: none !important;
}

.spf-filter__popup-body--location {
	flex: 1 1 auto;
	min-height: 180px;
	max-height: 360px;
	overflow: auto;
	padding: 6px 0 10px;
}

.spf-filter__district {
	padding: 8px 16px 2px;
}

.spf-filter__district-name {
	margin: 0 0 2px;
	color: #101828;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.spf-filter__chips {
	display: flex;
	flex-wrap: wrap;
	column-gap: 14px;
	row-gap: 0;
}

.spf-filter__popup--location .spf-filter__chips .spf-filter__term {
	padding-inline-start: 0;
}

.spf-filter__popup--location .spf-filter__chips .spf-filter__term-label,
.spf-filter__popup--location .spf-filter__chips .spf-filter__term-label:hover,
.spf-filter__popup--location .spf-filter__chips .spf-filter__term-label--checked {
	padding: 4px 0;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #344054 !important;
}

.spf-filter__popup--location .spf-filter__chips .spf-filter__term-name {
	color: #344054 !important;
}

.spf-filter__popup--location .spf-filter__chips .spf-filter__term-name {
	flex: 0 1 auto;
}

.spf-filter__popup--location .spf-filter__popup-footer {
	flex: 0 0 auto;
	padding: 12px 16px 14px;
	border-top: 1px solid #f2f4f7;
	background: #fff;
}

.spf-filter__popup--location .spf-filter__clear-draft {
	border: none;
	background: transparent;
	color: var(--spf-confirm-bg, #6941c6);
	font-weight: 600;
	min-width: 56px;
}

.spf-filter__popup--location .spf-filter__clear-draft:hover {
	background: transparent;
	color: var(--spf-confirm-hover-bg, #53389e);
}

.spf-filter__popup--location .spf-filter__hub-panel[data-hub="mtr"] .spf-filter__popup-body--split {
	flex: 1 1 auto;
	min-height: 0;
}

.spf-filter__popup--location .spf-filter__split {
	min-height: 280px;
	max-height: 360px;
}

.spf-filter__split {
	display: flex;
	align-items: stretch;
	min-height: 280px;
	max-height: 380px;
}

.spf-filter__parents {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 42%;
	min-width: 140px;
	max-width: 200px;
	overflow-y: auto;
	border-right: 1px solid #e4e7ec;
	background: var(--spf-parents-bg, #f9fafb);
}

.spf-filter__parent-item {
	margin: 0;
}

.spf-filter__parent {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	padding: 12px 14px;
	border: none;
	border-left: 3px solid transparent;
	background: var(--spf-parent-bg, transparent);
	color: var(--spf-parent-color, #344054);
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.spf-filter__parent:hover {
	background: var(--spf-parent-hover-bg, #f2f4f7);
	color: var(--spf-parent-hover-color, var(--spf-parent-color, #344054));
}

.spf-filter__parent.is-active {
	background: var(--spf-parent-active-bg, #1d4ed8);
	border-left-color: var(--spf-parent-active-accent, var(--spf-parent-active-bg, #1d4ed8));
	color: var(--spf-parent-active-color, #fff);
}

.spf-filter__parent-name {
	flex: 1;
	min-width: 0;
}

.spf-filter__parent-arrow {
	flex-shrink: 0;
	width: 0;
	height: 0;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 6px solid currentColor;
	opacity: 0.55;
}

.spf-filter__parent.is-active .spf-filter__parent-arrow {
	opacity: 1;
}

.spf-filter__children-panels {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--spf-children-bg, transparent);
}

.spf-filter__children {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
	margin: 0;
	list-style: none;
}

.spf-filter__children[hidden] {
	display: none !important;
}

.spf-filter__children.is-active {
	display: block;
}

.spf-filter__term--all .spf-filter__term-name {
	font-weight: 600;
}

.spf-filter__terms {
	list-style: none;
	margin: 0;
	padding: 0;
}

.spf-filter__term {
	margin: 0;
	padding: 0;
	padding-inline-start: calc(var(--spf-depth, 0) * 20px);
}

.spf-filter__term-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	cursor: pointer;
	font-size: 14px;
	color: var(--spf-term-color, #344054);
	background: var(--spf-term-bg, transparent);
	transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.spf-filter__term-label:hover {
	color: var(--spf-term-hover-color, var(--spf-term-color, #344054));
	background: var(--spf-term-hover-bg, #f9fafb);
}

.spf-filter__term-label--checked {
	color: var(--spf-term-selected-color, var(--spf-term-color, #344054));
	background: var(--spf-term-selected-bg, var(--spf-term-bg, transparent));
}

.spf-filter__checkbox {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--spf-checkbox-accent, #1570ef);
	cursor: pointer;
}

.spf-filter__term-name {
	flex: 1;
}

.spf-filter__term-count {
	color: #98a2b3;
	font-size: 12px;
}

.spf-filter__empty {
	margin: 0;
	padding: 16px;
	color: #667085;
	font-size: 14px;
	text-align: center;
}

.spf-filter__range {
	padding: 12px 16px 16px;
}

.spf-filter__range-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}

.spf-filter__range-field {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
}

.spf-filter__range-caption.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.spf-filter__range-number {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	color: #101828;
	font-size: 16px;
	font-weight: 600;
}

.spf-filter__range-number::placeholder {
	color: #101828;
	font-weight: 600;
	opacity: 1;
}

.spf-filter__range-number:focus {
	outline: none;
	border-color: #1570ef;
	box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

.spf-filter__range-sep {
	padding-bottom: 0;
	color: #f63d68;
	font-size: 14px;
	font-weight: 600;
}

.spf-filter__range-currency {
	flex: 0 0 auto;
	padding-bottom: 0;
	color: #667085;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.spf-filter__range-slider {
	position: relative;
	height: 28px;
	touch-action: none;
}

.spf-filter__range-track,
.spf-filter__range-fill {
	position: absolute;
	top: 50%;
	height: 4px;
	border-radius: 2px;
	transform: translateY(-50%);
	pointer-events: none;
}

.spf-filter__range-track {
	left: 0;
	right: 0;
	background: var(--spf-range-track, #e4e7ec);
}

.spf-filter__range-fill {
	left: 0;
	width: 100%;
	background: var(--spf-range-fill, #1570ef);
}

.spf-filter__range-handle {
	position: absolute;
	left: 0;
	top: 50%;
	width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	pointer-events: none;
	appearance: none;
	-webkit-appearance: none;
	transform: translateY(-50%);
	touch-action: none;
}

.spf-filter__range-handle:focus {
	outline: none;
}

.spf-filter__range-handle::-webkit-slider-runnable-track {
	height: 4px;
	background: transparent;
}

.spf-filter__range-handle::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	margin-top: -7px;
	border: 2px solid var(--spf-range-thumb, #1570ef);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.16);
	pointer-events: auto;
	cursor: pointer;
}

.spf-filter__range-handle::-moz-range-track {
	height: 4px;
	background: transparent;
	border: none;
}

.spf-filter__range-handle::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border: 2px solid var(--spf-range-thumb, #1570ef);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.16);
	pointer-events: auto;
	cursor: pointer;
}

.spf-filter__notice {
	padding: 16px;
	border: 1px dashed #d0d5dd;
	border-radius: 6px;
	color: #667085;
	font-size: 14px;
	text-align: center;
}

.spf-filter__overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	background: transparent;
	pointer-events: none !important;
}

.spf-filter__overlay--visible {
	display: block;
	background: transparent;
	pointer-events: none !important;
}

.spf-filter__overlay--ported.spf-filter__overlay--visible {
	background: transparent;
	pointer-events: none !important;
}

/* Open + in-flow popup: unlock strip overflow so absolute sheets are not clipped.
   Ported mode must KEEP overflow-x:auto so the chip row can still scroll to the active filter. */
.spf-filter--open:not(.spf-filter--ported) .spf-filter__items {
	overflow: visible !important;
}

.spf-filter--open.spf-filter--ported .spf-filter__items {
	overflow-x: auto !important;
	overflow-y: hidden !important;
	-webkit-overflow-scrolling: touch;
}

.spf-filter--open {
	position: relative;
	z-index: 2147483000;
}

/* Never lock body overflow — real iOS Safari squashes fixed popups + page layout. */

.spf-filter__icon--search {
	display: inline-block;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	position: relative;
	box-sizing: border-box;
}

.spf-filter__icon--search::after {
	content: '';
	position: absolute;
	width: 5px;
	height: 1.5px;
	background: currentColor;
	border-radius: 1px;
	right: -4px;
	bottom: -1px;
	transform: rotate(45deg);
	transform-origin: left center;
}

.spf-filter__popup--keyword {
	min-width: 280px;
	max-width: 320px;
	max-height: none;
}

.spf-filter__popup-body--keyword {
	padding: 16px;
	max-height: none;
	overflow: visible;
}

.spf-filter__keyword-field {
	display: block;
	margin-bottom: 12px;
}

.spf-filter__keyword-input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	font-size: 14px;
	color: #101828;
	background: #fff;
}

.spf-filter__keyword-input:focus {
	outline: none;
	border-color: #1570ef;
	box-shadow: 0 0 0 3px rgba(21, 112, 239, 0.12);
}

.spf-filter__popup-footer {
	display: flex;
	align-items: center;
	gap: 10px;
}

.spf-filter__confirm {
	flex: 1 1 auto;
	padding: 10px 16px;
	border: none;
	border-radius: 6px;
	background: var(--spf-confirm-bg, #e11d48);
	color: var(--spf-confirm-color, #fff);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.spf-filter__confirm:hover {
	background: var(--spf-confirm-hover-bg, #be123c);
	color: var(--spf-confirm-hover-color, var(--spf-confirm-color, #fff));
}

.spf-filter__clear-draft {
	flex: 0 0 auto;
	min-width: 72px;
	padding: 10px 14px;
	border: 1px solid var(--spf-clear-draft-border, #e4e7ec);
	border-radius: 6px;
	background: var(--spf-clear-draft-bg, #f9fafb);
	color: var(--spf-clear-draft-color, #667085);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.spf-filter__clear-draft:hover {
	background: var(--spf-clear-draft-hover-bg, #f2f4f7);
	color: var(--spf-clear-draft-hover-color, #344054);
}

/* More conditions / range group: under-button dropdown */
.spf-filter__popup--more,
.spf-filter__popup--range-group {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: auto;
	bottom: auto;
	transform: none;
	z-index: 2147483001;
	min-width: 300px;
	width: min(420px, calc(100vw - 16px));
	max-width: min(420px, calc(100vw - 16px));
	max-height: min(70vh, 520px);
	display: flex;
	flex-direction: column;
	border-radius: 8px;
	overflow: hidden;
}

.spf-filter__popup--more[hidden],
.spf-filter__popup--range-group[hidden] {
	display: none !important;
}

.spf-filter__unit-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 14px 0;
	flex: 0 0 auto;
}

.spf-filter__mode-hint {
	margin: 8px 14px 0;
	padding: 0;
	color: var(--spf-mode-hint-color, #667085);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	flex: 0 0 auto;
}

.spf-filter__unit-tab {
	flex: 1 1 auto;
	min-width: 0;
	padding: 7px 10px;
	border: 1px solid var(--spf-unit-tab-border, #d0d5dd);
	border-radius: var(--spf-unit-tab-radius, 999px);
	background: var(--spf-unit-tab-bg, #f2f4f7);
	color: var(--spf-unit-tab-color, #344054);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.spf-filter__unit-tab:hover:not(.is-active) {
	border-color: var(--spf-unit-tab-hover-border, #c8cdd6);
	background: var(--spf-unit-tab-hover-bg, #e4e7ec);
	color: var(--spf-unit-tab-hover-color, #1d2939);
}

.spf-filter__unit-tab.is-active {
	border-color: var(--spf-unit-tab-active-border, var(--spf-unit-tab-active-bg, var(--spf-trigger-active-bg, #6941c6)));
	background: var(--spf-unit-tab-active-bg, var(--spf-trigger-active-bg, #6941c6));
	color: var(--spf-unit-tab-active-color, var(--spf-trigger-active-color, #fff));
}

.spf-filter__popup-body--range-group {
	flex: 1 1 auto;
	overflow: auto;
	padding: 4px 0 8px;
}

.spf-filter__section--range-mode {
	margin: 0;
}

.spf-filter__section--range-mode[hidden] {
	display: none !important;
}

.spf-filter__popup-header--more {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--spf-more-header-bg, #e11d48);
	border-bottom: none;
	padding: 12px 16px;
	flex: 0 0 auto;
}

.spf-filter__popup-header--more .spf-filter__popup-title {
	color: var(--spf-more-header-color, #fff);
}

.spf-filter__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: var(--spf-more-header-color, #fff);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.spf-filter__close:hover {
	background: rgba(255, 255, 255, 0.15);
}

.spf-filter__popup-header:not(.spf-filter__popup-header--more) .spf-filter__close {
	color: #667085;
}

.spf-filter__popup-header:not(.spf-filter__popup-header--more) .spf-filter__close:hover {
	background: #f2f4f7;
	color: #101828;
}

.spf-filter__popup-body--more {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow-y: auto;
	padding: 8px 0 12px;
	-webkit-overflow-scrolling: touch;
}

.spf-filter__popup--more .spf-filter__popup-footer,
.spf-filter__popup--range-group .spf-filter__popup-footer {
	flex: 0 0 auto;
	padding: 12px 16px 16px;
	border-top: 1px solid #f2f4f7;
	background: #fff;
}

/* Legacy modal class (if cached markup) → behave like under-button too */
.spf-filter__popup--modal {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: auto;
	bottom: auto;
	transform: none;
	z-index: 2147483001;
	width: min(420px, calc(100vw - 16px));
	min-width: 0;
	max-width: min(420px, calc(100vw - 16px));
	max-height: min(70vh, 520px);
	display: flex;
	flex-direction: column;
	border-radius: 8px;
	overflow: hidden;
}

.spf-filter__popup--modal[hidden] {
	display: none !important;
}

.spf-filter__item--more.spf-filter__item--open .spf-filter__overlay,
.spf-filter__overlay--modal {
	background: transparent;
}

.spf-filter__item--more.spf-filter__item--open ~ .spf-filter__overlay,
.spf-filter:has(.spf-filter__item--more.spf-filter__item--open) .spf-filter__overlay {
	background: transparent;
}

.spf-filter__popup-header--modal {
	background: var(--spf-more-header-bg, #e11d48);
	border-bottom: none;
	padding: 12px 16px;
}

.spf-filter__popup-header--modal .spf-filter__popup-title {
	color: var(--spf-more-header-color, #fff);
}

.spf-filter__popup-body--modal {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow-y: auto;
	padding: 8px 0 12px;
}

.spf-filter__popup--modal .spf-filter__popup-footer {
	flex: 0 0 auto;
	padding: 12px 16px 16px;
	border-top: 1px solid #f2f4f7;
	background: #fff;
}

.spf-filter__section {
	padding: 8px 0 4px;
}

.spf-filter__section + .spf-filter__section {
	border-top: 1px solid #f2f4f7;
	margin-top: 4px;
	padding-top: 12px;
}

.spf-filter__section-title {
	margin: 0;
	padding: 8px 16px 4px;
	font-size: 14px;
	font-weight: 700;
	color: #101828;
}

.spf-filter__section-body {
	padding: 0;
}

.spf-filter__section--split_pane .spf-filter__section-body {
	padding: 0 0 8px;
}

.spf-filter__section--split_pane .spf-filter__split {
	min-height: 200px;
	max-height: 260px;
	border-top: 1px solid #e4e7ec;
	border-bottom: 1px solid #e4e7ec;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Phone/tablet: chip row scrolls; dropdown = same absolute under-button as desktop */
@media (max-width: 1024px) {
	.spf-layout-horizontal .spf-filter__items {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		max-width: 100%;
	}

	.spf-layout-horizontal .spf-filter__items::-webkit-scrollbar {
		display: none;
	}

	.spf-filter--open:not(.spf-filter--ported) .spf-filter__items,
	.spf-layout-horizontal.spf-filter--open:not(.spf-filter--ported) .spf-filter__items {
		overflow: visible !important;
		overflow-x: visible !important;
		overflow-y: visible !important;
	}

	.spf-filter--open.spf-filter--ported .spf-filter__items,
	.spf-layout-horizontal.spf-filter--open.spf-filter--ported .spf-filter__items {
		overflow-x: auto !important;
		overflow-y: hidden !important;
		-webkit-overflow-scrolling: touch;
	}

	.spf-filter__item {
		position: relative;
		z-index: 1;
	}

	.spf-filter__item--open {
		z-index: 20;
	}

	.spf-filter__popup {
		position: absolute;
		top: calc(100% + 6px);
		left: 0;
		right: auto;
		bottom: auto;
		transform: none;
		z-index: 2147483001;
		max-width: min(560px, calc(100vw - 16px));
	}

	.spf-filter__item--split_pane .spf-filter__popup {
		min-width: 0;
		width: min(520px, calc(100vw - 16px));
		max-width: calc(100vw - 16px);
		max-height: min(400px, 60vh);
	}

	.spf-filter__item--location .spf-filter__popup {
		min-width: 0;
		width: min(620px, calc(100vw - 16px));
		max-width: calc(100vw - 16px);
		max-height: min(560px, 72vh);
	}

	.spf-filter__split {
		min-height: 200px;
		max-height: min(320px, 50vh);
	}

	.spf-filter__parents {
		min-width: 100px;
		max-width: 140px;
		width: 38%;
	}
}

/* Fixed portal host on <body> — popups mount here so they are not children of <html>
   (invisible on some real iOS Safari builds) and escape Elementor overflow/transform. */
.spf-portal-host {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	max-width: 100vw !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
	transform: none !important;
	filter: none !important;
	perspective: none !important;
	contain: none !important;
	z-index: 2147483000 !important;
	background: transparent !important;
	box-sizing: border-box !important;
}

/* Ported popup: compact under-trigger dropdown (size/coords via JS !important) */
.spf-filter__popup--ported {
	position: fixed !important;
	right: auto !important;
	width: auto !important;
	max-width: min(560px, calc(100vw - 16px)) !important;
	min-width: 0 !important;
	height: auto !important;
	margin: 0 !important;
	border-radius: 8px !important;
	z-index: 2147483001 !important;
	pointer-events: auto !important;
	box-sizing: border-box !important;
	display: flex !important;
	flex-direction: column !important;
	overflow: hidden !important;
	background: #fff !important;
	visibility: visible !important;
	opacity: 1 !important;
	box-shadow: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
	-webkit-transform: none !important;
	transform: none !important;
}

.spf-filter__popup--ported:not([hidden]) {
	display: flex !important;
	visibility: visible !important;
	opacity: 1 !important;
}

.spf-filter__popup--ported[hidden] {
	display: none !important;
}

.spf-filter__popup--ported .spf-filter__popup-header,
.spf-filter__popup--ported .spf-filter__popup-footer {
	flex: 0 0 auto;
}

.spf-filter__popup--ported .spf-filter__popup-body {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none !important;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

.spf-filter__popup--ported .spf-filter__popup-body--split {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0;
}

.spf-filter__popup--ported.spf-filter__popup--location .spf-filter__popup-body--location {
	max-height: none;
}

.spf-filter__popup--ported .spf-filter__split {
	flex: 1 1 auto;
	min-height: 200px !important;
	max-height: none !important;
	height: auto !important;
}

.spf-filter__popup--ported .spf-filter__parents {
	min-width: 110px;
	max-width: 150px;
	width: 36%;
}

.spf-filter__popup--ported .spf-filter__children,
.spf-filter__popup--ported .spf-filter__children-panels {
	-webkit-overflow-scrolling: touch;
}

.spf-filter__overlay--ported {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483000 !important;
	pointer-events: none !important;
	background: transparent !important;
}

.spf-filter__overlay--ported.spf-filter__overlay--visible {
	background: transparent !important;
	pointer-events: none !important;
}

.spf-filter__popup-placeholder,
.spf-filter__overlay-placeholder {
	display: none !important;
}

/* Debug panel */
.spf-debug__toggle {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99998;
	padding: 10px 14px;
	border: none;
	border-radius: 8px;
	background: #7f56d9;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.spf-debug {
	position: fixed;
	right: 16px;
	bottom: 64px;
	z-index: 99999;
	width: min(520px, calc(100vw - 32px));
	max-height: min(70vh, 640px);
	display: flex;
	flex-direction: column;
	border-radius: 10px;
	background: #101828;
	color: #e4e7ec;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.spf-debug[hidden] {
	display: none !important;
}

.spf-debug__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #1d2939;
	border-bottom: 1px solid #344054;
}

.spf-debug__badge {
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 4px;
	background: #42307d;
	color: #d6bbfb;
}

.spf-debug__actions {
	margin-left: auto;
	display: flex;
	gap: 6px;
}

.spf-debug__btn {
	padding: 4px 8px;
	border: 1px solid #475467;
	border-radius: 6px;
	background: #344054;
	color: #f2f4f7;
	font-size: 12px;
	cursor: pointer;
}

.spf-debug__btn--close {
	font-size: 16px;
	line-height: 1;
	padding: 2px 8px;
}

.spf-debug__log {
	flex: 1;
	margin: 0;
	padding: 12px;
	overflow: auto;
	font-size: 11px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
	color: #d0d5dd;
}
