/* ============================================================================
 * styles.css — Istela Monguini Imóveis
 * ----------------------------------------------------------------------------
 * Design system profissional, estilo PLATAFORMA IMOBILIÁRIA PREMIUM.
 * Referência de estrutura: camillasallesimoveis.com.br (busca protagonista,
 * mega-menu, seções de bairros/condomínios/cidades, selo VIP, CRECI).
 *
 * Paleta "vermelho refinado": marfim + bordô discreto + dourado fosco.
 * Tipografia: Fraunces (serifada elegante) p/ títulos + Inter (sans) p/ corpo.
 * Complementa o Tailwind (CDN).
 * ==========================================================================*/

:root {
  /* --- Fundos --- */
  --c-ivory:  #FBFAF8;  /* marfim claro (fundo) */
  --c-paper:  #FFFFFF;  /* cartões */
  --c-sand:   #F3EFE9;  /* seções alternadas */

  /* --- Marca (vermelho refinado + dourado) --- */
  --c-bordeaux:      #7A1828; /* acento principal (bordô discreto) */
  --c-bordeaux-deep: #5E121F; /* hover/escuro */
  --c-gold:          #B08D57; /* detalhe dourado fosco */
  --c-gold-soft:     #C8A877;

  /* --- Neutros --- */
  --c-ink:      #211A1C; /* texto principal */
  --c-ink-soft: #6B5F62; /* texto secundário */
  --c-line:     #ECE6E0; /* linhas/bordas */
  --c-line-2:   #E2DAD2;

  /* --- Tipografia --- */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* --- Sombras (discretas, sóbrias) --- */
  --shadow-sm:  0 1px 2px rgba(33,26,28,.05), 0 2px 8px rgba(33,26,28,.04);
  --shadow-md:  0 6px 24px -10px rgba(33,26,28,.18);
  --shadow-lg:  0 18px 50px -20px rgba(33,26,28,.28);

  /* --- Métricas --- */
  --topbar-h: 38px;
  --header-h: 112px;
  --radius:   14px;
}

*,*::before,*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--c-ink);
  background: var(--c-ivory);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,h2,h3,h4,.font-serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--c-ink);
  line-height: 1.12;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.ratio-16x9 { aspect-ratio: 16/9; object-fit: cover; }
.ratio-4x3  { aspect-ratio: 4/3;  object-fit: cover; }
.ratio-3x2  { aspect-ratio: 3/2;  object-fit: cover; }

.container { max-width: 1200px; margin-inline: auto; padding-inline: 1.25rem; }

/* ---------------------------------------------------------------------------
 * Tokens de marca utilitários
 * -------------------------------------------------------------------------*/
.text-bordeaux { color: var(--c-bordeaux); }
.text-gold     { color: var(--c-gold); }
.text-soft     { color: var(--c-ink-soft); }
.bg-sand       { background: var(--c-sand); }
.bg-paper      { background: var(--c-paper); }

/* Aliases de compatibilidade (nomes usados em páginas/JS anteriores) */
.text-ink-soft { color: var(--c-ink-soft); }
.text-wine     { color: var(--c-bordeaux); }
.text-accent   { color: var(--c-bordeaux); }
.bg-ivory-deep { background: var(--c-sand); }
.bg-ivory      { background: var(--c-ivory); }
.bg-cream      { background: var(--c-paper); }

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-gold);
}
.eyebrow.dark { color: var(--c-bordeaux); }

.rule { width: 48px; height: 2px; background: var(--c-gold); border: 0; margin: 1rem 0; }
.rule.center { margin-inline: auto; }

.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }

/* ---------------------------------------------------------------------------
 * Botões
 * -------------------------------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 500; font-size: .9rem; letter-spacing: .01em;
  cursor: pointer; border: 1px solid transparent;
  transition: background-color .25s, color .25s, border-color .25s, transform .25s, box-shadow .25s;
}
.btn-primary { background: var(--c-bordeaux); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-bordeaux-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--c-gold); color: #2a2017; }
.btn-gold:hover { background: var(--c-gold-soft); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--c-ink); border-color: var(--c-line-2); }
.btn-ghost:hover { border-color: var(--c-bordeaux); color: var(--c-bordeaux); }
.btn-light { background: #fff; color: var(--c-bordeaux); }
.btn-light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-block { width: 100%; justify-content: center; }

.link-seta { color: var(--c-bordeaux); font-weight: 500; font-size: .92rem; display: inline-flex; align-items: center; gap: .4rem; }
.link-seta span { transition: transform .25s; }
.link-seta:hover span { transform: translateX(4px); }

/* ---------------------------------------------------------------------------
 * Top bar (CRECI · telefone · VIP)
 * -------------------------------------------------------------------------*/
.topbar {
  height: var(--topbar-h);
  background: var(--c-bordeaux);
  color: #f5e9ea;
  font-size: .78rem;
  display: flex; align-items: center;
}
.topbar a { color: #fff; }
.topbar .vip { color: var(--c-gold-soft); font-weight: 600; letter-spacing: .08em; }

/* ---------------------------------------------------------------------------
 * Header + mega-menu
 * -------------------------------------------------------------------------*/
.site-header {
  position: sticky; top: 0; z-index: 50;
  min-height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(251,250,248,.9);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--c-line);
  transition: box-shadow .35s, background-color .35s;
}
.site-header.scrolled { box-shadow: var(--shadow-sm); background: rgba(255,255,255,.95); }

.header-shell {
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(1rem, 2.8vw, 2.75rem);
}

/* Header transparente sobre hero (somente na home, antes do scroll) */
.site-header.over-hero {
  position: fixed; left: 0; right: 0;
  background: transparent; border-bottom-color: transparent; backdrop-filter: none;
}
.site-header.over-hero:not(.scrolled) { color: #fff; }
.site-header.over-hero:not(.scrolled) .brand,
.site-header.over-hero:not(.scrolled) .nav-top > a { color: #fff; }

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex: none;
  justify-self: start;
}
.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  padding: 0;
  background: transparent;
  border-radius: 0;
  flex: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .28));
}

.brand-logo-header {
  width: auto;
  height: clamp(82px, 8vw, 100px);
  max-width: 138px;
}

.brand-logo-mobile {
  width: auto;
  height: 173px;
  max-width: 263px;
}

.brand-logo-footer {
  width: auto;
  height: 120px;
  max-width: 176px;
}

.header-actions {
  justify-self: end;
  flex-wrap: nowrap;
}

.site-header.over-hero:not(.scrolled) .brand-logo {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
}

.site-header.over-hero:not(.scrolled) .brand {
  padding: .35rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.08));
  box-shadow: 0 10px 28px -20px rgba(0,0,0,.55);
}

.nav-top { display: none; align-items: center; justify-content: center; gap: clamp(1rem, 1.7vw, 1.8rem); height: 100%; }
@media (min-width: 1024px) { .nav-top { display: flex; } }

.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-item > a {
  font-size: .9rem; font-weight: 500; letter-spacing: .01em;
  padding: .3rem 0; display: inline-flex; align-items: center; gap: .3rem;
}
.nav-item > a::after {
  content: ''; position: absolute; left: 0; bottom: 1.2rem; height: 1.5px; width: 0;
  background: var(--c-bordeaux); transition: width .3s;
}
.nav-item:hover > a::after { width: 100%; }

/* Dropdown do mega-menu */
.submenu {
  position: absolute; top: calc(100% - 6px); left: 50%; transform: translateX(-50%) translateY(8px);
  background: #fff; border: 1px solid var(--c-line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: .5rem; min-width: 220px;
  opacity: 0; visibility: hidden; transition: opacity .22s, transform .22s; z-index: 60;
}
.nav-item:hover .submenu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.submenu a {
  display: block; padding: .6rem .8rem; border-radius: 8px; font-size: .88rem; color: var(--c-ink);
  transition: background-color .2s, color .2s;
}
.submenu a:hover { background: var(--c-sand); color: var(--c-bordeaux); }

/* Link simples no header (ex.: Área do Cliente) */
.nav-link { font-size: .9rem; font-weight: 500; color: var(--c-ink); transition: color .25s; }
.nav-link:hover { color: var(--c-bordeaux); }

@media (max-width: 1279px) {
  :root { --header-h: 104px; }
  .header-shell { column-gap: 1rem; }
  .brand-logo-header { height: 88px; max-width: 124px; }
}

@media (max-width: 1023px) {
  :root { --header-h: 96px; }
  .header-shell { grid-template-columns: auto 1fr auto; }
  .brand-logo-header { height: 78px; max-width: 112px; }
}

@media (max-width: 520px) {
  :root { --header-h: 88px; }
  .header-shell { column-gap: .75rem; }
  .brand-logo-header { height: 64px; max-width: 96px; }
  .brand-logo-mobile { height: 144px; max-width: 223px; }
  .brand-logo-footer { height: 104px; max-width: 148px; }
  .header-actions { gap: .55rem; }
}

/* Botão hambúrguer (reset do estilo nativo do navegador) */
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: .25rem; margin: 0;
  color: var(--c-ink); cursor: pointer; line-height: 1;
}
.menu-toggle:hover { color: var(--c-bordeaux); }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

/* Botão fechar do menu mobile (também sem chrome nativo) */
#menu-close { background: transparent; border: 0; padding: .25rem; color: var(--c-ink); cursor: pointer; line-height: 1; }
#menu-close:hover { color: var(--c-bordeaux); }
.mobile-menu {
  position: fixed; inset: 0; z-index: 9995; background: #fff;
  transform: translateX(100%); transition: transform .4s cubic-bezier(.16,1,.3,1);
  overflow-y: auto; padding: 1.5rem;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu .grp { border-bottom: 1px solid var(--c-line); padding: 1rem 0; }
.mobile-menu .grp > p { font-family: var(--font-serif); font-size: 1.15rem; margin: 0 0 .5rem; }
.mobile-menu .grp a { display: block; padding: .4rem 0; color: var(--c-ink-soft); }

/* ---------------------------------------------------------------------------
 * Hero + busca protagonista
 * -------------------------------------------------------------------------*/
.hero {
  position: relative; min-height: 92vh; display: flex; align-items: center;
  color: #fff; overflow: hidden;
}
.hero > .container {
  padding-top: calc(var(--header-h) + clamp(1rem, 3vw, 2rem));
  padding-bottom: clamp(2rem, 6vw, 4rem);
}
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(20,12,14,.55), rgba(20,12,14,.35) 40%, rgba(20,12,14,.7));
}
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.5vw, 4.6rem); font-weight: 400; }
.hero .lead { color: rgba(255,255,255,.9); font-size: clamp(1.05rem,2vw,1.3rem); font-weight: 300; }

@media (max-width: 767px) {
  .hero {
    min-height: auto;
  }
  .hero > .container {
    padding-top: calc(var(--header-h) + 1.25rem);
  }
}

/* Caixa de busca */
.searchbox {
  background: rgba(255,255,255,.97); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 1.1rem; border: 1px solid rgba(255,255,255,.6);
}
.search-tabs { display: flex; gap: .3rem; margin-bottom: .9rem; }
.search-tab {
  padding: .45rem 1.1rem; border-radius: 8px; font-size: .85rem; font-weight: 500; cursor: pointer;
  color: var(--c-ink-soft); background: transparent; border: 0;
}
.search-tab.active { background: var(--c-bordeaux); color: #fff; }
.search-grid { display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .search-grid { grid-template-columns: 1.3fr 1fr 1fr auto; align-items: end; } }

/* ---------------------------------------------------------------------------
 * Campos de formulário
 * -------------------------------------------------------------------------*/
.field {
  font-family: var(--font-sans); width: 100%;
  padding: .8rem .95rem; border: 1px solid var(--c-line-2); border-radius: 10px;
  background: #fff; color: var(--c-ink); font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
}
.field:focus { outline: none; border-color: var(--c-bordeaux); box-shadow: 0 0 0 3px rgba(122,24,40,.1); }
.label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--c-ink-soft); margin-bottom: .35rem; font-weight: 600; }

/* ---------------------------------------------------------------------------
 * Selo VIP
 * -------------------------------------------------------------------------*/
.vip-card {
  background: linear-gradient(135deg, var(--c-bordeaux), var(--c-bordeaux-deep));
  color: #fff; border-radius: var(--radius); overflow: hidden; position: relative;
}
.vip-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(176,141,87,.35), transparent 60%);
}
.vip-card .gold { color: var(--c-gold-soft); }

/* ---------------------------------------------------------------------------
 * Categorias (tiles)
 * -------------------------------------------------------------------------*/
.cat-tile {
  position: relative; border-radius: var(--radius); overflow: hidden; display: block;
  min-height: 220px; color: #fff;
}
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.16,1,.3,1); }
.cat-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,12,14,.78), rgba(20,12,14,.05)); }
.cat-tile:hover img { transform: scale(1.07); }
.cat-tile .cap { position: absolute; left: 1.1rem; bottom: 1rem; z-index: 1; }
.cat-tile .cap h3 { color: #fff; font-size: 1.4rem; }

/* ---------------------------------------------------------------------------
 * Cards de imóveis
 * -------------------------------------------------------------------------*/
.imovel-card {
  background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; transition: transform .4s cubic-bezier(.16,1,.3,1), box-shadow .4s, border-color .3s;
}
.imovel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--c-line-2); }
.imovel-card .card-media { position: relative; overflow: hidden; }
.imovel-card .card-media img { width: 100%; transition: transform .8s cubic-bezier(.16,1,.3,1); }
.imovel-card:hover .card-media img { transform: scale(1.06); }

.badge {
  display: inline-block; padding: .26rem .6rem; border-radius: 6px;
  font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.badge-finalidade { background: rgba(255,255,255,.92); color: var(--c-bordeaux); }
.badge-destaque   { background: var(--c-gold); color: #2a2017; }

.preco { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; color: var(--c-bordeaux); }

.specs { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--c-ink-soft); font-size: .84rem; }
.specs span { display: inline-flex; align-items: center; gap: .35rem; }
.divider { height: 1px; background: var(--c-line); border: 0; }

/* ---------------------------------------------------------------------------
 * Bairros (chips/grid) e cidades
 * -------------------------------------------------------------------------*/
.bairro-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .6rem; }
@media (min-width: 640px) { .bairro-grid { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 1024px) { .bairro-grid { grid-template-columns: repeat(4,1fr); } }
.bairro-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; background: #fff; border: 1px solid var(--c-line); border-radius: 10px;
  font-size: .9rem; transition: border-color .25s, color .25s, transform .25s;
}
.bairro-link:hover { border-color: var(--c-bordeaux); color: var(--c-bordeaux); transform: translateY(-2px); }
.bairro-link .n { color: var(--c-ink-soft); font-size: .8rem; }

.condo-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 280px; color: #fff; display: block; }
.condo-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s; }
.condo-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,12,14,.8), transparent 60%); }
.condo-card:hover img { transform: scale(1.06); }
.condo-card .cap { position: absolute; left: 1.2rem; bottom: 1.1rem; z-index: 1; }

.cidade-pill {
  padding: .55rem 1.1rem; border: 1px solid var(--c-line-2); border-radius: 999px;
  font-size: .88rem; background: #fff; transition: border-color .25s, color .25s;
}
.cidade-pill:hover { border-color: var(--c-gold); color: var(--c-bordeaux); }

/* ---------------------------------------------------------------------------
 * Listagem: split mapa + lista
 * -------------------------------------------------------------------------*/
.listing-filters {
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.mobile-filters-bar,
.mobile-filters-actions {
  display: none;
}

.mobile-filters-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  border: 1px solid var(--c-line-2);
  border-radius: 14px;
  background: #fff;
  color: var(--c-ink);
  padding: .95rem 1rem;
  font: inherit;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.mobile-filters-badge {
  min-width: 30px;
  height: 30px;
  padding-inline: .55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--c-bordeaux);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}

.mobile-filters-badge.is-empty {
  background: var(--c-line-2);
  color: var(--c-ink-soft);
}

.mobile-filters-summary {
  margin: 0;
  color: var(--c-ink-soft);
  font-size: .86rem;
  line-height: 1.45;
}

.mobile-filters-panel {
  display: block;
}

.filters-meta {
  gap: 1rem;
}

.mobile-filters-actions {
  margin-top: 1rem;
}

.split { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - var(--header-h)); }
@media (min-width: 1024px) { .split { grid-template-columns: 1fr 1fr; } }
.split-list { padding: 1.25rem; overflow-y: auto; max-height: calc(100vh - var(--header-h)); }
.split-map { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); }
#map, #map-detalhe { width: 100%; height: 100%; z-index: 1; }

.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 0; width: 230px !important; }
.map-popup img { width: 100%; height: 130px; object-fit: cover; }
.map-popup .pad { padding: .7rem .85rem .9rem; }
.map-popup .preco { font-size: 1.1rem; }

.pin { background: var(--c-bordeaux); width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
.pin.ativo { background: var(--c-gold); transform: rotate(-45deg) scale(1.25); }

.tab-btn { flex: 1; padding: .7rem; text-align: center; font-weight: 500; color: var(--c-ink-soft); border-bottom: 2px solid transparent; cursor: pointer; }
.tab-btn.active { color: var(--c-bordeaux); border-color: var(--c-bordeaux); }

@media (max-width: 1023px) {
  .mobile-filters-bar {
    display: grid;
    gap: .75rem;
  }

  .mobile-filters-actions {
    display: block;
  }

  .mobile-filters-panel {
    display: none;
    padding-top: 1rem;
  }

  .mobile-filters-panel.open {
    display: block;
  }

  #filtros {
    grid-template-columns: 1fr;
  }

  #filtros > div,
  #filtros .col-span-2 {
    grid-column: auto;
  }

  .filters-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .split-list {
    max-height: none;
    padding: 1rem;
  }
}

@media (min-width: 1024px) {
  .mobile-filters-panel {
    display: block !important;
  }
}

/* ---------------------------------------------------------------------------
 * Galeria (detalhes) + lightbox
 * -------------------------------------------------------------------------*/
.gallery-main { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4,1fr); gap: .55rem; }
.gallery-thumbs img { border-radius: 9px; cursor: pointer; aspect-ratio: 4/3; object-fit: cover; opacity: .65; transition: opacity .3s, transform .3s; }
.gallery-thumbs img:hover, .gallery-thumbs img.active { opacity: 1; transform: translateY(-2px); }
.lightbox { position: fixed; inset: 0; background: rgba(15,8,10,.94); z-index: 9000; display: none; align-items: center; justify-content: center; padding: 2rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; }
.lightbox-close, .lightbox-nav { position: absolute; color: #fff; font-size: 1.8rem; cursor: pointer; background: rgba(255,255,255,.12); border: 0; width: 50px; height: 50px; border-radius: 50%; }
.lightbox-close { top: 1.5rem; right: 1.5rem; }
.lightbox-nav.prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* Navegação na galeria principal (sem ampliar) */
.gallery-main { position: relative; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--c-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); transition: background .2s; z-index: 2; }
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: .8rem; }
.gallery-nav.next { right: .8rem; }
.gallery-contador { position: absolute; bottom: .8rem; right: .8rem; background: rgba(33,26,28,.7); color: #fff; font-size: .8rem; padding: .2rem .6rem; border-radius: 8px; z-index: 2; }

/* Lightbox — modo mosaico (colagem) + modo individual */
.lb-mosaico { width: min(1100px,94vw); max-height: 88vh; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: .6rem; padding: .4rem; }
.lb-mosaico img { width: 100%; height: 165px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: transform .25s, box-shadow .25s; }
.lb-mosaico img:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }
.lb-single { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.lb-mosaico.hidden, .lb-single.hidden { display: none; }
.lb-voltar { position: absolute; top: 1.5rem; left: 1.5rem; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 20px; padding: .5rem 1rem; cursor: pointer; font-size: .9rem; }
.lb-voltar:hover { background: rgba(255,255,255,.25); }

/* Vídeo na galeria + lightbox */
.gallery-video { aspect-ratio: 16/9; width: 100%; object-fit: contain; background: #000; display: block; }
.gallery-video.hidden { display: none; }   /* garante que 'hidden' prevaleça sobre display:block */
#lightbox-video { max-width: 92vw; max-height: 88vh; border-radius: 8px; background: #000; }

/* Miniaturas como células (foto ou vídeo, com selo ▶) */
.thumb-cell { position: relative; cursor: pointer; border-radius: 9px; overflow: hidden; aspect-ratio: 4/3; }
.thumb-cell img { width: 100%; height: 100%; object-fit: cover; opacity: .65; transition: opacity .3s, transform .3s; display: block; }
.thumb-cell:hover img, .thumb-cell.active img { opacity: 1; transform: translateY(-2px); }
.thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem; background: rgba(0,0,0,.30); pointer-events: none; }

/* Mosaico: célula de vídeo */
.lb-mosaico .mosaico-cell { position: relative; height: 165px; border-radius: 8px; overflow: hidden; cursor: pointer; }
.lb-mosaico .mosaico-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

/* Admin — gerenciador de imagens (ordenar / colagem / excluir) */
#preview-imagens { display: flex; flex-wrap: wrap; gap: .6rem; }
.img-thumb { position: relative; width: 108px; height: 80px; border-radius: 10px; overflow: hidden; cursor: grab; border: 2px solid transparent; background: var(--c-sand); }
.img-thumb:active { cursor: grabbing; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.img-thumb.arrastando { opacity: .35; }
.img-thumb.na-colagem { border-color: var(--c-gold); }
.img-thumb .img-del, .img-thumb .img-flag { position: absolute; width: 22px; height: 22px; border: 0; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.img-thumb .img-del { top: 4px; right: 4px; background: rgba(122,24,40,.92); color: #fff; }
.img-thumb .img-flag { top: 4px; left: 4px; background: rgba(255,255,255,.85); color: #b9b0a6; }
.img-thumb.na-colagem .img-flag { background: var(--c-gold); color: #fff; }
.img-thumb .img-capa { position: absolute; bottom: 4px; left: 4px; background: rgba(33,26,28,.8); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 6px; letter-spacing: .04em; }

/* ---------------------------------------------------------------------------
 * Admin
 * -------------------------------------------------------------------------*/
.admin-shell { min-height: 100vh; background: var(--c-sand); }
.admin-card { background: var(--c-paper); border: 1px solid var(--c-line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.pin-input { width: 3rem; height: 3.6rem; text-align: center; font-size: 1.4rem; font-family: var(--font-serif); border: 1px solid var(--c-line-2); border-radius: 12px; background: #fff; }
.pin-input:focus { outline: none; border-color: var(--c-bordeaux); box-shadow: 0 0 0 3px rgba(122,24,40,.12); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--c-line); font-size: .9rem; }
.admin-table th { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; color: var(--c-ink-soft); }
.admin-table tr:hover td { background: var(--c-sand); }
.admin-tab { padding: .7rem 1.1rem; font-size: .85rem; font-weight: 600; color: var(--c-ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; transition: color .2s, border-color .2s; }
.admin-tab:hover { color: var(--c-bordeaux); }
.admin-tab.active { color: var(--c-bordeaux); border-bottom-color: var(--c-bordeaux); }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--c-ink); color: #fff; padding: .9rem 1.4rem; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 9999; transition: transform .45s cubic-bezier(.16,1,.3,1); max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------------------
 * Modal de cadastro em "tamanho de página" (cadastro de imóvel)
 * Folha ampla e alta, com cabeçalho e ações fixos; vira tela cheia no mobile.
 * ------------------------------------------------------------------------- */
.modal-pagina { padding: 1.25rem; }
.modal-folha { max-width: 1100px; max-height: 94vh; overflow: auto; }
.modal-folha legend { letter-spacing: .04em; }
@media (max-width: 768px) {
  .modal-pagina { padding: 0; }
  .modal-folha { max-width: 100%; max-height: 100vh; min-height: 100vh; border-radius: 0; margin: 0; }
}

/* ---------------------------------------------------------------------------
 * Filtro dinâmico do painel (chips de quantidade: dorm./vagas/suítes)
 * ------------------------------------------------------------------------- */
.chip-group { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .42rem .85rem; border: 1px solid var(--c-line-2); border-radius: 10px; font-size: .85rem; font-weight: 600; line-height: 1; background: #fff; color: var(--c-ink); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--c-bordeaux); color: var(--c-bordeaux); }
.chip.active { background: var(--c-bordeaux); color: #fff; border-color: var(--c-bordeaux); }

/* ---------------------------------------------------------------------------
 * Listagem de imóveis do painel em CARDS (layout estilo plataforma)
 * ------------------------------------------------------------------------- */
.imovel-row { position: relative; display: grid; grid-template-columns: 170px minmax(0,1fr) auto auto 48px; align-items: stretch; background: var(--c-paper); border: 1px solid var(--c-line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s; }
.imovel-row:hover { box-shadow: var(--shadow-md); border-color: var(--c-line-2); }

.ir-foto { position: relative; min-height: 128px; background: var(--c-sand); overflow: hidden; }
.ir-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ir-sem { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--c-ink-soft); font-size: .8rem; }
.ir-ref { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.94); color: var(--c-ink); font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: .2rem .5rem; border-radius: 8px; box-shadow: var(--shadow-sm); }
.ir-dot { width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; display: inline-block; }
.ir-count { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; padding: .15rem .45rem; border-radius: 8px; }
.ir-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; border: 0; cursor: pointer; font-size: 1.1rem; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.imovel-row:hover .ir-nav { opacity: 1; }
.ir-nav.ir-prev { left: 6px; } .ir-nav.ir-next { right: 6px; }

.ir-main { padding: .9rem 1.1rem; min-width: 0; }
.ir-titulo { color: var(--c-bordeaux); font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; line-height: 1.2; }
.ir-sub { color: var(--c-ink-soft); font-size: .85rem; margin-top: .25rem; }
.ir-specs { font-size: .92rem; margin-top: .55rem; color: var(--c-ink); }
.ir-specs b { font-weight: 700; }
.ir-specs i { color: var(--c-line-2); font-style: normal; margin: 0 .2rem; }
.ir-foot { font-size: .78rem; color: var(--c-ink-soft); margin-top: .55rem; }

.ir-mid { display: flex; align-items: center; padding: .9rem; }
.ir-exc { font-size: .85rem; color: var(--c-ink); white-space: nowrap; }
.ir-exc b { color: #2ecc71; }

.ir-preco { padding: .9rem 1.3rem; text-align: right; border-left: 1px solid var(--c-line); align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-width: 140px; }
.ir-preco-linha { display: flex; gap: .5rem; align-items: baseline; justify-content: flex-end; }
.ir-preco-linha span { color: var(--c-ink-soft); font-size: .8rem; }
.ir-preco-linha strong { color: var(--c-bordeaux); font-size: 1.05rem; white-space: nowrap; }
.ir-m2 { color: var(--c-ink-soft); font-size: .78rem; margin-top: .25rem; }

.ir-acoes { position: relative; display: flex; align-items: flex-start; justify-content: center; padding-top: .6rem; }
.ir-kebab { background: transparent; border: 0; font-size: 1.5rem; line-height: 1; color: var(--c-ink-soft); cursor: pointer; padding: .2rem .4rem; border-radius: 8px; }
.ir-kebab:hover { color: var(--c-bordeaux); background: var(--c-sand); }
.ir-menu { position: absolute; right: 8px; top: 40px; background: #fff; border: 1px solid var(--c-line); border-radius: 10px; box-shadow: var(--shadow-md); z-index: 30; min-width: 132px; overflow: hidden; }
.ir-menu button { display: block; width: 100%; text-align: left; padding: .6rem .9rem; font-size: .85rem; background: #fff; border: 0; cursor: pointer; }
.ir-menu button:hover { background: var(--c-sand); }
.ir-menu button[data-del] { color: #b3261e; }

@media (max-width: 820px) {
  .imovel-row { grid-template-columns: 120px minmax(0,1fr) 44px; }
  .ir-mid { display: none; }
  .ir-preco { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--c-line); text-align: left; }
  .ir-preco-linha { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .imovel-row { grid-template-columns: 1fr; }
  .ir-foto { min-height: 190px; }
  .ir-acoes { position: absolute; top: 6px; right: 6px; padding: 0; z-index: 5; }
  .ir-kebab { background: rgba(255,255,255,.92); }
}

/* ---------------------------------------------------------------------------
 * Rodapé
 * -------------------------------------------------------------------------*/
.site-footer { background: #1A1416; color: #d8cdce; }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: var(--c-gold-soft); }
.site-footer h4 { color: #fff; font-family: var(--font-sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.site-footer a { color: #c4b8ba; transition: color .2s; }
.site-footer a:hover { color: #fff; }

/* ---------------------------------------------------------------------------
 * Cursor customizado (sutil, desktop)
 * -------------------------------------------------------------------------*/
.cursor-ring { position: fixed; top: 0; left: 0; width: 30px; height: 30px; border: 1.5px solid rgba(122,24,40,.5); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%,-50%); transition: width .2s, height .2s, border-color .2s, opacity .2s; mix-blend-mode: multiply; }
.cursor-ring.hover { width: 46px; height: 46px; border-color: var(--c-bordeaux); background: rgba(122,24,40,.05); }
@media (hover: none), (pointer: coarse) { .cursor-ring { display: none !important; } }

/* ---------------------------------------------------------------------------
 * Botão flutuante de WhatsApp
 * -------------------------------------------------------------------------*/
.wa-float {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 9990;
  display: inline-flex; align-items: center; justify-content: center;
  background: #25D366; color: #fff;
  width: 58px; height: 58px; border-radius: 50%;
  box-shadow: 0 10px 28px -8px rgba(37,211,102,.6);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.wa-float svg { width: 32px; height: 32px; flex: none; }
.wa-float:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 14px 32px -8px rgba(37,211,102,.7); }
/* Pulso sutil para chamar atenção (respeita prefers-reduced-motion via regra global) */
.wa-float::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37,211,102,.5); animation: wa-pulse 2.6s infinite;
}
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.45); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
@media (max-width: 640px) { .wa-float { right: 1rem; bottom: 1rem; } }

/* Transição de página */
.page-transition { position: fixed; inset: 0; background: var(--c-ivory); z-index: 9998; pointer-events: none; opacity: 0; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(22px); }

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

.split-list::-webkit-scrollbar { width: 8px; }
.split-list::-webkit-scrollbar-thumb { background: var(--c-line-2); border-radius: 8px; }
