:root {
  --ink: #0e1712;
  --green: #17392b;
  --leaf: #2f6b4f;
  --cream: #f5f0e6;
  --paper: #fbf8f2;
  --amber: #f2b33d;
  --amber-ink: #3a2a05;
  --gray: #5f6a64;
  --soft: #ece5d8;
  --line: rgba(14, 23, 18, 0.12);
  --card: #ffffff;
  --head: "Bricolage Grotesque", system-ui, sans-serif;
  --ui: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--ui); }
img { display: block; max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* topo */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; background: var(--cream); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--green); display: grid; place-items: center; }
.brand-mark svg { width: 24px; height: 24px; fill: var(--amber); }
.brand-name { font: 800 21px/1 var(--head); letter-spacing: -0.03em; color: var(--green); }
.brand-name em { font-style: normal; font-weight: 500; color: var(--leaf); }
.top-nav { display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
.top-nav a { text-decoration: none; color: var(--green); }
.top-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* hero: texto à esquerda, fotos reais da base à direita */
.hero { background: var(--cream); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 20px 28px 44px; max-width: 1440px; margin: 0 auto; }
.kicker { margin: 0 0 14px; font-weight: 700; font-size: 14px; color: var(--leaf); }
.kicker b { color: var(--green); }
.hero h1 { font: 800 clamp(38px, 5.2vw, 72px)/0.98 var(--head); letter-spacing: -0.045em; margin: 0 0 28px; color: var(--green); }
.hero h1 span { color: var(--leaf); font-weight: 500; }
.search { position: relative; display: flex; align-items: center; max-width: 560px; background: var(--card); border-radius: 999px; padding: 6px; box-shadow: 0 10px 30px rgba(23, 57, 43, 0.12); }
.search-ico { position: absolute; left: 20px; width: 20px; height: 20px; fill: none; stroke: var(--gray); stroke-width: 2.2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; padding: 0 12px 0 48px; font-size: 16px; outline: none; }
.search button { height: 48px; border: 0; border-radius: 999px; padding: 0 26px; background: var(--green); color: var(--cream); font-weight: 700; }
.hero-photos { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; height: 400px; }
.hero-photos div { border-radius: 18px; background: var(--soft) center / cover no-repeat; }
.hero-photos div:first-child { grid-row: span 2; }

/* barra de filtros */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(251, 248, 242, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 1440px; margin: 0 auto; padding: 12px 28px; }
.chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.types { display: flex; gap: 6px; }
.types button, .chip { flex: none; height: 38px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 16px; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.chip[data-pop]::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: 0.6; }
.types button.on, .chip.on { background: var(--green); border-color: var(--green); color: var(--cream); }
.chip.ghost { border-color: transparent; background: transparent; color: var(--leaf); text-decoration: underline; text-underline-offset: 3px; }
.sep { flex: none; width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.pop { position: relative; flex: none; }
.panel { display: none; position: fixed; z-index: 60; width: 300px; background: var(--card); border-radius: 18px; padding: 18px; box-shadow: 0 20px 60px rgba(14, 23, 18, 0.2); }
.panel.wide { width: 320px; }
.panel.open { display: block; }
.panel-t { margin: 0 0 12px; font: 700 18px var(--head); letter-spacing: -0.02em; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--gray); }
.row2 select { height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 0 10px; background: var(--paper); color: var(--ink); font-size: 15px; }
.presets, .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.presets button, .opts button { height: 36px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.opts button.on, .presets button.on { background: var(--green); color: var(--cream); border-color: var(--green); }
.panel-search { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--paper); margin-bottom: 8px; }
.list { max-height: 320px; overflow: auto; margin: 0 -6px; }
.list button { display: flex; width: 100%; justify-content: space-between; gap: 10px; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 10px; font-size: 15px; }
.list button:hover { background: var(--paper); }
.list button.on { background: #e6efe9; font-weight: 700; color: var(--green); }
.list button span { color: var(--gray); font-size: 13.5px; }

/* resultados */
.main { max-width: 1440px; margin: 0 auto; padding: 22px 28px 60px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.count { margin: 0; font: 800 26px/1.1 var(--head); letter-spacing: -0.03em; color: var(--green); }
.count small { display: block; font: 500 14px var(--ui); letter-spacing: 0; color: var(--gray); margin-top: 2px; }
.head-right { display: flex; align-items: center; gap: 10px; }
.sort select { height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; background: var(--card); font-size: 14px; font-weight: 600; }
.view { display: flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.view button { height: 32px; border: 0; background: transparent; border-radius: 999px; padding: 0 16px; font-weight: 700; font-size: 14px; }
.view button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 28px 20px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border: 0; background: none; padding: 0; text-align: left; }
.photo { position: relative; aspect-ratio: 5 / 4; border-radius: 18px; overflow: hidden; background: var(--soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .photo img { transform: scale(1.04); }
.photo.none::after { content: "sem foto"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gray); font-size: 14px; }
.photo::before { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55)); z-index: 1; pointer-events: none; }
.price { position: absolute; left: 14px; bottom: 12px; z-index: 2; color: #fff; font: 800 26px/1 var(--head); letter-spacing: -0.03em; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
.badge { position: absolute; right: 12px; top: 12px; z-index: 2; background: var(--amber); color: var(--amber-ink); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 700; }
.meta { padding: 12px 4px 0; display: grid; gap: 2px; }
.line1 { font-weight: 700; font-size: 16px; }
.line2 { color: var(--gray); font-size: 14.5px; }
.by { color: var(--gray); font-size: 13.5px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.by b { color: var(--ink); font-weight: 600; }
.by .go { color: var(--leaf); font-weight: 700; }

.more-wrap { display: flex; justify-content: center; margin-top: 36px; }
.more { height: 46px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 26px; font-weight: 700; }
.empty { text-align: center; color: var(--gray); padding: 60px 0; }

/* mapa (visualização alternativa, tela cheia da área de resultados) */
.mapview { position: relative; }
.map { height: calc(100vh - 170px); min-height: 460px; border-radius: 20px; overflow: hidden; background: var(--soft); }
.map-card { position: absolute; left: 16px; bottom: 16px; width: min(340px, calc(100% - 32px)); background: var(--card); border-radius: 18px; padding: 16px 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2); }
.map-card h3 { margin: 0; font: 800 24px var(--head); letter-spacing: -0.03em; color: var(--green); }
.map-card p { margin: 4px 0 12px; color: var(--gray); }
.map-card button { width: 100%; height: 44px; border: 0; border-radius: 999px; background: var(--green); color: var(--cream); font-weight: 700; }

/* lista de imobiliárias de um imóvel repetido */
.sheet { border: 0; border-radius: 22px; padding: 22px; width: min(440px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.sheet::backdrop { background: rgba(14, 23, 18, 0.45); }
.sheet-x:focus:not(:focus-visible) { outline: none; }
.sheet-x { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--gray); }
.sheet h3 { margin: 0 0 4px; font: 800 24px var(--head); letter-spacing: -0.03em; color: var(--green); }
.sheet p { margin: 0 0 14px; color: var(--gray); }
.sheet a { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; padding: 13px 16px; border-radius: 14px; background: var(--paper); font-weight: 600; margin-top: 8px; }
.sheet a:hover { background: #e6efe9; }
.sheet a span { color: var(--leaf); font-weight: 700; white-space: nowrap; }

/* seções */
.info { background: var(--cream); padding: 64px 28px; }
.info.alt { background: var(--paper); }
.info-inner { max-width: 1180px; margin: 0 auto; }
.info h2 { font: 800 40px/1 var(--head); letter-spacing: -0.04em; margin: 0 0 24px; color: var(--green); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.steps li { counter-increment: s; border-top: 2px solid var(--green); padding-top: 16px; }
.steps li::before { content: counter(s, decimal-leading-zero); font: 800 15px var(--head); color: var(--leaf); }
.steps h3 { font: 700 22px var(--head); letter-spacing: -0.02em; margin: 6px 0 6px; }
.steps p { margin: 0; color: var(--gray); }
.fine { font-size: 13px; color: var(--gray); margin-top: 28px; }
.lead { max-width: 60ch; color: var(--gray); }
.sources { list-style: none; padding: 0; margin: 22px 0 0; columns: 3 240px; column-gap: 32px; }
.sources li { break-inside: avoid; display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sources a { font-weight: 600; text-decoration: none; }
.sources a:hover { text-decoration: underline; }
.sources span { color: var(--gray); white-space: nowrap; }
.foot { padding: 28px; text-align: center; font-size: 13px; color: var(--gray); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 8px 16px 28px; }
  .hero-photos { height: 190px; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 1fr; }
  .hero-photos div:first-child { grid-row: auto; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 640px) {
  .top { padding: 14px 16px; }
  .top-nav { display: none; }
  .hero h1 { margin-bottom: 20px; }
  .search button { padding: 0 18px; }
  .bar-inner { padding: 10px 16px; }
  .main { padding: 18px 16px 50px; }
  .results-head { flex-wrap: wrap; }
  .count { font-size: 22px; }
  .grid { grid-template-columns: 1fr; gap: 24px; }
  .map { height: calc(100dvh - 190px); }
  /* filtros viram folha de baixo no celular */
  .panel, .panel.wide { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; border-radius: 22px 22px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .info { padding: 44px 16px; }
  .info h2 { font-size: 32px; }
}
