/* Peças comuns às 5 versões. Cada versão define os tokens (cores, fontes) no seu :root. */
:root {
  --bg: #fff; --fg: #1d2420; --muted: #5d6a62; --line: #dfe5e1; --surface: #f6f8f7; --accent: #0f6b4f;
  --fa: #0d7a4a; --fb: #3f9a45; --fc: #c58a12; --fd: #8a948f; --on-faixa: #fff;
  --novo: #1b5fd1; --caiu: #b4232a; --ad-bg: repeating-linear-gradient(45deg, #f1f1ee 0 10px, #e9e9e4 10px 20px);
  --font-ui: "Inter", system-ui, sans-serif; --font-num: "Inter", system-ui, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-ui); margin: 0; line-height: 1.45; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.num, .lucro td:last-child, .ficha dd { font-variant-numeric: tabular-nums; }

/* Foto */
.foto, .pop-foto, .detalhe-foto { position: relative; overflow: hidden; background: var(--surface); }
.foto img, .pop-foto img, .detalhe-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sem-foto { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; min-height: 80px; }
.sem-foto span { text-align: center; padding: 6px 10px; line-height: 1.3; }
.foto [hidden], .pop-foto [hidden], .detalhe-foto [hidden] { display: none !important; }

/* Galeria da ficha: setas sobre a imagem e contador no canto. */
.galeria-ant, .galeria-prox { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 99px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; z-index: 1; }
.galeria-ant { left: 10px; } .galeria-prox { right: 10px; }
.galeria-ant:hover, .galeria-prox:hover { background: rgba(0, 0, 0, .7); }
.galeria-ant:focus-visible, .galeria-prox:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent); }
.galeria-cont { position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; z-index: 1; }

/* Selos */
.selos { display: flex; flex-wrap: wrap; gap: 6px; }
.selo { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface); color: var(--fg); border: 1px solid var(--line); white-space: nowrap; letter-spacing: .01em; }
.selo-novo { background: var(--novo); color: #fff; border-color: transparent; }
.selo-caiu { background: var(--caiu); color: #fff; border-color: transparent; }
.selo-bom { color: var(--fa); border-color: currentColor; }
.selo-ocup, .selo-div, .selo-cond { color: var(--caiu); border-color: currentColor; }
.selo-ci { color: var(--novo); border-color: currentColor; }

/* Link para o leilão */
.link-leilao { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; background: var(--accent); color: #fff; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; }
.link-leilao:hover { filter: brightness(1.08); }
.link-sec { font-size: 13px; }

/* Pins */
.pin-gota { width: 26px; height: 34px; position: relative; transition: transform .15s; }
.pin-gota i { position: absolute; inset: 0 0 8px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg) scale(.82); background: var(--f); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pin-a { --f: var(--fa); } .pin-b { --f: var(--fb); } .pin-c { --f: var(--fc); } .pin-d, .pin-sem { --f: var(--fd); }
.pin-aviso i { box-shadow: 0 0 0 3px var(--novo), 0 1px 4px rgba(0,0,0,.35); }
.pin-etq { background: var(--f); color: var(--on-faixa); font: 700 12px/1 var(--font-num); padding: 5px 7px; border-radius: 6px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.35); position: relative; transform: translate(-50%, -100%); display: inline-block; margin-left: 22px; margin-top: 30px; }
.pin-etq::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--f); }
.pin-etq.pin-aviso { outline: 2px solid var(--novo); }
.pin-hover { z-index: 9999 !important; }
.pin-hover .pin-gota, .pin-hover .pin-etq { transform: scale(1.35); }
.pin-hover .pin-etq { transform: translate(-50%, -100%) scale(1.25); }
.clu { width: 48px; height: 48px; border-radius: 50%; background: var(--f); color: var(--on-faixa); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 1px 6px rgba(0,0,0,.3); line-height: 1; }
.clu b { font: 700 14px var(--font-num); } .clu small { font-size: 9px; opacity: .92; margin-top: 2px; }
.clu-a { --f: var(--fa); } .clu-b { --f: var(--fb); } .clu-c { --f: var(--fc); } .clu-d, .clu-sem { --f: var(--fd); }

/* Popup */
.pop-wrap .leaflet-popup-content { margin: 0; width: 260px !important; }
.pop-wrap .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 10px; }
.pop { font-family: var(--font-ui); color: #1d2420; }
.pop-foto { height: 120px; }
.pop-corpo { padding: 10px 12px 12px; display: grid; gap: 3px; }
.pop-desc { font: 800 20px var(--font-num); color: var(--fa); margin-right: 8px; }
.pop-preco { font-weight: 700; }
.pop-local { font-size: 12.5px; }
.pop-quando { font-size: 12px; color: #5d6a62; }
.pop-acoes { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.pop-acoes .link-leilao { padding: 5px 10px; font-size: 12.5px; color: #fff; }
.pop-mais { border: 1px solid #c9d1cc; background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; }
.pop-prec { color: #7b867f; font-size: 11px; }

/* Detalhe */
.detalhe { border: 0; padding: 0; border-radius: 14px; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--bg); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.detalhe::backdrop { background: rgba(10, 16, 13, .55); }
.detalhe-caixa { position: relative; }
.detalhe-fechar { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 22px; line-height: 1; }
.detalhe-foto { height: 300px; }
.detalhe-corpo { padding: 18px 22px 24px; display: grid; gap: 14px; }
.detalhe-topo { display: flex; gap: 16px; align-items: flex-start; }
.detalhe-topo h2 { margin: 0; font-size: 20px; text-wrap: balance; }
.detalhe-topo p { margin: 4px 0 0; font-size: 13px; }
.detalhe-desc { flex: none; background: var(--f); color: var(--on-faixa); border-radius: 10px; padding: 8px 12px; font: 800 26px/1 var(--font-num); text-align: center; }
.detalhe-desc small { display: block; font: 600 10px var(--font-ui); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.d-a { --f: var(--fa); } .d-b { --f: var(--fb); } .d-c { --f: var(--fc); } .d-d, .d-sem { --f: var(--fd); }
.ficha { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 18px; margin: 0; }
.ficha dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ficha dd { margin: 2px 0 0; font-weight: 600; }
.detalhe h3 { margin: 6px 0 0; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detalhe-acoes { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.desc-texto { margin: 0; font-size: 13px; color: var(--muted); }
.caiu { margin: 0; color: var(--caiu); font-weight: 600; }
.aviso-div { margin: 0; color: var(--caiu); }
.lucro { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lucro td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.lucro td:last-child { text-align: right; }
.lucro-total td { font-weight: 700; border-bottom: 0; padding-top: 8px; }
.tg { display: flex; gap: 8px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.tg code { flex: 1; min-width: 0; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.tg button { flex: none; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 6px; padding: 4px 10px; font-size: 12px; }
@media (max-width: 560px) { .detalhe-foto { height: 200px; } .detalhe-corpo { padding: 14px 16px 20px; } .detalhe-topo { flex-direction: column; } }

/* Anúncio (marcador do MVP) */
.ad { background: var(--ad-bg); border: 1px dashed var(--muted); border-radius: 8px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; margin: 0 auto; max-width: 100%; }
.ad span { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.ad small { font-size: 10.5px; opacity: .8; }
.ad-728x90 { width: 728px; height: 90px; } .ad-320x50 { width: 320px; height: 50px; }
.ad-300x250 { width: 300px; height: 250px; } .ad-336x280 { width: 336px; height: 280px; }
.ad-300x600 { width: 300px; height: 600px; } .ad-nativo { width: 100%; min-height: 100%; }

.erro-carga { margin: 16px; padding: 12px 16px; background: #fde8e8; color: #7a1b1b; border-radius: 8px; }
.leaflet-container { font-family: var(--font-ui); }
.tiles-escuro { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.tiles-cinza { filter: grayscale(1) contrast(.92) brightness(1.04); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
