/* Vitrine pública. As cores da loja vêm de /theme.css (--brand, --accent, --ink, --paper).
   Cores de cada loja vêm de lojas/<apelido>/loja.json (/theme.css): --brand no topo, --accent na marca
   como cor de destaque. Layout de marketplace: busca flutuante, cards com foto padronizada,
   anúncio com mosaico de fotos e card de contato fixo. */

:root {
  --surface: #ffffff;
  --line: color-mix(in srgb, var(--ink) 11%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 22%, transparent);
  --muted: color-mix(in srgb, var(--ink) 64%, var(--paper));
  --soft: color-mix(in srgb, var(--ink) 5%, var(--surface));
  --on-brand-muted: color-mix(in srgb, var(--on-brand) 66%, var(--brand));
  --good: #15803d;
  --bad: #b3261e;
  --wa: #0f8045;          /* verde do WhatsApp escurecido para texto branco legível */
  --wa-hover: #0b6a39;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --wrap: 1240px;
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 10px 30px -18px rgb(0 0 0 / .35);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / .06), 0 18px 40px -18px rgb(0 0 0 / .45);
  --topbar-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--topbar-h) + 1rem); }
html.lb-open { overflow: hidden; }

body {
  margin: 0;
  font: 400 1rem/1.5 var(--body);
  color: var(--ink);
  background: var(--paper);
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a, button, select, input, label, textarea { touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { text-wrap: balance; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

.ico { width: 1.15em; height: 1.15em; flex: none; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  padding: .6rem 1rem; border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.15rem;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .ico { width: 1.25em; height: 1.25em; }
.btn-sm { min-height: 40px; padding: .45rem .9rem; font-size: .95rem; }
.btn-lg { min-height: 54px; font-size: 1.05rem; width: 100%; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 82%, var(--on-brand)); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-hover); }

.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Topo ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--brand); color: var(--on-brand);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid color-mix(in srgb, var(--on-brand) 10%, transparent);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: var(--topbar-h); }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { height: 46px; width: auto; }
.brand-mark { width: 46px; height: 46px; flex: none; border-radius: 50%; object-fit: cover; }
.brand-text { display: grid; line-height: 1; }
.brand-text b { font: 800 1.85rem/.9 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.brand-text small {
  margin-top: .2rem; font: 500 .7rem/1 var(--body);
  letter-spacing: .42em; text-transform: uppercase; color: var(--on-brand-muted);
}

.topnav { display: flex; align-items: center; gap: .4rem; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: .5rem;
  min-height: 42px; padding: .45rem .85rem; border-radius: 12px;
  color: var(--on-brand-muted); font-weight: 600; text-decoration: none;
  transition: color .18s, background-color .18s, transform .12s;
}
.nav-link::after {
  content: ''; position: absolute; left: .85rem; right: .85rem; bottom: 5px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
/* No computador os links ficam só com texto; o ícone do Instagram aparece só no celular, onde o texto não cabe. */
.nav-ico { display: none; width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: color .18s; }
.nav-link:hover, .nav-link:focus-visible { color: var(--on-brand); background: color-mix(in srgb, var(--on-brand) 9%, transparent); }
.nav-link:hover::after, .nav-link:focus-visible::after { transform: scaleX(1); }
.nav-link:hover .nav-ico { color: var(--accent); }
.nav-link:active { transform: scale(.96); }
.topnav .btn { margin-left: .4rem; }

/* ---------- Início: chamada + busca flutuante ---------- */

.hero { background: var(--brand); color: var(--on-brand); padding: 2.5rem 0 5.5rem; }
.hero h1 {
  margin: 0;
  font: 800 clamp(2.6rem, 7.5vw, 5.2rem)/.9 var(--display);
  text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.hero .tagline { margin: .9rem 0 0; max-width: 56ch; color: var(--on-brand-muted); font-size: 1.125rem; text-wrap: pretty; }

.search-wrap { margin-top: -3.75rem; position: relative; z-index: 2; }
.search {
  display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(130px, 1fr));
  gap: .75rem; padding: 1.1rem;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-hover);
}
.search label, .sort { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.search input, .search select, .sort select {
  width: 100%; min-height: 46px; padding: .5rem .8rem;
  background-color: var(--soft); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-weight: 500;
}
.search input:hover, .search select:hover { border-color: var(--line-strong); }
.search input::placeholder { color: var(--muted); font-weight: 400; }

.results-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1.25rem; margin: 2rem 0 1rem; }
.results-count { margin: 0 auto 0 0; font: 800 1.6rem/1 var(--display); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.results-bar .link-btn { margin-bottom: .7rem; }
.sort { grid-template-columns: auto minmax(200px, auto); align-items: center; gap: .6rem; }

/* ---------- Cards de veículo ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 1.25rem;
  padding-bottom: 4.5rem;
}

.car {
  position: relative;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.car:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.car:hover .photo img { transform: scale(1.04); }
.car:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.car:focus-within .stretched:focus-visible { outline: none; }

/* Foto sempre no mesmo formato (4:3), qualquer que seja o tamanho original */
.photo {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 7%, var(--paper));
}
.photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .35s ease;
}
.photo-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .35rem;
  color: var(--muted); font-size: .95rem;
}
.photo-empty .ico { width: 2rem; height: 2rem; opacity: .6; }

.tags { position: absolute; left: .75rem; top: .75rem; display: flex; gap: .35rem; }
.tag {
  padding: .25rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: var(--ink); color: var(--paper);
}
.tag--featured { background: var(--accent); color: var(--on-accent); }
.photo-count {
  position: absolute; right: .75rem; bottom: .75rem;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgb(0 0 0 / .62); color: #fff; backdrop-filter: blur(4px);
}

.car-body { display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.15rem 1rem; flex: 1; min-width: 0; }
.car-brand { margin: 0; font-size: .85rem; font-weight: 700; color: var(--muted); }
.car-name { margin: 0; font: 800 1.85rem/1 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.car-name a { text-decoration: none; }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.car-version { margin: 0; color: var(--muted); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.specs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .55rem 0 0; padding: 0; list-style: none; font-size: .85rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.specs li { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: var(--r-sm); background: var(--soft); }
.specs .ico { width: 1rem; height: 1rem; color: var(--muted); }

.price { margin: .8rem 0 0; font: 800 2.15rem/1 var(--display); font-variant-numeric: tabular-nums; }
.car .ruler { margin-top: auto; padding-top: .9rem; }
.car .ruler-foot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.car-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem 1.15rem; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted);
}
.car-city { display: inline-flex; align-items: center; gap: .3rem; }
.car-wa {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .75rem; border-radius: 999px;
  background: var(--wa); color: #fff; font-weight: 600; text-decoration: none;
  transition: background-color .15s;
}
.car-wa:hover { background: var(--wa-hover); }

/* ---------- Régua FIPE: o balão marca o preço ---------- */

.ruler-head { margin: 0 0 1.35rem; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ruler-head strong { color: var(--ink); font-weight: 700; }
.ruler--below .ruler-head strong { color: var(--good); }
.ruler--above .ruler-head strong { color: var(--bad); }

.ruler-track {
  position: relative; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--good) 45%, white) 0 50%,
    color-mix(in srgb, var(--ink) 16%, white) 50% 100%);
}
.ruler-mark { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; transform: translateX(-1px); background: var(--ink); }
.ruler-dot {
  position: absolute; bottom: 9px; width: 16px; height: 19px;
  transform: translateX(-50%);
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 75%, var(--accent));
}
.ruler-dot::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 9px; transform: translateX(-50%); background: var(--ink); }
.ruler-foot { margin: .5rem 0 0; font-size: .8rem; color: var(--muted); }

.ruler--large .ruler-head { font-size: 1rem; margin-bottom: 1.75rem; }
.ruler--large .ruler-head strong { font: 800 1.5rem/1.1 var(--display); display: block; }
.ruler--large .ruler-track { height: 8px; border-radius: 4px; }
.ruler--large .ruler-dot { width: 22px; height: 26px; bottom: 12px; }
.ruler--large .ruler-dot::after { height: 12px; }

/* ---------- Estados ---------- */

.loading { color: var(--muted); padding: 3rem 0; }
.empty { grid-column: 1 / -1; padding: 3rem 0 5rem; max-width: 50ch; }
.empty h1, .empty h2 { margin: 0 0 .5rem; font: 800 2rem/1.05 var(--display); text-transform: uppercase; }
.empty p { margin: 0 0 1.25rem; color: var(--muted); }

/* ---------- Anúncio ---------- */

.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.25rem 0 1rem; font-size: .9rem; color: var(--muted); }
.crumbs a { text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* Mosaico: uma foto grande + até 4 menores (como nos marketplaces) */
.gallery {
  position: relative;
  display: grid; gap: .5rem;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: clamp(300px, 44vw, 540px);
  border-radius: var(--r-lg); overflow: hidden;
}
.gallery--n1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.gallery--n2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.gallery--n3 { grid-template-columns: 2fr 1fr; }
.gallery--n4 { grid-template-columns: 2fr 1fr 1fr; }
.gallery--n4 .g-tile:nth-child(2) { grid-row: span 2; }
.gallery--empty { display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 7%, var(--paper)); }
.gallery--empty .photo-empty { position: static; }

.g-tile { position: relative; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: color-mix(in srgb, var(--ink) 7%, var(--paper)); }
.g-main { grid-row: 1 / -1; }
.g-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .2s; }
.g-tile:hover img { transform: scale(1.03); filter: brightness(.92); }
.g-more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(0 0 0 / .5); color: #fff; font: 800 1.6rem/1 var(--display);
}
.g-all {
  position: absolute; right: 1rem; bottom: 1rem;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem .9rem; border: 0; border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-hover);
}
.g-all:hover { background: var(--soft); }

.gallery-strip-wrap { display: none; position: relative; }
.gallery-strip {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; border-radius: var(--r-lg);
}
.gallery-strip::-webkit-scrollbar { display: none; }
.g-slide { flex: 0 0 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; scroll-snap-align: center; background: color-mix(in srgb, var(--ink) 7%, var(--paper)); }
.g-slide img { width: 100%; height: 100%; object-fit: cover; }
.g-counter {
  position: absolute; right: .75rem; bottom: .75rem;
  padding: .2rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgb(0 0 0 / .62); color: #fff; pointer-events: none;
}

.detail {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.5rem; align-items: start; padding: 1.5rem 0 4.5rem;
}
.detail-main { display: grid; gap: 1.25rem; min-width: 0; }

.vhead { padding: .25rem 0 .25rem; }
.vhead-tags { display: flex; gap: .35rem; margin-bottom: .6rem; }
.vhead h1 { margin: .1rem 0 0; font: 800 clamp(2.4rem, 5vw, 3.6rem)/.92 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.vhead-version { margin: .45rem 0 0; font-size: 1.15rem; color: var(--muted); }

.block { background: var(--surface); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.block > h2 { margin: 0 0 1.1rem; font: 800 1.45rem/1.1 var(--display); text-transform: uppercase; }
.block-note { margin: 1rem 0 0; font-size: .85rem; color: var(--muted); }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.1rem 1rem; margin: 0; }
.spec-grid dt { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.spec-grid dd { margin: .15rem 0 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.fipe-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.4rem; }
.fipe-cards div { padding: .85rem 1rem; border-radius: var(--r-md); background: var(--soft); }
.fipe-cards span { display: block; font-size: .85rem; color: var(--muted); }
.fipe-cards strong { font: 800 1.45rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.fipe-cards .is-good strong { color: var(--good); }
.fipe-cards .is-bad strong { color: var(--bad); }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .55rem 1rem; margin: 0; padding: 0; list-style: none; }
.features li { display: flex; align-items: flex-start; gap: .45rem; }
.features .ico { margin-top: .2rem; color: var(--good); }
.description { margin: 0; white-space: pre-line; max-width: 72ch; text-wrap: pretty; }

.store-head { display: flex; gap: 1rem; align-items: center; }
.store-logo {
  display: grid; place-items: center; flex: none; width: 92px; height: 72px;
  border-radius: var(--r-md); background: var(--brand); color: var(--on-brand);
}
.store-logo .brand-text { display: none; }
.store-logo img { max-width: 80px; max-height: 56px; }
.store-head h2 { margin: 0 0 .2rem; font: 800 1.45rem/1.1 var(--display); text-transform: uppercase; }
.store-head p { display: flex; align-items: center; gap: .35rem; margin: .15rem 0; color: var(--muted); font-size: .95rem; }
.store-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }

/* Card de preço e contato */
.buy { position: sticky; top: calc(var(--topbar-h) + 1rem); }
.buy-card { display: grid; gap: .8rem; padding: 1.5rem; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-hover); }
.buy-label { margin: 0; font-size: .9rem; color: var(--muted); }
.buy-price { margin: -.4rem 0 0; font: 800 3rem/1 var(--display); font-variant-numeric: tabular-nums; }
.fipe-chip {
  justify-self: start; margin: 0; padding: .25rem .7rem; border-radius: 999px;
  font-size: .85rem; font-weight: 700; background: var(--soft);
}
.fipe-chip.is-good { background: color-mix(in srgb, var(--good) 13%, white); color: var(--good); }
.fipe-chip.is-bad { background: color-mix(in srgb, var(--bad) 11%, white); color: var(--bad); }
.status-note { margin: 0; padding: .65rem .85rem; border-radius: var(--r-md); background: color-mix(in srgb, var(--accent) 24%, white); }

.quick { display: grid; gap: .55rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.quick-title { margin: 0; font-size: .85rem; font-weight: 700; color: var(--muted); }
.quick-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.quick-q {
  display: inline-flex; align-items: center; min-height: 38px; padding: .4rem .8rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: .88rem; font-weight: 600; text-decoration: none;
  transition: border-color .15s, background-color .15s, color .15s, transform .1s;
}
.quick-q:hover { border-color: var(--wa); background: #e9f6ef; color: #0b5c32; }
.quick-q:active { transform: scale(.96); }
.msg-off { margin: 0; color: var(--muted); }

.buy-secondary { display: flex; gap: .5rem; padding-top: .3rem; border-top: 1px solid var(--line); }
.buy-secondary a, .buy-secondary button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .4rem; border: 0; border-radius: var(--r-md);
  background: none; font-weight: 600; text-decoration: none; cursor: pointer;
}
.buy-secondary a:hover, .buy-secondary button:hover { background: var(--soft); }

.mobile-bar { display: none; }

/* ---------- Fotos ampliadas ---------- */

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #000; color: #fff;
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto auto; }
.lightbox::backdrop { background: #000; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); }
.lb-count { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; gap: .25rem; }
.lb-btn, .lb-nav {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; cursor: pointer;
  transition: background-color .15s;
}
.lb-btn:hover, .lb-nav:hover { background: rgb(255 255 255 / .22); }
.lb-btn .ico, .lb-nav .ico { width: 22px; height: 22px; }

.lb-stage {
  position: relative; display: grid; place-items: center; overflow: hidden;
  touch-action: none; user-select: none; cursor: zoom-in;
}
.lb-stage.is-zoomed { cursor: grab; }
.lb-stage.is-zoomed:active { cursor: grabbing; }
/* absoluta + margin:auto faz a foto caber inteira na área, centralizada, em qualquer proporção */
.lb-stage img {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  transform-origin: center; will-change: transform;
}
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-single .lb-nav, .lb-single .lb-thumbs { display: none; }
.lb-hint { margin: 0; padding: .4rem 1rem; text-align: center; font-size: .8rem; color: rgb(255 255 255 / .6); }
.lb-thumbs { display: flex; gap: .4rem; justify-content: safe center; overflow-x: auto; padding: .5rem 1rem; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
.lb-thumbs button { flex: 0 0 76px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; background: none; cursor: pointer; opacity: .55; transition: opacity .15s; }
.lb-thumbs button:hover { opacity: .9; }
.lb-thumbs button[aria-current='true'] { border-color: var(--accent); opacity: 1; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- WhatsApp flutuante ---------- */

.wa-fab {
  position: fixed; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 25;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.15rem .8rem .95rem; border-radius: 999px;
  background: var(--wa); color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 28px -8px rgb(0 0 0 / .45);
  transition: background-color .15s, transform .15s;
}
.wa-fab:hover { background: var(--wa-hover); transform: translateY(-2px); }
.wa-fab .ico { width: 26px; height: 26px; }

/* ---------- Rodapé ---------- */

.footer { background: var(--brand); color: var(--on-brand); padding: 3rem 0 calc(1.5rem + env(safe-area-inset-bottom)); }
.footer-inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
  width: min(100% - 2rem, var(--wrap)); margin-inline: auto;
}
.footer-col h2 { margin: 0 0 .75rem; font: 700 1rem/1.2 var(--body); color: var(--on-brand); }
.footer-col p { display: flex; gap: .45rem; align-items: flex-start; margin: .35rem 0; color: var(--on-brand-muted); }
.footer-col p .ico { margin-top: .2rem; }
.footer-about p { max-width: 38ch; margin-top: 1rem; }
.footer-links { display: grid; gap: .55rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .45rem; color: var(--on-brand-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-legal {
  width: min(100% - 2rem, var(--wrap)); margin: 2.5rem auto 0; padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--on-brand) 12%, transparent);
  font-size: .8rem; color: var(--on-brand-muted);
}

/* ---------- Responsivo ---------- */

@media (max-width: 1020px) {
  .search { grid-template-columns: 1fr 1fr 1fr; }
  .search-q { grid-column: 1 / -1; }
  .detail { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 880px) {
  .detail { grid-template-columns: 1fr; }
  .buy { position: static; order: -1; }
  .buy-card { box-shadow: var(--shadow); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }

  /* barra fixa com preço e WhatsApp */
  .page-car .mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    background: var(--surface); box-shadow: 0 -8px 24px -12px rgb(0 0 0 / .3);
  }
  .mobile-bar span { display: block; font-size: .8rem; color: var(--muted); }
  .mobile-bar strong { font: 800 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
  .page-car .footer { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}

@media (max-width: 760px) {
  .gallery { display: none; }
  .gallery-strip-wrap { display: block; margin-inline: -1rem; }
  .gallery-strip { border-radius: 0; }
  .fipe-cards { grid-template-columns: 1fr; }
  .lb-nav { display: none; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 60px; }
  .topnav { gap: .15rem; }
  .nav-link { padding: .45rem; min-width: 42px; justify-content: center; }
  .nav-link span, .nav-link::after { display: none; }
  .nav-link:not(.nav-link--ig) { display: none; } /* o logo já leva ao estoque */
  .nav-link--ig .nav-ico { display: block; }
  .brand-text b { font-size: 1.6rem; }
  .hero { padding: 1.5rem 0 4.75rem; }
  .search { grid-template-columns: 1fr 1fr; padding: .9rem; }
  .sort { grid-template-columns: 1fr; width: 100%; }
  .results-count { font-size: 1.35rem; }
  .wa-fab { padding: .9rem; }
  .wa-fab span { display: none; }
  .block { padding: 1.15rem; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- Como chegar (Google Maps) ---------- */

.visit { background: var(--surface); border-top: 1px solid var(--line); padding: 3.5rem 0; }
.visit-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: center; }
.visit-info h2 { margin: 0; font: 800 clamp(2rem, 4vw, 2.75rem)/1 var(--display); text-transform: uppercase; }
.visit-lead { margin: .6rem 0 1.4rem; color: var(--muted); font-size: 1.05rem; }
.visit-row { display: flex; gap: .55rem; align-items: flex-start; margin: .5rem 0; font-weight: 500; }
.visit-row .ico { margin-top: .2rem; color: var(--muted); }
.visit-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 85%, var(--ink)); }
.visit-map {
  aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden;
  background: var(--soft); box-shadow: var(--shadow);
}
.visit-map iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 880px) {
  .visit { padding: 2.5rem 0; }
  .visit-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .visit-map { aspect-ratio: 4 / 3; }
}

/* ---------- Desconto: o preço baixou desde o primeiro anúncio ---------- */

:root { --deal: #c81e1e; }
.tag--deal { background: var(--deal); color: #fff; }
.price-was { margin: .8rem 0 -.55rem; font-size: .9rem; font-weight: 500; color: var(--muted); }
.price-was s, .buy-was s, .mobile-bar s { text-decoration-thickness: 1.5px; text-decoration-color: var(--deal); }
.deal-off {
  display: inline-block; margin-left: .35rem; padding: .2rem .5rem; border-radius: var(--r-sm); vertical-align: .35em;
  background: color-mix(in srgb, var(--deal) 11%, white); color: var(--deal);
  font: 700 .85rem/1.1 var(--body); letter-spacing: 0;
}
.buy-was { margin: -.4rem 0 .5rem; font-size: 1rem; font-weight: 500; color: var(--muted); }
.buy-was + .buy-price { margin-top: 0; }
.deal-chip {
  justify-self: start; margin: 0; padding: .35rem .75rem; border-radius: 999px;
  background: color-mix(in srgb, var(--deal) 11%, white); color: var(--deal); font-weight: 700; font-size: .92rem;
}

/* Logo com muita margem (ex.: fundo preto no próprio arquivo): loja.json → logo_scale amplia a marca no topo. */
.topbar .brand-mark { transform: scale(var(--logo-scale, 1)); }
