/* =========================================================================
   base.css — identidade visual compartilhada (loja + painel)
   Cores tiradas da própria logo da Vertex: grafite, azul aço e cinza filamento.
   Tipografia: Archivo — larga e pesada nos títulos (como o "VERTEX" da logo),
   normal no texto corrido.
   ========================================================================= */
:root {
  --grafite: #20252C;
  --grafite-2: #343C46;
  --aco: #4F7190;
  --aco-forte: #3D5B77;
  --aco-claro: #DFE8F0;
  --nevoa: #EEF2F5;
  --nevoa-2: #E3E9EE;
  --linha: #D8DFE5;
  --filamento: #AEB0B4;
  --texto-2: #56616C;
  --branco: #FFFFFF;
  --zap: #17834A;
  --zap-forte: #116A3B;
  --perigo: #B42318;
  --ok: #17834A;
  --alerta: #9A6700;
  --alerta-claro: #FFF3D1;

  --r-s: 6px;
  --r: 10px;
  --r-l: 16px;
  --sombra-1: 0 1px 2px rgba(32, 37, 44, .06);
  --sombra-2: 0 18px 40px -18px rgba(32, 37, 44, .35);
  --fonte: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --noite: #111418;
  --noite-2: #1A1F25;
  --gelo: #F2F4F6;
  --aco-luz: #A9BED1;
  --topo-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--fonte); font-size: 16px; line-height: 1.55; color: var(--grafite); background: var(--branco); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -.015em; }
p { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
code { font-size: .9em; background: var(--nevoa); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--aco); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }
@media (max-width: 520px) { .wrap { width: calc(100% - 28px); } }

/* ---------- Marca ---------- */
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.marca { gap: 12px; }
.marca .marca-v { width: 34px; height: 34px; }
/* Bloco do nome: "VERTEX" em cima, linha fina, e o subtítulo esticado para ter
   exatamente a mesma largura do VERTEX (o ajuste fino é feito por V.ajustarMarcas) */
.marca-txt { display: inline-grid; justify-items: start; line-height: 1; }
.marca-txt b { display: block; font-size: 21px; font-weight: 800; font-stretch: 120%; letter-spacing: .02em; line-height: .78; padding-top: 1px; }
.marca-txt small { display: block; width: 100%; margin-top: 6px; padding-top: 5px; border-top: 1px solid currentColor; border-top-color: rgba(127, 140, 152, .35); font-size: 7.5px; font-weight: 500; letter-spacing: .2em; color: var(--texto-2); text-transform: uppercase; white-space: nowrap; }
.marca-txt small.so-nome { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; background: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn .ic { width: 18px; height: 18px; }
.btn-primario { background: var(--grafite); color: #fff; }
.btn-primario:hover { background: var(--grafite-2); }
.btn-sec { background: #fff; border-color: var(--linha); color: var(--grafite); }
.btn-sec:hover { border-color: var(--grafite); }
.btn-zap { background: var(--zap); color: #fff; }
.btn-zap:hover { background: var(--zap-forte); }
.btn-claro { background: #fff; color: var(--grafite); }
.btn-claro:hover { background: var(--aco-claro); }
.btn-perigo { background: var(--perigo); color: #fff; }
.btn-texto { min-height: 36px; padding: 0 6px; border: 0; color: var(--aco-forte); font-weight: 600; }
.btn-texto:hover { text-decoration: underline; }
.btn-p { min-height: 38px; padding: 0 13px; font-size: 14px; }
.btn-bloco { width: 100%; }
.btn[disabled], .btn[aria-disabled=true] { opacity: .45; pointer-events: none; }
.btn-icone { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); border: 1px solid transparent; background: none; color: inherit; flex: none; }
.btn-icone:hover { background: var(--nevoa); }
.btn-icone .ic { width: 22px; height: 22px; }

/* ---------- Campos ---------- */
.campo { display: grid; gap: 6px; }
.campo > span, .rotulo { font-size: 14px; font-weight: 600; }
.campo small, .ajuda { color: var(--texto-2); font-size: 13.5px; }
.inp {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--linha);
  border-radius: var(--r); background: #fff; font-size: 16px;
}
textarea.inp { min-height: 96px; resize: vertical; line-height: 1.45; }
.inp:focus { outline: none; border-color: var(--aco); box-shadow: 0 0 0 3px var(--aco-claro); }
.inp[aria-invalid=true] { border-color: var(--perigo); }
.inp:disabled { background: var(--nevoa); color: var(--texto-2); }
select.inp {
  appearance: none; padding-right: 38px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2320252C' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
}
.erro { color: var(--perigo); font-size: 13.5px; font-weight: 500; }
.busca { position: relative; display: block; }
.busca .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--texto-2); pointer-events: none; }
.busca .inp { padding-left: 40px; }

/* Interruptor (liga/desliga) */
.chave { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 15px; }
.chave input {
  appearance: none; -webkit-appearance: none; width: 42px; height: 24px; margin: 0; flex: none;
  border-radius: 999px; background: var(--linha); position: relative; cursor: pointer; transition: background-color .15s;
}
.chave input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.chave input:checked { background: var(--aco); }
.chave input:checked::after { transform: translateX(18px); }
.chave input:focus-visible { outline: 2px solid var(--aco); outline-offset: 2px; }
.chave > span { display: grid; gap: 1px; }
.chave small { color: var(--texto-2); font-size: 13px; }

/* Quantidade (– 1 +) */
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: var(--r); overflow: hidden; background: #fff; }
.qtd button { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; }
.qtd button:hover { background: var(--nevoa); }
.qtd .ic { width: 18px; height: 18px; }
.qtd input { width: 52px; height: 44px; border: 0; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; -moz-appearance: textfield; background: none; }
.qtd input::-webkit-inner-spin-button, .qtd input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qtd input:focus { outline: none; background: var(--aco-claro); }
.qtd-p button { width: 34px; height: 34px; }
.qtd-p input { width: 38px; height: 34px; font-size: 14px; }

/* ---------- Selos ---------- */
.selo { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff; border: 1px solid var(--linha); white-space: nowrap; }
.selo-nfc { background: var(--grafite); color: #fff; border-color: var(--grafite); }
.selo-destaque { background: var(--aco-claro); color: var(--aco-forte); border-color: transparent; }
.selo-off { background: var(--nevoa); color: var(--texto-2); border-color: transparent; }
.selo-alerta { background: var(--alerta-claro); color: var(--alerta); border-color: transparent; }

/* ---------- Foto de produto + espaço reservado ----------
   As listras horizontais imitam as linhas de camada de uma peça impressa. */
.foto { position: relative; aspect-ratio: 1; background: var(--nevoa); overflow: hidden; display: grid; place-items: center; color: #A3B2BF; }
.foto::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(79, 113, 144, .07) 5px 6px); }
.foto .ph { position: relative; width: 24%; height: auto; stroke-width: 1.2; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.foto img.ok { opacity: 1; }

/* ---------- Janelas (dialog) ---------- */
.dlg { border: 0; padding: 0; border-radius: var(--r-l); width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px); background: #fff; color: inherit; box-shadow: var(--sombra-2); overflow: auto; }
.dlg::backdrop { background: rgba(20, 25, 31, .55); }
.dlg[open] { animation: entra .18s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }
.dlg-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--linha); }
.dlg h2[tabindex]:focus { outline: none; }
.dlg-cab h2 { font-size: 20px; font-weight: 700; font-stretch: 108%; }
.dlg-corpo { padding: 22px; }
.dlg-rodape { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--linha); flex-wrap: wrap; background: #fff; }
.dlg-confirma .dlg-corpo { display: grid; gap: 10px; }
.dlg-confirma h2 { font-size: 20px; font-weight: 700; }
.dlg-confirma p { color: var(--texto-2); }
.dlg-confirma .dlg-rodape { border-top: 0; padding-top: 0; }

/* Painel lateral (orçamento e editor) */
.dlg-lateral { margin: 0 0 0 auto; max-width: 100%; width: min(480px, 100%); height: 100dvh; max-height: 100dvh; border-radius: 0; overflow: hidden; }
.dlg-lateral[open] { display: flex; flex-direction: column; animation: lado .22s ease-out; }
@keyframes lado { from { transform: translateX(28px); opacity: 0; } }
.dlg-lateral > form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dlg-lateral .dlg-corpo { flex: 1; overflow: auto; }

/* ---------- Avisos rápidos ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--grafite); color: #fff; padding: 12px 14px 12px 16px; border-radius: var(--r); box-shadow: var(--sombra-2); font-size: 15px; animation: entra .2s ease-out; }
.toast button { background: none; border: 0; color: #BFD3E6; font-weight: 700; padding: 4px 6px; white-space: nowrap; }
.toast button:hover { color: #fff; text-decoration: underline; }

/* Avisos sobem quando a barra "Publicar no site" está aparecendo */
.com-barra .toasts { bottom: 112px; }
@media (max-width: 900px) { .com-barra .toasts { bottom: 230px; } }
