:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1b1f27;
  --muted: #6b7280;
  --line: #e3e6eb;
  --navy: #141b2d;
  --navy-2: #1f2940;
  --accent: #f5a623;
  --accent-dark: #d48806;
  --green: #1fa855;
  --green-dark: #178a45;
  --red: #d64545;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Cabeçalho ---------- */
#header { position: sticky; top: 0; z-index: 20; }
.site-header { background: #000; color: #fff; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -.01em; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { height: 50px; display: flex; align-items: center; }
.brand-logo img { height: 100%; width: auto; max-width: min(300px, 58vw); object-fit: contain; border-radius: 6px; }
.site-footer a { color: #fff; }
/* Botões das redes sociais */
.social { display: flex; gap: 10px; flex-wrap: wrap; }
.site-footer .social { margin-top: 14px; }
.social-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; transition: transform .1s, filter .15s;
}
.site-footer .social-btn { color: #fff; }
.social-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.social-btn svg { width: 18px; height: 18px; flex: none; }
.social-instagram { background: linear-gradient(45deg, #f9a825 0%, #e1306c 45%, #833ab4 100%); }
.social-facebook { background: #1877f2; }
.social-marketplace { background: #0a5ac2; }
/* Ícones redondos na barra do topo */
.header-social { display: flex; gap: 8px; flex: none; }
.social-icon {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  transition: transform .1s, filter .15s;
}
.social-icon:hover { filter: brightness(1.12); transform: translateY(-1px); }
.social-icon svg { width: 20px; height: 20px; }
@media (max-width: 520px) {
  /* Celular: logo + redes + Admin na 1ª linha. O WhatsApp fica nos números logo abaixo
     e no botão verde flutuante, então o "Fale conosco" sai daqui para caber tudo. */
  .site-header .header-cta { display: none; }
  .header-social { gap: 6px; }
  .social-icon { width: 36px; height: 36px; }
  .social-icon svg { width: 18px; height: 18px; }
  .brand-logo img { max-width: calc(100vw - 32px - 150px); }
}
.opcionais { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.opcionais li { background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.opcionais li::before { content: "✓ "; color: var(--green); }
.brand-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-icon svg { width: 22px; height: 22px; }

/* Telefones dentro da barra do topo */
.header-phones { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.header-phones a { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.header-phones a:hover { color: #6fe39a; }
.header-phones svg { width: 18px; height: 18px; color: #25d366; flex: none; }
.header-cta { flex: none; }
.site-header .btn-admin {
  flex: none; background: transparent; color: #c9ced8; border: 1px solid #4a4a4a;
  padding: 9px 14px; font-size: 14px; gap: 6px;
}
.site-header .btn-admin:hover { background: #1a1a1a; color: #fff; border-color: #777; }
.site-header .btn-admin svg { width: 15px; height: 15px; }
.site-header .brand { flex: none; }
/* A frase ocupa o espaço que sobrar; em telas mais estreitas quebra em 2 linhas */
.header-slogan { color: #d6dbe4; font-size: 14px; font-weight: 600; line-height: 1.3; flex: 1 1 0; min-width: 0; max-width: 360px; }
.site-header .container { max-width: 1320px; }
@media (max-width: 1180px) {
  /* Telas médias: frase desce para uma segunda linha, dentro da mesma barra */
  .site-header .container { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; row-gap: 4px; }
  .header-slogan { order: 4; flex: 1 1 100%; max-width: none; white-space: normal; text-align: center; font-size: 14px; padding-bottom: 2px; }
}
@media (max-width: 1000px) {
  /* Celular e tablet: logo e botões; depois telefones; depois a frase — tudo na mesma barra */
  .site-header .container { column-gap: 10px; }
  /* Empurra os botões para a direita (redes, se houver; senão o "Fale conosco") */
  .header-cta { margin-left: auto; }
  .header-social { margin-left: auto; }
  .header-social ~ .header-cta { margin-left: 0; }
  .site-header .btn-admin { padding: 10px; }
  .site-header .btn-admin span { display: none; }
  .header-phones { order: 3; width: 100%; justify-content: center; gap: 18px; margin-left: 0; }
  .header-phones a { font-size: 14px; }
  .header-slogan { font-size: 13px; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: var(--navy); }
.btn-accent:hover { background: var(--accent-dark); }
.btn-whats { background: var(--green); color: #fff; }
.btn-whats:hover { background: var(--green-dark); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid #f1caca; }
.btn-danger:hover { background: #fdf0f0; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 48px 0 88px; }
.hero { position: relative; overflow: hidden; isolation: isolate; }
.filters { z-index: 5; }
.hero .container { position: relative; z-index: 2; }
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s; }
.hero-media video.on { opacity: 1; }
/* Com foto/vídeo de capa: banner inteiro, sem texto por cima (a arte já traz a marca) */
.hero.has-media { padding: 0; background: #000; }
/* Altura contida: deixa a busca e o estoque aparecerem já na abertura do site.
   O enquadramento puxa para cima, cortando mais da parte de baixo da imagem. */
/* Só foto: banner grande. Com vídeo: mais baixo, para não tomar a tela toda */
.hero.has-media .hero-media {
  position: relative; inset: auto; width: 100%; overflow: hidden;
  height: max(200px, min(80vh, 820px, calc(100vw / var(--ar, 1.778))));
}
.hero.has-video .hero-media { height: clamp(220px, 48vh, 440px); }
/* Laterais: a própria capa, desfocada e escurecida */
.hero.has-media .hero-media::before {
  content: ""; position: absolute; inset: -40px;
  background: var(--capa, none) center / cover no-repeat;
  filter: blur(24px) brightness(.45) saturate(1.2);
}
/* Foto e vídeo aparecem inteiros (sem corte), centralizados */
.hero-photo, .hero.has-media .hero-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.hero-photo { z-index: 1; }
.hero.has-media .hero-media video { z-index: 2; }
@media (max-width: 600px) {
  /* No celular a largura manda: altura exata de 16:9, sem sobra */
  .hero.has-media .hero-media { height: calc(100vw / var(--ar, 1.778)); }
}
/* A frase já aparece na barra do topo: o texto abaixo da foto some (o título fica só para leitores de tela) */
.hero.has-media .container { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
.hero.has-media ~ main .filters { margin-top: 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p { margin: 0; color: #c3cad8; font-size: 17px; }
.hero .hero-city { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; color: var(--accent); font-weight: 600; }

/* ---------- Filtros ---------- */
.filters {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-top: -56px; position: relative;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
}
.filters .field:first-child { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ---------- Grade de anúncios ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 32px 0 16px; gap: 12px; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head .count { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(16, 24, 40, .12); }
.card-img { aspect-ratio: 4 / 3; background: #e9ecf1; position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 700; font-size: 17px; line-height: 1.25; }
.card-meta { display: flex; gap: 12px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.card-price { font-size: 21px; font-weight: 800; margin-top: auto; padding-top: 6px; }
.price-ask { font-size: 16px; color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em;
}
.card-img .badge { position: absolute; top: 10px; left: 10px; }
.badge-destaque { background: var(--accent); color: var(--navy); }
.badge-reservado { background: #3b6fd8; color: #fff; }
.badge-vendido { background: var(--red); color: #fff; }
.badge-disponivel { background: #e3f6ea; color: var(--green-dark); }
.card-img .badge + .badge { left: auto; right: 10px; }

.placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #b4bcc8; }
.placeholder svg { width: 38%; height: auto; }

.empty { text-align: center; color: var(--muted); padding: 60px 16px; background: var(--card); border-radius: var(--radius); }
.empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }

/* ---------- Página do caminhão ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 24px 0 16px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.back:hover { color: var(--text); }
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.gallery { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery-main { aspect-ratio: 4 / 3; background: #0f141f; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .9); cursor: pointer; display: grid; place-items: center; font-size: 22px;
}
.gallery-nav.prev { left: 12px; } .gallery-nav.next { right: 12px; }
.gallery-counter { position: absolute; bottom: 12px; right: 12px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 84px; aspect-ratio: 4 / 3; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; cursor: pointer; background: #eee; opacity: .7; }
.thumbs button.active { border-color: var(--accent); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.info { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; position: sticky; top: 120px; }
.info h1 { margin: 8px 0 4px; font-size: 26px; line-height: 1.2; }
.info .price { font-size: 32px; font-weight: 800; margin: 12px 0 18px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 20px; }
.spec { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.spec dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.spec dd { margin: 0; font-weight: 700; }
.info .btn { width: 100%; padding: 14px; font-size: 16px; }
.info .note { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; }
.desc { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }
.desc h2 { margin: 0 0 10px; font-size: 18px; }
.desc p { margin: 0; white-space: pre-line; color: #374151; }

/* ---------- Rodapé ---------- */
.site-footer { background: #000; color: #c3cad8; margin-top: 64px; padding: 40px 0 28px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.site-footer h3 { color: #fff; font-size: 15px; margin: 0 0 8px; }
.site-footer p { margin: 0 0 6px; white-space: pre-line; }
.footer-bottom { border-top: 1px solid #262626; margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.footer-bottom { padding-right: 76px; }
.footer-bottom a { color: #8f9ab0; text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

.wa-float {
  position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 30;
}
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field:first-child { grid-column: 1 / -1; }
  .detail { grid-template-columns: 1fr; }
  .info { position: static; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-header .btn-text { display: none; }
  .hero { padding: 32px 0 80px; }
  .specs { grid-template-columns: 1fr 1fr; }
  .info .price { font-size: 28px; }
}
