/**
 * Oplus — Property Type archive (v2).
 *
 * Page components on top of oplus-ds.css. Tokens only. Logical properties
 * throughout (RTL-safe).
 *
 * Section rhythm (one rule, no exceptions):
 *   hero ......... white   — what this is, what it costs
 *   filter bar ... white   — sticky, hairline below
 *   results ...... tint    — white cards on a light grey ground, the marketplace pattern
 *   price guide .. white   — two tables in matching panels
 *   guide ........ white   — editor prose, only when written
 *   help ......... tint    — FAQ + adviser card; ends light so the slate site
 *                            footer is the page's only dark block
 *
 * Shapes match the chrome: 10px controls (header button is 9px), 14px panels
 * (footer cards are 12px). No pills.
 */

.tx .o-i { width: 18px; height: 18px; flex: none; }
.tx .o-h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.tx .o-lede { font-size: var(--o-fs-md); margin-block-start: var(--o-s-2); }

/* ================================================================== HERO */

.tx-hero {
	background: var(--o-surface);
	padding-block: var(--o-s-8) var(--o-s-6);
}

.tx-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
	gap: var(--o-s-12);
	align-items: center;
}

.tx-hero__grid--solo { grid-template-columns: minmax(0, 1fr); }

.tx-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--o-s-2); list-style: none; margin: 0 0 var(--o-s-4); padding: 0; font-size: 0.8125rem; }
.tx-crumbs li { display: inline-flex; align-items: center; gap: var(--o-s-2); color: var(--o-muted); }
.tx-crumbs li + li::before { content: "/"; color: var(--o-line-strong); }
.tx .tx-crumbs a { color: var(--o-muted); text-decoration: none; }
.tx .tx-crumbs a:hover { color: var(--o-brand-600); }
.tx-crumbs [aria-current] { color: var(--o-ink); font-weight: 600; }

.tx-hero__title { font-size: clamp(2rem, 1.4rem + 2.2vw, 2.875rem); font-weight: 800; letter-spacing: -0.02em; max-width: 17ch; }
.tx-hero__lede { font-size: 1.0625rem; margin-block-start: var(--o-s-3); max-width: 56ch; }

/* Facts: one bordered panel, divided cells — reads as data, not decoration. */
.tx-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
	margin: var(--o-s-6) 0 0;
	border: 1px solid var(--o-line);
	border-radius: var(--o-r-lg);
	overflow: hidden;
	background: var(--o-surface);
}

.tx-stats__item { min-width: 0; padding: var(--o-s-4) var(--o-s-5); border-inline-start: 1px solid var(--o-line); }
.tx-stats__item:first-child { border-inline-start: 0; }

/* Four figures: one row, or a clean 2 × 2 — never three and an orphan. */
@media (min-width: 1101px) {
	.tx-stats:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1100px) {
	.tx-stats:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tx-stats:has(> :nth-child(4)) .tx-stats__item:nth-child(odd) { border-inline-start: 0; }
	.tx-stats:has(> :nth-child(4)) .tx-stats__item:nth-child(n + 3) { border-block-start: 1px solid var(--o-line); }
}
.tx-stats dt { font-size: var(--o-fs-xs); font-weight: 600; color: var(--o-muted); margin-block-end: var(--o-s-1); }
.tx-stats dd { margin: 0; white-space: nowrap; font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.625rem); font-weight: 800; line-height: 1.15; color: var(--o-ink); letter-spacing: -0.01em; }
.tx-stats__unit { font-size: 0.75rem; font-weight: 700; color: var(--o-brand-600); margin-inline-end: 0.3em; letter-spacing: 0; }

.tx-hero__media { margin: 0; border-radius: var(--o-r-lg); overflow: hidden; aspect-ratio: 4 / 3; max-height: 400px; background: var(--o-surface-2); }
.tx-hero__media img { width: 100%; height: 100%; object-fit: cover; }

.tx-types { margin-block-start: var(--o-s-8); }
.tx-types__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.tx-types__list::-webkit-scrollbar { display: none; }

/* ============================================================ FILTER BAR */

.tx-bar {
	position: sticky;
	top: var(--o-header-h);
	z-index: 40;
	background: var(--o-surface);
	border-block: 1px solid var(--o-line);
}

.tx-bar__form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: var(--o-s-3);
	align-items: end;
	padding-block: var(--o-s-3);
}

.tx-bar .o-select select { min-height: 44px; }

/* Hub search: the first and widest field of the same bar. */
/* One row: search, then however many selects there are, in equal columns. */
.tx-bar__form--search { grid-template-columns: minmax(200px, 1.6fr); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.tx-search { position: relative; }
.tx-search .o-i { position: absolute; inset-inline-start: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--o-muted); pointer-events: none; }
.tx .tx-search input {
	width: 100%; min-height: 44px; margin: 0; padding: 0 12px; padding-inline-start: 38px;
	border: 1px solid var(--o-line-strong); border-radius: var(--o-r-md); background: var(--o-surface);
	color: var(--o-ink); font: 500 0.9375rem/1.2 sans-serif; font-family: inherit; box-shadow: none; -webkit-appearance: none; appearance: none;
}
.tx .tx-search input::placeholder { color: var(--o-muted); opacity: 1; }
.tx .tx-search input:focus-visible { outline: 2px solid var(--o-brand-600); outline-offset: 1px; border-color: var(--o-brand-600); }
.tx .tx-search input::-webkit-search-cancel-button { cursor: pointer; }

/* ===================================================================== MAP */

.tx-mapbar { display: flex; margin-inline-start: auto; }
.tx .tx-mapbar__btn { display: inline-flex; align-items: center; gap: var(--o-s-2); min-height: 44px; }
.tx-mapbar__btn[aria-expanded="true"] { border-color: var(--o-brand-600); color: var(--o-brand-600); }
.tx-map { margin-block-end: var(--o-s-6); }
.tx-map[hidden] { display: none; }
.tx-map__canvas { height: min(62vh, 560px); border: 1px solid var(--o-line); border-radius: var(--o-r-lg); overflow: hidden; background: var(--o-surface-2); }
.tx-map__note { margin: var(--o-s-2) 0 0; font-size: var(--o-fs-xs); color: var(--o-muted); }
.tx-pin span { display: block; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--o-brand-600); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(19, 38, 28, 0.35); }
.tx .leaflet-popup-content { margin: 0; width: 240px !important; }
.tx .leaflet-popup-content-wrapper { padding: 0; border-radius: var(--o-r-md); overflow: hidden; }
.tx .tx-pop { display: grid; gap: 2px; color: var(--o-ink); text-decoration: none; font-family: var(--o-font); }
.tx .tx-pop img { display: block; width: 100%; height: 140px; object-fit: cover; margin-block-end: var(--o-s-2); }
.tx-pop__price { padding-inline: var(--o-s-3); font-weight: 800; font-size: 1rem; color: var(--o-brand-600); }
.tx-pop__title { padding-inline: var(--o-s-3); font-weight: 700; font-size: 0.875rem; line-height: 1.35; }
.tx-pop__facts { padding: 0 var(--o-s-3) var(--o-s-3); font-size: 0.75rem; color: var(--o-muted); }
.tx .marker-cluster-small, .tx .marker-cluster-medium, .tx .marker-cluster-large { background: rgba(36, 122, 59, 0.22); }
.tx .marker-cluster-small div, .tx .marker-cluster-medium div, .tx .marker-cluster-large div { background: var(--o-brand-600); color: #fff; font-weight: 700; font-family: var(--o-font); }
.tx-bar__actions { display: flex; }
.tx-bar__apply { width: 100%; min-height: 44px; }
.o-js .tx-bar__actions { display: none; }

/* =============================================================== RESULTS */

.tx-results { background: var(--o-surface-2); padding-block: var(--o-s-8) var(--o-s-12); }
.tx-results__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--o-s-3) var(--o-s-6); margin-block-end: var(--o-s-5); }
.tx-results__title { font-size: 1.25rem; font-weight: 800; }
.tx-results__range { font-size: 0.8125rem; color: var(--o-muted); margin-block-start: 2px; }

.tx-pill { padding-inline-end: var(--o-s-3); }
.tx-pill .o-i { width: 14px; height: 14px; color: var(--o-muted); }
.tx .tx-pills__clear { display: inline-flex; align-items: center; min-height: 40px; padding-inline: var(--o-s-2); font-size: var(--o-fs-sm); font-weight: 600; }

/* .tx-grid lives in oplus-ds.css (shared). */

/* CARD — moved to oplus-ds.css (shared listing card). */

/* ============================================================ PAGINATION */

.tx-pagination { margin-block-start: var(--o-s-10); display: flex; justify-content: center; }
.tx-pagination .pagination { display: flex; flex-wrap: wrap; gap: var(--o-s-2); list-style: none; margin: 0; padding: 0; }
.tx-pagination .page-link {
	display: inline-grid; place-items: center;
	min-width: var(--o-touch); height: var(--o-touch); padding-inline: var(--o-s-3);
	border: 1px solid var(--o-line); border-radius: var(--o-r-md);
	background: var(--o-surface); color: var(--o-ink);
	font-weight: 700; font-size: var(--o-fs-sm); text-decoration: none;
}
.tx-pagination a.page-link:hover { border-color: var(--o-brand-600); color: var(--o-brand-600); }
.tx-pagination .active .page-link { background: var(--o-brand-600); border-color: var(--o-brand-600); color: #fff; }
.tx-pagination .disabled .page-link { opacity: 0.4; }

/* ================================================================= EMPTY */

.tx-empty { padding: var(--o-s-12) var(--o-s-6); text-align: center; background: var(--o-surface); border: 1px solid var(--o-line); border-radius: var(--o-r-lg); }
.tx-empty h3 { font-size: 1.25rem; font-weight: 800; }
.tx-empty p { margin: var(--o-s-3) auto 0; max-width: 52ch; }
.tx-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--o-s-3); margin-block-start: var(--o-s-6); }

/* =========================================================== PRICE GUIDE */

.tx-prices .o-head { margin-block-end: var(--o-s-6); }
.tx-prices__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: var(--o-s-6); align-items: start; }
.tx-prices .o-table-wrap { border-radius: var(--o-r-lg); }
.tx-prices .o-table caption { padding: var(--o-s-4) var(--o-s-5); border-block-end: 1px solid var(--o-line); }
.tx-prices .o-table thead th { background: var(--o-surface-2); }
.tx .tx-prices .o-table tbody th a { color: var(--o-ink); text-decoration: none; font-weight: 700; }
.tx .tx-prices .o-table tbody th a:hover { color: var(--o-brand-600); text-decoration: underline; }
.tx .tx-prices__guide a { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8125rem; font-weight: 600; text-decoration: none; }
.tx .tx-prices__guide a:hover { text-decoration: underline; }
.tx-prices__guide .o-i { width: 14px; height: 14px; }
[dir="rtl"] .tx-prices__guide .o-i { transform: scaleX(-1); }
.tx-prices__method { margin-block-start: var(--o-s-4); font-size: 0.8125rem; color: var(--o-muted); }

/* ================================================================= GUIDE */

.tx-guide { border-block-start: 1px solid var(--o-line); }
.tx-guide__inner { max-width: 760px; }
.tx-prose { margin-block-start: var(--o-s-5); }
.tx-prose p,
.tx-prose ul,
.tx-prose ol { margin: 0 0 var(--o-s-4); }
.tx-prose h3 { font-size: 1.125rem; font-weight: 800; margin: var(--o-s-8) 0 var(--o-s-3); }
/* Links in running text need more than colour (WCAG 1.4.1). */
.tx .tx-prose a { color: var(--o-brand-600); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ================================================================== HELP */

.tx-help__grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--o-s-10); align-items: start; }
.tx-help__grid--solo { grid-template-columns: minmax(0, 560px); justify-content: center; }

.tx-faq__list { margin-block-start: var(--o-s-6); background: var(--o-surface); border: 1px solid var(--o-line); border-radius: var(--o-r-lg); overflow: hidden; }
.tx-faq__item + .tx-faq__item { border-block-start: 1px solid var(--o-line); }
.tx-faq__item summary { display: flex; align-items: center; justify-content: space-between; gap: var(--o-s-4); min-height: 60px; padding: var(--o-s-4) var(--o-s-5); cursor: pointer; list-style: none; font-size: 1rem; font-weight: 700; color: var(--o-ink); }
.tx-faq__item summary::-webkit-details-marker { display: none; }
.tx-faq__item summary:hover { color: var(--o-brand-600); }
.tx-faq__item summary .o-i { transition: transform var(--o-t-base) var(--o-ease); color: var(--o-muted); }
.tx-faq__item[open] summary .o-i { transform: rotate(180deg); }
.tx-faq__item p { padding: 0 var(--o-s-5) var(--o-s-5); max-width: 68ch; }

.tx-advisor {
	position: sticky;
	top: calc(var(--o-header-h) + var(--o-s-6));
	padding: var(--o-s-6);
	background: var(--o-surface);
	border: 1px solid var(--o-line);
	border-radius: var(--o-r-lg);
	box-shadow: var(--o-shadow-2);
}
.tx-advisor__title { font-size: 1.375rem; font-weight: 800; }
.tx-advisor__text { margin-block-start: var(--o-s-3); font-size: 0.9375rem; }
.tx-advisor__actions { display: grid; gap: var(--o-s-3); margin-block-start: var(--o-s-5); }
.tx-advisor__actions .o-btn { width: 100%; }
.tx-advisor__note { margin-block-start: var(--o-s-3); font-size: 0.8125rem; color: var(--o-muted); text-align: center; }

/* ========================================================== THEME CHROME */

.oplus-type-page .page-title-wrap,
.oplus-type-page .listing-tools-wrap,
.oplus-type-page .bt-sidebar-wrap { display: none; }
.oplus-type-page .main-wrap,
.oplus-type-page .content-wrap { padding-block: 0; }

/* Deep links (#tx-results after a filter) land below the header + bar. */
.tx-results { scroll-margin-top: calc(var(--o-header-h) + 72px); }

/* ============================================================ RESPONSIVE */

@media (max-width: 1100px) {
	.tx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tx-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: var(--o-s-8); }
}

@media (max-width: 900px) {
	.tx-help__grid { grid-template-columns: minmax(0, 1fr); gap: var(--o-s-8); }
	.tx-advisor { position: static; }
}

@media (max-width: 767px) {
	/* Phones: listings first. The hero is a compact summary, not a poster —
	   the first card must start inside the first screen (Bayut/PF pattern). */
	.tx-hero { padding-block: var(--o-s-3); }
	.tx-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.tx-hero__media { display: none; }
	.tx-crumbs ol { margin-block-end: var(--o-s-2); font-size: var(--o-fs-xs); }
	.tx-hero__title { font-size: 1.5rem; max-width: none; }
	.tx-hero__lede { display: none; }

	.tx-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block-start: var(--o-s-3); border-radius: var(--o-r-md); }
	.tx-stats__item { padding: var(--o-s-2) var(--o-s-3); }
	.tx-stats__item:nth-child(n + 4) { display: none; }
	.tx-stats dt { font-size: 0.6875rem; margin-block-end: 0; }
	.tx-stats dd { font-size: 1.0625rem; }
	.tx-stats__unit { font-size: 0.625rem; }

	.tx-types { margin-block-start: var(--o-s-3); }
	.tx-types .o-chip { min-height: 36px; padding-inline: var(--o-s-3); font-size: 0.8125rem; }

	/* One sticky row: the options say what they are ("Any beds"), so the
	   labels move to screen readers and the bar stays ~60px. */
	.tx-bar__form { display: flex; overflow-x: auto; scrollbar-width: none; gap: var(--o-s-2); padding-block: var(--o-s-2); }
	.tx-bar__form::-webkit-scrollbar { display: none; }
	.tx-bar__field { flex: 0 0 auto; }
	.tx-bar__field--q { flex: 0 0 min(62vw, 240px); }
	.tx-bar .o-field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
	.tx-mapbar { margin-block: 0 var(--o-s-3); }
	.tx .tx-mapbar__btn { width: 100%; justify-content: center; }
	.tx-map__canvas { height: 60vh; }

	.tx-results { padding-block: var(--o-s-4) var(--o-s-10); scroll-margin-top: calc(var(--o-header-h) + 64px); }
	.tx-results__head { margin-block-end: var(--o-s-3); gap: var(--o-s-2); }
	.tx-results__title { font-size: 1rem; }
	.tx-results__range { margin: 0; font-size: var(--o-fs-xs); }
	.tx-grid { grid-template-columns: minmax(0, 1fr); gap: var(--o-s-4); }
	.tx-card__title { min-height: 0; }

	.tx-prices .o-table th,
	.tx-prices .o-table td { padding-inline: var(--o-s-3); }
	.tx-advisor { padding: var(--o-s-5); box-shadow: none; }
}

/* Price guide links: name → city guide, count → filtered results. */
.tx .tx-prices__count { color: var(--o-brand-600); font-weight: 700; text-decoration: none; }
.tx .tx-prices__count:hover { text-decoration: underline; }

@media (max-width: 767px) {
	/* Four columns fit a phone without sideways scrolling; size is the least
	   decision-relevant figure, so it is the one that steps aside. */
	.tx-prices .o-table th:nth-child(5),
	.tx-prices .o-table td:nth-child(5) { display: none; }
	.tx-prices .o-table { font-size: 0.8125rem; }
	.tx-prices .o-table th,
	.tx-prices .o-table td { padding-inline: var(--o-s-2); }
	.tx-prices .o-table th:first-child,
	.tx-prices .o-table td:first-child { padding-inline-start: var(--o-s-4); }
}
