/* ConnectPrint3D — estilos do site
   Tema padrão (Personagens e Decorações): branco predominante, preto e cinzas.
   Tema airsoft (body.theme-airsoft): preto, branco e caqui. */

:root {
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --bg: #ffffff;
  --surface: #f2f2f2;
  --line: #dadada;
  --muted: #666666;
  --ink: #000000;
  --accent: #000000;       /* botões e destaques */
  --accent-ink: #ffffff;   /* texto sobre --accent */
  --titulo: #000000;       /* cor do título */
  --camada: #4d4d4d;       /* linha fina das "camadas" dentro do título (use a mesma cor de --titulo para letra 100% lisa) */
  --head-stretch: 125%;    /* títulos largos */
  --radius: 10px;
  color-scheme: light;
}
body.theme-airsoft {
  --bg: #000000;
  --surface: #151515;
  --line: #2e2e2e;
  --muted: #a3a3a3;
  --ink: #ffffff;
  --accent: #b9a57e;       /* caqui / tan */
  --accent-ink: #000000;
  --titulo: #b9a57e;
  --camada: #8c7b58;
  --head-stretch: 75%;     /* títulos condensados, mais "táticos" */
  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-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  padding: 11px 20px; border-radius: 999px; font-weight: 650; cursor: pointer;
  text-decoration: none; font-size: .95rem; line-height: 1.2;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Logo flutuante + menu ---------- */
.fm-logo {
  position: fixed; z-index: 60;
  top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px;
  width: 58px; height: 58px; padding: 0; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); overflow: visible;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
.fm-logo img { width: 100%; height: 100%; border-radius: 15px; }
.fm-logo:hover { transform: scale(1.04); }
body.theme-airsoft .fm-logo { border-color: var(--accent); }
.fm-badge {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: .75rem; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.fm-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.fm-panel {
  position: fixed; z-index: 50; inset: 0 0 auto 0;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 22px 92px;
  transform: translateY(-105%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  max-height: 100dvh; overflow-y: auto;
}
.fm.open .fm-panel { transform: none; }
.fm.open .fm-backdrop { opacity: 1; pointer-events: auto; }
.fm-inner { max-width: 1100px; display: grid; gap: 18px; }
.fm-secoes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fm-tile {
  display: grid; gap: 4px; padding: 18px 20px; border-radius: 14px; text-decoration: none;
  border: 1px solid #000; min-height: 104px; align-content: end;
}
.fm-tile span { font-weight: 900; font-size: 1.25rem; line-height: 1.05; }
.fm-tile small { font-size: .85rem; opacity: .7; }
.fm-tile-decor { background: #fff; color: #000; }
.fm-tile-decor span { font-stretch: 125%; }
.fm-tile-airsoft { background: #000; color: #fff; border-color: #b9a57e; }
.fm-tile-airsoft span { font-stretch: 75%; text-transform: uppercase; color: #b9a57e; font-size: 1.5rem; }
.fm-tile[aria-current="page"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.fm-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; text-decoration: none; cursor: pointer; font-size: .95rem;
}
.fm-link:hover { border-color: var(--ink); }
.fm-n { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; font-size: .8rem; font-weight: 800; }
@media (max-width: 640px) {
  .fm-panel { padding-left: 16px; padding-top: calc(86px + env(safe-area-inset-top, 0px)); }
  .fm-secoes { grid-template-columns: 1fr; }
  .fm-tile { min-height: 84px; }
}

/* ---------- Aviso modo demonstração ---------- */
.demo-aviso { background: var(--surface); color: var(--muted); font-size: .85rem; text-align: center; padding: 8px 16px 8px 84px; }

/* ---------- Topo + destaques ---------- */
.hero { padding: calc(100px + env(safe-area-inset-top, 0px)) 0 20px; }
.hero h1 {
  margin: 0; font-weight: 900; font-stretch: var(--head-stretch);
  font-size: clamp(2.7rem, 9vw, 7.2rem); line-height: .92; letter-spacing: -.02em;
  color: var(--titulo);
  /* Letra cheia; a cada 7px passa uma linha de 1px num tom próximo, lembrando as camadas da impressão. */
  background: repeating-linear-gradient(to bottom, var(--titulo) 0 6px, var(--camada) 6px 7px);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  max-width: 13ch;
}
body.theme-airsoft .hero h1 { text-transform: uppercase; letter-spacing: 0; max-width: none; }
.hero .lead { margin: 18px 0 0; max-width: 54ch; color: var(--muted); font-size: 1.1rem; }

.temporada {
  margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline;
  border: 1px solid var(--ink); border-radius: var(--radius); padding: 14px 18px;
}
.temporada strong { font-weight: 800; font-size: 1.1rem; }
.temporada span { color: var(--muted); }

.destaques-head { display: flex; justify-content: space-between; align-items: end; margin: 40px 0 14px; gap: 12px; }
.destaques-head h2 { margin: 0; font-weight: 800; font-stretch: var(--head-stretch); font-size: 1.4rem; }
.destaques-nav { display: flex; gap: 6px; }
.destaques {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 330px); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin;
}
.destaques .card { scroll-snap-align: start; }
.destaques .card .img { aspect-ratio: 4 / 5; }

/* ---------- Catálogo ---------- */
.catalogo { padding: 40px 0 72px; }
.catalogo > .wrap > h2 { margin: 0 0 4px; font-weight: 800; font-stretch: var(--head-stretch); font-size: 1.4rem; }
.filtros-bar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px; border-bottom: 1px solid var(--line);
}
.filtros { display: flex; gap: 10px; align-items: center; padding-left: 72px; }
#chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
#chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font-size: .92rem; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.busca { flex: 0 0 220px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 16px; }
@media (max-width: 720px) {
  .filtros { flex-direction: column; align-items: stretch; }
  .busca { flex: none; width: 100%; }
}

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 30px 20px; padding-top: 24px; }
.vazio { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 56px 0; }

/* ---------- Card de produto ---------- */
.card { display: flex; flex-direction: column; gap: 10px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.card .img { aspect-ratio: 1 / 1; background: var(--surface); border-radius: var(--radius); overflow: hidden; position: relative; }
.card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .img img { transform: scale(1.03); }
.ph { width: 100%; height: 100%; display: grid; place-items: center;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 6px); }
.ph span { font-weight: 900; font-stretch: var(--head-stretch); font-size: 3.4rem; color: var(--muted); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--accent-ink);
  font-size: .8rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.card h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: .85rem; }
.preco { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.preco .agora { font-weight: 800; font-size: 1.1rem; }
.preco .antes { color: var(--muted); text-decoration: line-through; font-size: .9rem; }

/* ---------- Diálogos ---------- */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog.produto { border-radius: 16px; width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
.produto-grid { display: grid; grid-template-columns: 1fr 1fr; }
.produto-grid .img { background: var(--surface); aspect-ratio: 1 / 1; }
.produto-grid .img img { width: 100%; height: 100%; object-fit: cover; }
.produto-body { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.produto-body h2 { margin: 0; font-weight: 800; font-stretch: var(--head-stretch); font-size: 1.6rem; line-height: 1.1; }
.produto-body .desc { color: var(--muted); white-space: pre-line; margin: 0; }
.fechar { position: absolute; top: 12px; right: 12px; z-index: 2; }
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qtd button { border: 0; background: none; width: 36px; height: 36px; cursor: pointer; font-size: 1.1rem; }
.qtd input { width: 40px; text-align: center; border: 0; background: none; -moz-appearance: textfield; }
.qtd input::-webkit-outer-spin-button, .qtd input::-webkit-inner-spin-button { -webkit-appearance: none; }
.acoes-compra { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: auto; }
@media (max-width: 640px) { .produto-grid { grid-template-columns: 1fr; } .produto-grid .img { aspect-ratio: 4 / 3; } }

dialog.gaveta {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw);
  border-left: 1px solid var(--line);
}
.gaveta-in { display: flex; flex-direction: column; height: 100%; padding: calc(20px + env(safe-area-inset-top, 0px)) 22px calc(20px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
.gaveta-head { display: flex; justify-content: space-between; align-items: center; }
.gaveta-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.itens { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 14px; }
.item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.item .thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface); }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .nome { font-size: .95rem; font-weight: 600; line-height: 1.25; }
.item .sub { font-size: .85rem; color: var(--muted); }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 800; border-top: 1px solid var(--line); padding-top: 14px; }
.nota { color: var(--muted); font-size: .85rem; margin: 0; }

/* ---------- Rodapé ---------- */
footer.rodape { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer.rodape .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; padding-top: 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-size: .92rem;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; }

/* ---------- Páginas simples (conta, obrigado) ---------- */
.pagina { padding: calc(110px + env(safe-area-inset-top, 0px)) 0 72px; }
.pagina h1 { margin: 0 0 8px; font-weight: 900; font-stretch: 125%; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1; }
.caixa { max-width: 440px; border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: grid; gap: 14px; margin-top: 24px; }
.campo { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
.campo input { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 11px 12px; color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: .9rem; justify-self: start; }
.erro { color: #b00020; font-size: .9rem; margin: 0; }
body.theme-airsoft .erro { color: #ff6b6b; }
.ok { font-size: .9rem; margin: 0; }
.pedido-cliente { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 6px; }
.pedido-cliente header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; }

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