/* ==========================================================================
   /properties/ - search page. Colours come from theme.css (:root).
   ========================================================================== */

.psPage { background: var(--cream-warm); padding-bottom: 60px; }

.psWrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.psPage *, .psPage *::before, .psPage *::after { box-sizing: border-box; }

.psSrOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Search bar ---- */

.psSearchBar {
	background: var(--white);
	border-bottom: 1px solid var(--line);
	padding: 16px 0;
	position: sticky;
	top: 0;
	z-index: 20;
	box-shadow: var(--shadow);
}

.psSearchGrid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr auto;
	gap: 12px;
	align-items: end;
}

.psField label {
	display: block;
	font-size: .7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--ink-soft);
	margin-bottom: 5px;
}

.psField select,
.psSort select {
	width: 100%;
	height: 46px;
	padding: 0 38px 0 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--white) url('/images/down-arrow.png') no-repeat right 14px center;
	color: var(--ink);
	font: inherit;
	font-size: .95rem;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

.psField select:focus,
.psSort select:focus { outline: 2px solid var(--lime); outline-offset: 1px; }

.psSearchBtn {
	height: 46px;
	padding: 0 32px;
	border: 0;
	border-radius: 10px;
	background: var(--lime);
	color: var(--lime-ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background .2s ease;
}

.psSearchBtn:hover { background: var(--lime-dark); }
.psSearchBtn i { margin-right: 8px; }

/* Thin loading bar under the search bar */
.psSearchBar::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -1px;
	height: 3px;
	width: 0;
	background: var(--lime);
	opacity: 0;
}

.psLoading .psSearchBar::after { opacity: 1; animation: psLoad 1s ease-out forwards; }

@keyframes psLoad { from { width: 0; } to { width: 85%; } }

.psLoading #psResults { opacity: .45; pointer-events: none; transition: opacity .15s ease; }

/* ---- Heading row ---- */

.psCrumbs { padding: 22px 0 6px; font-size: .82rem; color: var(--ink-soft); }
.psCrumbs a { color: var(--green-mid); text-decoration: none; }
.psCrumbs a:hover { text-decoration: underline; }
.psCrumbs span { margin: 0 7px; opacity: .6; }

.psHead {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 14px;
	scroll-margin-top: 100px;
}

.psHead h1 {
	margin: 0 0 4px;
	font-size: 1.6rem;
	line-height: 1.25;
	color: var(--green-deep);
}

.psCount { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.psCount strong { color: var(--green-deep); }

.psTools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.psToolBtn {
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--white);
	color: var(--green-deep);
	font: inherit;
	font-size: .88rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	transition: border-color .2s ease;
}

.psToolBtn:hover { border-color: var(--green-deep); }

.psBadge {
	background: var(--lime);
	color: var(--lime-ink);
	border-radius: 999px;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	font-size: .72rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.psBadge[hidden] { display: none; }

.psSort { position: relative; display: inline-flex; align-items: center; }
.psSort i { position: absolute; left: 14px; color: var(--green-deep); font-size: .85rem; pointer-events: none; }
.psSort select { height: 40px; border-radius: 999px; padding-left: 36px; font-size: .88rem; font-weight: 600; color: var(--green-deep); min-width: 190px; }

/* ---- Quick filter pills ---- */

.psQuick {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px 0 14px;
	scrollbar-width: none;
}

.psQuick::-webkit-scrollbar { display: none; }

.psPill {
	flex: 0 0 auto;
	border: 1px solid var(--line);
	background: var(--white);
	color: var(--ink);
	border-radius: 999px;
	padding: 8px 14px;
	font: inherit;
	font-size: .84rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	transition: background .15s ease, border-color .15s ease;
}

.psPill i { color: var(--lime-dark); }
.psPill:hover { border-color: var(--green-deep); }
.psPill.isOn { background: var(--green-deep); border-color: var(--green-deep); color: var(--white); }
.psPill.isOn i { color: var(--lime); }
.psPill.isZero { opacity: .45; cursor: default; }

.psN { color: var(--ink-soft); font-size: .85em; }
.psPill.isOn .psN { color: rgba(255,255,255,.7); }

/* ---- Active chips ---- */

.psChips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.psChip {
	border: 0;
	background: var(--lime);
	color: var(--lime-ink);
	border-radius: 999px;
	padding: 6px 12px;
	font: inherit;
	font-size: .8rem;
	font-weight: 600;
	cursor: pointer;
}

.psChip i { margin-left: 5px; }
.psChip:hover { background: var(--lime-dark); }

.psChipClear,
.psLinkBtn {
	border: 0;
	background: none;
	color: var(--green-mid);
	font: inherit;
	font-size: .82rem;
	text-decoration: underline;
	cursor: pointer;
}

/* ---- Results grid ---- */

.psGrid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.psCard {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: transform .2s ease, box-shadow .2s ease;
}

.psCard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.psCardMedia { position: relative; aspect-ratio: 4 / 3; background: var(--cream); }
.psCardMedia img { width: 100%; height: 100%; object-fit: cover; display: block; }

.psNoImage {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--line);
	font-size: 2.6rem;
}

.psRating {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(255,255,255,.95);
	color: var(--green-deep);
	border-radius: 999px;
	padding: 4px 10px;
	font-size: .78rem;
	font-weight: 700;
}

.psRating i { color: var(--lime-dark); margin-right: 5px; }

.psFav {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255,255,255,.95);
	color: var(--green-deep);
	cursor: pointer;
	font-size: .95rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}

.psFav:hover { transform: scale(1.1); }
.psFav.isOn { color: #d6455d; }

.psCardBody { padding: 15px 17px 17px; display: flex; flex-direction: column; flex: 1; }

.psCardLoc { font-size: .78rem; color: var(--ink-soft); margin-bottom: 4px; }
.psCardLoc i { color: var(--lime-dark); margin-right: 6px; }

.psCard h3 { margin: 0 0 10px; font-size: 1.05rem; line-height: 1.3; }

.psCardLink { color: var(--green-deep); text-decoration: none; }

/* Whole card is the link; the heart sits above it */
.psCardLink::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.psCardLink:focus-visible { outline: none; }
.psCard:focus-within { outline: 2px solid var(--lime); outline-offset: 2px; }

.psCardMeta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .84rem; color: var(--ink); margin-bottom: 10px; }
.psCardMeta i { color: var(--lime-dark); margin-right: 6px; }

.psCardTags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.psCardTags span {
	background: var(--cream);
	border-radius: 6px;
	padding: 4px 9px;
	font-size: .74rem;
	color: var(--ink-soft);
}

.psCardTags i { color: var(--lime-dark); margin-right: 5px; }

.psCardFoot {
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.psPrice { font-size: .8rem; color: var(--ink-soft); line-height: 1.3; }
.psPrice strong { font-size: 1.2rem; color: var(--green-deep); }

.psBtn {
	background: var(--green-deep);
	color: var(--white);
	border-radius: 999px;
	padding: 9px 16px;
	font-size: .8rem;
	font-weight: 700;
	white-space: nowrap;
	transition: background .2s ease;
}

.psCard:hover .psBtn { background: var(--lime); color: var(--lime-ink); }

/* ---- Empty ---- */

.psEmpty {
	text-align: center;
	background: var(--white);
	border: 1px dashed var(--line);
	border-radius: var(--radius);
	padding: 50px 20px;
	color: var(--ink-soft);
}

.psEmpty > i { font-size: 2rem; color: var(--lime-dark); }
.psEmpty h3 { color: var(--green-deep); margin: 12px 0 6px; }

.psBtnDark {
	border: 0;
	background: var(--green-deep);
	color: var(--white);
	border-radius: 999px;
	padding: 11px 22px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

/* ---- Pagination ---- */

.psPager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 36px; }

.psPager a,
.psPager span {
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: .9rem;
	text-decoration: none;
}

.psPager a { background: var(--white); border: 1px solid var(--line); color: var(--green-deep); }
.psPager a:hover { border-color: var(--green-deep); }
.psPager .psCur { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.psPager .psGap { color: var(--ink-soft); }

/* ---- Filter drawer ---- */

.psOverlay { position: fixed; inset: 0; background: rgba(31, 51, 38, .45); z-index: 900; }
.psOverlay[hidden] { display: none; }

.psDrawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 420px;
	max-width: 100%;
	background: var(--white);
	z-index: 901;
	display: flex;
	flex-direction: column;
	box-shadow: var(--shadow-lift);
	transform: translateX(105%);
	transition: transform .25s ease;
}

.psDrawer.isOpen { transform: none; }

.psNoScroll { overflow: hidden; }

.psDrawerHead {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 18px 22px;
	border-bottom: 1px solid var(--line);
}

.psDrawerHead h2 { margin: 0; font-size: 1.2rem; color: var(--green-deep); }

.psClose {
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 50%;
	background: var(--cream);
	color: var(--green-deep);
	cursor: pointer;
	font-size: 1rem;
}

.psDrawerBody { flex: 1; overflow-y: auto; padding: 6px 22px 20px; overscroll-behavior: contain; }

.psGroup { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 16px 0 10px; }
.psGroup:last-child { border-bottom: 0; }

.psGroup legend {
	float: left;
	width: 100%;
	padding: 0 0 8px;
	font-size: .74rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--ink-soft);
}

.psCheck {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
	cursor: pointer;
	font-size: .93rem;
	color: var(--ink);
	clear: both;
}

.psCheck input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.psBox {
	flex: 0 0 22px;
	height: 22px;
	border: 2px solid var(--line);
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: transparent;
	font-size: .7rem;
	transition: all .15s ease;
}

.psCheck:hover .psBox { border-color: var(--green-deep); }
.psCheck input:checked + .psBox { background: var(--green-deep); border-color: var(--green-deep); color: var(--lime); }
.psCheck input:focus-visible + .psBox { outline: 2px solid var(--lime); outline-offset: 2px; }

.psIcon { width: 18px; text-align: center; color: var(--lime-dark); }
.psLabel { flex: 1; }

.psCheck.isZero { opacity: .4; cursor: default; }
.psCheck.isZero:hover .psBox { border-color: var(--line); }

.psDrawerFoot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 14px 22px;
	border-top: 1px solid var(--line);
	background: var(--white);
}

.psShowBtn {
	border: 0;
	background: var(--lime);
	color: var(--lime-ink);
	border-radius: 10px;
	padding: 13px 22px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	flex: 1;
	max-width: 240px;
}

.psShowBtn:hover { background: var(--lime-dark); }

/* ---- Responsive ---- */

@media (max-width: 1000px) {
	.psGrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {

	.psWrap { padding: 0 16px; }

	.psSearchBar { position: relative; padding: 12px 0; }
	.psSearchGrid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.psField:first-child,
	.psFieldBtn { grid-column: 1 / -1; }
	.psSearchBtn { width: 100%; }

	.psHead { align-items: flex-start; }
	.psHead h1 { font-size: 1.3rem; }
	.psTools { width: 100%; }
	.psSort { flex: 1; }
	.psSort select { min-width: 0; }

	.psGrid { grid-template-columns: 1fr; gap: 16px; }

	.psDrawer { width: 100%; }
}
