/* ==========================================================================
   SinoAuto Angola — Folha de estilo principal
   Mobile-first · tokens em CSS custom properties · sem dependências externas
   ========================================================================== */

/* ---------- 1. Tokens de design ---------- */
:root {
  --navy: #0b2545;
  --navy-700: #123a63;
  --blue: #1668c8;
  --blue-soft: #e8f1fc;
  --orange: #ff6a00;
  --orange-600: #e65f00;
  --green: #1f9d63;
  --green-soft: #e6f5ee;

  --ink: #14212e;
  --muted: #5b6b7c;
  --line: #e2e8f0;
  --bg: #f5f8fb;
  --white: #ffffff;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(16, 32, 52, .06);
  --shadow: 0 6px 24px rgba(16, 32, 52, .08);
  --shadow-lg: 0 18px 44px rgba(16, 32, 52, .14);

  --container: 1200px;
  --header-h: 68px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; color: var(--navy); }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2.4vw, 1.35rem); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy); color: var(--white); padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 3. Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.section-alt { background: var(--bg); }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--orange); margin-bottom: .6rem;
}
.lead { font-size: clamp(1rem, 2.2vw, 1.1rem); color: var(--muted); }
.center { text-align: center; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 4. Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.3rem; border: 1px solid transparent; border-radius: 999px;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  min-height: 48px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: var(--white); box-shadow: 0 8px 20px rgba(255, 106, 0, .28); }
.btn-primary:hover { background: var(--orange-600); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-700); }
.btn-outline { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn-whats { background: var(--green); color: var(--white); box-shadow: 0 8px 20px rgba(31, 157, 99, .25); }
.btn-whats:hover { background: #188550; }
.btn-sm { padding: .5rem 1rem; min-height: 40px; font-size: .875rem; }
.btn-block { width: 100%; }

/* ---------- 5. Cabeçalho ---------- */
.header {
  position: sticky; top: 0; z-index: 60; background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.brand img { height: 40px; width: auto; }
.brand-fallback { font-weight: 800; color: var(--navy); font-size: 1.05rem; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--white); cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--navy); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: var(--navy);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.nav {
  display: none; position: absolute; inset: var(--header-h) 0 auto 0;
  background: var(--white); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow); padding: .5rem 20px 1.25rem;
}
.nav.is-open { display: block; }
.nav ul { display: grid; gap: 2px; }
.nav a {
  display: block; padding: .75rem .5rem; color: var(--navy); font-weight: 600;
  border-radius: 10px;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--orange); }
.nav .nav-cta { margin-top: .75rem; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav {
    display: block !important; position: static; box-shadow: none; border: 0; padding: 0;
    background: transparent; margin-right: 1rem;
  }
  .nav ul { display: flex; gap: .25rem; }
  .nav a { padding: .5rem .8rem; }
  .nav .nav-cta { display: none; }
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0b2545 0%, #123a63 55%, #17507f 100%);
  color: var(--white);
}
.hero-inner {
  display: grid; gap: 2rem; align-items: center;
  padding-block: clamp(2.5rem, 8vw, 4.5rem);
}
.hero h1 { color: var(--white); }
.hero p { color: rgba(255, 255, 255, .82); font-size: clamp(1rem, 2.2vw, 1.12rem); }
.hero-media { order: -1; }
.hero-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; height: auto; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.hero-badge {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  color: var(--white); border-radius: 999px; padding: .35rem .8rem; font-size: .82rem; font-weight: 600;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.05fr .95fr; gap: 3rem; }
  .hero-media { order: 0; }
}

/* Barra de pesquisa rápida */
.searchbar {
  background: var(--white); border-radius: var(--radius-lg); padding: 1rem;
  box-shadow: var(--shadow-lg); display: grid; gap: .75rem;
}
.searchbar-row { display: grid; gap: .75rem; }
@media (min-width: 700px) {
  .searchbar { padding: 1.25rem; }
  .searchbar-row { grid-template-columns: repeat(3, 1fr) auto; align-items: end; }
}

.field { display: grid; gap: .35rem; }
.field label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.field select, .field input {
  width: 100%; min-height: 48px; padding: .55rem .75rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white);
}

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.5rem; }
.stat { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--radius); padding: 1rem; }
.stat strong { display: block; font-size: clamp(1.4rem, 3.4vw, 1.9rem); color: var(--white); line-height: 1.1; }
.stat span { font-size: .82rem; color: rgba(255, 255, 255, .78); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 7. Cartões ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); }
.card-media { position: relative; background: var(--bg); }
.card-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-title { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .82rem; color: var(--muted); }
.card-meta span { background: var(--bg); border-radius: 6px; padding: .15rem .5rem; }
.card-price { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.card-price small { display: block; font-size: .75rem; font-weight: 600; color: var(--muted); }
.card-price-alt {
  display: block; margin-top: .2rem; font-size: .78rem; font-style: normal;
  font-weight: 600; color: var(--muted);
}
.card-foot { margin-top: auto; display: flex; gap: .5rem; padding-top: .75rem; }
.card-foot .btn { flex: 1; }

.badge {
  position: absolute; top: .7rem; left: .7rem; z-index: 2;
  background: var(--orange); color: var(--white); font-size: .72rem; font-weight: 800;
  padding: .25rem .6rem; border-radius: 999px; letter-spacing: .04em;
}
.badge-blue { background: var(--blue); }
.badge-green { background: var(--green); }

/* Categorias */
.cat {
  display: grid; gap: .35rem; place-items: center; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem .75rem; font-weight: 700; color: var(--navy); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}
.cat:hover { transform: translateY(-3px); border-color: var(--blue); text-decoration: none; }
.cat img { width: 100%; max-width: 150px; height: auto; }
.cat span { font-size: .9rem; }
.cat small { font-size: .74rem; font-weight: 600; color: var(--muted); }

/* ---------- 8. Lista de benefícios ---------- */
.feature { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.feature h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
.feature-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--blue-soft); margin-bottom: .8rem; color: var(--navy); font-weight: 800;
}

/* Passos do processo */
.steps { counter-reset: step; display: grid; gap: 1rem; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 1rem; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--white); font-weight: 800;
}
.step h3 { font-size: 1rem; margin-bottom: .25rem; }
.step p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- 9. Filtros (página de veículos) ---------- */
.layout-side { display: grid; gap: 1.5rem; }
@media (min-width: 980px) { .layout-side { grid-template-columns: 280px 1fr; align-items: start; } }

.filters {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.1rem; box-shadow: var(--shadow-sm);
}
.filters h2 { font-size: 1.05rem; margin-bottom: .75rem; }
.filters .field { margin-bottom: .9rem; }
.filters-actions { display: flex; gap: .5rem; }
.filters-actions .btn { flex: 1; }
.filter-toggle { display: block; width: 100%; }
@media (min-width: 980px) { .filter-toggle { display: none; } .filters-body { display: block !important; } }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: 1rem;
}
.toolbar .count { color: var(--muted); font-size: .9rem; }
.toolbar .field { min-width: 200px; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip {
  background: var(--blue-soft); color: var(--navy-700); border: 0; border-radius: 999px;
  padding: .35rem .8rem; font-size: .82rem; font-weight: 700; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--navy); color: var(--white); }

.empty {
  background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--muted);
}

/* ---------- 10. Detalhe do veículo ---------- */
.detail { display: grid; gap: 1.5rem; }
@media (min-width: 980px) { .detail { grid-template-columns: 1.35fr .65fr; align-items: start; } }
.gallery { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.gallery-main img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: .75rem; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; overflow: hidden; }
.thumbs button[aria-pressed="true"] { border-color: var(--orange); }
.thumbs img { aspect-ratio: 16 / 10; object-fit: cover; }

.price-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow); }
.price-box .price { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.price-box .price-note { color: var(--muted); font-size: .85rem; }
.price-box ul { margin: 1rem 0; display: grid; gap: .45rem; font-size: .92rem; }
.price-box li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .45rem; }
.price-box li span:last-child { font-weight: 700; }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--line); font-size: .93rem; }
.spec-table th { width: 42%; color: var(--muted); font-weight: 600; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }

/* ---------- 11. Guia de importação ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data th, table.data td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
table.data thead th { background: var(--navy); color: var(--white); font-size: .85rem; letter-spacing: .03em; }
table.data tbody tr:nth-child(even) { background: #fafcfd; }

.callout {
  background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin: 1.25rem 0; font-size: .93rem;
}
.callout-warn { background: #fff4e8; border-left-color: var(--orange); }
.callout-ok { background: var(--green-soft); border-left-color: var(--green); }

.checklist li {
  display: grid; grid-template-columns: 24px 1fr; gap: .6rem; align-items: start;
  padding: .55rem 0; border-bottom: 1px solid var(--line);
}
.checklist li::before { content: "✓"; color: var(--green); font-weight: 800; }
.checklist li:last-child { border-bottom: 0; }

.faq { display: grid; gap: .6rem; }
.faq details {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem;
}
.faq summary { font-weight: 700; color: var(--navy); cursor: pointer; }
.faq details[open] summary { margin-bottom: .5rem; }
.faq p { color: var(--muted); font-size: .93rem; margin: 0; }

/* ---------- 12. Contacto ---------- */
.contact-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.25rem; display: grid; gap: .35rem;
}
.contact-card strong { color: var(--navy); }
.contact-card a { font-weight: 700; }
.form { display: grid; gap: .9rem; }
.form .field label { color: var(--navy); }
textarea { min-height: 120px; resize: vertical; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; }
.form-note { font-size: .82rem; color: var(--muted); }
.form-status { font-size: .9rem; font-weight: 700; color: var(--green); }

/* ---------- 13. CTA / rodapé ---------- */
.cta-band {
  background: linear-gradient(140deg, var(--navy), var(--navy-700)); color: var(--white);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 5vw, 2.75rem);
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255, 255, 255, .82); }

.footer { background: #08192e; color: rgba(255, 255, 255, .72); padding-block: 2.5rem 1.5rem; margin-top: 0; }
.footer h3 { color: var(--white); font-size: 1rem; margin-bottom: .75rem; }
.footer a { color: rgba(255, 255, 255, .82); }
.footer-grid { display: grid; gap: 1.75rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 2rem; padding-top: 1.25rem;
  font-size: .82rem; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between;
}

/* Botão flutuante do WhatsApp */
/* ---------- 13b. Seletor de idioma e aviso de detecção ---------- */
.lang-switch { position: relative; flex: 0 0 auto; }
.lang-switch::before {
  content: ""; position: absolute; left: .6rem; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--muted); pointer-events: none; opacity: .7;
}
.lang-switch::after {
  content: ""; position: absolute; left: .95rem; top: 50%; transform: translateY(-50%);
  width: 14px; height: 7px; border: 1.5px solid var(--muted); border-bottom: 0;
  border-radius: 7px 7px 0 0; pointer-events: none; opacity: .55;
}
.lang-switch select {
  appearance: none; -webkit-appearance: none;
  padding: .45rem 1.7rem .45rem 2rem; min-height: 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  color: var(--navy); font-size: .875rem; font-weight: 600; cursor: pointer;
  max-width: 9.5rem; text-overflow: ellipsis;
}
.lang-switch select:hover { border-color: var(--navy-700); }

.lang-notice {
  position: relative; background: var(--blue-soft); border-bottom: 1px solid #cfe1f7;
  color: var(--navy-700);
}
.lang-notice[hidden] { display: none; }
.lang-notice #lang-notice-text {
  display: block; padding: .7rem 3rem .7rem 20px; font-size: .875rem; font-weight: 600;
}
.lang-notice-x {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 1.25rem; line-height: 1;
}
.lang-notice-x:hover { color: var(--navy); }

/* Textos mais longos noutros idiomas não devem partir o layout */
.data td, .data th { vertical-align: top; }
.price-box li span, .card-meta span { overflow-wrap: anywhere; }

.whats-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 70;
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--green); color: var(--white); border-radius: 999px;
  padding: .75rem 1.1rem; font-weight: 700; box-shadow: var(--shadow-lg);
}
.whats-float:hover { background: #188550; text-decoration: none; }
@media (min-width: 900px) { .whats-float { right: 24px; bottom: 24px; } }

/* ---------- 14. Utilitários ---------- */
.header-cta { display: none; }
@media (min-width: 900px) { .header-cta { display: inline-flex; } }

/* Corpo dos filtros: recolhido no telemóvel, sempre visível no desktop */
.filters-body { display: none; }
.filters-body.is-open { display: block; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.hide { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pagination { display: flex; justify-content: center; gap: .6rem; margin-top: 1.5rem; }

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