/* ========================= Catalog filter (universal) =========================
 * Used on every hub surface (region archives + type-landings).
 * Mirrors the mockup: white card, two horizontal rows, segmented type-buttons,
 * capacity / format chips, dual price inputs, district select, amenities list
 * with "Показать ещё", reset/apply actions. Active chips bar lives below.
 * Mobile (≤860px) collapses the card into a drawer.
 */
.pk-catalog-filter { margin: 0 0 28px; }

/* Result counter — sits above the form card. */
.pk-catalog-filter__count {
	color: var(--pk-muted);
	font-size: 14px;
	margin: -6px 0 16px;
}

.pk-catalog-filter__card {
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: var(--pk-radius);
	padding: 22px 24px 18px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

/* Top row: type (a touch wider so "Беседки + Гриль-домики" fit on row 1) /
 * capacity (~50%, must fit 6 chips in one line) / price / district (~25%
 * narrower than before — long term names not the priority right now). */
.pk-catalog-filter__row {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 2.6fr) minmax(0, 1fr) minmax(0, 0.8fr);
	gap: 24px;
	align-items: start;
}
.pk-catalog-filter__row + .pk-catalog-filter__row { margin-top: 18px; }
/* Bottom row: format (content-sized) / amenities (fills remaining space and
 * extends right toward the action buttons) / actions (content-sized). */
.pk-catalog-filter__row--bottom {
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: start;
}

.pk-catalog-filter__group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pk-catalog-filter__group--actions {
	flex-direction: row;
	align-items: center;
	justify-content: flex-end;
	align-self: end;
	gap: 12px;
	padding-top: 22px; /* line up with bottom of inputs in same row */
}
.pk-catalog-filter__label {
	font-size: 13px;
	color: var(--pk-muted);
	font-weight: 500;
	letter-spacing: .01em;
}

/* ---------------- Type segmented buttons ---------------- */
.pk-catalog-filter__type { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-catalog-filter__type-btn,
.pk-catalog-filter__type-btn:link,
.pk-catalog-filter__type-btn:visited {
	display: inline-flex; align-items: center; justify-content: center;
	height: 40px; padding: 0 16px;
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: 999px;
	color: var(--pk-text);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
	white-space: nowrap;
}
.pk-catalog-filter__type-btn:hover { border-color: var(--pk-green); color: var(--pk-green-dark); }
.pk-catalog-filter__type-btn--active,
.pk-catalog-filter__type-btn--active:link,
.pk-catalog-filter__type-btn--active:visited,
.pk-catalog-filter__type-btn--active:hover {
	background: var(--pk-green);
	border-color: var(--pk-green);
	color: #fff !important;
	box-shadow: 0 4px 10px rgba(46, 125, 70, .25);
}
.pk-catalog-filter__type-btn--active:hover {
	background: var(--pk-green-dark);
	border-color: var(--pk-green-dark);
}

/* ---------------- Chip toggles (capacity) — anchor-style, identical to type-btn ----
 * Capacity chips are real <a href> links that toggle the cap_range value in the
 * URL. No form input, no left-side indicator. Visual matches __type-btn 1:1.
 * Equal-weight flex distribution so all 6 chips share width within the column. */
.pk-catalog-filter__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-catalog-filter__chip,
.pk-catalog-filter__chip:link,
.pk-catalog-filter__chip:visited {
	display: inline-flex; align-items: center; justify-content: center;
	flex: 1 1 0;
	min-width: 80px;
	height: 40px; padding: 0 12px;
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: 999px;
	color: var(--pk-text);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
	user-select: none;
}
.pk-catalog-filter__chip:hover { border-color: var(--pk-green); color: var(--pk-green-dark); }
.pk-catalog-filter__chip--active,
.pk-catalog-filter__chip--active:link,
.pk-catalog-filter__chip--active:visited,
.pk-catalog-filter__chip--active:hover {
	background: var(--pk-green);
	border-color: var(--pk-green);
	color: #fff !important;
	box-shadow: 0 4px 10px rgba(46, 125, 70, .25);
}
.pk-catalog-filter__chip--active:hover {
	background: var(--pk-green-dark);
	border-color: var(--pk-green-dark);
}

/* ---------------- Price ---------------- */
.pk-catalog-filter__price { display: flex; gap: 8px; }
.pk-catalog-filter__price input {
	flex: 1 1 0;
	min-width: 0;
	height: 40px;
	padding: 0 11px;
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: 10px;
	color: var(--pk-text);
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}
.pk-catalog-filter__price input:focus-visible {
	outline: none;
	border-color: var(--pk-green);
	box-shadow: 0 0 0 3px rgba(46, 125, 70, .12);
}

/* ---------------- Select ----------------
 * Vertical centering: explicit line-height matches inner height (40 - 2px
 * borders = 38px) so the "selected option" text is centered properly across
 * Chromium/Firefox/Safari. No overflow:hidden on a <select> — it can mask
 * descenders ("у", "р", "д") and clip "Любой" by height in some browsers. */
.pk-catalog-filter__select {
	width: 100%;
	min-width: 0;
	height: 40px;
	padding: 0 24px 0 12px;
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: 10px;
	color: var(--pk-text);
	font-size: 14px;
	line-height: 38px;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6775' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
	background-repeat: no-repeat;
	background-position: right 8px center;
}
.pk-catalog-filter__select-empty {
	height: 40px;
	display: flex; align-items: center;
	padding: 0 14px;
	color: var(--pk-muted);
	background: var(--pk-bg-soft);
	border: 1px dashed var(--pk-border);
	border-radius: 10px;
	font-size: 13px;
}

/* ---------------- Format chips: pill + round indicator (per ref C) ---------------- */
.pk-catalog-filter__format-chip {
	position: relative;
	display: inline-flex; align-items: center; gap: 8px;
	height: 40px; padding: 0 14px 0 10px;
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: 999px;
	color: var(--pk-text);
	font-size: 14px;
	cursor: pointer;
	user-select: none;
	transition: background .15s, border-color .15s, color .15s;
}
.pk-catalog-filter__format-chip:hover { border-color: var(--pk-green); }
.pk-catalog-filter__format-chip input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 15px; height: 15px;
	margin: 0;
	border-radius: 50%;
	border: 2px solid var(--pk-border);
	background: var(--pk-bg);
	position: relative;
	cursor: pointer;
	flex: none;
	transition: border-color .15s, background .15s;
}
.pk-catalog-filter__format-chip input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--pk-green);
	outline-offset: 2px;
}
.pk-catalog-filter__format-chip:has(input:checked) {
	background: var(--pk-green);
	border-color: var(--pk-green);
	color: #fff;
}
/* Active state: white outer circle, small green dot inside. */
.pk-catalog-filter__format-chip:has(input:checked) input[type="checkbox"] {
	background: #fff;
	border-color: #fff;
}
.pk-catalog-filter__format-chip input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 6px; height: 6px;
	border-radius: 50%;
	background: var(--pk-green);
}

/* ---------------- Amenities: round indicator + label, no pill bg ---------------- */
.pk-catalog-filter__amenity {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 4px 2px;
	font-size: 14px;
	color: var(--pk-text);
	cursor: pointer;
	user-select: none;
}
.pk-catalog-filter__amenity input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 18px; height: 18px;
	margin: 0;
	border-radius: 50%;
	border: 2px solid #c9cfd6;
	background: var(--pk-bg);
	position: relative;
	cursor: pointer;
	flex: none;
	transition: border-color .15s;
}
.pk-catalog-filter__amenity input[type="checkbox"]:hover { border-color: var(--pk-green); }
.pk-catalog-filter__amenity input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--pk-green);
	outline-offset: 2px;
}
.pk-catalog-filter__amenity input[type="checkbox"]:checked {
	border-color: var(--pk-green);
	background: var(--pk-bg);
}
.pk-catalog-filter__amenity input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 9px; height: 9px;
	border-radius: 50%;
	background: var(--pk-green);
}
.pk-catalog-filter__amenities { display: flex; flex-wrap: wrap; gap: 4px 14px; }
/* Extra block is the natural continuation of the primary list — keep the same
 * vertical row gap (4px) so there's no visible "section break" between them. */
.pk-catalog-filter__amenities--extra { width: 100%; margin-top: 4px; }
/* Force-hide collapsed amenity block — wins over .pk-catalog-filter__amenities flex. */
.pk-catalog-filter__amenities--extra[hidden] { display: none !important; }

/* "Показать ещё / Скрыть" toggle — sits below the (optional) extra list.
 * align-self: flex-start keeps it left-aligned with the amenity grid above. */
.pk-catalog-filter__more {
	align-self: flex-start;
	display: inline-flex; align-items: center; gap: 6px;
	margin: 8px 0 0;
	padding: 4px 6px;
	background: none;
	border: 0;
	color: var(--pk-muted);
	font-size: 13px;
	cursor: pointer;
}
.pk-catalog-filter__more:hover { color: var(--pk-green-dark); }
.pk-catalog-filter__more svg { transition: transform .15s; }
.pk-catalog-filter__more[aria-expanded="true"] svg { transform: rotate(180deg); }
.pk-catalog-filter__more-hide { display: none; }
.pk-catalog-filter__more[aria-expanded="true"] .pk-catalog-filter__more-show { display: none; }
.pk-catalog-filter__more[aria-expanded="true"] .pk-catalog-filter__more-hide { display: inline; }

/* ---------------- Action buttons ---------------- */
.pk-catalog-filter__btn-reset,
.pk-catalog-filter__btn-apply {
	display: inline-flex; align-items: center; justify-content: center;
	height: 44px; padding: 0 28px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 500;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.pk-catalog-filter__btn-reset,
.pk-catalog-filter__btn-reset:link,
.pk-catalog-filter__btn-reset:visited {
	background: var(--pk-bg);
	border-color: var(--pk-border);
	color: var(--pk-text);
}
.pk-catalog-filter__btn-reset:hover { border-color: var(--pk-green); color: var(--pk-green-dark); }
/* Apply — explicit selectors to override any theme-level button reset that
 * might leave the resting state without bg/color. */
button.pk-catalog-filter__btn-apply,
.pk-catalog-filter__btn-apply,
.pk-catalog-filter__btn-apply:link,
.pk-catalog-filter__btn-apply:visited {
	background-color: var(--pk-green) !important;
	border-color: var(--pk-green) !important;
	color: #fff !important;
}
button.pk-catalog-filter__btn-apply:hover,
.pk-catalog-filter__btn-apply:hover {
	background-color: var(--pk-green-dark) !important;
	border-color: var(--pk-green-dark) !important;
	color: #fff !important;
	box-shadow: 0 6px 14px rgba(46, 125, 70, .28);
}

/* ---------------- Active chips bar ---------------- */
.pk-catalog-filter__active {
	display: flex; flex-wrap: wrap; gap: 8px;
	margin-top: 16px;
}
.pk-catalog-filter__active-chip,
.pk-catalog-filter__active-chip:link,
.pk-catalog-filter__active-chip:visited {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 7px 14px;
	background: var(--pk-green-soft);
	color: var(--pk-green-dark);
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: background .15s;
}
.pk-catalog-filter__active-chip:hover { background: #d9ead0; }
.pk-catalog-filter__active-chip-x {
	font-size: 14px;
	line-height: 1;
	opacity: .6;
	font-weight: 400;
}

/* ---------------- Mobile drawer scaffolding (hidden on desktop) ---------------- */
.pk-catalog-filter__mobile-toggle { display: none; }
.pk-catalog-filter__drawer-head { display: none; }
.pk-catalog-filter__drawer-close { display: none; }

/* Tablet adjustments */
@media (max-width: 1100px) {
	.pk-catalog-filter__row { grid-template-columns: 1fr 1fr; }
	.pk-catalog-filter__row--bottom { grid-template-columns: 1fr 1fr; }
	.pk-catalog-filter__group--actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 0; }
}

/* Mobile drawer */
@media (max-width: 860px) {
	.pk-catalog-filter__mobile-toggle {
		display: inline-flex; align-items: center; gap: 8px;
		height: 44px; padding: 0 18px;
		border-radius: 999px;
		background: var(--pk-bg);
		border: 1px solid var(--pk-border);
		color: var(--pk-text);
		font-size: 14px;
		font-weight: 500;
		cursor: pointer;
	}
	.pk-catalog-filter__mobile-count {
		display: inline-flex; align-items: center; justify-content: center;
		width: 22px; height: 22px;
		border-radius: 999px;
		background: var(--pk-green);
		color: #fff;
		font-size: 12px;
		font-weight: 600;
	}
	.pk-catalog-filter__card {
		display: none;
		position: fixed; inset: 0;
		z-index: 1000;
		background: var(--pk-bg);
		border-radius: 0;
		padding: 16px 16px 96px;
		overflow-y: auto;
	}
	.pk-catalog-filter[data-pk-filter-open] .pk-catalog-filter__card { display: block; }
	.pk-catalog-filter__drawer-head {
		display: flex; align-items: center; justify-content: space-between;
		padding-bottom: 12px;
		margin-bottom: 12px;
		border-bottom: 1px solid var(--pk-border);
		font-size: 18px;
	}
	.pk-catalog-filter__drawer-close {
		display: inline-flex; align-items: center; justify-content: center;
		width: 36px; height: 36px;
		border: 0; background: var(--pk-bg-soft);
		border-radius: 50%;
		font-size: 20px;
		cursor: pointer;
	}
	.pk-catalog-filter__row,
	.pk-catalog-filter__row--bottom { grid-template-columns: 1fr; gap: 16px; }
	.pk-catalog-filter__row + .pk-catalog-filter__row { margin-top: 16px; }
	.pk-catalog-filter__group--actions {
		position: fixed; left: 0; right: 0; bottom: 0;
		padding: 12px 16px;
		background: var(--pk-bg);
		border-top: 1px solid var(--pk-border);
		justify-content: space-between;
	}
	.pk-catalog-filter__btn-reset,
	.pk-catalog-filter__btn-apply { flex: 1 1 0; }
}

/* Empty-state for hub listings (used when filter returns 0). */
.pk-listings-empty-card {
	background: var(--pk-bg);
	border: 1px solid var(--pk-border);
	border-radius: var(--pk-radius);
	padding: 32px 28px;
	text-align: center;
	color: var(--pk-muted);
	margin: 8px 0 24px;
}
.pk-listings-empty-card h3 { color: var(--pk-text); margin: 0 0 8px; font-size: 18px; }
.pk-listings-empty-card .pk-btn { margin-top: 14px; }
