/* Property dealer public website. Mobile first; wider layouts at 640px / 900px. */
:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --brand-soft: #e6f4f1;
    --text: #1d2433;
    --muted: #667085;
    --line: #e4e7ec;
    --bg: #f5f6f8;
    --card: #ffffff;
    --orange: #b54708;
    --orange-soft: #fff4e5;
    --green: #067647;
    --green-soft: #ecfdf3;
    --red: #b42318;
    --red-soft: #fef3f2;
    --wa: #1fae54;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    padding-bottom: 72px; /* room for the mobile bottom bar */
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .8em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; margin-top: 16px; }
.pre-line { white-space: pre-line; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-light { background: #fff; color: var(--brand); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-link { background: none; color: var(--brand); padding-left: 0; padding-right: 0; }
.badge { background: var(--brand); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 7px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none !important; }
.brand svg { width: 28px; height: 28px; fill: var(--brand); flex: none; }
.nav-toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 60px;
    flex-direction: column; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .06);
}
.site-nav.open { display: flex; }
.site-nav a:not(.btn) { padding: 12px 4px; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--line); }
.site-nav a.active { color: var(--brand); }
.site-nav .btn { margin-top: 8px; }

@media (min-width: 900px) {
    .nav-toggle { display: none; }
    .site-nav { display: flex; position: static; flex-direction: row; align-items: center; gap: 24px; padding: 0; border: 0; box-shadow: none; }
    .site-nav a:not(.btn) { padding: 0; border: 0; }
    .site-nav .btn { margin: 0; }
}

/* Alerts */
.alert { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-error { background: var(--red-soft); color: var(--red); margin: 0 0 16px; }
.alert-warn { background: var(--orange-soft); color: var(--orange); margin: 0 0 16px; }

/* Hero + search */
.hero { background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%); color: #fff; padding: 40px 0 48px; }
.hero h1 { font-size: 1.75rem; }
.hero-sub { opacity: .85; }
.search-box { background: #fff; color: var(--text); border-radius: 14px; padding: 12px; margin-top: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.search-fields { display: grid; gap: 8px; margin-top: 10px; }
@media (min-width: 640px) { .hero { padding: 64px 0 72px; } .hero h1 { font-size: 2.4rem; } }
@media (min-width: 900px) { .search-fields { grid-template-columns: 1fr 1fr 1.4fr auto; } }

/* Form controls */
input, select, textarea {
    width: 100%; font: inherit; color: var(--text); background: #fff;
    min-height: 44px; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field { margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; padding: 0; }
.field-row { display: grid; gap: 0 12px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.hint { display: block; color: var(--brand); font-weight: 600; min-height: 1.2em; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.check input { width: auto; min-height: 0; }

.segmented { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 4px; gap: 4px; }
.segmented-block { display: flex; width: 100%; margin-bottom: 14px; }
.segmented-block label { flex: 1; }
.segmented label, .check-chips label { position: relative; }
.segmented input, .check-chips input { position: absolute; inset: 0; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 8px 18px; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--muted); }
.segmented input:checked + span { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); }

.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chips span { display: inline-block; padding: 7px 12px; border: 1px solid #d0d5dd; border-radius: 99px; font-size: .9rem; cursor: pointer; background: #fff; }
.check-chips input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.check-chips input:focus-visible + span { outline: 2px solid var(--brand); }

/* Sections, cards, grid */
.page { padding-top: 20px; padding-bottom: 32px; }
.page-head { margin-bottom: 16px; }
.section { padding-top: 24px; padding-bottom: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none !important; }
.pad { padding: 16px; margin-bottom: 12px; }
.card-heading { font-size: 1.05rem; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.property-card { overflow: hidden; transition: box-shadow .15s, transform .15s; }
.property-card:hover { box-shadow: 0 8px 24px rgba(16, 24, 40, .1); transform: translateY(-2px); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #eef1f4; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px 14px; }
.card-title { font-size: 1rem; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-size: 1.3rem; font-weight: 800; }
.specs { font-size: .9rem; margin-top: 4px; }
.placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.placeholder svg { width: 30%; max-width: 90px; fill: #b8c0cc; }

.tag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; color: #fff; }
.tag-featured { left: auto; right: 10px; background: #f59e0b; }
.tag-sale, .tag-inline.tag-sale { background: var(--brand); }
.tag-rent, .tag-inline.tag-rent { background: #4f46e5; }
.tag-inline { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.chip-orange { background: var(--orange-soft); color: var(--orange); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-grey { background: #f2f4f7; color: #475467; }

/* Call to action + features */
.cta { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; background: var(--brand); color: #fff; border-radius: 16px; padding: 24px; margin: 16px 0; }
.cta p { opacity: .9; margin: 0; }
@media (min-width: 900px) { .cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px; } }
.features { display: grid; gap: 16px; }
.features > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.features h3 { font-size: 1.05rem; margin-top: 8px; }
.features p { color: var(--muted); margin: 0; }
.feature-icon { font-size: 1.5rem; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, 1fr); } }

/* Listing page */
.listing-layout { display: grid; gap: 20px; }
.filters { display: none; }
.filters.open { display: block; }
.filters form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.filters-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.sort-form select { min-height: 36px; padding: 6px 10px; width: auto; }
@media (min-width: 900px) {
    .listing-layout { grid-template-columns: 280px 1fr; align-items: start; }
    .filters { display: block; position: sticky; top: 76px; }
    .filters-toggle { visibility: hidden; }
    .listing-main .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1150px) { .listing-main .grid { grid-template-columns: repeat(3, 1fr); } }
.empty { background: #fff; border: 1px dashed #d0d5dd; border-radius: var(--radius); padding: 32px 20px; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0 0; }
.page-link { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; }
.page-link.disabled { color: #98a2b3; }
.page-info { color: var(--muted); font-size: .9rem; }

/* Property detail */
.breadcrumb { font-size: .875rem; color: var(--muted); margin-bottom: 12px; }
.detail-layout { display: grid; gap: 16px; }
@media (min-width: 900px) {
    .detail-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
    .sticky { position: sticky; top: 76px; }
}
.detail-title { font-size: 1.35rem; margin-top: 10px; }
.detail-price { font-size: 1.8rem; font-weight: 800; }
.detail-price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; }
@media (min-width: 640px) { .specs-grid { grid-template-columns: repeat(3, 1fr); } }
.specs-grid dt { font-size: .8rem; color: var(--muted); }
.specs-grid dd { margin: 0; font-weight: 600; }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

.gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: #eef1f4; margin-bottom: 12px; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; }
@media (min-width: 900px) { .gallery-track img { aspect-ratio: 16 / 10; } }
.gallery-empty { aspect-ratio: 16 / 9; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); font-size: 1.5rem; cursor: pointer; box-shadow: var(--shadow); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff; padding: 2px 10px; border-radius: 99px; font-size: .8rem; }

/* Account, auth, contact */
.auth { max-width: 440px; }
.auth h1 { margin-bottom: 4px; }
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.contact-grid { display: grid; gap: 12px; margin-bottom: 8px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-item { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.contact-item > span { font-size: 1.6rem; }

/* Footer + mobile bottom bar */
.site-footer { background: #101828; color: #d0d5dd; margin-top: 40px; padding: 32px 0 16px; }
.site-footer a { color: #d0d5dd; display: block; padding: 3px 0; }
.site-footer strong { color: #fff; display: block; margin-bottom: 6px; }
.footer-grid { display: grid; gap: 24px; }
.footer-brand { font-size: 1.1rem; }
.footer-bottom { border-top: 1px solid #344054; margin-top: 24px; padding-top: 16px; font-size: .85rem; color: #98a2b3; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

.bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line);
}
.bottom-bar .btn { flex: 1; }
@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .bottom-bar { display: none; }
}
