/* ===== Paleta: casa ampla, jardim verde, família feliz ===== */
:root {
  --leaf: #2f6b3a;
  --leaf-2: #3f8146;
  --leaf-soft: #e3f0dc;
  --moss: #8cc271;
  --cream: #fbf7ee;
  --paper: #ffffff;
  --sand: #f2ead9;
  --terracotta: #c9623f;
  --terracotta-soft: #fbe6dc;
  --sun: #f2b84b;
  --ink: #213027;
  --muted: #5e6c62;
  --line: #e6dfcf;
  --wa: #25d366;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(33, 48, 39, .06), 0 8px 24px rgba(33, 48, 39, .08);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
img { max-width: 100%; display: block; }
a { color: var(--leaf); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; min-height: 460px; display: flex; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-content { position: relative; padding: 56px 0 170px; }
.eyebrow {
  margin: 0 0 10px; color: var(--leaf); font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; font-size: 13px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700; color: var(--ink);
  font-size: clamp(30px, 5vw, 52px); line-height: 1.08; margin: 0 0 14px; max-width: 16ch;
}
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 46ch; margin: 0 0 20px; }
.deadline-pill {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 10px 16px; border-radius: 999px; margin: 0; font-size: 15px;
}
.deadline-pill strong { color: var(--terracotta); }
#countdown { color: var(--muted); }

/* ===== Informações ===== */
.info-grid {
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: -64px; position: relative;
}
.info {
  display: flex; gap: 14px; background: var(--paper); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.info-ico {
  flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--leaf-soft);
  display: grid; place-items: center; font-size: 22px;
}
.info h2 { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.info p { margin: 0; color: var(--muted); font-size: 15px; }
.info a { font-weight: 700; }

/* ===== Barra de busca / filtros ===== */
.toolbar { margin: 36px 0 8px; display: grid; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 999px; padding: 0 18px; height: 52px;
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--leaf-2); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 16px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; }
.seg button {
  border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-weight: 700; color: var(--muted); font-size: 14px; white-space: nowrap;
}
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg button small { font-weight: 600; opacity: .7; }
select {
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted);
}
.chip.on { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.result-count { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }

/* ===== Grade de itens ===== */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s;
  border: 0; padding: 0; text-align: left;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(33,48,39,.06), 0 16px 32px rgba(33,48,39,.12); }
.card:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.ph { position: relative; aspect-ratio: 4 / 3; background: var(--leaf-soft); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; opacity: .5; }
.ph .count-photos {
  position: absolute; left: 10px; bottom: 10px; background: rgba(33,48,39,.65); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.like-chip {
  position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.92); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 13px;
}
.like-chip.liked { color: var(--terracotta); }
.card-body { padding: 14px 16px 16px; display: grid; gap: 4px; flex: 1; align-content: start; }
.sector-tag { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--leaf-2); }
.card h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.2; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.price { font-weight: 800; font-size: 20px; color: var(--leaf); }
.price-new { color: var(--muted); font-size: 13px; }
.price-new s { opacity: .8; }
.off { background: var(--terracotta-soft); color: var(--terracotta); font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.dims { color: var(--muted); font-size: 13px; }

/* Vendido */
.sold .ph img { filter: grayscale(.85) brightness(.95); }
.sold-stamp {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  background: rgba(251,247,238,.25);
}
.sold-stamp span {
  transform: rotate(-12deg); border: 4px solid var(--terracotta); color: var(--terracotta);
  font: 800 28px/1 var(--sans); letter-spacing: .14em; padding: 8px 18px; border-radius: 10px;
  background: rgba(255,255,255,.85);
}
.sold-tag { background: var(--terracotta); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; letter-spacing: .06em; text-transform: uppercase; }
.sold .price { color: var(--muted); text-decoration: line-through; }

.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  border-radius: 999px; padding: 11px 20px; font-weight: 800; text-decoration: none; font-size: 15px;
  background: var(--leaf); color: #fff; transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); }
.btn.wa { background: var(--wa); color: #0b3d1f; }
.btn.like.liked { background: var(--terracotta-soft); color: var(--terracotta); border-color: var(--terracotta-soft); }
.btn svg { width: 18px; height: 18px; }

/* ===== Modal do item ===== */
.modal {
  border: 0; padding: 0; border-radius: 22px; width: min(980px, 100% - 24px); max-height: calc(100% - 24px);
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.25);
}
.modal::backdrop { background: rgba(26, 40, 30, .55); backdrop-filter: blur(3px); }
.modal-inner { display: grid; grid-template-columns: 1.15fr 1fr; }
.close {
  position: absolute; right: 12px; top: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.95); box-shadow: var(--shadow); font-size: 22px; cursor: pointer; line-height: 1;
}
.gallery { background: var(--leaf-soft); position: relative; display: flex; flex-direction: column; }
.gallery .main { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; background: #f4f1e8; }
.gallery .nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.9); cursor: pointer; font-size: 20px; box-shadow: var(--shadow);
}
.gallery .prev { left: 10px; } .gallery .next { right: 10px; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; }
.thumbs button.on { border-color: var(--leaf); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.details { padding: 26px 26px 24px; display: grid; gap: 14px; align-content: start; }
.details h2 { font-family: var(--serif); font-size: 28px; line-height: 1.15; margin: 0; }
.details .price { font-size: 28px; }
.desc { margin: 0; color: var(--ink); white-space: pre-line; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; background: var(--cream); border-radius: 14px; padding: 14px 16px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 700; }
.ni { color: var(--muted); font-weight: 400; font-style: italic; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.qa { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 22px 26px 26px; background: var(--cream); }
.qa h3 { font-family: var(--serif); margin: 0 0 12px; font-size: 20px; }
.q { background: var(--paper); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.q p { margin: 0; }
.q .who { font-size: 13px; color: var(--muted); }
.q .a { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--moss); background: var(--leaf-soft); border-radius: 0 10px 10px 0; }
.q .wait { margin-top: 6px; font-size: 13px; color: var(--muted); font-style: italic; }
.ask { display: grid; gap: 8px; margin-top: 14px; }
.ask .row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.ask input, .ask textarea, .field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper);
}
.ask input:focus, .ask textarea:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--leaf-2); }
.hp { position: absolute; left: -9999px; }
.msg { font-size: 14px; color: var(--leaf); margin: 0; }
.msg.err { color: var(--terracotta); }

/* ===== WhatsApp flutuante ===== */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 60px; height: 60px; border-radius: 50%;
  background: var(--wa); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(37,211,102,.45);
  transition: transform .18s;
}
.wa-float:hover { transform: scale(1.07); }
.wa-float svg { width: 32px; height: 32px; }
.wa-tip {
  position: absolute; right: 70px; white-space: nowrap; background: var(--paper); color: var(--ink);
  padding: 8px 12px; border-radius: 12px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
}
.wa-tip::after { content: ""; position: absolute; right: -6px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-right: 0; border-left-color: var(--paper); }
body.modal-open .wa-float { display: none; }

.footer { text-align: center; color: var(--muted); font-size: 14px; padding: 48px 16px 96px; }

/* ===== Celular ===== */
@media (max-width: 760px) {
  .hero { min-height: 420px; }
  .hero-content { padding: 36px 0 150px; }
  .modal { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; margin: 0; }
  .modal-inner { grid-template-columns: 1fr; }
  .details { padding: 20px 16px; }
  .qa { padding: 18px 16px 28px; }
  .wa-tip { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card h3 { font-size: 16px; }
  .price { font-size: 17px; }
  .card-body { padding: 10px 12px 12px; }
  .sold-stamp span { font-size: 18px; padding: 6px 10px; border-width: 3px; }
  .dims { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
