/* ============================
   VARIÁVEIS
============================ */
:root {
    /* Paleta: grafite = contraste e superfícies escuras; areia = fundo claro (logo colorido);
       verde só no logotipo, links e na ação principal; ouro em destaques pontuais. */
    --verde:       #367F3B;
    --verde-esc:   #2C6A31;   /* hover do verde (não usar como fundo) */
    --grafite:     #2B2524;
    --grafite-2:   #3A3433;
    --grafite-fundo: #1F1B1A;
    --areia:       #F6F3EC;
    --areia-2:     #ECE7DC;
    --linha:       #DDD6C8;
    --marrom:      #544443;
    --ouro:        #F2B705;
    --wpp:         #25D366;
    --wpp-esc:     #1ebe5d;
    --overlay:     rgba(0,0,0,.55);
    --fonte:       'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    --radius:      12px;
    --prog-h:      3px;
    --autoplay-s:  6s;
}

/* ============================
   RESET
============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--fonte); }
body.modo-splash { overflow: auto; background: var(--grafite-fundo); }
body.modo-grade  { overflow: auto; background: var(--grafite-fundo); }
body:not(.modo-splash):not(.modo-grade) { overflow: hidden; background: var(--grafite-fundo); } /* imovel.php */
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================
   TELA DE BUSCA (SPLASH)
============================ */
.tela-busca {
    position: relative; min-height: 100vh; z-index: 50;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    transition: opacity .4s, transform .4s;
}
.tela-busca.oculta { display: none; }

.splash-bg {
    position: fixed; inset: 0; z-index: -1;
    background: var(--bg-url, var(--grafite)) center/cover no-repeat;
}
.splash-overlay {
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(31,27,26,.35) 0%, rgba(31,27,26,.75) 100%);
}

.splash-conteudo {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    width: 100%; max-width: 480px; padding: 20px 16px;
}

.splash-logo { width: 230px; max-width: 100%; }
.splash-marca { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 4px; }
.splash-h1 {
    color: var(--marrom); font-size: 14px; font-weight: 600; text-align: center; line-height: 1.35;
    max-width: 320px;
}

.card-busca {
    background: var(--areia); color: var(--grafite);
    box-shadow: 0 16px 48px rgba(0,0,0,.35);
    border-radius: 16px; padding: 24px 20px;
    width: 100%; display: flex; flex-direction: column; gap: 14px;
}

.busca-tipo { display: flex; gap: 0; background: var(--areia-2); border-radius: 8px; overflow: hidden; }
.tipo-pill {
    flex: 1; text-align: center; padding: 10px; cursor: pointer;
    color: var(--marrom); font-weight: 600; font-size: 15px;
    transition: .2s;
}
.tipo-pill.ativo { background: var(--grafite); color: #fff; }
.tipo-pill input { display: none; }

.busca-campo select,
.busca-campo input[type="text"] {
    width: 100%; padding: 12px 14px; border-radius: 8px;
    border: 1px solid var(--linha);
    background: #fff; color: var(--grafite);
    font-size: 15px; outline: none;
}
.busca-campo select option { color: #222; background: #fff; }
.busca-campo input::placeholder { color: #8C7F7D; }
.busca-campo input:focus, .busca-campo select:focus { border-color: var(--grafite); }

.busca-preco label {
    font-size: 13px; color: var(--marrom); font-weight: 600;
    display: block; margin-bottom: 6px;
}
.busca-preco input[type="range"] {
    width: 100%; accent-color: var(--grafite); height: 4px;
    background: var(--linha); border: none;
}

.busca-quartos label { font-size: 13px; color: var(--marrom); font-weight: 600; margin-bottom: 6px; }
.quartos-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.q-pill {
    padding: 6px 14px; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500;
    border: 1px solid var(--linha); color: var(--marrom); background: #fff;
    transition: .15s;
}
.q-pill.ativo, .q-pill:hover { background: var(--grafite); color: #fff; border-color: var(--grafite); }
.q-pill input { display: none; }

.btn-ver-imoveis {
    background: var(--verde); color: #fff; border: none;
    padding: 14px; border-radius: 8px; font-size: 16px; font-weight: 700;
    cursor: pointer; width: 100%; transition: background .15s;
    letter-spacing: .3px;
}
.btn-ver-imoveis:hover { background: var(--verde-esc); }

.link-ver-todos { color: rgba(255,255,255,.7); font-size: 13px; text-decoration: underline; }
.link-ver-todos:hover { color: #fff; }

/* ============================
   FEED DE STORIES
============================ */
.feed-stories {
    position: fixed; inset: 0; overflow: hidden;
    transition: opacity .4s;
}
.feed-stories.oculto { opacity: 0; pointer-events: none; }

.stories-feed {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    overflow-y: scroll; scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.stories-feed::-webkit-scrollbar { display: none; }

/* ============================
   IMÓVEL (container vertical)
============================ */
.story-imovel {
    flex-shrink: 0; width: 100%; height: 100vh;
    position: relative; overflow: hidden;
    scroll-snap-align: start;
    display: flex;
}

/* Slides dentro de um imóvel (horizontal) */
.story-imovel {
    flex-direction: row;
    overflow-x: scroll; scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.story-imovel::-webkit-scrollbar { display: none; }

.story-slide {
    flex-shrink: 0; width: 100%; height: 100vh;
    position: relative; overflow: hidden;
    scroll-snap-align: start;
    background: #111;
    display: flex; align-items: center; justify-content: center;
}

/* ============================
   BARRA DE PROGRESSO
============================ */
.progress-bar-container {
    position: absolute; top: 0; left: 0; right: 0; z-index: 20;
    display: flex; gap: 3px; padding: 8px 10px;
    pointer-events: none;
}
.progress-seg {
    flex: 1; height: var(--prog-h); background: rgba(255,255,255,.35);
    border-radius: 2px; overflow: hidden;
}
.progress-seg .fill {
    height: 100%; width: 0; background: #fff;
    border-radius: 2px;
}
.progress-seg.done .fill { width: 100%; }
.progress-seg.active .fill {
    animation: prog var(--autoplay-s) linear forwards;
}
@keyframes prog { from { width: 0 } to { width: 100% } }

/* ============================
   SLIDE — FOTO
============================ */
.story-slide img, .story-slide video {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
}

.slide-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 50%);
    display: flex; align-items: flex-end; padding: 24px 20px;
    pointer-events: none;
}
.slide-info { color: #fff; }
.slide-titulo { font-size: 18px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.slide-preco  { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.slide-local  { font-size: 13px; opacity: .85; }

/* Botão unmute vídeo */
.btn-unmute {
    position: absolute; bottom: 24px; right: 20px; z-index: 10;
    background: rgba(0,0,0,.5); border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}

/* ============================
   SLIDE — FICHA TÉCNICA
============================ */
.ficha-bg {
    position: absolute; inset: 0;
    background: var(--grafite) center/cover no-repeat;
    filter: blur(8px) brightness(.3);
    transform: scale(1.05);
}

.ficha-conteudo {
    position: relative; z-index: 2; color: #fff;
    width: 100%; max-width: 520px; padding: 60px 24px 80px;
    overflow-y: auto; height: 100%;
}

.ficha-header { margin-bottom: 24px; }
.ficha-header h2 { font-size: 22px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.ficha-preco { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.ficha-tag {
    display: inline-block; padding: 3px 12px; border-radius: 12px;
    font-size: 13px; font-weight: 700;
}
.ficha-tag.tag-venda   { background: var(--areia); color: var(--grafite); }
.ficha-tag.tag-aluguel { background: var(--ouro); color: var(--grafite); }

.ficha-itens { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.ficha-item {
    font-size: 17px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    opacity: 0; transform: translateX(-16px);
}
.ficha-item.anim.visible {
    animation: slideIn .4s ease var(--d, 0s) forwards;
}
@keyframes slideIn {
    to { opacity: 1; transform: none; }
}

.ficha-descricao {
    font-size: 14px; line-height: 1.6; opacity: .85;
    border-top: 1px solid rgba(255,255,255,.2); padding-top: 16px;
    max-height: 200px; overflow-y: auto;
}

/* ============================
   SLIDE — MAPA
============================ */
.mapa-container { position: absolute; inset: 0; }

/* Faixas de navegação sobre o mapa (acima do z-index do Leaflet ~400) */
.mapa-nav-esq,
.mapa-nav-dir {
    position: absolute; top: 0; bottom: 80px; z-index: 1000;
    width: 18%; cursor: pointer;
}
.mapa-nav-esq { left: 0; }
.mapa-nav-dir { right: 0; }

.mapa-endereco {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 500;
    background: rgba(255,255,255,.95); padding: 14px 20px;
    font-size: 14px; line-height: 1.5;
    box-shadow: 0 -2px 12px rgba(0,0,0,.12);
}

/* ============================
   SLIDE — CTA
============================ */
.cta-bg {
    position: absolute; inset: 0;
    background: var(--grafite) center/cover no-repeat;
    filter: blur(12px) brightness(.25);
    transform: scale(1.05);
}
.cta-conteudo {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    gap: 16px; padding: 80px 28px 40px; text-align: center; color: #fff;
    width: 100%; max-width: 400px;
}
.cta-logo { display: none; }
.cta-chamada { font-size: 16px; opacity: .8; }
.cta-titulo  { font-size: 20px; font-weight: 700; line-height: 1.3; }
.btn-wpp {
    display: inline-block; background: var(--wpp); color: #fff;
    padding: 14px 28px; border-radius: 50px; font-size: 16px; font-weight: 700;
    text-decoration: none; letter-spacing: .3px;
    box-shadow: 0 4px 20px rgba(37,211,102,.4);
    transition: background .15s, transform .1s;
}
.btn-wpp:hover { background: var(--wpp-esc); transform: translateY(-2px); }
.cta-tel { font-size: 14px; opacity: .7; }
.cta-link-imovel { font-size: 13px; opacity: .7; text-decoration: underline; }
.cta-link-imovel:hover { opacity: 1; }

/* Cursor pointer nos slides (clique esq/dir para navegar) */
.story-slide { cursor: pointer; }

/* ============================
   MINI-BLOCO EMPRESA NO CTA
============================ */
.cta-empresa {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px;
    margin-top: 4px; width: 100%;
}
.cta-empresa span { font-size: 11px; color: rgba(255,255,255,.55); }
.cta-link-sobre  { font-size: 12px; color: rgba(255,255,255,.7); text-decoration: underline; margin-top: 2px; }
.cta-link-sobre:hover { color: #fff; }

/* ============================
   RODAPÉ DO SITE
============================ */
.rodape-site {
    background: var(--grafite);
    color: rgba(255,255,255,.75);
    font-size: 13px;
}
.rodape-site-inner {
    display: flex; flex-wrap: wrap; gap: 28px;
    padding: 32px 24px 24px;
    max-width: 900px; margin: 0 auto;
}
.rodape-col {
    display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 160px;
}
.rodape-col strong { color: #fff; font-size: 13px; margin-bottom: 2px; }
.rodape-col a { color: rgba(255,255,255,.8); text-decoration: none; }
.rodape-col a:hover { color: #fff; text-decoration: underline; }
.rodape-logo { height: 32px; }
.rodape-slogan { font-size: 12px; color: rgba(255,255,255,.5); margin-top: 2px; }
.rodape-base {
    border-top: 1px solid rgba(255,255,255,.1);
    text-align: center; padding: 14px 24px;
    font-size: 12px; color: rgba(255,255,255,.45);
}
.rodape-base a { color: rgba(255,255,255,.6); text-decoration: none; }
.rodape-base a:hover { color: #fff; }

/* Rodapé dentro da splash — flui abaixo do conteúdo, cola na base em telas grandes */
.tela-busca .rodape-site {
    width: 100%;
    margin-top: auto;
    z-index: 10;
    background: rgba(31,27,26,.85);
}
.tela-busca .rodape-site-inner { padding: 16px 24px; gap: 16px; }
.tela-busca .rodape-col:first-child { display: none; }
.tela-busca .rodape-base { padding: 10px 24px; }

body.modo-grade .rodape-site { margin-top: auto; }

/* ============================
   AUTOCOMPLETE
============================ */
.autocomplete-wrap { position: relative; }

.autocomplete-lista {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    list-style: none;
    margin: 0; padding: 4px 0;
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
}
.autocomplete-lista:empty { display: none; }

.ac-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #222;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ac-item:hover, .ac-item.ativo { background: var(--areia); }

.ac-item::before {
    font-size: 13px;
    opacity: .6;
    flex-shrink: 0;
}
.ac-bairro::before  { content: '📍'; }
.ac-cidade::before,
.ac-cidade-sp::before { content: '🏙'; }

/* ============================
   COMPARTILHAR
============================ */
.compartilhar {
    margin: 14px 0 4px;
    text-align: center;
}
.compartilhar-label {
    font-size: 12px;
    color: rgba(255,255,255,.7);
    margin-bottom: 10px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.compartilhar-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.btn-share {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s, opacity .15s;
}
.btn-share:hover  { transform: scale(1.12); }
.btn-share:active { transform: scale(.95); }
.btn-share svg { width: 20px; height: 20px; }

.btn-share-wpp  { background: #25D366; color: #fff; }
.btn-share-fb   { background: #1877F2; color: #fff; }
.btn-share-x    { background: #000;    color: #fff; }
.btn-share-copy { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-share-copy.copiado { background: var(--verde); border-color: var(--verde); }

/* ============================
   PÁGINA DE DETALHES (imovel.php): conteúdo textual indexável
============================ */
.btn-detalhes {
    display: inline-block; margin-top: 18px; padding: 10px 18px;
    border: 1px solid rgba(255,255,255,.55); border-radius: 24px;
    color: #fff; font-size: 14px; font-weight: 600; text-decoration: none;
    background: rgba(0,0,0,.25); backdrop-filter: blur(4px);
}
.btn-detalhes:hover { background: rgba(255,255,255,.18); }

.detalhes-sheet {
    position: fixed; inset: 0; z-index: 300;
    background: var(--marca-areia, #F6F3EC); color: #2B2524;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    visibility: hidden; transform: translateY(100%);
    transition: transform .28s ease, visibility 0s linear .28s;
}
.detalhes-sheet.aberto { visibility: visible; transform: none; transition: transform .28s ease; }
.detalhes-inner { max-width: 720px; margin: 0 auto; padding: 18px 20px 48px; line-height: 1.65; font-size: 15px; }
.detalhes-fechar {
    display: inline-block; margin-bottom: 12px; padding: 7px 14px;
    border-radius: 20px; background: var(--grafite); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
}
.detalhes-crumbs { font-size: 13px; color: #544443; margin-bottom: 10px; }
.detalhes-sheet a { color: #367F3B; }
.detalhes-sheet .detalhes-fechar, .detalhes-sheet .btn-wpp { color: #fff; }
.detalhes-sheet h1 { font-size: 24px; line-height: 1.25; font-weight: 800; margin-bottom: 10px; }
.detalhes-sheet h2 { font-size: 18px; font-weight: 800; margin: 26px 0 8px; color: var(--grafite); }
.detalhes-sheet h3 { font-size: 15px; font-weight: 600; margin: 14px 0 2px; }
.detalhes-resumo { font-size: 16px; }
.detalhes-ficha {
    display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px;
    background: #fff; border-radius: 10px; padding: 14px 16px; border: 1px solid #e3ddd0;
}
.detalhes-ficha dt { color: #544443; font-weight: 600; }
.detalhes-ficha dd { margin: 0; }
.detalhes-semelhantes { list-style: none; padding: 0; }
.detalhes-semelhantes li { padding: 8px 0; border-bottom: 1px solid #e3ddd0; display: flex; flex-direction: column; }
.detalhes-semelhantes li span { font-size: 13px; color: #544443; }
.detalhes-wpp { display: inline-flex; margin-top: 24px; }
.detalhes-rodape { margin-top: 24px; font-size: 12px; color: #544443; }

/* ============================
   BOTÃO FILTRAR FLUTUANTE
============================ */
.btn-filtros-flutuante {
    position: fixed; top: 16px; right: 16px; z-index: 100;
    background: rgba(255,255,255,.15); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.3); color: #fff;
    padding: 8px 16px; border-radius: 20px; cursor: pointer;
    font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px;
    transition: background .15s;
}
.btn-filtros-flutuante:hover { background: rgba(255,255,255,.25); }

/* Botão voltar em imovel.php */
.btn-voltar {
    position: fixed; top: 16px; left: 16px; z-index: 100;
    background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
    color: #fff; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; text-decoration: none;
    transition: background .15s;
}
.btn-voltar:hover { background: rgba(0,0,0,.7); }

/* ============================
   INFO RESULTADOS
============================ */
.resultados-info {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 30; background: rgba(0,0,0,.6); backdrop-filter: blur(8px);
    color: #fff; padding: 8px 20px; border-radius: 20px; font-size: 13px;
    white-space: nowrap; pointer-events: none;
}
.resultados-info a { color: #adf; pointer-events: all; }

/* Sem resultados */
.sem-resultados {
    height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px;
    color: #fff; text-align: center; padding: 20px;
}
.sem-resultados h2 { font-size: 22px; }
.sem-resultados p  { opacity: .7; }

/* ============================
   RESPONSIVO DESKTOP (stories)
============================ */
@media (min-width: 768px) {
    .stories-feed { align-items: center; }
    .story-imovel { max-width: 420px; margin: 0 auto; border-radius: 12px; overflow: hidden; }
    .story-slide  { border-radius: 12px; }
    .splash-conteudo { max-width: 520px; }
}

/* ============================
   RESULTADOS — FAIXA HORIZONTAL
============================ */
body.modo-grade { overflow: auto; background: var(--grafite-fundo); }

.tela-resultados {
    min-height: 100vh;
    display: flex; flex-direction: column;
    background: var(--grafite-fundo);
    color: #fff;
}

/* ============================
   PÁGINA DE BAIRRO / CIDADE
============================ */
.bairro-hero {
    padding: 28px 24px 16px;
    max-width: 700px;
    margin: 0 auto;
}
.bairro-hero h1 {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: #fff;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.25;
}
.bairro-hero p {
    font-size: 14px;
    color: rgba(255,255,255,.7);
    line-height: 1.5;
}

/* Botão "Conheça mais esse bairro" na página de listagem */
.btn-conhecer-bairro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 10px 20px;
    background: var(--verde);
    color: #fff;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s, transform .15s;
}
.btn-conhecer-bairro:hover { background: var(--verde-esc); transform: translateY(-1px); }

/* Outros bairros no slide CTA do story de bairro */
.outros-bairros-cta {
    margin: 18px 0 8px;
    text-align: center;
}
.outros-bairros-label {
    font-size: 12px;
    color: rgba(255,255,255,.65);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 10px;
}
.outros-bairros-lista {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.bairros-relacionados {
    padding: 20px 24px 8px;
    max-width: 700px;
    margin: 0 auto;
}
.bairros-relacionados p {
    font-size: 13px;
    color: rgba(255,255,255,.55);
    margin-bottom: 10px;
}
.bairros-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bairro-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.85);
    font-size: 13px;
    transition: background .2s;
}
.bairro-pill:hover { background: rgba(255,255,255,.2); }

/* Header */
.res-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    background: var(--areia);
    position: sticky; top: 0; z-index: 50;
    border-bottom: 1px solid var(--linha);
}
.res-logo { height: 34px; }
.btn-nova-busca {
    color: rgba(255,255,255,.75); font-size: 14px; font-weight: 500;
    border: 1px solid rgba(255,255,255,.25); padding: 6px 16px;
    border-radius: 20px; transition: .15s; white-space: nowrap;
}
.btn-nova-busca:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Info */
.res-info {
    padding: 20px 20px 10px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; color: rgba(255,255,255,.5);
}
.res-info span:first-child { color: rgba(255,255,255,.8); font-weight: 600; font-size: 15px; }

/* Faixa de cards */
.res-faixa {
    display: flex;
    gap: 14px;
    padding: 10px 20px 32px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
    cursor: grab;
    flex: 1;
    align-items: flex-start;
}
.res-faixa.arrastando { cursor: grabbing; }
.res-faixa::-webkit-scrollbar { height: 4px; }
.res-faixa::-webkit-scrollbar-track { background: transparent; }
.res-faixa::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* Card individual — proporção story (9:16) */
.res-card {
    flex-shrink: 0;
    width: 160px;
    scroll-snap-align: start;
    border-radius: 14px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    transition: transform .2s;
}
.res-card:hover { transform: scale(1.03); }

.res-card-foto {
    position: relative;
    width: 160px;
    height: 284px; /* 9:16 */
    background: #222;
    overflow: hidden;
}
.res-card-foto img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s;
}
.res-card:hover .res-card-foto img { transform: scale(1.05); }

.res-card-semfoto {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #555;
}

/* Gradiente sobre a foto */
.res-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
}

/* Badge tipo */
.res-card-badge {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 9px; border-radius: 10px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.badge-venda   { background: var(--areia); color: var(--grafite); }
.badge-aluguel { background: var(--ouro); color: var(--grafite); }

/* Informações na base do card */
.res-card-info {
    position: absolute; bottom: 44px; left: 0; right: 0;
    padding: 0 10px;
    color: #fff;
}
.res-card-preco  { font-size: 14px; font-weight: 800; line-height: 1.2; margin-bottom: 3px; }
.res-card-titulo {
    font-size: 12px; font-weight: 600; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 5px; opacity: .95;
}
.res-card-detalhes {
    display: flex; flex-wrap: wrap; gap: 4px;
    font-size: 10px; color: rgba(255,255,255,.75);
}

/* Botão "Ver story" na base */
.res-card-play {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(246,243,236,.95);
    color: var(--grafite); text-align: center;
    font-size: 12px; font-weight: 700;
    padding: 9px 0;
    letter-spacing: .3px;
    transition: background .15s;
}
.res-card:hover .res-card-play { background: var(--verde-esc); }

/* Wrapper do card + link de bairro */
.res-card-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
}
.res-card-wrap .res-card {
    flex-shrink: 0;
    scroll-snap-align: unset;
}

/* Link "Ver mais em [bairro]" abaixo do card */
.res-card-bairro-link {
    display: block;
    margin-top: 7px;
    font-size: 11px;
    color: rgba(255,255,255,.6);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-align: center;
    transition: color .15s;
    max-width: 160px;
}
.res-card-bairro-link:hover { color: #fff; }
@media (min-width: 600px)  { .res-card-bairro-link { max-width: 190px; } }
@media (min-width: 1024px) { .res-card-bairro-link { max-width: 210px; } }

/* Vazio */
.res-vazia {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 20px; padding: 60px 20px; text-align: center; color: rgba(255,255,255,.6);
}

/* Desktop: cards um pouco maiores */
@media (min-width: 600px) {
    .res-card        { width: 190px; }
    .res-card-foto   { width: 190px; height: 338px; }
    .res-faixa       { gap: 16px; padding: 10px 28px 36px; }
}
@media (min-width: 1024px) {
    .res-card        { width: 210px; }
    .res-card-foto   { width: 210px; height: 373px; }
    .res-info        { padding: 24px 28px 12px; }
}

/* ============================
   GRADE DE RESULTADOS
============================ */
.tela-grade {
    min-height: 100vh;
    background: #f4f6f8;
    display: flex; flex-direction: column;
}

.grade-header {
    background: var(--areia); border-bottom: 1px solid var(--linha);
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.grade-logo { height: 36px; }
.btn-nova-busca {
    color: var(--grafite); font-size: 14px; font-weight: 600;
    border: 1px solid var(--linha); padding: 6px 14px; background: #fff;
    border-radius: 20px; transition: .15s;
}
.btn-nova-busca:hover { background: var(--grafite); border-color: var(--grafite); color: #fff; }

.grade-info {
    padding: 16px 20px 8px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; color: #555;
}
.grade-pagina-info { font-size: 13px; color: #888; }

.grade-imoveis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 14px 20px;
    flex: 1;
}

.card-imovel {
    background: #fff; border-radius: 12px;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform .15s, box-shadow .15s;
    text-decoration: none; color: inherit;
}
.card-imovel:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
}

.card-foto {
    position: relative; padding-top: 68%; overflow: hidden;
    background: #ddd;
}
.card-foto img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s;
}
.card-imovel:hover .card-foto img { transform: scale(1.04); }

.card-sem-foto {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #999;
}

.card-badge {
    position: absolute; top: 8px; left: 8px;
    padding: 3px 9px; border-radius: 10px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px;
}
.badge-venda   { background: var(--areia); color: var(--grafite); }
.badge-aluguel { background: var(--ouro); color: var(--grafite); }

.card-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.0); color: rgba(255,255,255,.0);
    font-size: 28px; transition: .2s;
}
.card-imovel:hover .card-play {
    background: rgba(0,0,0,.25);
    color: rgba(255,255,255,.9);
}

.card-info { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-preco { font-size: 15px; font-weight: 800; color: var(--verde-esc); }
.card-titulo { font-size: 13px; font-weight: 600; color: #222; line-height: 1.3;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-detalhes { display: flex; gap: 8px; font-size: 11px; color: #666; flex-wrap: wrap; margin-top: 2px; }
.card-local { font-size: 11px; color: #888; margin-top: 2px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Paginação */
.paginacao {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 20px 14px 32px; flex-wrap: wrap;
}
.pag-btn {
    padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
    background: var(--grafite); color: #fff; transition: .15s;
}
.pag-btn:hover { background: var(--grafite-2); }
.pag-desabilitado { background: #ddd; color: #aaa; cursor: default; }
.pag-numeros { display: flex; gap: 4px; }
.pag-num {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 14px; font-weight: 600; background: #fff;
    color: var(--grafite); border: 1px solid var(--linha); transition: .15s;
}
.pag-num:hover { background: var(--areia); }
.pag-num.ativo { background: var(--grafite); color: #fff; border-color: var(--grafite); }

.grade-vazia {
    padding: 60px 20px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 16px; color: #666;
}

/* Grade desktop */
@media (min-width: 640px) {
    .grade-imoveis { grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 0 24px 24px; }
    .grade-info { padding: 20px 24px 10px; }
}
@media (min-width: 1024px) {
    .grade-imoveis { grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 24px; }
}

/* ============================
   AGENDA (slide temporada)
============================ */
.agenda-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    filter: blur(6px) brightness(.45);
    transform: scale(1.05);
}

.agenda-conteudo {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    width: 100%; max-width: 400px; margin: 0 auto;
    padding: 20px 16px 24px;
    overflow-y: auto;
    max-height: 100%;
}

.agenda-titulo {
    font-size: 16px; font-weight: 700; color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    margin-bottom: 4px;
}

/* ── Flatpickr inline override ── */
#agenda-calendario .flatpickr-calendar {
    background: rgba(255,255,255,.95);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.3);
    font-size: 13px;
    width: 100%;
}
#agenda-calendario .flatpickr-calendar.inline {
    display: block; max-width: 320px;
}
#agenda-calendario .flatpickr-months .flatpickr-month {
    background: var(--grafite); color: #fff; border-radius: 12px 12px 0 0;
}
#agenda-calendario .flatpickr-months .flatpickr-prev-month,
#agenda-calendario .flatpickr-months .flatpickr-next-month {
    fill: #fff;
}
#agenda-calendario .flatpickr-current-month span.cur-month,
#agenda-calendario .flatpickr-current-month .numInputWrapper span { color: #fff; }
#agenda-calendario .flatpickr-weekday { color: rgba(255,255,255,.75); background: var(--grafite-2); }
#agenda-calendario .flatpickr-day.selected,
#agenda-calendario .flatpickr-day.startRange,
#agenda-calendario .flatpickr-day.endRange {
    background: var(--verde); border-color: var(--verde); color: #fff;
}
#agenda-calendario .flatpickr-day.inRange {
    background: rgba(26,107,58,.15); border-color: transparent; box-shadow: none;
}
#agenda-calendario .flatpickr-day.flatpickr-disabled {
    background: #f5f5f5; color: #bbb; text-decoration: line-through;
}

/* Cores por origem do bloqueio */
#agenda-calendario .flatpickr-day.bloqueado-airbnb {
    background: #ff5a5f !important; color: #fff !important;
    text-decoration: none !important;
}
#agenda-calendario .flatpickr-day.bloqueado-booking {
    background: #003580 !important; color: #fff !important;
    text-decoration: none !important;
}
#agenda-calendario .flatpickr-day.bloqueado-manual {
    background: #888 !important; color: #fff !important;
    text-decoration: none !important;
}

/* ── Resumo de preço ── */
.agenda-resumo {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 10px;
    padding: 10px 14px;
    width: 100%; max-width: 320px;
    display: flex; flex-direction: column; gap: 8px;
    backdrop-filter: blur(6px);
}
#agenda-calendario > input { display: none; }   /* campo interno do Flatpickr (modo inline) */
/* display:flex anularia o atributo hidden usado pelo agenda.js */
.agenda-resumo[hidden], .agenda-wpp[hidden] { display: none; }
.agenda-calculo { flex-wrap: wrap; gap: 4px 12px; }
.agenda-calculo {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; font-weight: 600; color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.agenda-wpp {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; text-decoration: none;
    padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 700;
}

/* ── Legenda ── */
.agenda-legenda {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    margin-top: 2px;
}
.agenda-legenda span {
    font-size: 11px; font-weight: 600; padding: 3px 9px;
    border-radius: 20px; color: #fff;
}
.leg-disponivel      { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); }
.leg-bloqueado-airbnb  { background: #ff5a5f; }
.leg-bloqueado-booking { background: #003580; }
.leg-bloqueado-manual  { background: #888; }

.agenda-obs {
    font-size: 11px; color: rgba(255,255,255,.55);
    text-align: center; line-height: 1.4; max-width: 300px;
}

/* Prévia de rascunho (link assinado ou admin logado) */
.faixa-rascunho {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    background: #F2B705; color: #2B2524; text-align: center;
    font: 800 12px/1 var(--fonte, sans-serif); letter-spacing: .08em;
    padding: 6px 8px calc(6px); padding-top: calc(6px + env(safe-area-inset-top));
    pointer-events: none;
}

/* ============================
   STORY DE BAIRRO (bairro.php): um trecho do texto sobre cada foto
============================ */
.bairro-overlay { padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); }
.bairro-overlay.com-texto {
    background: linear-gradient(to top, rgba(31,27,26,.92) 0%, rgba(31,27,26,.7) 38%, rgba(31,27,26,0) 70%);
}
.bairro-legenda { color: #fff; max-width: 560px; }
.bairro-rotulo {
    display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 12px; background: rgba(246,243,236,.18); backdrop-filter: blur(4px);
    margin-bottom: 8px;
}
.bairro-nome { font-size: 30px; font-weight: 800; line-height: 1.15; margin-bottom: 10px; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.bairro-trecho {
    font-size: 17px; line-height: 1.55; font-weight: 500; text-shadow: 0 1px 6px rgba(0,0,0,.5);
    display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden;
}
.bairro-trecho.longo { font-size: 15px; line-height: 1.5; -webkit-line-clamp: 13; }
.slide-bairro .bairro-legenda { animation: bairroEntra .5s ease both; }
@keyframes bairroEntra { from { opacity: 0; transform: translateY(14px); } }

/* Último slide: cartões dos imóveis do bairro */
.bairro-final {
    gap: 12px; padding: 64px 20px calc(24px + env(safe-area-inset-bottom)); max-width: 480px;
    max-height: 100%; overflow-y: auto;
}
.bairro-final .cta-titulo { font-size: 22px; }
.bairro-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 4px 0; }
.bairro-card {
    position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden;
    background: var(--grafite-2); text-decoration: none; color: #fff; text-align: left;
    box-shadow: 0 4px 16px rgba(0,0,0,.35); transition: transform .15s;
}
.bairro-card:hover { transform: scale(1.02); }
.bairro-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bairro-card::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(31,27,26,.9) 0%, rgba(31,27,26,0) 60%);
}
.bairro-card .res-card-badge { z-index: 2; }
.bairro-card-info { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 2; display: flex; flex-direction: column; gap: 2px; }
.bairro-card-info strong { font-size: 14px; font-weight: 800; }
.bairro-card-info span {
    font-size: 12px; line-height: 1.3; opacity: .9;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bairro-sem-imoveis { font-size: 15px; line-height: 1.5; opacity: .85; }
.bairro-final .btn-wpp { padding: 12px 24px; font-size: 15px; }
.bairro-final .btn-sobre-bairro { margin-top: 0; }
.bairro-final .outros-bairros-cta { margin: 6px 0 0; }
.detalhes-texto p { margin-bottom: 12px; }
@media (max-height: 700px) {
    .bairro-cards { grid-template-columns: repeat(4, 1fr); }
    .bairro-card { aspect-ratio: 3 / 5; }
    .bairro-card-info span { display: none; }
}

/* Fim do story do imóvel (imovel.php): sugestões e saída bem visível */
.story-slide[data-tipo="cta"] .cta-conteudo { max-height: 100%; overflow-y: auto; padding-top: 64px; gap: 12px; }
.cta-veja-tambem { width: 100%; }
.cta-veja-tambem .bairro-cards { margin: 0; }
.btn-cta-voltar {
    display: block; width: 100%; padding: 13px 20px; border-radius: 50px;
    background: var(--areia); color: var(--grafite); font-size: 15px; font-weight: 700; text-align: center;
    text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.3); transition: transform .1s, background .15s;
}
.btn-cta-voltar:hover { background: #fff; transform: translateY(-1px); }
.story-slide[data-tipo="cta"] .compartilhar { margin: 4px 0 0; }

/* ============================
   ALTURA REAL DA TELA E MARGEM SEGURA NA BASE
   100vh no Android (Chrome/Samsung Internet) é a tela SEM as barras do navegador:
   a base do slide ficava escondida atrás da barra de navegação. 100dvh acompanha a área visível.
   --base-segura afasta textos e botões da borda de baixo (barra de gestos incluída).
============================ */
:root { --base-segura: max(32px, calc(20px + env(safe-area-inset-bottom))); }
.story-imovel, .story-slide { height: 100vh; height: 100dvh; }
.sem-resultados { height: 100vh; height: 100dvh; }
.stories-feed.single-story { height: 100vh; height: 100dvh; }

.slide-overlay { padding-bottom: var(--base-segura); }
.bairro-overlay { padding-bottom: var(--base-segura); }
.ficha-conteudo { padding-bottom: calc(var(--base-segura) + 40px); }
.cta-conteudo, .story-slide[data-tipo="cta"] .cta-conteudo { padding-bottom: var(--base-segura); }
.bairro-final, .agenda-conteudo { padding-bottom: var(--base-segura); }
.btn-unmute { bottom: var(--base-segura); }
.mapa-endereco { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.resultados-info { bottom: var(--base-segura); }

/* Imóvel: trechos da descrição sobre as fotos (mesmo visual do story de bairro) */
.slide-trecho .bairro-legenda { animation: bairroEntra .5s ease both; }
.slide-trecho .bairro-rotulo, .overlay-leve .bairro-rotulo { text-transform: none; letter-spacing: 0; font-weight: 700; }
.slide-overlay.overlay-leve {
    background: linear-gradient(to top, rgba(0,0,0,.45) 0%, transparent 28%);
    align-items: flex-end; padding-left: 20px;
}
.overlay-leve .bairro-rotulo { color: #fff; margin: 0; }

/* ============================
   ESPAÇO PARA O BALÃO DO WHATSAPP (includes/whatsapp-flutuante.php, canto inferior direito)
   Textos sobre as fotos não passam por baixo dele; conteúdos roláveis terminam acima dele.
============================ */
:root { --base-bolha: calc(var(--base-segura) + 64px); }
.story-slide .slide-overlay { padding-right: 84px; }
.ficha-conteudo { padding-bottom: calc(var(--base-bolha) + 16px); }
.cta-conteudo, .story-slide[data-tipo="cta"] .cta-conteudo,
.bairro-final, .agenda-conteudo { padding-bottom: var(--base-bolha); }
.btn-unmute { bottom: calc(var(--base-bolha) + 8px); }
.mapa-endereco { padding-right: 84px; }
.detalhes-sheet { padding-bottom: 88px; }
.resultados-info { bottom: calc(var(--base-segura) + 8px); max-width: calc(100% - 180px); overflow: hidden; text-overflow: ellipsis; }

/* Barra de progresso fixa no topo enquanto os slides deslizam.
   Ela fica dentro do contêiner que rola na horizontal; com position:absolute ia embora junto com o
   primeiro slide. Sticky + largura líquida zero (margin-right:-100%) a mantém parada sem empurrar os slides. */
.story-imovel > .progress-bar-container {
    position: sticky; left: 0; top: 0;
    order: -1; flex: 0 0 100%; margin-right: -100%;
    align-self: flex-start; box-sizing: border-box;
}

/* Foto deitada no story vertical: corte leve nas laterais, com a própria foto desfocada no fundo (stories.js) */
.story-slide.foto-larga { background: var(--grafite-fundo); }
.story-slide.foto-larga::before {
    content: ''; position: absolute; inset: -40px;
    background: var(--foto-fundo) center / cover no-repeat;
    filter: blur(28px) brightness(.68) saturate(1.15);
    transform: scale(1.1);
}
/* Corta ~10% de cada lado (mostra 80% da largura) para ocupar mais altura; o resto é o fundo desfocado */
.story-slide.foto-larga > img {
    inset: auto; left: 50%; top: 44%;
    width: 125%; height: auto; max-width: none;
    transform: translate(-50%, -50%);
}

/* Escurecimento só atrás do texto (antes cobria 70% da foto): o fundo acompanha a altura do trecho,
   com uma transição curta acima dele; o resto da foto fica limpo */
.bairro-overlay.com-texto { background: none; }
.com-texto .bairro-legenda { position: relative; isolation: isolate; }
.com-texto .bairro-legenda::before {
    content: ''; position: absolute; z-index: -1;
    left: -20px; right: -84px; top: -56px; bottom: calc(-1 * var(--base-segura));
    background: linear-gradient(to top, rgba(31,27,26,.72) 0%, rgba(31,27,26,.5) calc(100% - 56px), rgba(31,27,26,0) 100%);
}
.com-texto .bairro-trecho { text-shadow: 0 1px 3px rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.35); }
/* Capa (título e preço): gradiente mais baixo e mais leve */
.slide-overlay:not(.bairro-overlay):not(.overlay-leve) {
    background: linear-gradient(to top, rgba(0,0,0,.6) 0%, rgba(0,0,0,.25) 22%, transparent 38%);
}
