:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --text: #16181d;
  --muted: #6b7079;
  --border: #e4e4e0;
  --primary: #16181d;
  --on-primary: #ffffff;
  --accent: #ff5a36;
  --whats: #25d366;
  --whats-dark: #128c4b;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
  --shadow-lg: 0 20px 60px rgb(0 0 0 / .18);
  --sem-foto-l: 92%;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1013;
    --surface: #17191d;
    --surface-2: #202328;
    --text: #f2f2f0;
    --muted: #9a9fa8;
    --border: #2a2d33;
    --primary: #f2f2f0;
    --on-primary: #111214;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3);
    --sem-foto-l: 20%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1013;
  --surface: #17191d;
  --surface-2: #202328;
  --text: #f2f2f0;
  --muted: #9a9fa8;
  --border: #2a2d33;
  --primary: #f2f2f0;
  --on-primary: #111214;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .3);
  --sem-foto-l: 20%;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.travado { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topo__inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex-shrink: 0; }
.marca__logo {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 18px;
}
.marca__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.marca__nome { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }

.busca {
  flex: 1; max-width: 460px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 0 16px; height: 44px; color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.busca:focus-within { border-color: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent); }
.busca svg { width: 18px; height: 18px; flex-shrink: 0; }
.busca input { border: 0; outline: 0; background: none; width: 100%; color: var(--text); }

.btn-carrinho {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--primary); color: var(--on-primary); flex-shrink: 0;
  transition: transform .15s;
}
.btn-carrinho:active { transform: scale(.94); }
.btn-carrinho.pulo { animation: pulo .45s; }
@keyframes pulo { 40% { transform: scale(1.18); } }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* ---------- Hero ---------- */
.hero { padding-top: 48px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; max-width: 760px; }
.hero p { margin-top: 14px; color: var(--muted); font-size: 17px; max-width: 560px; }
.confianca { list-style: none; padding: 0; margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.confianca li {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 600;
}

/* ---------- Categorias ---------- */
.categorias {
  display: flex; gap: 10px; overflow-x: auto; padding-top: 4px; padding-bottom: 12px;
  scrollbar-width: none;
}
.categorias::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border);
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--text); }
.chip.ativo { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip small { font-weight: 500; opacity: .6; }

/* ---------- Filtros ---------- */
.filtros { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px auto 20px; flex-wrap: wrap; }
.segmentado { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 999px; overflow-x: auto; max-width: 100%; }
.segmentado button { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.segmentado button.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
#ordenar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 500;
}
.resultado { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

/* ---------- Grade ---------- */
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding-bottom: 60px; }
@media (max-width: 560px) { .grade { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  animation: surgir .4s both;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
@keyframes surgir { from { opacity: 0; transform: translateY(10px); } }

.card__foto { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); }
.card__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card__foto img { transform: scale(1.05); }
.sem-foto { width: 100%; height: 100%; display: grid; place-items: center; font-size: 64px; }

.selos { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.selo {
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: rgb(255 255 255 / .92); color: #16181d; backdrop-filter: blur(6px);
}
.selo--novo { background: #16181d; color: #fff; }
.selo--aluguel { background: #2f7d4f; color: #fff; }
.selo--destaque { background: var(--accent); color: #fff; }

.card__info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card__cat { font-size: 12px; color: var(--muted); font-weight: 500; }
.card__nome { font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__base { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; gap: 8px; }
.preco { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.preco small { font-weight: 500; font-size: 12px; color: var(--muted); }
.preco--consultar { font-size: 14px; font-weight: 600; color: var(--muted); }

.btn-add {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); transition: background .2s, color .2s, transform .15s;
}
.btn-add:hover { background: var(--primary); color: var(--on-primary); }
.btn-add:active { transform: scale(.9); }
.btn-add.no-carrinho { background: var(--whats); color: #fff; }
.btn-add svg { width: 18px; height: 18px; }
.card__acoes { display: flex; gap: 6px; flex-shrink: 0; }
.btn-add--whats { background: var(--whats); color: #fff; }
.btn-add--whats:hover { background: var(--whats-dark); color: #fff; }
.btn-add--whats svg { fill: currentColor; stroke: none; }
@media (max-width: 560px) { .card__base { flex-wrap: wrap; } }

.card.vendido { cursor: default; }
.card.vendido .card__foto { filter: grayscale(1); opacity: .55; }
.card.vendido:hover { transform: none; box-shadow: none; }
.faixa-vendido {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; letter-spacing: .1em; font-size: 18px; color: #fff; text-shadow: 0 2px 10px rgb(0 0 0 / .4);
}

.vazio { text-align: center; padding: 60px 0 100px; color: var(--muted); }
.vazio span { font-size: 40px; }

/* ---------- Botões ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  height: 52px; border-radius: 14px; font-weight: 700; font-size: 15px;
  background: var(--primary); color: var(--on-primary); text-decoration: none; transition: filter .2s, transform .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--whats { background: var(--whats); color: #fff; }
.btn--whats svg { fill: currentColor; stroke: none; }
.btn--secundario { background: var(--surface-2); color: var(--text); }
.btn-link { color: var(--muted); font-size: 13px; text-decoration: underline; padding: 6px; margin: 0 auto; display: block; }

.fechar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-size: 14px; color: var(--text);
}

/* ---------- Modal ---------- */
.modal {
  border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--text);
  width: min(920px, calc(100% - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); }
.modal[open] { animation: abrir .3s; }
@keyframes abrir { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.modal .fechar { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); box-shadow: var(--shadow); }
.modal__corpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.galeria { align-self: start; position: sticky; top: 0; }
.galeria { background: var(--surface-2); }
.aviso-ilustrativa {
  position: absolute; top: 12px; left: 12px; z-index: 1; padding: 4px 10px; border-radius: 999px;
  background: rgb(0 0 0 / .6); color: #fff; font-size: 12px; font-weight: 600;
}
.galeria__principal { aspect-ratio: 1; }
.galeria__principal img { width: 100%; height: 100%; object-fit: contain; display: block; }
.galeria__principal .sem-foto { font-size: 110px; }
.miniaturas { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.miniaturas button { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; flex-shrink: 0; opacity: .55; border: 2px solid transparent; }
.miniaturas button.ativo { opacity: 1; border-color: var(--text); }
.miniaturas img { width: 100%; height: 100%; object-fit: cover; }
.miniaturas button { position: relative; }
.miniaturas .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .35); color: #fff; }
.miniaturas .play svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.galeria__principal video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

.detalhe { padding: 32px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.detalhe h2 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; padding-right: 30px; }
.detalhe .preco { font-size: 28px; }
.detalhe__desc { color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.bloco h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.ficha { display: grid; grid-template-columns: auto 1fr; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; font-size: 14px; }
.ficha dt, .ficha dd { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.ficha dt { color: var(--muted); background: var(--surface-2); }
.ficha dd { font-weight: 600; }
.ficha dt:last-of-type, .ficha dd:last-of-type { border-bottom: 0; }
.inclui { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.inclui li { display: flex; gap: 8px; }
.inclui li::before { content: "✓"; color: var(--whats-dark); font-weight: 700; }
.lista-detalhes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lista-detalhes li { background: var(--surface-2); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.detalhe__acoes { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 10px; }
.detalhe .selos { position: static; }
.detalhe .selo { border: 1px solid var(--border); }

@media (max-width: 760px) {
  .modal { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .modal__corpo { grid-template-columns: minmax(0, 1fr); }
  .galeria { position: relative; }
  /* no celular a caixa acompanha a foto (em pé ou deitada), sem cortar */
  .galeria__principal { aspect-ratio: auto; }
  .galeria__principal img, .galeria__principal video { height: auto; max-height: 60dvh; }
  .galeria__principal .sem-foto { aspect-ratio: 4 / 3; }
  .detalhe { padding: 22px 20px 28px; }
  .detalhe h2 { font-size: 22px; }
}

/* ---------- Carrinho (gaveta) ---------- */
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 40; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.gaveta {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(420px, 100%); background: var(--surface);
  display: flex; flex-direction: column; visibility: hidden;
  transform: translateX(100%); transition: transform .35s cubic-bezier(.3, .7, .2, 1), visibility 0s .35s;
}
.gaveta.aberta { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition-delay: 0s; }
.gaveta__topo { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border); }
.gaveta__topo h2 { font-size: 20px; letter-spacing: -.01em; }
.gaveta__itens { flex: 1; overflow-y: auto; padding: 8px 20px; }
.gaveta__rodape { padding: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.total strong { font-size: 22px; letter-spacing: -.01em; }
.aviso { font-size: 13px; color: var(--muted); margin-top: -8px; }
.campo { height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); padding: 0 14px; outline: 0; }
.campo:focus { border-color: var(--text); }

.item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item__foto { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: var(--surface-2); }
.item__foto img { width: 100%; height: 100%; object-fit: cover; }
.item__foto .sem-foto { font-size: 30px; }
.item__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item__nome { font-weight: 600; font-size: 14px; line-height: 1.3; }
.item__linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item__preco { font-weight: 700; font-size: 14px; }
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; }
.qtd button { width: 30px; height: 30px; font-size: 16px; font-weight: 600; }
.qtd button:disabled { opacity: .3; cursor: default; }
.qtd span { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; }
.remover { color: var(--muted); font-size: 12px; text-decoration: underline; align-self: flex-start; }

.carrinho-vazio { text-align: center; padding: 60px 10px; color: var(--muted); }
.carrinho-vazio span { font-size: 44px; display: block; margin-bottom: 8px; }

/* ---------- Rodapé ---------- */
.rodape { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 14px; }
.rodape .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rodape__whats { color: var(--whats-dark); font-weight: 600; text-decoration: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--primary); color: var(--on-primary); padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .25s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.visivel { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .topo__inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; row-gap: 10px; }
  .busca { order: 3; flex-basis: 100%; max-width: none; }
  .btn-carrinho { margin-left: auto; }
  .hero { padding-top: 28px; padding-bottom: 18px; }
  .hero p { font-size: 15px; }
  .card__info { padding: 10px 12px 12px; }
  .card__nome { font-size: 14px; }
  .preco { font-size: 15px; }
  .btn-add { width: 34px; height: 34px; }
  .sem-foto { font-size: 48px; }
}
.rodape__creditos { font-size: 12px; color: var(--muted); }
