/* Dica Certa — CSS único, sem framework. Mobile primeiro. */

:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --ink: #14201b;
  --ink-2: #33423b;
  --muted: #5d6c65;
  --line: #dfe4de;
  --brand: #0a7a4a;
  --brand-ink: #06583a;
  --brand-soft: #e3f3ea;
  --accent: #f2b705;
  --otimo: #0a7a4a;  --otimo-bg: #dcf2e5;
  --bom: #3d7f1f;    --bom-bg: #e8f3d9;
  --pouco: #8a6100;  --pouco-bg: #fbf0d0;
  --ruim: #b3261e;   --ruim-bg: #fbe3e1;
  --neutro: #5d6c65; --neutro-bg: #edf0ec;
  --suspeito: #6b3fb8; --suspeito-bg: #efe7fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 27, .06), 0 4px 16px rgba(20, 32, 27, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1613;
    --surface: #16201c;
    --surface-2: #1c2823;
    --ink: #e8efe9;
    --ink-2: #c9d4cd;
    --muted: #93a39b;
    --line: #26342e;
    --brand: #3ec486;
    --brand-ink: #7fdcae;
    --brand-soft: #173326;
    --otimo: #5fd49a;  --otimo-bg: #173326;
    --bom: #9bd46a;    --bom-bg: #22301a;
    --pouco: #f0c455;  --pouco-bg: #332a12;
    --ruim: #ff8a80;   --ruim-bg: #3a1c1a;
    --neutro: #93a39b; --neutro-bg: #1f2a25;
    --suspeito: #c4a4ff; --suspeito-bg: #2a2140;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3.5vw, 1.7rem); font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- topo ---------- */
.topo { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topo .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.marca img { width: 34px; height: 34px; }
.marca span b { color: var(--brand); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.nav .so-desktop { display: none; }
@media (min-width: 720px) { .nav .so-desktop { display: inline-block; } }

/* ---------- herói + busca ---------- */
.heroi { padding: 36px 0 28px; }
.heroi p.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 46ch; }
.busca { display: flex; gap: 8px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); max-width: 640px; }
.busca:focus-within { border-color: var(--brand); }
.busca input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; padding: 10px 12px; }
.busca input:focus { outline: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primario { background: var(--brand); color: #fff; }
.btn-primario:hover { background: var(--brand-ink); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primario { color: #0b1a13; } .btn-primario:hover { color: #0b1a13; } }
.btn-sec { background: var(--surface-2); color: var(--ink); }
.btn-sec:hover { background: var(--line); color: var(--ink); }
.btn-peq { padding: 8px 12px; font-size: .875rem; border-radius: 10px; }
.sugestoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: .9rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ---------- modos: comprar x revender ---------- */
.modos { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin: 0 0 12px; flex-wrap: wrap; }
.modo { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.modo[aria-pressed="true"] { background: var(--surface); color: var(--brand-ink); box-shadow: var(--shadow); }

/* ---------- lote (revenda) ---------- */
.lote { position: sticky; bottom: 0; z-index: 30; background: var(--surface); border-top: 2px solid var(--brand); box-shadow: 0 -6px 24px rgba(0, 0, 0, .12); }
.lote[hidden] { display: none; }
.lote .wrap { padding-top: 10px; padding-bottom: 10px; }
.lote summary { cursor: pointer; font-weight: 800; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; list-style: none; }
.lote summary::-webkit-details-marker { display: none; }
.lote[open] > div { max-height: 60vh; overflow: auto; }
.lote-itens { margin-top: 10px; overflow-x: auto; }
body.com-lote main { padding-bottom: 80px; }
.pisca { animation: pisca .9s ease; }
@keyframes pisca { 0%, 100% { background: var(--surface); } 30% { background: var(--brand-soft); } }
@media (prefers-reduced-motion: reduce) { .pisca { animation: none; } }
.lote-itens table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lote-itens td, .lote-itens th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.lote-itens input.campo-venda { width: 90px; }
@media (max-width: 560px) {
  .lote-itens th:nth-child(3), .lote-itens td:nth-child(3) { display: none; }  /* custo un. some no celular */
  .lote-itens input { width: 52px !important; }
  .lote-itens input.campo-venda { width: 70px !important; }
  .lote-itens td, .lote-itens th { padding: 6px 4px; }
}
.lote-itens input { width: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.lote-totais { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.lote-totais div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.lote-totais b { display: block; font-size: 1.05rem; }
.lote-totais span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.linha-rev { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.lado.destaque-lucro .val { color: var(--otimo); }
.lado.destaque-prejuizo .val { color: var(--ruim); }

/* ---------- faixa de câmbio ---------- */
.faixa { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 22px 0 0; }
.faixa div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.faixa dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.faixa dd { margin: 2px 0 0; font-size: 1.2rem; font-weight: 800; }
.faixa dd small { font-size: .78rem; font-weight: 500; color: var(--muted); display: block; }

/* ---------- seções ---------- */
.secao { padding: 28px 0; }
.secao-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.secao-titulo h2 { margin: 0; }
.grade { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grade-2 { grid-template-columns: 1fr 1fr; } .grade-3, .grade-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grade-3 { grid-template-columns: repeat(3, 1fr); } .grade-4 { grid-template-columns: repeat(4, 1fr); } }

.caixa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.caixa > :last-child { margin-bottom: 0; }

/* ---------- cartão de destaque (home / preços) ---------- */
.destaque { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.destaque:hover { border-color: var(--brand); color: var(--ink); transform: translateY(-1px); }
.destaque img, .destaque .sem-img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #fff; flex-shrink: 0; }
.destaque .sem-img { background: var(--surface-2); }
.destaque .info { min-width: 0; flex: 1; }
.destaque .nome { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.destaque .valores { font-size: .875rem; color: var(--muted); margin-top: 2px; }

/* ---------- selos ---------- */
.selo { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.selo-otimo { color: var(--otimo); background: var(--otimo-bg); }
.selo-bom { color: var(--bom); background: var(--bom-bg); }
.selo-pouco { color: var(--pouco); background: var(--pouco-bg); }
.selo-ruim { color: var(--ruim); background: var(--ruim-bg); }
.selo-neutro { color: var(--neutro); background: var(--neutro-bg); }
.selo-suspeito { color: var(--suspeito); background: var(--suspeito-bg); }

/* ---------- resultado da busca ---------- */
.resumo { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 6px 0 16px; }
@media (min-width: 720px) { .resumo { grid-template-columns: 2fr 1fr; } }
.ajustes summary { cursor: pointer; font-weight: 700; }
.ajustes-campos { display: grid; gap: 4px 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .ajustes-campos { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { body[data-modo="revenda"] .ajustes-campos { grid-template-columns: repeat(3, 1fr); } }
.ajustes-campos p { margin: 6px 0 0; }
.ajustes select { width: 100%; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
body[data-modo="revenda"] .so-compra, body[data-modo="compra"] .so-revenda, body:not([data-modo]) .so-revenda { display: none; }
@media (max-width: 520px) { .linha-rev { grid-template-columns: 1fr 1fr; } .linha-rev > :last-child { grid-column: 1 / -1; } }
.ajustes label { display: block; font-size: .9rem; color: var(--ink-2); margin: 10px 0 4px; }
.ajustes input { width: 100%; max-width: 200px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.card-topo { display: flex; gap: 12px; align-items: flex-start; }
.card-topo img, .card-topo .sem-img { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #fff; flex-shrink: 0; }
.card-topo .sem-img { background: var(--surface-2); }
.card-nome { font-weight: 700; line-height: 1.3; margin: 0 0 6px; }
.lados { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lado { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.lado .rot { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.lado .val { font-size: 1.15rem; font-weight: 800; margin-top: 2px; }
.lado .det { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.economia { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed var(--line); padding-top: 10px; font-weight: 700; flex-wrap: wrap; }
.economia .pos { color: var(--otimo); }
.economia .neg { color: var(--ruim); }
.card-links { display: flex; gap: 8px; flex-wrap: wrap; }
.aviso { background: var(--pouco-bg); color: var(--pouco); border-radius: 10px; padding: 8px 12px; font-size: .875rem; font-weight: 600; }
.aviso-suspeito { background: var(--suspeito-bg); color: var(--suspeito); }

.lista-simples { list-style: none; padding: 0; margin: 0; }
.lista-simples li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lista-simples li:last-child { border-bottom: 0; }

.carregando { text-align: center; padding: 40px 0; color: var(--muted); }
.giro { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 12px; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation: none; } .destaque { transition: none; } }

/* ---------- página de produto ---------- */
.migalhas { font-size: .875rem; color: var(--muted); padding-top: 18px; }
.migalhas a { color: var(--muted); }
.produto-topo { display: grid; gap: 18px; grid-template-columns: 1fr; padding: 16px 0 8px; }
@media (min-width: 820px) { .produto-topo { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.foto { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; display: flex; justify-content: center; }
.foto img { max-height: 220px; object-fit: contain; }
.placar { display: grid; gap: 10px; }
.placar .linha { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.placar .linha > :last-child { white-space: nowrap; text-align: right; }
.nw { white-space: nowrap; }
.placar .linha:last-child { border-bottom: 0; }
.placar .total { font-size: 1.25rem; font-weight: 800; }
.grande { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 900; letter-spacing: -.03em; line-height: 1; }

table.tabela { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabela-rolagem { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tabela th, table.tabela td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tabela th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
table.tabela tr:last-child td { border-bottom: 0; }
table.tabela td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- texto longo (guias, políticas) ---------- */
.prosa { max-width: 72ch; }
.prosa h2 { margin-top: 1.6em; }
.prosa h3 { margin-top: 1.3em; }
.prosa ul, .prosa ol { padding-left: 1.3em; }
.prosa li { margin-bottom: .4em; }
.prosa blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.prosa .fonte { font-size: .85rem; color: var(--muted); }
.conta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-variant-numeric: tabular-nums; }
.conta div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.conta div.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 800; }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 10px 0 0; color: var(--ink-2); }

/* ---------- rodapé ---------- */
.rodape { margin-top: auto; background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0; font-size: .9rem; color: var(--muted); }
.rodape .colunas { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .rodape .colunas { grid-template-columns: 2fr 1fr 1fr; } }
.rodape h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.rodape ul { list-style: none; padding: 0; margin: 0; }
.rodape li { margin-bottom: 6px; }
.rodape a { color: var(--muted); }
.rodape a:hover { color: var(--ink); }

/* ---------- aviso de cookies ---------- */
.cookies { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto; background: var(--ink); color: var(--bg); border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); font-size: .9rem; }
.cookies a { color: var(--accent); }
.cookies[hidden] { display: none; }
