/* ============================================================
   PropTech public site — layout & page components
   Tokens live in app.css (:root). Flat colours only, no gradients.
   Breakpoints: 1280 standard · 1024 tablet-landscape · 768 tablet · 430 mobile
   ============================================================ */

.skip-link {
    position: absolute; left: -999px; top: 8px; z-index: 300;
    background: var(--color-primary); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { left: 8px; }

main { min-height: 60vh; }

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.site-header {
    --h-fg: var(--color-text);
    --h-brand: var(--color-primary);
    --h-solid: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--color-border), 0 8px 24px rgba(23,42,58,0.06); }

/* Overlay variant: transparent on top of the hero, solid after scrolling */
.site-header--overlay { position: fixed; left: 0; right: 0; }
.site-header--overlay:not(.is-scrolled) {
    --h-fg: #fff;
    --h-brand: #fff;
    --h-solid: var(--color-primary);
    background: transparent;
    border-bottom-color: transparent;
}

.site-header-inner { display: flex; align-items: center; gap: 2rem; height: 72px; }

.brand {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-family: var(--font-heading); font-weight: 800; font-size: 1.3rem;
    letter-spacing: -0.02em; color: var(--h-brand, var(--color-primary));
}
.brand:hover { text-decoration: none; }
.site-header--overlay:not(.is-scrolled) .brand-mark { background: var(--color-secondary); color: var(--color-primary); }
.brand--light { color: #fff; }
.brand--light .brand-mark { background: var(--color-secondary); color: var(--color-primary); }

.site-nav { display: flex; align-items: center; justify-content: center; gap: 1.75rem; flex: 1; }
.site-nav > a, .site-nav .mega-nav-trigger {
    position: relative; color: var(--h-fg); font-weight: 500; font-size: 0.95rem;
    padding: 0.4rem 0; transition: color 0.15s var(--ease);
}
.site-nav > a:hover, .site-nav .mega-nav-trigger:hover { color: var(--h-fg); text-decoration: none; }
.site-nav > a::after, .site-nav .mega-nav-trigger::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--color-accent); transform: scaleX(0); transform-origin: left; transition: transform 0.2s var(--ease);
}
.site-nav > a:hover::after, .site-nav > a.is-current::after, .site-nav .mega-nav-trigger:hover::after { transform: scaleX(1); }
.site-nav .mega-nav-trigger svg { width: 14px; height: 14px; }
.site-nav .mega-nav.is-open .mega-nav-trigger svg { transform: rotate(180deg); }
.site-nav .mega-panel { color: var(--color-text); }

.site-actions { display: flex; align-items: center; gap: 0.75rem; }
.site-actions form { margin: 0; }
.site-link {
    display: inline-flex; align-items: center; gap: 0.4rem; color: var(--h-fg);
    font-weight: 500; font-size: 0.95rem; padding: 0 0.5rem;
}
.site-link:hover { text-decoration: none; opacity: 0.8; }

.btn-nav { background: transparent; color: var(--h-fg); border-color: currentColor; }
.btn-nav:hover { background: var(--h-fg); color: var(--h-solid); border-color: var(--h-fg); }

.site-mobile-actions { display: none; margin-left: auto; gap: 0.25rem; }

/* ------------------------------------------------------------
   Mobile chrome: bottom nav + menu sheet
   ------------------------------------------------------------ */

.bottom-nav { display: none; }

.more-sheet-backdrop { display: none; position: fixed; inset: 0; background: rgba(23,42,58,0.5); z-index: 90; }
.more-sheet-backdrop.is-open { display: block; }
.more-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
    background: var(--color-surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 0.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    animation: pt-sheet 0.28s var(--ease);
}
@keyframes pt-sheet { from { transform: translateY(100%); } }
.more-sheet-handle { width: 40px; height: 4px; background: var(--color-border); border-radius: 999px; margin: 0 auto 0.75rem; }
.more-sheet a:not(.btn), .more-sheet button:not(.btn) {
    display: block; width: 100%; text-align: left; padding: 1rem 0.25rem; font-size: 1rem; font-weight: 500;
    color: var(--color-text); border: 0; background: none; border-bottom: 1px solid var(--color-border); cursor: pointer;
}
.more-sheet form { margin: 0; }

/* ------------------------------------------------------------
   Sections
   ------------------------------------------------------------ */

.section { padding: var(--space-9) 0; }
.section--white { background: var(--color-surface); }
.section--tint { background: var(--color-secondary-light); }
.section--tight { padding: var(--space-8) 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: var(--space-6); }
.section-head h2 { font-size: var(--text-2xl); margin: 0; letter-spacing: -0.02em; font-weight: 800; }
.section-head p { margin: 0.4rem 0 0; color: var(--color-text-muted); }
.section-head > a { font-weight: 600; color: var(--color-accent-dark); white-space: nowrap; display: inline-flex; align-items: center; gap: 0.35rem; }
.eyebrow {
    display: block; margin-bottom: 0.5rem; padding: 0; background: none; border-radius: 0;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-accent-dark);
}

/* ------------------------------------------------------------
   Home: hero + floating search
   ------------------------------------------------------------ */

.hero {
    position: relative; display: flex; align-items: center; color: #fff;
    min-height: clamp(560px, 78vh, 760px);
    padding: 140px 0 128px;
    background-color: var(--color-primary);
    background-image: var(--hero-bg-image, none);
    background-size: cover; background-position: center;
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(23,42,58,0.5); }
.hero-content { position: relative; max-width: 1240px; }
.hero .eyebrow { color: var(--color-secondary); margin-bottom: 1rem; }
.hero h1 {
    font-size: var(--text-4xl); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
    max-width: 14ch; margin-bottom: 1.1rem; text-shadow: 0 2px 24px rgba(0,0,0,0.25);
}
.hero p { font-size: var(--text-lg); max-width: 46ch; opacity: 0.95; margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,0.25); }

.hero-search-wrap { position: relative; z-index: 6; margin-top: -76px; }
.search-tabs { display: flex; gap: 0.25rem; padding-left: 0.25rem; }
.search-tab {
    padding: 0.7rem 1.4rem; font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; cursor: pointer;
    background: rgba(255,255,255,0.22); color: #fff; border: 0; border-radius: var(--radius) var(--radius) 0 0;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.search-tab:hover { background: rgba(255,255,255,0.32); }
.search-tab.is-active { background: var(--color-surface); color: var(--color-primary); box-shadow: inset 0 3px 0 var(--color-accent); }

.search-card {
    background: var(--color-surface); border-radius: 0 var(--radius-xl) var(--radius-xl) var(--radius-xl);
    border: 1px solid var(--color-border); box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr auto; align-items: stretch; gap: 0;
}
.search-card[hidden] { display: none; }
.search-card--agents { grid-template-columns: 1.5fr 1fr auto; }
.sf {
    position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.25rem;
    min-width: 0; cursor: pointer;
}
.sf + .sf::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--color-border); }
.sf .icon { color: var(--color-accent); flex-shrink: 0; }
.sf-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sf-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.02em; }
.sf select, .sf input {
    min-height: 0; padding: 0.15rem 1.4rem 0.15rem 0; border: 0; background: transparent; box-shadow: none;
    font-weight: 600; font-size: 0.95rem; color: var(--color-text); text-overflow: ellipsis; width: 100%;
    -webkit-appearance: none; appearance: none; cursor: pointer;
}
.sf input { cursor: text; padding-right: 0; }
.sf select { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right center; }
.sf select:focus, .sf input:focus { box-shadow: none; }
.sf:focus-within { background: var(--color-bg); border-radius: var(--radius); }
.search-card .btn { align-self: stretch; margin: 0.1rem; padding: 0 2rem; min-height: 56px; }

/* Trust strip */
.trust { padding: var(--space-8) 0 var(--space-6); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.trust-item { display: flex; gap: 1rem; padding: 0 1.5rem; align-items: flex-start; }
.trust-item + .trust-item { border-left: 1px solid var(--color-border); }
.trust-item:first-child { padding-left: 0; }
.trust-icon {
    flex-shrink: 0; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: var(--color-secondary-light); color: var(--color-accent);
}
.trust-item h3 { font-size: 1rem; margin: 0 0 0.2rem; }
.trust-item p { margin: 0; font-size: 0.875rem; color: var(--color-text-muted); line-height: 1.5; }

/* Card grids + mobile carousels */
.grid-cards { display: grid; gap: var(--space-5); }
.grid-cards--3 { grid-template-columns: repeat(3, 1fr); }
.grid-cards--4 { grid-template-columns: repeat(4, 1fr); }

/* Property-type tiles */
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-4); }
.type-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding: 1.5rem;
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); color: var(--color-text);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.type-tile:hover { border-color: var(--color-accent); transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.type-tile .type-icon {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; margin-bottom: 0.75rem;
    background: var(--color-secondary-light); color: var(--color-primary);
}
.type-tile strong { font-family: var(--font-heading); font-size: 1.05rem; }
.type-tile span { font-size: 0.85rem; color: var(--color-text-muted); }

/* Neighbourhood cards get more presence with the site layout */
.area-card { min-height: 170px; border-radius: var(--radius-lg); }

/* Why choose us */
.why { display: grid; grid-template-columns: 1fr 1fr; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); overflow: hidden; }
.why-media { background-size: cover; background-position: center; min-height: 380px; background-color: var(--color-primary); }
.why-body { padding: var(--space-8) var(--space-8); display: flex; flex-direction: column; justify-content: center; }
.why-body h2 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; }
.why-body p { color: var(--color-text-muted); max-width: 46ch; }
.why-stats { display: flex; gap: var(--space-7); margin: var(--space-4) 0 var(--space-5); }
.why-stat strong { display: block; font-family: var(--font-heading); font-size: 2rem; font-weight: 800; color: var(--color-primary); line-height: 1.1; }
.why-stat span { font-size: 0.85rem; color: var(--color-text-muted); }

/* Closing CTA */
.cta { background: var(--color-primary); color: #fff; text-align: center; padding: var(--space-10) 0; position: relative; }
.cta::before { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; background: var(--color-secondary); margin: 0 auto var(--space-5); }
.cta h2 { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 0.75rem; color: #fff; }
.cta p { color: rgba(255,255,255,0.8); max-width: 48ch; margin: 0 auto var(--space-6); }
.cta-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.btn-on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-on-dark:hover { background: #fff; color: var(--color-primary); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.site-footer { background: var(--color-primary); color: rgba(255,255,255,0.72); border: 0; margin-top: 0; padding: var(--space-9) 0 var(--space-5); font-size: 0.9rem; }
.site-footer a { color: rgba(255,255,255,0.72); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-7); }
.footer-about p { margin-top: 1rem; max-width: 38ch; }
.footer-col summary {
    list-style: none; font-family: var(--font-heading); font-weight: 700; color: #fff; margin-bottom: 0.9rem;
    pointer-events: none; cursor: default;
}
.footer-col summary::-webkit-details-marker { display: none; }
.footer-col a { display: block; padding: 0.3rem 0; }
.footer-bottom { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid rgba(255,255,255,0.14); font-size: 0.82rem; }

/* ------------------------------------------------------------
   Promo banner (agents CTA strip) — refined
   ------------------------------------------------------------ */

.promo-banner { border-radius: var(--radius-xl); }
.promo-banner-inner { min-height: 200px; padding: var(--space-7) var(--space-5); }
.promo-banner h2 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; color: #fff; }

/* ------------------------------------------------------------
   Search results page
   ------------------------------------------------------------ */

.page-head { padding: var(--space-6) 0 var(--space-5); }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.page-head .count { color: var(--color-text-muted); margin-top: 0.25rem; }
.head-tools { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.head-tools select { min-height: 44px; width: auto; padding-right: 2rem; }

.seg { display: inline-flex; padding: 3px; background: #eeece7; border-radius: var(--radius); }
.seg button {
    display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; padding: 0 1rem; border: 0; border-radius: 8px;
    background: transparent; font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--color-text-muted); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow); }

.search-body { display: grid; grid-template-columns: 296px 1fr; gap: var(--space-6); align-items: start; padding-bottom: var(--space-9); }
.filters {
    position: sticky; top: 88px; background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: var(--space-5); max-height: calc(100vh - 108px); overflow-y: auto;
}
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.filters-head h2 { font-size: 1.1rem; margin: 0; }
.filters-close { display: none; }
.filter-group { padding: var(--space-4) 0; border-top: 1px solid var(--color-border); }
.filter-group:first-of-type { border-top: 0; padding-top: 0; }
.filter-group > label, .filter-group > .fg-title, .filter-group summary {
    display: block; font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; margin-bottom: 0.65rem; color: var(--color-primary);
}
.filter-group summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group[open] summary { margin-bottom: 0.65rem; }
.filter-group .field { margin-bottom: 0.65rem; }
.filter-group .field label { font-size: 0.8rem; font-weight: 500; color: var(--color-text-muted); }
.filter-group select, .filter-group input[type="number"] { min-height: 44px; }
.filter-row { display: flex; gap: 0.5rem; }
.filter-row > * { flex: 1; min-width: 0; }
.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; }
.check-list label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 400; margin: 0; cursor: pointer; }
.filters-actions { display: flex; gap: 0.5rem; margin-top: var(--space-3); }
.filters-actions .btn { flex: 1; }
.chip-group .chip { min-height: 40px; padding: 0 0.9rem; font-size: 0.85rem; }

.results { min-width: 0; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.results-sponsored { margin-bottom: var(--space-6); }
.results-sponsored h2 { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.map-pane { display: none; }

/* Map view: split screen */
.search-body[data-view="map"] .results-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--space-5); align-items: start; }
.search-body[data-view="map"] .results-grid { grid-template-columns: 1fr; }
.search-body[data-view="map"] .map-pane { display: block; position: sticky; top: 88px; height: calc(100vh - 108px); }
.search-body[data-view="map"] #search-map { height: 100%; border-radius: var(--radius-lg); }
.search-body[data-view="map"] .results-sponsored { display: none; }

.price-pin {
    background: var(--color-primary); color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 0.78rem;
    padding: 0.3rem 0.6rem; border-radius: 999px; border: 2px solid #fff; box-shadow: var(--shadow-lg); cursor: pointer; white-space: nowrap;
    transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.price-pin:hover, .price-pin.is-hot { background: var(--color-accent); transform: scale(1.12); }
.map-preview { width: 220px; }
.map-preview img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; margin-bottom: 0.5rem; }
.map-preview strong { display: block; font-family: var(--font-heading); }

.empty-state { background: var(--color-surface); border: 1px dashed #d5d2ca; border-radius: var(--radius-lg); padding: var(--space-9) var(--space-5); }
.empty-state .empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--color-secondary-light); color: var(--color-accent); margin: 0 auto var(--space-4); }
.empty-state h3 { font-size: var(--text-xl); }

.filter-backdrop { display: none; }
.only-mobile { display: none; }
.listing-card.is-hot { border-color: var(--color-accent); box-shadow: var(--shadow-lg); }
@media (max-width: 900px) { .only-mobile { display: inline-flex; } }

/* ------------------------------------------------------------
   Property detail page
   ------------------------------------------------------------ */

.detail-top { padding: var(--space-5) 0 0; }

.gallery-grid {
    position: relative; display: grid; gap: 8px; height: 500px; border-radius: var(--radius-xl); overflow: hidden;
    grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr;
}
.gallery-grid .g-item { position: relative; display: block; padding: 0; border: 0; background: var(--color-border); cursor: zoom-in; overflow: hidden; }
.gallery-grid .g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.gallery-grid .g-item:hover img { transform: scale(1.04); }
.gallery-grid .g-item:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }
.gallery-grid .g-item:nth-child(1) { grid-row: 1 / span 2; }
.gallery-grid .g-item:nth-child(n+6) { display: none; }
.gallery-grid[data-count="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.gallery-grid[data-count="2"] { grid-template-columns: 2fr 1fr; }
.gallery-grid[data-count="2"] .g-item:nth-child(2) { grid-row: 1 / span 2; }
.gallery-grid[data-count="3"] { grid-template-columns: 2fr 1fr; }
.gallery-grid[data-count="4"] { grid-template-columns: 2fr 1fr 1fr; }
.gallery-grid[data-count="4"] .g-item:nth-child(4) { grid-column: 2 / span 2; }
.gallery-all {
    position: absolute; right: 16px; bottom: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 0.5rem;
    min-height: 44px; padding: 0 1rem; background: var(--color-surface); color: var(--color-primary); border: 0; border-radius: var(--radius);
    font-family: var(--font-heading); font-weight: 700; font-size: 0.875rem; cursor: pointer; box-shadow: var(--shadow-lg);
}
.gallery-all:hover { background: var(--color-bg); }
.gallery-count { display: none; }
.gallery-overlay { display: none; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-8); padding: var(--space-6) 0 var(--space-9); align-items: start; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); flex-wrap: wrap; }
.detail-badges { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.detail-head h1 { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 0.5rem; }
.detail-location { display: flex; align-items: center; gap: 0.4rem; color: var(--color-text-muted); margin: 0; }
.detail-location .icon { color: var(--color-accent); }
.detail-price { text-align: right; }
.detail-price strong { display: block; font-family: var(--font-heading); font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.03em; color: var(--color-primary); line-height: 1.1; }
.detail-price small { color: var(--color-text-muted); font-size: 0.9rem; }

.detail-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; margin: var(--space-6) 0;
    background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden;
}
.detail-stat { background: var(--color-surface); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.detail-stat .icon { color: var(--color-accent); margin-bottom: 0.35rem; }
.detail-stat strong { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 800; color: var(--color-primary); }
.detail-stat span { font-size: 0.8rem; color: var(--color-text-muted); }

.detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: var(--space-2); }

.detail-section { padding: var(--space-6) 0; border-top: 1px solid var(--color-border); }
.detail-section h2 { font-size: var(--text-xl); font-weight: 800; margin-bottom: var(--space-4); }
.detail-desc { white-space: pre-line; color: var(--color-text); line-height: 1.75; margin: 0; }

.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 var(--space-7); margin: 0; }
.spec-grid > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--color-border); }
.spec-grid dt { color: var(--color-text-muted); }
.spec-grid dd { margin: 0; font-weight: 600; text-align: right; }

.amenity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem var(--space-5); list-style: none; margin: 0; padding: 0; }
.amenity-grid li { display: flex; align-items: center; gap: 0.6rem; }
.amenity-grid .icon { color: var(--color-success); flex-shrink: 0; }

.detail-aside { position: sticky; top: 96px; display: grid; gap: var(--space-4); }
.enquiry { padding: var(--space-5); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.agent-mini { display: flex; align-items: center; gap: 0.9rem; margin-bottom: var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.avatar {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    background: var(--color-primary); color: var(--color-secondary); font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-mini strong { display: block; font-family: var(--font-heading); }
.agent-mini span { font-size: 0.85rem; color: var(--color-text-muted); }
.enquiry h2 { font-size: var(--text-lg); margin-bottom: var(--space-4); }
.contact-alt { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: var(--space-3); }
.contact-alt .btn { min-height: 44px; }

.action-bar { display: none; }

.lightbox-v {
    position: fixed; inset: 0; z-index: 400; background: rgba(15,28,40,0.96); display: none; flex-direction: column; color: #fff;
}
.lightbox-v.is-open { display: flex; }
.lv-top { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; }
.lv-count { font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem; opacity: 0.85; }
.lv-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.12); color: #fff; cursor: pointer; }
.lv-btn:hover { background: rgba(255,255,255,0.22); }
.lv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 64px; overflow: auto; }
.lv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; transition: transform 0.25s var(--ease); border-radius: 6px; }
.lv-stage img.is-zoomed { transform: scale(2); cursor: zoom-out; }
.lv-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lv-prev { left: 12px; } .lv-next { right: 12px; }
.lv-thumbs { display: flex; gap: 8px; padding: 0.75rem 1rem 1rem; overflow-x: auto; justify-content: center; }
.lv-thumbs button { flex: 0 0 auto; width: 76px; height: 56px; border: 2px solid transparent; border-radius: 8px; padding: 0; overflow: hidden; opacity: 0.55; cursor: pointer; background: none; }
.lv-thumbs button.is-active { opacity: 1; border-color: var(--color-accent); }
.lv-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
    .grid-cards--4 { grid-template-columns: repeat(2, 1fr); }
    .type-grid { grid-template-columns: repeat(3, 1fr); }
    .results-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); }
    .site-nav { gap: 1.25rem; }
    .site-header-inner { gap: 1.25rem; }
}

@media (max-width: 900px) {
    /* Header collapses to logo + search + menu; bottom nav takes over */
    .site-nav, .site-actions { display: none; }
    .site-mobile-actions { display: flex; }
    .site-header-inner { height: 60px; }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        background: var(--color-surface); border-top: 1px solid var(--color-border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .bottom-nav-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
        min-height: 60px; color: var(--color-text-muted); font-size: 0.7rem; font-weight: 600; text-decoration: none;
    }
    .bottom-nav-item:hover { text-decoration: none; }
    .bottom-nav-item.is-active { color: var(--color-accent-dark); }

    .hero { padding: 104px 0 110px; min-height: 500px; }
    .hero h1 { font-size: 2.4rem; }
    .hero p { font-size: 1rem; }

    /* Search becomes a compact stacked card */
    .hero-search-wrap { margin-top: -64px; }
    .search-card, .search-card--agents { grid-template-columns: 1fr; padding: 0.5rem; }
    .sf { padding: 0.55rem 0.9rem; min-height: 56px; }
    .sf + .sf { border-top: 1px solid var(--color-border); }
    .sf + .sf::before { display: none; }
    .search-card .btn { margin: 0.5rem 0.25rem 0.25rem; min-height: 52px; }

    .trust-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5) 0; }
    .trust-item:nth-child(3) { border-left: 0; padding-left: 0; }
    .section { padding: var(--space-8) 0; }
    .section-head h2 { font-size: var(--text-xl); }
    .why { grid-template-columns: 1fr; }
    .why-media { min-height: 240px; }
    .why-body { padding: var(--space-6) var(--space-5); }
    .footer-grid { grid-template-columns: 1fr; gap: 0; }
    .footer-about { margin-bottom: var(--space-5); }
    .footer-col { border-top: 1px solid rgba(255,255,255,0.14); padding: 0.25rem 0; }
    .footer-col summary { pointer-events: auto; cursor: pointer; display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 0.9rem 0; }
    .footer-col summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; }
    .footer-col[open] summary::after { content: "–"; }
    .footer-col[open] { padding-bottom: 0.75rem; }
    .site-footer { padding-bottom: var(--space-6); }

    /* Filters become a bottom sheet */
    .search-body { grid-template-columns: 1fr; }
    .filters {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 95; max-height: 90vh; height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0; border: 0; padding: 0; display: none; flex-direction: column;
        overflow: hidden; animation: pt-sheet 0.28s var(--ease);
    }
    .filters.is-open { display: flex; }
    .filters form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
    .filters-head { padding: var(--space-4) var(--space-5); margin: 0; border-bottom: 1px solid var(--color-border); }
    .filters-close { display: grid; }
    .filters-scroll { overflow-y: auto; padding: var(--space-4) var(--space-5); flex: 1; }
    .filters-actions { position: sticky; bottom: 0; margin: 0; padding: var(--space-3) var(--space-5) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); background: var(--color-surface); border-top: 1px solid var(--color-border); }
    .filter-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 94; background: rgba(23,42,58,0.5); }
    .results-grid { grid-template-columns: repeat(2, 1fr); }
    .search-body[data-view="map"] .results-wrap { display: block; }
    .search-body[data-view="map"] .results-pane { display: none; }
    .search-body[data-view="map"] .map-pane { position: relative; top: 0; height: calc(100vh - 220px); min-height: 420px; }

    /* Detail: swipeable gallery + sticky action bar */
    .detail-top { padding-top: 0; }
    .detail-top .container { padding: 0; }
    .detail-top .breadcrumbs { display: none; }
    .gallery-grid {
        display: flex; height: auto; border-radius: 0; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .gallery-grid::-webkit-scrollbar { display: none; }
    .gallery-grid .g-item, .gallery-grid .g-item:nth-child(n+6) { display: block; flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: start; }
    .gallery-all { display: none; }
    .gallery-count {
        display: block; position: absolute; right: 12px; bottom: 12px; z-index: 3; padding: 0.3rem 0.7rem; border-radius: 999px;
        background: rgba(23,42,58,0.78); color: #fff; font-size: 0.8rem; font-weight: 600; pointer-events: none;
    }
    .gallery-wrap { position: relative; }
    .gallery-overlay { display: flex; justify-content: space-between; position: absolute; top: 12px; left: 12px; right: 12px; z-index: 4; }
    .gallery-overlay .icon-btn { background: rgba(255,255,255,0.94); color: var(--color-primary); box-shadow: var(--shadow); }
    .gallery-overlay .icon-btn:hover { background: #fff; }
    .gallery-overlay div { display: flex; gap: 0.5rem; }
    .detail-layout { grid-template-columns: 1fr; padding-top: var(--space-5); }
    .detail-aside { position: static; }
    .detail-head h1 { font-size: var(--text-2xl); }
    .detail-price { text-align: left; }
    .detail-price strong { font-size: var(--text-2xl); }
    .detail-actions { display: none; }
    body.has-action-bar { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
    body.has-action-bar .bottom-nav { display: none; }
    .action-bar {
        display: flex; gap: 0.5rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        background: var(--color-surface); border-top: 1px solid var(--color-border);
    }
    .action-bar .btn { flex: 1; }
    .action-bar .btn-secondary { flex: 0 0 auto; }
    .lv-stage { padding: 0; }
    .lv-nav { display: none; }
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .grid-cards--3 { grid-template-columns: repeat(2, 1fr); }
    .spec-grid { grid-template-columns: 1fr; }
    .amenity-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .hero h1 { font-size: 2.1rem; max-width: 12ch; }
    .hero { min-height: 460px; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .trust-grid { grid-template-columns: 1fr; gap: var(--space-4); }
    .trust-item, .trust-item + .trust-item { border-left: 0; padding: 0; }
    .type-grid { grid-template-columns: repeat(2, 1fr); }
    .results-grid { grid-template-columns: 1fr; }
    .why-stats { gap: var(--space-5); }
    .cta { padding: var(--space-9) 0; }
    .cta h2 { font-size: var(--text-2xl); }
    .cta-actions .btn { width: 100%; }

    /* Card grids become horizontal, swipeable carousels */
    .grid-cards--3, .grid-cards--4 {
        display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0.75rem;
        margin: 0 -1rem; padding: 0 1rem 0.5rem; scrollbar-width: none;
    }
    .grid-cards--3::-webkit-scrollbar, .grid-cards--4::-webkit-scrollbar { display: none; }
    .grid-cards--3 > *, .grid-cards--4 > * { flex: 0 0 82%; scroll-snap-align: start; }
    .grid-cards--stack { display: grid; margin: 0; padding: 0; overflow: visible; }
    .grid-cards--stack > * { flex: none; }

    .listing-card-body { padding: 1rem; }
    .contact-alt { grid-template-columns: 1fr; }
}

@media (min-width: 1440px) {
    :root { --container-width: 1320px; }
}

/* ============================================================
   Account area
   ============================================================ */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.account { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--space-7); padding: var(--space-7) 0 var(--space-10); align-items: start; }
.account-nav { position: sticky; top: 96px; display: grid; gap: var(--space-4); }
.account-me { display: flex; align-items: center; gap: 0.85rem; padding: 1rem; border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text); }
.account-me:hover, .account-me.is-active { text-decoration: none; border-color: var(--color-accent); }
.account-me strong { display: block; font-family: var(--font-heading); line-height: 1.2; }
.account-me small { display: block; color: var(--color-text-muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.account-nav nav { display: grid; gap: 2px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 0.4rem; }
.account-link { display: flex; align-items: center; gap: 0.7rem; min-height: 48px; padding: 0 0.85rem; border-radius: var(--radius); color: var(--color-text); font-weight: 500; }
.account-link span:not(.count-pill) { flex: 1; }
.account-link .icon { color: var(--color-text-muted); }
.account-link .chev { display: none; }
.account-link:hover { background: var(--color-bg); text-decoration: none; }
.account-link.is-active { background: var(--color-primary); color: #fff; }
.account-link.is-active .icon { color: var(--color-secondary); }

.account-back { display: none; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; font-weight: 600; font-size: 0.9rem; color: var(--color-text-muted); }
.account-back--always { display: inline-flex; }

.account-head { margin-bottom: var(--space-5); }
.account-head h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.25rem; }
.account-head p { margin: 0; color: var(--color-text-muted); }
.account-head--row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.account-head--row h1 { margin: 0; }
.account-sub { font-size: 1.05rem; margin: var(--space-6) 0 var(--space-3); }
.account-tabs { margin-bottom: var(--space-5); }

.account-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.account-tile { display: flex; align-items: center; gap: 0.9rem; padding: 1.15rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); color: var(--color-text); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.account-tile:hover { border-color: var(--color-accent); transform: translateY(-2px); text-decoration: none; }
.account-tile > .icon:last-child { color: var(--color-text-muted); }
.account-tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--color-secondary-light); color: var(--color-primary); flex-shrink: 0; }
.account-tile-body { flex: 1; min-width: 0; }
.account-tile-body strong { display: block; font-family: var(--font-heading); }
.account-tile-body span { font-size: 0.85rem; color: var(--color-text-muted); }
.account-cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: var(--space-6); padding: 1.5rem; background: var(--color-primary); color: #fff; border-radius: var(--radius-lg); }
.account-cta strong { display: block; font-family: var(--font-heading); font-size: 1.1rem; }
.account-cta span { color: rgba(255,255,255,0.75); font-size: 0.9rem; }

.results-grid--account { grid-template-columns: repeat(2, 1fr); }

.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.account-list > li, .account-list-link { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.account-list--links > li { padding: 0; }
.account-list-link { width: 100%; border: 0; color: var(--color-text); }
.account-list-link:hover { background: var(--color-bg); text-decoration: none; }
.account-list-link.is-unread { background: var(--color-accent-light); }
.account-list-main { flex: 1; min-width: 0; }
.account-list-main strong { display: block; font-family: var(--font-heading); }
.account-list-main span { display: block; color: var(--color-text-muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; }
.account-list-main small { display: block; color: var(--color-text-muted); font-size: 0.78rem; margin-top: 0.15rem; }
.account-list-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.account-list-actions form { margin: 0; }
.date-tile { display: grid; place-items: center; width: 54px; height: 58px; border-radius: 12px; background: var(--color-secondary-light); color: var(--color-primary); flex-shrink: 0; line-height: 1.1; }
.date-tile b { font-family: var(--font-heading); font-size: 1.35rem; }
.date-tile span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.note-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--color-secondary-light); color: var(--color-primary); flex-shrink: 0; }
.account-list-link.is-unread .note-icon { background: var(--color-accent); color: #fff; }

.thread { display: grid; gap: 0.75rem; margin-bottom: var(--space-5); }
.bubble { max-width: 82%; padding: 0.85rem 1.1rem; border-radius: 16px; }
.bubble p { margin: 0 0 0.3rem; white-space: pre-line; }
.bubble small { font-size: 0.75rem; opacity: 0.7; }
.bubble--me { justify-self: end; background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble--agent { justify-self: start; background: var(--color-surface); border: 1px solid var(--color-border); border-bottom-left-radius: 4px; }
.thread-reply { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1rem; }

.account-form { margin-bottom: var(--space-5); }
.account-form h2 { font-size: 1.15rem; margin-bottom: var(--space-4); }

@media (max-width: 900px) {
    .account { grid-template-columns: 1fr; padding-top: var(--space-5); gap: var(--space-4); }
    /* Mobile: the account home is a clean list menu; sub-pages get a back link instead of the menu */
    .account-nav { position: static; }
    body.account-sub .account-nav { display: none; }
    body.account-sub .account-back { display: inline-flex; }
    body.account-page:not(.account-sub) .account-tiles { display: none; }
    .account-link { min-height: 56px; }
    .account-link .chev { display: block; color: var(--color-text-muted); }
    .account-tiles { grid-template-columns: 1fr 1fr; }
    .results-grid--account { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .results-grid--account { grid-template-columns: 1fr; }
    .account-list > li { flex-wrap: wrap; }
    .account-list-actions { width: 100%; justify-content: flex-end; }
    .bubble { max-width: 92%; }
}

/* Save search + viewing scheduler */
.save-search { position: relative; }
.save-search > summary { list-style: none; cursor: pointer; }
.save-search > summary::-webkit-details-marker { display: none; }
.save-search-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 320px; padding: 1rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.save-search-pop .field { margin-bottom: 0.75rem; }
@media (max-width: 640px) { .save-search-pop { position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; width: auto; } }

dialog.sheet { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; }
dialog.sheet::backdrop { background: rgba(23,42,58,0.55); }
.sheet-inner { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; background: var(--color-surface); border-radius: var(--radius-xl); padding: var(--space-6); box-shadow: var(--shadow-lg); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: var(--space-4); }
.sheet-head h2 { font-size: 1.25rem; margin: 0 0 0.15rem; }
.sheet-head p { margin: 0; font-size: 0.875rem; color: var(--color-text-muted); }
.vw-steps { display: flex; gap: 6px; margin-bottom: var(--space-5); }
.vw-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--color-border); }
.vw-steps i.on { background: var(--color-accent); }
.vw-step[hidden] { display: none; }
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: var(--space-3); }
.day-btn { display: grid; place-items: center; gap: 0; min-height: 64px; padding: 0.4rem 0; background: var(--color-surface); border: 1px solid #d5d2ca; border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--color-text); }
.day-btn small { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.day-btn b { font-family: var(--font-heading); font-size: 1.1rem; }
.day-btn:hover { border-color: var(--color-primary); }
.day-btn[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.day-btn[aria-pressed="true"] small { color: rgba(255,255,255,0.75); }
.day-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); font-weight: 600; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot-btn { min-height: 48px; border: 1px solid #d5d2ca; border-radius: var(--radius); background: var(--color-surface); font: inherit; font-weight: 600; cursor: pointer; color: var(--color-text); }
.slot-btn:hover:not(:disabled) { border-color: var(--color-primary); }
.slot-btn[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.slot-btn:disabled { color: #a8a59c; background: var(--color-bg); text-decoration: line-through; cursor: not-allowed; }
.vw-actions { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: var(--space-5); }
.vw-done { text-align: center; padding: var(--space-4) 0; }
.vw-done .empty-icon { background: var(--color-success-light); color: var(--color-success); }
.vw-summary { text-align: left; margin: var(--space-4) 0; border: 1px solid var(--color-border); border-radius: var(--radius); }
.vw-summary div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; }
.vw-summary div:last-child { border-bottom: 0; }
.vw-summary dt { color: var(--color-text-muted); } .vw-summary dd { margin: 0; font-weight: 600; text-align: right; }
@media (max-width: 640px) {
    .sheet-inner { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: pt-sheet 0.28s var(--ease); }
}

.save-toggle.is-saved { border-color: var(--color-accent); color: var(--color-accent-dark); }
.save-toggle.is-saved svg, .save-icon.is-saved svg { fill: var(--color-accent); color: var(--color-accent); }
.save-icon.is-saved { color: var(--color-accent); }
