:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --text: #16213d;
  --muted: #646e85;
  --line: #e1e6ef;
  --brand: #1747a6;         /* azul da logo */
  --brand-dark: #0e2f73;
  --brand-ink: #ffffff;
  --accent: #ffc20e;        /* amarelo da logo */
  --accent-ink: #16213d;
  --ok: #0a8f4a;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --shadow-hover: 0 2px 4px rgba(16,24,40,.08), 0 12px 32px rgba(16,24,40,.12);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1424;
    --surface: #161e31;
    --text: #e8ecf5;
    --muted: #98a1b6;
    --line: #26304a;
    --brand: #5b8ef0;
    --brand-dark: #0e2f73;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Cabeçalho: logo sobre branco (a arte tem fundo branco) + barra azul de categorias */
header { position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.topo { background: #fff; color: #16213d; }
.bar { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 8px 0; }
.logo { display: block; flex: none; line-height: 0; }
.logo img { height: 56px; width: auto; }
.search { flex: 1; position: relative; max-width: 640px; }
.search input {
  width: 100%; padding: 12px 14px 12px 42px; border: 2px solid #dfe5f1; border-radius: 12px;
  font: inherit; font-size: 15px; background: #f7f9fc; color: #16213d;
}
.search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #6b7385; }

nav.cats { background: var(--brand-dark); }
.cats ul { display: flex; gap: 4px; margin: 0 auto; padding: 0 16px; list-style: none; overflow-x: auto; scrollbar-width: none; max-width: 1240px; }
.cats ul::-webkit-scrollbar { display: none; }
.cats a {
  display: block; padding: 10px 12px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 500;
  white-space: nowrap; border-bottom: 3px solid transparent;
}
.cats a:hover { border-bottom-color: rgba(255,255,255,.5); }
.cats a[aria-current="true"] { border-bottom-color: var(--accent); font-weight: 700; }

/* Hero */
.hero {
  margin: 20px 0 0; padding: 26px 28px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, var(--brand-dark), #1747a6 60%, #2a63d4);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hero h1 { margin: 0 0 6px; font-size: clamp(22px, 3.6vw, 32px); letter-spacing: -.02em; }
.hero h1 span { color: var(--accent); }
.hero p { margin: 0; color: #d6e1ff; max-width: 60ch; }
.hero .num { flex: none; text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 12px 18px; font-weight: 800; }
.hero .num b { display: block; font-size: 28px; line-height: 1; }
.hero .num small { font-size: 12px; font-weight: 600; }

/* Ferramentas */
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 18px 0 6px; }
.tools h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sort select {
  font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}

/* Seções por categoria (página inicial) */
.secao { padding: 18px 0 8px; }
.secao-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.secao-topo h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.secao-topo h2 span { font-size: 22px; }
.ver-todos { font-size: 14px; font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; }
.ver-todos:hover { text-decoration: underline; }

/* Vitrine */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding-bottom: 16px; }
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.thumb { aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 16px; border-bottom: 1px solid var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.sem-foto { color: #9aa3b5; font-size: 13px; font-weight: 500; text-align: center; display: grid; gap: 8px; justify-items: center; }
.sem-foto svg { width: 56px; height: 56px; }
/* Selos ficam fora da foto: a imagem do anúncio é exibida inteira, sem nada por cima */
.tags { display: flex; gap: 6px; align-items: center; min-height: 22px; flex-wrap: wrap; }
.badge { background: var(--ok); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.type {
  background: var(--line); color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em;
}
.info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.brand { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.name { font-size: 14px; font-weight: 500; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.old { font-size: 13px; color: var(--muted); text-decoration: line-through; min-height: 1.2em; }
.price { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.price small { font-size: 14px; font-weight: 600; vertical-align: 8px; margin-left: 1px; }
.buy {
  margin-top: auto; display: block; text-align: center; background: var(--brand); color: var(--brand-ink);
  font-weight: 600; font-size: 14px; padding: 10px; border-radius: 10px;
}
.card:hover .buy { filter: brightness(1.1); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 0; }

footer { margin-top: 24px; border-top: 1px solid var(--line); padding: 22px 0 36px; font-size: 13px; color: var(--muted); }
footer p { margin: 4px 0; }
footer .rodape-logo { height: 40px; width: auto; margin-bottom: 8px; background: #fff; border-radius: 8px; padding: 4px 6px; }

@media (max-width: 640px) {
  html { scroll-padding-top: 170px; }
  .bar { flex-wrap: wrap; gap: 8px; justify-content: center; }
  .logo img { height: 46px; }
  .search { flex-basis: 100%; max-width: none; }
  .hero { padding: 20px; flex-direction: column; align-items: flex-start; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .thumb { padding: 10px; }
  .info { padding: 10px 12px 12px; }
  .price { font-size: 20px; }
  .tools { flex-direction: column; align-items: stretch; }
}

/* Páginas geradas no servidor: título da categoria, trilha, introdução e textos institucionais */
.search { margin: 0; }
.titulo { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.titulo small { color: var(--muted); font-weight: 500; font-size: 16px; }
.secao-topo h2 a { text-decoration: none; }
.secao-topo h2 a:hover { text-decoration: underline; }
.trilha { padding-top: 16px; font-size: 13px; color: var(--muted); }
.trilha a { color: var(--brand); text-decoration: none; }
.intro { margin: 4px 0 20px; color: var(--muted); max-width: 80ch; }
.texto { max-width: 760px; padding: 24px 0 8px; }
.texto h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 12px; }
.texto h2 { font-size: 19px; margin: 24px 0 6px; }
.texto p { margin: 0 0 10px; }
.texto a { color: var(--brand); }

/* SEO: texto da página inicial, guias de compra, categorias relacionadas e rodapé com links */
.seo { max-width: none; padding-top: 28px; }
.seo h2 { font-size: 20px; margin-top: 0; }
.guias-lista { columns: 2 320px; margin: 8px 0 0; padding-left: 18px; }
.guias-lista li { margin: 0 0 6px; break-inside: avoid; }
.guias-lista a, .intro a, .guia-box a { color: var(--brand); }
.guias-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding-bottom: 16px; }
.guia-card {
  display: block; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; transition: box-shadow .2s, transform .2s;
}
.guia-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.guia-card h3 { font-size: 16px; margin: 0 0 4px; line-height: 1.3; }
.guia-card p { margin: 0; color: var(--muted); font-size: 14px; }
.guia-icone { font-size: 26px; }
.guia .guia-meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.guia .guia-lead { font-size: 17px; }
.guia ul, .guia ol { padding-left: 20px; margin: 0 0 10px; }
.guia li { margin-bottom: 6px; }
.guia-indice { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 16px 0 8px; font-size: 14px; }
.guia-indice ol { margin: 6px 0 0; }
.guia-indice a { color: var(--brand); text-decoration: none; }
.guia-nota { margin-top: 20px; font-size: 13px; color: var(--muted); }
.guia-tabela { overflow-x: auto; margin: 8px 0 12px; }
.guia-tabela table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; font-variant-numeric: tabular-nums; }
.guia-tabela th, .guia-tabela td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.guia-tabela th { font-weight: 600; }
.calc-btu { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0 14px; }
.calc-btu[hidden] { display: none; }
.calc-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.calc-campos label { display: grid; gap: 4px; font-size: 14px; }
.calc-campos input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.calc-opcao { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.calc-resultado { display: block; margin-top: 10px; font-weight: 600; }
.guia-box {
  display: flex; gap: 14px; align-items: flex-start; margin: 8px 0 8px; padding: 16px 18px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.guia-box h2 { font-size: 17px; margin: 0 0 4px; }
.guia-box p { margin: 0; color: var(--muted); font-size: 14px; }
.relacionadas { padding: 16px 0 4px; }
.relacionadas h2 { font-size: 17px; margin: 0 0 10px; }
.relacionadas ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.relacionadas a {
  display: block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 500;
}
.relacionadas a:hover { border-color: var(--brand); color: var(--brand); }
.rodape-colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 4px 0 16px; }
.rodape-colunas h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin: 0 0 6px; }
.rodape-colunas ul { list-style: none; margin: 0; padding: 0; }
.rodape-colunas li { margin: 0 0 4px; }
.rodape-colunas a { color: var(--muted); text-decoration: none; }
.rodape-colunas a:hover { color: var(--brand); text-decoration: underline; }
.guia-box ul { margin: 4px 0 0; padding-left: 18px; }
.guia-box li { margin-bottom: 4px; }
.relacionadas li a { border-radius: 10px; }

/* Texto próprio das categorias (como escolher + perguntas frequentes) */
.categoria-texto { padding-top: 28px; }
.categoria-texto h2:first-child { margin-top: 0; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--brand); }
.faq p { margin: 8px 0 2px; color: var(--muted); }
