/* =============================================================
   RESET & BASE
============================================================= */
:root {
  --primary: #E84A3F;
  --primary-dark: #C43A30;
  --accent: #0E1A2B;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 6px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 45px rgba(0,0,0,.12);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--accent);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,h4 { color: var(--accent); line-height: 1.2; margin: 0 0 .5em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =============================================================
   HEADER
============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--accent); }
.brand img { display: block; max-height: 44px; width: auto; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  letter-spacing: .5px;
}
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }

.nav { display: flex; align-items: center; gap: 8px; }

.nav-item { position: relative; }

.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px;
  font-weight: 600; color: var(--accent); font-size: 15px;
  transition: background .15s;
}
.nav-link:hover { background: var(--bg-soft); }
.nav-link.active { color: var(--primary); }
.nav-caret { opacity: .6; transition: transform .15s; }
.nav-item:hover .nav-caret { transform: rotate(180deg); }

/* Dropdown menu em cascata (Alugar/Comprar) */
.nav-dropdown {
  position: absolute; top: calc(100% + 2px); left: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  padding: 20px 24px;
  display: none;
  grid-template-columns: 260px;
  gap: 24px;
  min-width: 260px;
  z-index: 60;
  transition: grid-template-columns .18s ease;
}
.nav-item:hover .nav-dropdown { display: grid; }
.nav-dropdown.show-types { grid-template-columns: 260px 280px; min-width: 564px; }

/* "buffer" invisível para o mouse conseguir chegar sem fechar */
.nav-dropdown::before {
  content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 12px;
}

.dropdown-col h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin: 0 0 6px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.dropdown-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.dropdown-hint .cur-bairro { color: var(--accent); font-weight: 700; }

.dropdown-col ul { list-style: none; padding: 0; margin: 0; }
.dropdown-col li a,
.dropdown-col li.bairro-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 8px;
  color: var(--accent);
  font-size: 14px; font-weight: 500;
  transition: background .12s;
  cursor: pointer;
}
.dropdown-col li a:hover,
.dropdown-col li.bairro-item:hover,
.dropdown-col li.bairro-item.active {
  background: var(--bg-soft);
}
.dropdown-col li.bairro-item .chev {
  opacity: 0;
  color: var(--muted);
  transition: opacity .12s;
}
.dropdown-col li.bairro-item:hover .chev,
.dropdown-col li.bairro-item.active .chev { opacity: 1; }

.dropdown-col li.dropdown-sep { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--border); }
.dropdown-col li.dropdown-sep a { color: var(--muted); font-weight: 500; }

/* Painel de tipos (só aparece quando .show-types) */
.dropdown-types-panel { display: none; }
.nav-dropdown.show-types .dropdown-types-panel { display: block; }
.dropdown-empty {
  padding: 12px; color: var(--muted); font-size: 13px; font-style: italic;
}

.nav-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px;
  background: var(--bg-soft); color: var(--accent);
  font-weight: 600; font-size: 15px;
  margin-left: 12px;
  transition: background .15s;
}
.nav-pill:hover { background: #e8ecf1; }
.nav-pill svg { opacity: .75; }

.menu-toggle {
  display: none; background: none; border: 0; font-size: 24px;
  color: var(--accent);
}

@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 76px; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 20px; gap: 6px; align-items: stretch;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .nav-pill { margin: 8px 0 0; justify-content: center; }
}

/* =============================================================
   HERO FULL-WIDTH (imagem edge-to-edge, header transparente por cima)
============================================================= */

/* Hero preenchendo a tela — imagem edge-to-edge, header sólido em cima */
.hero-full {
  position: relative;
  min-height: 620px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero-full-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.1) 20%, rgba(0,0,0,0) 45%),
    linear-gradient(90deg, rgba(0,0,0,.15) 0%, transparent 60%);
  pointer-events: none;
}
.hero-full-inner {
  position: relative; z-index: 2;
  min-height: 620px;
  display: flex; align-items: center;
  padding: 60px 20px;
}

/* Card branco flutuando à esquerda por cima da imagem */
.hero-card {
  width: 480px; max-width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.hero-card h1 {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 800; letter-spacing: -.5px; line-height: 1.15;
  color: var(--accent); margin: 0 0 24px;
}
.hero-tabs {
  display: flex; gap: 28px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.hero-tab {
  border: 0; background: transparent; padding: 10px 2px; font-family: inherit;
  font-size: 15px; font-weight: 600; color: var(--muted);
  cursor: pointer; position: relative; margin-bottom: -1px;
}
.hero-tab.active { color: var(--accent); border-bottom: 3px solid var(--primary); }

.hero-form { display: flex; flex-direction: column; gap: 10px; }
.hero-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-field {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; transition: border-color .15s;
}
.hero-field:focus-within { border-color: var(--accent); }
.hero-field-icon { font-size: 18px; flex-shrink: 0; }
.hero-field-body { flex: 1; min-width: 0; }
.hero-field-body label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--accent); margin-bottom: 2px;
}
.hero-field-body input, .hero-field-body select {
  border: 0; padding: 0; width: 100%; outline: none;
  font-size: 14px; color: var(--muted); font-family: inherit; background: transparent;
}
.hero-field:focus-within .hero-field-body input,
.hero-field:focus-within .hero-field-body select { color: var(--accent); }

.hero-submit {
  margin-top: 8px; padding: 16px; border: 0; border-radius: 12px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 16px;
  cursor: pointer; transition: background .2s;
  font-family: inherit;
}
.hero-submit:hover { background: var(--primary-dark); }

@media (max-width: 900px) {
  .hero-full { min-height: auto; }
  .hero-full-inner { min-height: auto; padding: 40px 16px; }
  .hero-card { width: 100%; padding: 24px; }
}

/* =============================================================
   LANÇAMENTOS (carrossel)
============================================================= */
.launches { padding: 70px 0 40px; }
.launches-nav {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; gap: 10px; z-index: 5;
}
.carousel-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px);
  font-size: 22px; font-weight: 700; color: var(--accent);
  cursor: pointer; transition: all .15s;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.carousel-btn:hover { background: #fff; transform: scale(1.06); }
.carousel-btn:active { transform: scale(.98); }

.launches-track-wrap {
  position: relative;
  overflow: hidden; border-radius: var(--radius);
}
.launches-track {
  display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.launch-slide {
  flex: 0 0 100%; height: 420px;
  background-size: cover; background-position: center;
  position: relative; display: flex; align-items: flex-end;
  color: #fff; text-decoration: none;
  border-radius: var(--radius); overflow: hidden;
}
.launch-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.85) 100%);
}
.launch-content { position: relative; z-index: 2; padding: 40px; max-width: 700px; }
.launch-tags { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.launch-tag {
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  border: 1px solid rgba(255,255,255,.2);
}
.launch-tag.tag-new { background: var(--primary); border-color: var(--primary); }
.launch-title { color: #fff; font-size: 28px; font-weight: 800; margin: 0 0 4px; line-height: 1.2; }
.launch-loc { color: rgba(255,255,255,.85); font-size: 15px; margin: 0 0 14px; }
.launch-facts { display: flex; gap: 18px; color: rgba(255,255,255,.9); font-size: 14px; margin-bottom: 14px; }
.launch-price { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.launch-cta {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  background: #fff; color: var(--accent); font-weight: 700; font-size: 14px;
}
.launch-cta:hover { background: var(--primary); color: #fff; }

.launches-dots {
  display: flex; justify-content: center; gap: 8px; margin-top: 20px;
}
.launch-dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0;
  background: #cbd5e1; cursor: pointer; transition: all .15s; padding: 0;
}
.launch-dot.active { background: var(--primary); width: 28px; border-radius: 999px; }
.launch-dot:hover { background: var(--accent); }

@media (max-width: 700px) {
  .launch-slide { height: 360px; }
  .launch-content { padding: 24px; }
  .launch-title { font-size: 22px; }
  .launch-price { font-size: 22px; }
}

/* Antigo (legado, ainda usado em contato) */
.hero {
  position: relative;
  min-height: 560px;
  display: flex; align-items: center;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #0E1A2B 0%, #1a2c48 100%);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?w=1900&auto=format&fit=crop");
  background-size: cover; background-position: center;
  opacity: .28;
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding: 80px 0 120px; }
.hero h1 {
  color: #fff; font-size: clamp(28px, 4vw, 46px);
  max-width: 780px; font-weight: 800; letter-spacing: -.5px;
}
.hero p { color: rgba(255,255,255,.85); font-size: 18px; max-width: 620px; margin-top: 10px; }

/* Search box */
.search-box {
  margin-top: 36px;
  background: #fff;
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  max-width: 900px;
}
.search-tabs { display: flex; gap: 8px; padding: 8px 8px 0; }
.search-tab {
  flex: 0 0 auto; padding: 10px 20px; border: 0; background: transparent;
  border-radius: 999px; font-weight: 600; color: #64748b;
}
.search-tab.active { background: var(--accent); color: #fff; }

.search-fields {
  display: grid;
  grid-template-columns: 1fr 200px 160px auto;
  gap: 10px; padding: 12px; align-items: stretch;
}
.search-fields .field {
  display: flex; flex-direction: column; padding: 8px 14px;
  background: var(--bg-soft); border-radius: 12px;
}
.search-fields label { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.search-fields input, .search-fields select {
  border: 0; background: transparent; padding: 4px 0; font-size: 15px;
  color: var(--accent); outline: none; font-weight: 500;
}
.search-submit {
  background: var(--primary); color: #fff; border: 0;
  border-radius: 12px; padding: 0 26px;
  font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
  transition: background .2s;
}
.search-submit:hover { background: var(--primary-dark); }
@media (max-width: 820px) {
  .search-fields { grid-template-columns: 1fr; }
  .search-submit { padding: 14px; }
}

/* =============================================================
   SECTIONS
============================================================= */
.section { padding: 70px 0; }
.section-title { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
.section-sub { color: var(--muted); margin-top: 4px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap; gap: 12px; }
.link-more { color: var(--primary); font-weight: 600; }

/* Property grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-img {
  position: relative; overflow: hidden; background: #eef1f4;
  flex-shrink: 0;
  width: 100%; height: 200px;
}
.card-img > img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: transform .4s;
}
.card:hover .card-img img { transform: scale(1.05); }
.card-badges {
  position: absolute; top: 10px; left: 10px; right: 56px;
  display: flex; gap: 6px; z-index: 2;
  flex-wrap: wrap;
}
.card-badge {
  background: #fff; color: var(--accent);
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  white-space: nowrap;
  line-height: 1.2;
}
.card-badge-new { background: var(--accent); color: #fff; }
.card-badge-op { background: rgba(255,255,255,.98); }
.card-badge-venda { color: #0f766e; }
.card-badge-aluguel { color: #7c2d12; }
.card-fav {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.95); border: 0;
  display: grid; place-items: center; font-size: 18px;
  color: #64748b; cursor: pointer; transition: all .15s;
  z-index: 3;
}
.card-fav:hover { background: #fff; transform: scale(1.08); }
.card-fav.active { color: var(--primary); background: #fff; }

/* Setas de navegação no card (carrossel) */
.card-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 0;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: var(--accent);
  cursor: pointer; opacity: 0; transition: opacity .15s;
  z-index: 2;
}
.card-nav-prev { left: 8px; }
.card-nav-next { right: 8px; }
.card-img:hover .card-nav { opacity: 1; }
.card-nav:hover { background: #fff; }

/* Dots do carrossel */
.card-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; z-index: 2;
}
.card-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  transition: all .15s;
}
.card-dot.active { background: #fff; width: 18px; border-radius: 999px; }
.card-body { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }
.card-code {
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  color: var(--muted); text-transform: uppercase; margin-bottom: 4px;
}
.card-price { font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.card-price small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.card-cond { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-title { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--accent); line-height: 1.35; }

/* =============================================================
   FEATURES / BENEFITS
============================================================= */
.benefits {
  background: var(--bg-soft);
}
.benefit-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px;
}
.benefit {
  background: #fff; border-radius: var(--radius); padding: 28px;
  border: 1px solid var(--border);
}
.benefit .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(232,74,63,.1); color: var(--primary);
  display: grid; place-items: center; font-size: 22px; margin-bottom: 16px;
}
.benefit h3 { font-size: 17px; }
.benefit p { color: var(--muted); font-size: 14px; margin: 0; }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--accent) 0%, #1e3358 100%);
  color: #fff; border-radius: var(--radius); padding: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  flex-wrap: wrap;
}
.cta-banner h2 { color: #fff; font-size: 26px; }
.cta-banner p { margin: 6px 0 0; color: rgba(255,255,255,.8); }
.cta-banner .btn { background: var(--primary); }

/* =============================================================
   FOOTER
============================================================= */
.site-footer {
  background: var(--accent); color: #cbd5e1; padding: 60px 0 30px; margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
}
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.site-footer a { color: #cbd5e1; display: block; padding: 4px 0; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 20px; font-size: 13px; color: #94a3b8; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================================
   BUTTONS
============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600;
  background: var(--primary); color: #fff; border: 0;
  transition: background .2s, transform .1s;
  font-size: 15px;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent; color: var(--accent); border: 1px solid var(--border);
}
.btn.ghost:hover { background: var(--bg-soft); }
.btn.dark { background: var(--accent); }
.btn.dark:hover { background: #1a2c48; }

/* =============================================================
   LISTING PAGE
============================================================= */
.listing-hero {
  background: #fff; padding: 18px 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 76px; z-index: 30;
}
/* Na listagem, o header sai do scroll e a barra de filtros cola no topo */
.listing-page .site-header { position: relative; }
.listing-page .listing-hero { top: 0; z-index: 40; box-shadow: 0 4px 12px rgba(0,0,0,.04); }

/* Chips de filtros estilo QuintoAndar — sem overflow para popovers renderizarem */
.chips-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  position: relative;
}
.chip-search {
  flex: 1 1 320px; min-width: 260px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border-radius: 999px; padding: 11px 18px;
  border: 1px solid transparent;
  transition: all .15s;
}
.chip-search:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(14,26,43,.08); }
.chip-search-icon { display: flex; color: var(--muted); flex-shrink: 0; }
.chip-search input {
  border: 0; background: transparent; outline: none; flex: 1; min-width: 0;
  font-size: 14px; color: var(--accent); font-weight: 500;
  font-family: inherit;
}
.chip-search input::placeholder { color: var(--muted); }
.chip-clear {
  border: 0; background: transparent; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
  transition: all .12s; flex-shrink: 0;
}
.chip-clear:hover { background: var(--border); color: var(--accent); }

/* Autocomplete dropdown */
.autocomplete-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 8px; z-index: 200;
  max-height: 380px; overflow-y: auto;
  display: none;
}
.autocomplete-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: var(--accent); text-decoration: none;
  transition: background .12s;
}
.autocomplete-item:hover { background: var(--bg-soft); }
.autocomplete-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-soft);
  display: grid; place-items: center; color: var(--muted);
  flex-shrink: 0;
}
.autocomplete-item:hover .autocomplete-icon { background: #fff; color: var(--primary); }
.autocomplete-text { display: flex; flex-direction: column; min-width: 0; }
.autocomplete-label {
  font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.autocomplete-sub {
  font-size: 12px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filter-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--accent);
  border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.has-value { background: #eef2f7; border-color: var(--accent); color: var(--accent); }
.filter-chip svg, .filter-chip .caret { width: 14px; height: 14px; }
.chip-popover {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; min-width: 260px; z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
}
.filter-chip.open .chip-popover { display: block; }
.chip-popover label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-bottom: 6px; }
.chip-popover input, .chip-popover select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: none;
}
.chip-popover .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.chip-popover .popover-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.chip-popover .link-clear { color: var(--muted); font-size: 13px; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }
.chip-popover .btn-apply { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
/* Chips especiais (Mais filtros / Alerta) */
.filter-chip-more, .filter-chip-alert {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: #fff;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--accent);
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.filter-chip-more:hover, .filter-chip-alert:hover { border-color: var(--accent); }
.filter-chip-alert { margin-left: auto; }

/* Badge com contagem no chip "Mais filtros" */
.chip-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--primary); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  margin-left: 2px;
}

/* Checklist (popover Lançamentos) */
.check-list { display: flex; flex-direction: column; gap: 4px; }
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; cursor: pointer;
  font-size: 14px; color: var(--accent);
}
.check-row input[type=checkbox] {
  width: 18px; height: 18px; cursor: pointer;
  accent-color: var(--accent);
}

.chip-options { display: grid; gap: 6px; }
.chip-option {
  display: block; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 14px; text-align: left; font-family: inherit;
}
.chip-option:hover { background: var(--bg-soft); }
.chip-option.selected { border-color: var(--accent); background: #eef2f7; font-weight: 600; }

.results-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin: 24px 0 20px; flex-wrap: wrap; gap: 10px;
}
.results-count { color: var(--muted); font-size: 14px; margin-top: 4px; }
.listing-title { font-size: 24px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
.listing-title small { color: var(--muted); font-weight: 500; font-size: 15px; display: block; margin-top: 2px; }

.sort-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--accent);
}
.sort-chip select {
  border: 0; background: transparent; outline: none; font-family: inherit;
  font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer;
}

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.empty-state h3 { color: var(--accent); }

/* =============================================================
   MAP VIEW (listagem)
============================================================= */
.view-toggle {
  display: inline-flex; background: var(--bg-soft); border-radius: 999px;
  padding: 4px; gap: 4px;
}
.view-toggle button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-weight: 600; color: var(--muted); font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.view-toggle button.active {
  background: #fff; color: var(--accent); box-shadow: var(--shadow-sm);
}

.map-layout {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px; height: calc(100vh - 200px); min-height: 600px;
}
.map-layout .cards-side {
  overflow-y: auto; padding: 4px 12px 4px 4px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px;
  align-content: start;
}
.map-layout .cards-side .card { min-width: 0; }
.map-layout .cards-side .card.card-active {
  outline: 3px solid var(--primary);
  outline-offset: -1px;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.map-side {
  position: sticky; top: 160px;
  height: calc(100vh - 200px); min-height: 600px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: #e9ecef;
}
#leafletMap { width: 100%; height: 100%; }

/* Price pin marker */
.price-pin {
  background: #fff; border: 2px solid var(--accent);
  color: var(--accent); font-weight: 700; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: all .15s;
  cursor: pointer;
  transform: translate(-50%, -50%);
}
.price-pin:hover, .price-pin.pin-active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 500 !important;
}

/* Leaflet marker container adjustment */
.leaflet-marker-icon.price-pin-icon { background: transparent; border: 0; }
.leaflet-popup-content-wrapper { border-radius: 12px; padding: 4px; }
.leaflet-popup-content { margin: 8px 10px; }
.leaflet-popup-content .pin-popup {
  display: flex; gap: 10px; width: 220px;
}
.leaflet-popup-content .pin-popup img {
  width: 70px; height: 70px; object-fit: cover; border-radius: 8px; flex-shrink: 0;
}
.leaflet-popup-content .pin-popup .info { min-width: 0; }
.leaflet-popup-content .pin-popup .info strong { font-size: 14px; color: var(--accent); display: block; margin-bottom: 4px; }
.leaflet-popup-content .pin-popup .info .p-title {
  font-size: 12px; color: #333; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.leaflet-popup-content .pin-popup .info .p-loc { font-size: 11px; color: var(--muted); margin-top: 4px; }
.leaflet-popup-content .pin-popup a { color: var(--primary); font-size: 12px; font-weight: 600; margin-top: 6px; display: inline-block; }

.map-search-btn {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-weight: 600; font-size: 13px; cursor: pointer;
  box-shadow: var(--shadow-md); z-index: 500;
  display: none; align-items: center; gap: 6px;
}
.map-search-btn.show { display: inline-flex; }
.map-search-btn:hover { background: var(--bg-soft); }

.map-wrap { position: relative; height: 100%; }

.draw-btn {
  position: absolute; bottom: 20px; right: 20px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 18px;
  font-weight: 600; font-size: 13px; cursor: pointer;
  box-shadow: var(--shadow-md); z-index: 500;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
}
.draw-btn:hover { background: var(--bg-soft); }
.draw-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.map-side.drawing #leafletMap { cursor: crosshair; }
.leaflet-container.drawing { cursor: crosshair !important; }

.card-facts {
  margin-top: 12px; padding-top: 12px;
  color: var(--accent); font-size: 13px; font-weight: 500;
  border-top: 1px solid var(--border);
}
.card-loc {
  font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-loc:first-of-type { margin-top: 8px; }
.card-loc strong { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-side { position: static; height: 500px; }
  .map-layout .cards-side { max-height: none; overflow: visible; }
}

/* =============================================================
   DETAIL PAGE
============================================================= */
.detail-hero {
  padding: 30px 0;
}
.gallery {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 220px 220px; gap: 8px;
  border-radius: var(--radius); overflow: hidden;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.gallery img:first-child { grid-row: 1/3; }
@media (max-width: 780px) {
  .gallery { grid-template-columns: 1fr; grid-template-rows: 260px; }
  .gallery img:first-child { grid-row: auto; }
  .gallery img:not(:first-child) { display: none; }
}

.detail-grid {
  display: grid; grid-template-columns: 1fr 380px; gap: 40px;
  margin-top: 30px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-title { font-size: 28px; font-weight: 800; }
.detail-loc { color: var(--muted); margin-top: 4px; }
.code-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--accent); cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.code-chip strong { font-family: "SF Mono", ui-monospace, monospace; letter-spacing: .5px; }
.code-chip:hover { background: #fff; border-color: var(--accent); }
.detail-facts {
  display: flex; gap: 30px; margin: 20px 0; padding: 20px;
  background: var(--bg-soft); border-radius: var(--radius);
  flex-wrap: wrap;
}
.detail-facts .fact { display: flex; align-items: center; gap: 10px; }
.detail-facts .fact strong { font-weight: 700; font-size: 15px; }
.detail-facts .fact small { display: block; color: var(--muted); font-size: 12px; }

.section-block { margin: 30px 0; }
.section-block h3 { font-size: 18px; margin-bottom: 12px; }
.feature-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin: 0; padding: 0; list-style: none;
}
.feature-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--bg-soft); border-radius: 10px;
  font-size: 14px;
}
.feature-list li::before { content: "✓"; color: var(--primary); font-weight: 700; }

.side-card {
  position: sticky; top: 90px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.side-card .price { font-size: 30px; font-weight: 800; }
.side-card .price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.side-card .costs { margin: 14px 0; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.side-card .costs div { display: flex; justify-content: space-between; padding: 4px 0; }
.side-card .costs .total { color: var(--accent); font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--border); margin-top: 8px; }

.side-card form { display: grid; gap: 10px; margin-top: 16px; }
.side-card input, .side-card textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; outline: none; font-family: inherit;
}
.side-card input:focus, .side-card textarea:focus { border-color: var(--primary); }

/* =============================================================
   ADMIN PAGE
============================================================= */
.admin-wrap { min-height: calc(100vh - 72px); background: var(--bg-soft); padding: 40px 0; }
.admin-card {
  max-width: 420px; margin: 60px auto; background: #fff;
  border-radius: var(--radius); padding: 40px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.admin-card h2 { text-align: center; margin-bottom: 20px; }
.admin-card form { display: grid; gap: 14px; }
.admin-card input {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  font-size: 15px; outline: none;
}
.admin-card input:focus { border-color: var(--primary); }
.admin-card .btn { margin-top: 6px; }
.admin-card .hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
.admin-error { background: #fee; color: #b91c1c; padding: 10px; border-radius: 8px; font-size: 14px; text-align: center; }

.admin-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
}
.admin-toolbar h1 { margin: 0; }
.admin-actions { display: flex; gap: 10px; }

.admin-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.admin-table th, .admin-table td { padding: 14px 16px; text-align: left; font-size: 14px; }
.admin-table th { background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.admin-table tr:not(:first-child) { border-top: 1px solid var(--border); }
.admin-table td .thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 6px; }
.admin-table td .row-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn.danger:hover { background: #fee; color: #b91c1c; border-color: #fca5a5; }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); padding: 30px;
  max-width: 780px; width: 100%; max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h2 { margin-bottom: 20px; }
.modal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-form .full { grid-column: 1/-1; }
.modal-form label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit;
}
.modal-form textarea { min-height: 100px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@media (max-width: 640px) { .modal-form { grid-template-columns: 1fr; } }

.flash {
  position: fixed; top: 90px; right: 20px; z-index: 200;
  background: #10b981; color: #fff; padding: 14px 20px; border-radius: 10px;
  box-shadow: var(--shadow-md); font-weight: 500;
  animation: slidein .3s ease-out;
}
.flash.err { background: #ef4444; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* =============================================================
   MODAL: Mais filtros / Criar alerta
============================================================= */
.modal-filters, .modal-alert {
  max-width: 620px; max-height: 90vh; overflow-y: auto;
  padding: 30px 34px;
}
.modal-close {
  position: absolute; top: 18px; left: 18px;
  background: transparent; border: 0; font-size: 20px;
  cursor: pointer; color: var(--accent); padding: 6px;
  width: 36px; height: 36px; border-radius: 50%;
}
.modal-close:hover { background: var(--bg-soft); }
.modal-filters, .modal-alert { position: relative; padding-top: 60px; }

.modal-op-toggle {
  display: inline-flex; background: var(--bg-soft);
  border-radius: 999px; padding: 4px; margin-bottom: 24px;
}
.op-pill {
  border: 0; background: transparent; padding: 8px 24px;
  border-radius: 999px; font-weight: 600; cursor: pointer;
  font-size: 14px; color: var(--muted); font-family: inherit;
}
.op-pill.active { background: var(--accent); color: #fff; }

.filter-section { margin-bottom: 26px; }
.filter-section h3 {
  font-size: 16px; font-weight: 800; color: var(--accent); margin: 0 0 12px;
}
.range-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;
}
.range-row label {
  display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px;
}
.range-row input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font-size: 15px; outline: none;
  font-family: inherit;
}
.range-row input:focus { border-color: var(--accent); }

/* Campo com prefixo R$ ao lado */
.money-input {
  display: flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; transition: border-color .15s;
  background: #fff;
}
.money-input:focus-within { border-color: var(--accent); }
.money-input .money-prefix {
  padding: 12px 4px 12px 14px;
  color: var(--muted); font-weight: 600; font-size: 15px;
  align-self: center;
}
.money-input input {
  flex: 1; min-width: 0;
  border: 0 !important; padding: 12px 12px 12px 6px !important;
  font-size: 15px; outline: none;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  background: transparent;
}

/* Dual-thumb range slider (mínimo + máximo com bolinhas arrastáveis) */
.dual-slider {
  position: relative;
  height: 28px;
  margin: 14px 4px 6px;
}
.slider-track {
  position: absolute; top: 50%;
  left: 0; right: 0; height: 4px;
  background: var(--border); border-radius: 999px;
  transform: translateY(-50%);
}
.slider-range {
  position: absolute; top: 50%;
  height: 4px; background: var(--accent);
  border-radius: 999px;
  transform: translateY(-50%);
  pointer-events: none;
}
.slider-input {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 28px;
  background: none;
  pointer-events: none;
  appearance: none; -webkit-appearance: none;
  outline: none;
  margin: 0;
}
.slider-input::-webkit-slider-runnable-track {
  background: transparent; border: 0; height: 28px;
}
.slider-input::-moz-range-track { background: transparent; border: 0; height: 28px; }
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: all;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  cursor: grab; margin-top: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  position: relative; z-index: 3;
}
.slider-input::-moz-range-thumb {
  pointer-events: all;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.slider-input::-webkit-slider-thumb:active { cursor: grabbing; }
.slider-input-max { z-index: 2; }
.slider-input-min { z-index: 2; }

.check-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-btn {
  border: 1px solid var(--border); background: #fff;
  padding: 8px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--accent);
  cursor: pointer; font-family: inherit; transition: all .12s;
}
.pill-btn:hover { border-color: var(--accent); }
.pill-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.modal-footer-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 30px;
  padding-top: 20px; border-top: 1px solid var(--border);
}
.btn-apply-lg {
  background: var(--accent); color: #fff; border: 0;
  padding: 14px 32px; border-radius: 999px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  font-family: inherit;
  min-width: 200px;
}
.btn-apply-lg:hover { background: var(--primary); }

/* Toggles (Alerta) */
.alert-section { margin-bottom: 22px; }
.alert-section h4 {
  font-size: 15px; font-weight: 800; color: var(--accent);
  margin: 0 0 12px;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; font-size: 15px; color: var(--accent);
  cursor: pointer;
}
.toggle {
  position: relative; display: inline-block; width: 46px; height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #cbd5e1;
  border-radius: 999px; cursor: pointer; transition: all .2s;
}
.toggle-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.alert-input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; font-size: 14px; outline: none;
  font-family: inherit; margin-bottom: 8px;
}
.alert-input:focus { border-color: var(--accent); }
.modal-alert .btn-apply-lg { width: 100%; margin-top: 8px; }

@media (max-width: 620px) {
  .range-row, .check-grid { grid-template-columns: 1fr; }
  .modal-filters, .modal-alert { padding: 60px 20px 20px; }
}
