/* Shared filter engine — full-width panel; one tab per property */

.pt-filter-engine {
	--pt-fe-radius: 8px; /* matches theme .btn */
	margin-bottom: 1rem;
}

.pt-filter-engine__bar {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.65rem;
}

.pt-filter-engine__bar-main {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.65rem 0.85rem;
	min-width: 0;
}

.pt-filter-engine__open {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	flex: 0 0 auto;
	margin: 0;
	padding: 0.55rem 1rem;
	border: 1px solid rgba(30, 102, 255, 0.22);
	border-radius: var(--pt-fe-radius);
	background: linear-gradient(180deg, #fff 0%, #f7faff 100%);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	color: var(--primary, #1e66ff);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 650;
	letter-spacing: 0.01em;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.pt-filter-engine__open:hover,
.pt-filter-engine__open:focus-visible {
	border-color: rgba(30, 102, 255, 0.45);
	box-shadow: 0 4px 14px rgba(30, 102, 255, 0.12);
	outline: none;
}

.pt-filter-engine__open:active {
	transform: translateY(1px);
}

.pt-filter-engine__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.35rem;
	border-radius: var(--pt-fe-radius);
	background: var(--primary, #1e66ff);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
}

.pt-filter-engine__quick {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.4rem;
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	padding: 0.1rem 0;
}

.pt-filter-engine__quick::-webkit-scrollbar {
	height: 4px;
}

.pt-filter-engine__quick::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.45);
	border-radius: 999px;
}

.pt-filter-engine__quick-pill {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.45rem 0.85rem;
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: var(--pt-fe-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	color: rgba(0, 0, 0, 0.72);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pt-filter-engine__quick-pill:hover,
.pt-filter-engine__quick-pill:focus-visible {
	border-color: rgba(30, 102, 255, 0.4);
	color: var(--primary, #1e66ff);
	outline: none;
}

.pt-filter-engine__quick-pill.is-active {
	border-color: rgba(30, 102, 255, 0.35);
	background: rgba(30, 102, 255, 0.08);
	color: var(--primary, #1e66ff);
	box-shadow: 0 2px 8px rgba(30, 102, 255, 0.12);
}

.pt-filter-engine__quick-pill:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.pt-filter-engine__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	min-width: 0;
}

.pt-filter-engine__chips--bar:empty,
.pt-filter-engine__chips--drawer:empty {
	display: none;
}

.pt-filter-engine__chips--drawer {
	display: none;
	padding: 0.65rem 1.25rem 0;
}

.pt-filter-engine__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	max-width: 100%;
	padding: 0.28rem 0.4rem 0.28rem 0.65rem;
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: var(--pt-fe-radius);
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	font-size: 0.75rem;
	line-height: 1.3;
	color: rgba(0, 0, 0, 0.78);
}

.pt-filter-engine__chip-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.15rem;
	height: 1.15rem;
	border: 0;
	border-radius: var(--pt-fe-radius);
	background: rgba(148, 163, 184, 0.18);
	color: rgba(0, 0, 0, 0.5);
	font-size: 0.95rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease;
}

.pt-filter-engine__chip-remove:hover,
.pt-filter-engine__chip-remove:focus-visible {
	background: rgba(30, 102, 255, 0.12);
	color: var(--primary, #1e66ff);
	outline: none;
}

.pt-filter-engine__sort {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex: 0 0 auto;
	margin-left: auto;
}

.pt-filter-engine__sort-label {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 600;
	color: rgba(0, 0, 0, 0.65);
	white-space: nowrap;
}

.pt-filter-engine__sort-select {
	min-width: 10rem;
	width: auto;
	border-radius: var(--pt-fe-radius);
	border-color: rgba(148, 163, 184, 0.4);
	box-shadow: none;
	padding-left: 0.85rem;
}

.pt-filter-engine__bar-count {
	font-size: 0.85rem;
	font-weight: 600;
	color: rgba(0, 0, 0, 0.7);
	white-space: nowrap;
}

.pt-filter-engine__backdrop {
	position: fixed;
	inset: 0;
	z-index: 1040;
	background: rgba(15, 23, 42, 0.42);
	backdrop-filter: blur(2px);
}

.pt-filter-engine__drawer {
	position: fixed;
	z-index: 1050;
	display: flex;
	flex-direction: column;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #fff;
	box-shadow: none;
}

.pt-filter-engine__drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.pt-filter-engine__drawer-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 750;
	letter-spacing: -0.01em;
}

.pt-filter-engine__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding-top: 5px;
	border: 0;
	border-radius: var(--pt-fe-radius);
	background: rgba(148, 163, 184, 0.14);
	font-size: 1.35rem;
	line-height: 1;
	color: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.pt-filter-engine__close:hover,
.pt-filter-engine__close:focus-visible {
	background: rgba(30, 102, 255, 0.12);
	color: var(--primary, #1e66ff);
	outline: none;
}

.pt-filter-engine__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0.75rem 1.25rem;
	border-bottom: 1px solid rgba(226, 232, 240, 0.95);
	overflow: visible;
}

.pt-filter-engine__tab {
	flex: 0 0 auto;
	border: 1px solid transparent;
	border-radius: var(--pt-fe-radius);
	background: rgba(148, 163, 184, 0.1);
	padding: 0.45rem 0.9rem;
	font-size: 0.8rem;
	font-weight: 650;
	color: rgba(0, 0, 0, 0.58);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pt-filter-engine__tab:hover,
.pt-filter-engine__tab:focus-visible {
	background: rgba(30, 102, 255, 0.08);
	color: var(--primary, #1e66ff);
	outline: none;
}

.pt-filter-engine__tab.is-active {
	border-color: rgba(30, 102, 255, 0.18);
	background: var(--primary, #1e66ff);
	box-shadow: 0 4px 12px rgba(30, 102, 255, 0.22);
	color: #fff;
}

.pt-filter-engine__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	padding: 1rem 1.25rem 0;
	box-sizing: border-box;
}

.pt-filter-engine__search-wrap {
	margin-bottom: 0.85rem;
	max-width: 28rem;
}

.pt-filter-engine__search {
	border-radius: var(--pt-fe-radius);
	padding-left: 1rem;
	border-color: rgba(148, 163, 184, 0.4);
}

.pt-filter-engine__search:focus {
	border-color: rgba(30, 102, 255, 0.45);
	box-shadow: 0 0 0 3px rgba(30, 102, 255, 0.12);
}

.pt-filter-engine__panels {
	flex: 1 1 auto;
	overflow-y: auto;
	min-height: 0;
	padding-bottom: 0.5rem;
}

.pt-filter-engine__facet-title.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pt-filter-engine__options {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 0.15rem 1rem;
}

.pt-filter-engine__options .pt-filter-engine__option {
	margin: 0;
	padding-left: 0;
}

.pt-filter-engine__options .pt-filter-engine__option:before {
	content: none;
}

.pt-filter-engine__option.is-hidden {
	display: none;
}

.pt-filter-engine__option.is-disabled {
	opacity: 0.45;
}

.pt-filter-engine__option-label {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.55rem 0.45rem;
	margin: 0;
	border-radius: var(--pt-fe-radius);
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
	color: rgba(0, 0, 0, 0.85);
	transition: background 0.12s ease;
}

.pt-filter-engine__option-label:hover {
	background: rgba(30, 102, 255, 0.05);
}

.pt-filter-engine__option.is-disabled .pt-filter-engine__option-label {
	cursor: not-allowed;
}

.pt-filter-engine__checkbox {
	flex: 0 0 auto;
	margin: 0;
	accent-color: var(--primary, #1e66ff);
}

.pt-filter-engine__option-icon {
	width: 1.15rem;
	height: 1.15rem;
	object-fit: contain;
	flex: 0 0 auto;
}

.pt-filter-engine__option-text {
	flex: 1 1 auto;
	min-width: 0;
}

.pt-filter-engine__option-count {
	flex: 0 0 auto;
	font-size: 0.75rem;
	color: rgba(0, 0, 0, 0.45);
	font-weight: 600;
}

.pt-filter-engine__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.95rem 1.25rem;
	border-top: 1px solid rgba(226, 232, 240, 0.95);
	background: rgba(248, 250, 252, 0.92);
}

.pt-filter-engine__footer-count {
	font-size: 0.95rem;
	font-weight: 750;
	color: rgba(0, 0, 0, 0.82);
}

.pt-filter-engine__footer-actions {
	display: flex;
	gap: 0.55rem;
}

.pt-filter-engine__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.35rem;
	padding: 0.5rem 1.15rem;
	border-radius: var(--pt-fe-radius);
	border: 1px solid transparent;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 650;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.pt-filter-engine__btn:active {
	transform: translateY(1px);
}

.pt-filter-engine__btn--ghost {
	background: #fff;
	border-color: rgba(148, 163, 184, 0.4);
	color: rgba(0, 0, 0, 0.72);
}

.pt-filter-engine__btn--ghost:hover,
.pt-filter-engine__btn--ghost:focus-visible {
	border-color: rgba(30, 102, 255, 0.35);
	color: var(--primary, #1e66ff);
	outline: none;
}

.pt-filter-engine__btn--primary {
	background: var(--primary, #1e66ff);
	border-color: var(--primary, #1e66ff);
	box-shadow: 0 6px 16px rgba(30, 102, 255, 0.22);
	color: #fff;
}

.pt-filter-engine__btn--primary:hover,
.pt-filter-engine__btn--primary:focus-visible {
	filter: brightness(1.05);
	outline: none;
}

body.pt-filter-engine-open {
	overflow: hidden;
}

/* Full-width open/close motion */
.pt-filter-engine__drawer {
	transform: translateY(100%);
	transition: transform 0.24s ease;
}

.pt-filter-engine.is-open .pt-filter-engine__drawer {
	transform: translateY(0);
}

@media (max-width: 991.98px) {
	.pt-filter-engine__bar-main {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-rows: auto auto;
		align-items: center;
		column-gap: 0.75rem;
		row-gap: 0.55rem;
	}

	.pt-filter-engine__open {
		grid-column: 1;
		grid-row: 1;
	}

	.pt-filter-engine__sort {
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
		margin-left: 0;
		min-width: 0;
		max-width: 100%;
	}

	.pt-filter-engine__sort-select {
		min-width: 0;
		width: auto;
		max-width: 100%;
	}

	.pt-filter-engine__quick {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.pt-filter-engine__chips--bar {
		display: none !important;
	}

	.pt-filter-engine__chips--drawer:not(:empty) {
		display: flex;
	}

	.pt-filter-engine__bar-count {
		width: 100%;
	}

	.pt-filter-engine__options {
		grid-template-columns: 1fr;
	}
}
