/* =========================================================================
   2D.imóveis — design system
   Tokens extraídos do bundle Palmier original (v2, 18/07) para preservar a
   identidade já aprovada: Sora, tinta #282828, acento lima #cbd77e, ouro #f4c079.
   Layout único responsivo (o original tinha duas árvores desktop/mobile).
   ========================================================================= */

:root {
  --ink: #282828;
  --ink-soft: #4a4a4a;
  --body: #5c5f56;
  --muted: #a2a598;
  --muted-2: #a9ac9f;
  --lime: #cbd77e;
  --lime-ink: #33380f;
  --lime-soft: #eaeede;
  --lime-bg: #eef1e2;
  --olive: #5c6427;
  --gold: #f4c079;
  --bg: #faf9f5;
  --bg-2: #f7f7f7;
  --surface: #fff;
  --line: #eef0ea;
  --line-2: #f0f0ec;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 2px 10px rgba(40, 40, 40, .03);
  --shadow-lg: 0 16px 40px rgba(40, 40, 40, .2);
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
/* Toda foto vive dentro de <picture> (AVIF + fallback WebP). O elemento é inline
   por padrão, o que impediria o <img> de preencher containers de altura fixa. */
picture { display: block; }
.card-ph picture, .gal picture, .strip picture, .hero > picture { width: 100%; height: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo svg { flex-shrink: 0; }
.logo-txt { font-size: 24px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); white-space: nowrap; }
.logo-txt span { font-weight: 500; color: var(--ink-soft); }
.nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.navlink { font-size: 15px; font-weight: 500; color: var(--ink-soft); transition: color .15s; }
.navlink:hover, .navlink[aria-current="page"] { color: var(--ink); }
.btn-wa {
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 11px 20px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s;
}
.btn-wa:hover { transform: translateY(-1px); }
.nav-toggle { display: none; margin-left: auto; padding: 8px; border-radius: 10px; }

@media (max-width: 860px) {
  .nav {
    position: fixed; inset: 64px 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 24px 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08); display: none;
  }
  .nav.open { display: flex; }
  .nav .navlink { padding: 14px 0; border-bottom: 1px solid var(--line-2); font-size: 16px; }
  .nav .btn-wa { margin-top: 14px; justify-content: center; padding: 14px 20px; font-size: 15px; }
  .nav-toggle { display: block; }
  .logo-txt { font-size: 20px; }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: min(88vh, 760px); display: flex; align-items: flex-end; }
.hero > picture { position: absolute; inset: 0; }
.hero > picture img { width: 100%; height: 100%; object-fit: cover; }
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40,40,40,.15) 0%, rgba(40,40,40,.35) 45%, rgba(40,40,40,.82) 100%);
}
.hero-in { position: relative; max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 0 24px 64px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(203,215,126,.95); color: var(--lime-ink);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  padding: 8px 16px; border-radius: 30px; margin-bottom: 22px;
}
.hero h1 {
  color: #fff; font-size: clamp(32px, 5.6vw, 62px); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.05; max-width: 16ch; text-wrap: balance;
}
.hero p {
  color: rgba(255,255,255,.85); font-size: clamp(15px, 1.6vw, 19px);
  max-width: 52ch; margin-top: 20px; line-height: 1.55;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.cta-1 { background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; padding: 16px 30px; border-radius: var(--radius-sm); }
.cta-2 {
  background: rgba(255,255,255,.14); border: 1.5px solid rgba(255,255,255,.5); color: #fff;
  font-size: 16px; font-weight: 600; padding: 16px 30px; border-radius: var(--radius-sm); backdrop-filter: blur(4px);
}
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 44px; }
.hero-stats b { display: block; color: var(--lime); font-size: 28px; font-weight: 700; }
.hero-stats span { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 500; }

/* Mobile: o hero ocupava a tela inteira com a dobra vazia, a pill quebrava em duas
   linhas soltas e os 3 números quebravam 2+1 com um vão de 40px no meio. */
@media (max-width: 700px) {
  .hero { min-height: min(76vh, 620px); }
  .hero-in { padding: 0 20px 34px; }
  .pill {
    font-size: 11.5px; letter-spacing: .01em; padding: 7px 13px;
    margin-bottom: 16px; line-height: 1.35; max-width: 100%;
  }
  .hero h1 { font-size: clamp(29px, 8.6vw, 38px); max-width: 20ch; }
  .hero p { font-size: 15px; margin-top: 14px; line-height: 1.5; max-width: 40ch; }
  .hero-cta { gap: 10px; margin-top: 24px; }
  .hero-cta a { flex: 1 1 auto; text-align: center; font-size: 15px; padding: 14px 18px; }
  .hero-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.22);
  }
  .hero-stats b { font-size: 20px; letter-spacing: -.02em; }
  .hero-stats span { font-size: 11px; line-height: 1.3; display: block; }
}

/* ---------- seções ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -.03em; margin-top: 8px; }
.sec { max-width: var(--maxw); margin: 0 auto; padding: 80px 24px 20px; scroll-margin-top: 80px; }
.sec-tight { padding-top: 64px; padding-bottom: 90px; }

/* ---------- cards de tipo ---------- */
.tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 32px; }
.tipo {
  border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 16px;
  min-height: 180px; justify-content: space-between; transition: transform .18s, box-shadow .18s;
  background: var(--bg-2); color: var(--ink); border: 1.5px solid var(--line);
}
.tipo:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(40,40,40,.08); }
.tipo.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.tipo-ico { width: 52px; height: 52px; border-radius: 16px; background: var(--lime-soft); display: flex; align-items: center; justify-content: center; }
.tipo.dark .tipo-ico { background: var(--lime); }
.tipo-name { font-size: 20px; font-weight: 700; }
.tipo-count { font-size: 14px; font-weight: 500; opacity: .7; margin-top: 4px; }

/* Mobile: 7 tipos × 180px de altura = uma parede de ~1.400px pra rolar, cada card
   quase vazio. Em 2 colunas compactas vira 4 linhas e a seção cabe numa tela. */
@media (max-width: 700px) {
  .sec { padding: 48px 20px 16px; }
  .sec-tight { padding-top: 40px; padding-bottom: 56px; }
  .tipos { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
  .tipo {
    min-height: 0; padding: 16px; border-radius: 18px; gap: 12px;
    flex-direction: column; justify-content: flex-start;
  }
  .tipo-ico { width: 38px; height: 38px; border-radius: 12px; }
  .tipo-ico svg { width: 19px; height: 19px; }
  .tipo-name { font-size: 15px; letter-spacing: -.01em; }
  .tipo-count { font-size: 12.5px; margin-top: 2px; }
}

/* ---------- grade de imóveis ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-top: 36px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(40,40,40,.10); }
.card-ph { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--lime-bg); }
.card-ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-ph img { transform: scale(1.04); }
.badge {
  position: absolute; top: 14px; font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: 20px;
}
.badge-l { left: 14px; background: rgba(255,255,255,.95); color: var(--ink); }
.badge-r { right: 14px; background: var(--ink); color: #fff; font-weight: 600; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.price { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.card-title { font-size: 16px; font-weight: 600; margin-top: 6px; }
.loc { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.specs {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--line-2);
}
.specs span { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.card-body .specs { margin-top: auto; }

/* ---------- filtros ---------- */
.filters { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid #e4e4de; background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 600; padding: 10px 20px; border-radius: 12px; transition: .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ctrl-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ctrl {
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1.5px solid #e4e4de; border-radius: 12px; padding: 10px 14px;
}
.ctrl:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }
.result-count { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: auto; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-weight: 500; }

/* "Ver mais" — só aparece no mobile, onde 115 cards davam 53.000px de rolagem.
   O JS mantém o botão oculto acima de 700px pra não alterar o desktop. */
.more {
  display: block; width: 100%; margin: 26px auto 0; max-width: 420px;
  background: #fff; border: 1.5px solid var(--ink); color: var(--ink);
  font-size: 15px; font-weight: 700; padding: 15px; border-radius: var(--radius-sm);
}
.more:hover { background: var(--ink); color: #fff; }
.more[hidden] { display: none; }

/* ---------- corretor ---------- */
.corretor { background: var(--bg-2); }
.corretor-in {
  max-width: var(--maxw); margin: 0 auto; padding: 80px 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 52px; align-items: center;
}
.corretor-ph { position: relative; }
/* Classe própria em vez de `.corretor-ph > div`: aquele seletor também casava com
   a tarja do CRECI (mesmo elemento, mesmo pai) e vencia em especificidade — a
   tarja herdava o fundo do placeholder e o aspect-ratio 4/5, saindo esticada e
   com texto claro sobre fundo claro. */
.corretor-ph .ph-frame { aspect-ratio: 4/5; border-radius: 28px; overflow: hidden; background: #e7eadb; }
.corretor-ph .ph-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.creci-tag {
  position: absolute; bottom: -18px; right: -8px; background: var(--ink); color: #fff;
  border-radius: 20px; padding: 18px 24px; box-shadow: var(--shadow-lg);
}
.creci-tag b { display: block; font-size: 24px; font-weight: 700; color: var(--lime); }
.creci-tag span { font-size: 14px; font-weight: 500; opacity: .85; }
.corretor p { font-size: 16px; line-height: 1.7; color: var(--body); margin-top: 18px; max-width: 52ch; text-wrap: pretty; }
/* A bio tem 3 parágrafos: o 1º já recebe o espaço do bloco, os seguintes precisam
   de respiro menor entre si pra não abrir buraco na coluna. */
.corretor p + p { margin-top: 13px; }
.contacts { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.contact { display: flex; align-items: center; gap: 14px; }
.contact-ico {
  width: 44px; height: 44px; border-radius: 13px; background: var(--lime-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-k { font-size: 12px; color: var(--muted); font-weight: 600; }
.contact-v { font-size: 16px; font-weight: 700; word-break: break-word; }
.btn-lime {
  display: inline-flex; align-items: center; gap: 10px; background: var(--lime); color: var(--lime-ink);
  font-size: 16px; font-weight: 700; padding: 16px 30px; border-radius: var(--radius-sm); margin-top: 30px;
  transition: transform .15s;
}
.btn-lime:hover { transform: translateY(-2px); }

/* ---------- footer ---------- */
.ftr { background: var(--ink); color: #fff; margin-top: 20px; }
.ftr-in {
  max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 44px;
}
.ftr h3 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); margin-bottom: 18px; }
.ftr-col { display: flex; flex-direction: column; gap: 12px; }
.ftr-col a, .ftr-col span { color: #dcdcd6; font-size: 15px; font-weight: 500; }
.ftr-col a:hover { color: #fff; }
.ftr-about { font-size: 14px; line-height: 1.6; color: #a8a8a3; margin-top: 16px; }
.ftr-bar { border-top: 1px solid #3c3c3c; }
.ftr-bar-in {
  max-width: var(--maxw); margin: 0 auto; padding: 22px 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #8a8a85;
}

/* ---------- página do imóvel ---------- */
.crumbs { font-size: 13px; color: var(--muted); padding: 20px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }

.pdp { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 90px; }
.pdp-head { padding: 18px 0 26px; }
.pdp-head h1 { font-size: clamp(24px, 3.2vw, 36px); font-weight: 700; letter-spacing: -.03em; text-wrap: balance; }
.pdp-price { font-size: clamp(26px, 3.6vw, 40px); font-weight: 700; letter-spacing: -.02em; }
.pdp-m2 { font-size: 14px; font-weight: 500; color: var(--muted); }

/* galeria: 4:3 uniforme, foto inteira só no lightbox */
.gal { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; border-radius: var(--radius); overflow: hidden; }
.gal-main, .gal-thumb { position: relative; overflow: hidden; background: var(--lime-bg); border: 0; padding: 0; }
.gal-main { aspect-ratio: 4 / 3; }
.gal-side { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
.gal-thumb { aspect-ratio: 4 / 3; }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, filter .2s; }
.gal button:hover img { transform: scale(1.03); }
.gal-more {
  position: absolute; inset: 0; background: rgba(40,40,40,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 700; backdrop-filter: blur(2px);
}
@media (max-width: 700px) {
  .gal { grid-template-columns: 1fr; }
  .gal-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
}

.strip { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: thin; }
.strip button { flex: 0 0 104px; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; background: var(--lime-bg); opacity: .72; transition: opacity .15s; }
.strip button:hover { opacity: 1; }
.strip img { width: 100%; height: 100%; object-fit: cover; }

.pdp-cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: 44px; margin-top: 42px; align-items: start; }
@media (max-width: 940px) { .pdp-cols { grid-template-columns: 1fr; gap: 32px; } }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-top: 8px; }
.spec-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.spec-box b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.spec-box span { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Mobile: a ficha virava 3 linhas de caixas altas e quase vazias. Compacta em 3
   colunas (o valor por m² ocupa 2, que é o único que não cabe em 1/3 da tela). */
@media (max-width: 700px) {
  .pdp { padding: 0 20px 70px; }
  .pdp-head { padding: 14px 0 20px; }
  .crumbs { font-size: 12px; gap: 6px; }
  .spec-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .spec-box { padding: 12px 11px; border-radius: 14px; }
  .spec-box b { font-size: 17px; }
  .spec-box span { font-size: 11.5px; line-height: 1.3; display: block; }
  .spec-box.wide { grid-column: span 2; }
  .block { margin-top: 30px; }
  .block h2 { font-size: 19px; margin-bottom: 12px; }
  .feats { gap: 8px; }
  .feat { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
  .desc { font-size: 15px; line-height: 1.65; }
  .aside { padding: 20px; border-radius: 20px; }
}

.block { margin-top: 40px; }
.block h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 16px; }
.feats { display: flex; flex-wrap: wrap; gap: 10px; }
.feat {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 14px; font-size: 14px; font-weight: 500; color: var(--ink-soft);
}
.desc { font-size: 16px; line-height: 1.75; color: var(--body); white-space: pre-line; text-wrap: pretty; }

.aside {
  position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.aside-corretor { display: flex; align-items: center; gap: 14px; }
.aside-corretor img { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; object-position: center top; flex-shrink: 0; }
.aside .btn-lime { margin-top: 22px; width: 100%; justify-content: center; }
.aside-note { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.code-tag { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 100; background: rgba(24, 24, 22, .96);
  display: none; align-items: center; justify-content: center;
}
.lb[open], .lb.on { display: flex; }
.lb-img { max-width: 94vw; max-height: 84vh; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.lb-bar {
  position: absolute; top: 0; left: 0; right: 0; padding: 16px 20px;
  display: flex; align-items: center; gap: 16px; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.5), transparent);
}
.lb-count { font-size: 14px; font-weight: 600; }
.lb-x { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; line-height: 1; }
.lb-x:hover { background: rgba(255,255,255,.26); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14);
  color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center;
}
.lb-nav:hover { background: rgba(255,255,255,.28); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
@media (max-width: 620px) { .lb-nav { width: 42px; height: 42px; bottom: 18px; top: auto; transform: none; } .lb-prev { left: 20px; } .lb-next { right: 20px; } }

/* ---------- barra fixa mobile ---------- */
.sticky-wa {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; display: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.sticky-wa a { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--lime); color: var(--lime-ink); font-size: 16px; font-weight: 700; padding: 15px; border-radius: var(--radius-sm); }
@media (max-width: 940px) { .sticky-wa { display: block; } body.has-sticky { padding-bottom: 84px; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
