/* =====================================================================================
   Victor Store — base visual (loja + painel)
   Estilo "Claro elegante": fundo gelo, topo preto com a logo, botões pretos.
   ===================================================================================== */

:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #eeece7;
  --surface-3: #e5e2db;
  --ink: #0c0c0d;
  --ink-2: #39393c;
  --muted: #74747a;
  --line: #e3e0d9;
  --line-2: #d2cec5;
  --black: #0a0a0a;
  --black-2: #171717;
  --on-black: #f5f4f1;
  --on-black-muted: #a3a29e;
  --ok: #157a3c;
  --ok-bg: #e5f3ea;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --danger: #b42318;
  --danger-bg: #fcebe9;
  --wa: #1c9e50;
  --wa-dark: #158442;
  --focus: #2f6fed;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-1: 0 1px 2px rgba(10, 10, 10, .05);
  --shadow-2: 0 2px 6px rgba(10, 10, 10, .05), 0 12px 32px rgba(10, 10, 10, .08);
  --shadow-3: 0 20px 60px rgba(10, 10, 10, .22);

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --gutter: 16px;
  --maxw: 1240px;
  --header-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 768px) {
  :root { --gutter: 28px; --header-h: 68px; }
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 56px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--bg); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.tnum { font-variant-numeric: tabular-nums; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ---------------------------------------------------------------- tipografia */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.display {
  font-stretch: 118%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .95;
}
.h2 { font-size: 20px; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; text-transform: uppercase; }
@media (min-width: 768px) { .h2 { font-size: 24px; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------------------------------------------------------------- ícones */
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 18px; height: 18px; }
.ico--xs { width: 13px; height: 13px; }
.ico--lg { width: 28px; height: 28px; }
.ico--fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- botões */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 22px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-size: 15px; font-weight: 600; letter-spacing: .01em; line-height: 1.1; text-align: center;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease), opacity .18s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn--block { display: flex; width: 100%; }
.btn--sm { --h: 40px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 56px; font-size: 16px; }

.btn--primary { background: var(--ink); color: #fff; }
@media (hover: hover) { .btn--primary:hover:not(:disabled) { background: #2a2a2c; } }
.btn--light { background: #fff; color: var(--ink); }
@media (hover: hover) { .btn--light:hover:not(:disabled) { background: #ecebe7; } }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--ink); }
@media (hover: hover) { .btn--outline:hover:not(:disabled) { background: var(--ink); color: #fff; } }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
@media (hover: hover) { .btn--ghost:hover:not(:disabled) { border-color: var(--ink); } }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
@media (hover: hover) { .btn--ghost-light:hover { border-color: #fff; } }
.btn--wa { background: var(--wa); color: #fff; }
@media (hover: hover) { .btn--wa:hover:not(:disabled) { background: var(--wa-dark); } }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(180, 35, 24, .35); }
@media (hover: hover) { .btn--danger:hover:not(:disabled) { background: var(--danger); color: #fff; } }
.btn--danger-solid { background: var(--danger); color: #fff; }

.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  color: inherit; position: relative; transition: background-color .15s;
}
@media (hover: hover) { .iconbtn:hover { background: rgba(127, 127, 127, .14); } }
.iconbtn:active { background: rgba(127, 127, 127, .2); }

.link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* spinner */
.spin {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.spin--lg { width: 28px; height: 28px; border-width: 2.5px; }
.spin--xs { width: 12px; height: 12px; border-width: 1.5px; display: inline-block; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- formulários */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.label .muted { font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 12px;
  font-size: 16px; /* 16px evita o zoom automático do iPhone */
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230c0c0d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(12, 12, 13, .08); }
.input::placeholder, .textarea::placeholder { color: #a3a19b; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .08); }
.hint { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 13px; color: var(--danger); font-weight: 500; }
.input-group { display: flex; align-items: stretch; }
.input-group__addon {
  display: grid; place-items: center; padding: 0 14px; min-width: 56px;
  background: var(--surface-2); border: 1.5px solid var(--line-2); border-right: 0;
  border-radius: 12px 0 0 12px; font-weight: 600; color: var(--ink-2); font-size: 15px;
}
.input-group .input { border-radius: 0 12px 12px 0; }

/* ---------------------------------------------------------------- chips (tamanhos, filtros, opções) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 48px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--surface);
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.chip:active { transform: scale(.97); }
@media (hover: hover) { .chip:hover { border-color: var(--ink); } }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.chip--sm { min-height: 36px; min-width: 40px; padding: 0 12px; font-size: 13.5px; }
.chip .x { width: 14px; height: 14px; }

/* cores (bolinhas) */
.swatch {
  --c: #ccc;
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
}
.swatch--multi { background: conic-gradient(#e94b3c, #f5b83d, #5cc16c, #3d8ff5, #8b5cf6, #e94b3c); }
.swatch--sm { width: 14px; height: 14px; }
.swatch--xs { width: 11px; height: 11px; }
.swatch-btn {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 56px; padding: 6px 4px; border-radius: 12px; font-size: 12px; font-weight: 500; color: var(--ink-2);
  touch-action: manipulation;
}
.swatch-btn .swatch { width: 36px; height: 36px; transition: box-shadow .15s; }
.swatch-btn[aria-pressed="true"] .swatch, .swatch-btn[aria-checked="true"] .swatch {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 2px var(--bg), 0 0 0 4px var(--ink);
}
.swatch-btn[aria-pressed="true"], .swatch-btn[aria-checked="true"] { color: var(--ink); font-weight: 700; }

/* ---------------------------------------------------------------- interruptor (Disponível) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  width: 46px; height: 28px; border-radius: 999px; background: #c9c5bd; position: relative; flex: none;
  transition: background-color .2s var(--ease);
}
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease);
}
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: .5; }

/* ---------------------------------------------------------------- selos */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--off { background: var(--surface-2); color: var(--muted); }
.badge--plain::before { display: none; }

/* ---------------------------------------------------------------- avisos */
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.45;
}
.notice .ico { margin-top: 1px; }
.notice--warn { background: var(--warn-bg); color: var(--warn); }
.notice--danger { background: var(--danger-bg); color: var(--danger); }
.notice--ok { background: var(--ok-bg); color: var(--ok); }

.boot, .a-boot { align-content: center; gap: 14px; text-align: center; }
.boot__msg { font-size: 14px; color: var(--muted); padding-inline: 24px; }

/* ---------------------------------------------------------------- vazio / erro */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 56px 12px; }
.empty__icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.empty__icon .ico { width: 32px; height: 32px; stroke-width: 1.4; }
.empty h2 { font-size: 19px; font-weight: 700; }
.empty p { color: var(--muted); max-width: 400px; font-size: 15px; }
.empty .btn { margin-top: 6px; }

/* ---------------------------------------------------------------- toast */
.toasts {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); z-index: 400;
  display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 14px;
  background: var(--black); color: #fff; box-shadow: var(--shadow-3); font-size: 14.5px; font-weight: 500;
  pointer-events: auto; animation: toast-in .28s var(--ease);
}
.toast--error { background: #4b1410; }
.toast__msg { flex: 1; min-width: 0; }
.toast__action { color: #fff; font-weight: 700; padding: 8px 10px; border-radius: 10px; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.toast.is-leaving { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- janelas (bottom sheet no celular) */
.overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(10, 10, 10, .48);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s var(--ease);
}
.overlay.is-leaving { animation: fade-out .18s var(--ease) forwards; }
.sheet {
  width: 100%; max-height: min(92dvh, 92vh); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-3);
  animation: sheet-in .3s var(--ease);
  padding-bottom: var(--safe-b);
}
.overlay.is-leaving .sheet { animation: sheet-out .2s var(--ease) forwards; }
.sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 8px 6px 20px; position: relative;
}
.sheet__head::before {
  content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2);
}
.sheet__title { font-size: 17px; font-weight: 700; padding-top: 12px; }
.sheet__body { padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet__foot { display: flex; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.sheet__foot .btn { flex: 1; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 22px; max-height: 86vh; animation-name: pop-in; }
  .overlay.is-leaving .sheet { animation-name: pop-out; }
  .sheet__head::before { display: none; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
body.is-locked { overflow: hidden; }

/* ---------------------------------------------------------------- carregamento */
.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, #f7f6f3 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -150% 0; } }
.sk-title { height: 30px; width: 72%; margin-top: 10px; }
.sk-text { height: 14px; width: 92%; margin-top: 14px; }
.sk-text--short { width: 55%; margin-top: 10px; }

/* foto com fundo da cor média enquanto carrega (carregamento progressivo) */
.ph { position: relative; overflow: hidden; background: var(--ph, var(--surface-2)); }
.ph > img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease); }
.ph > img.is-loaded { opacity: 1; }
.ph__empty { position: absolute; inset: 0; display: grid; place-items: center; color: #b3afa6; }
.ph__empty .ico { width: 34%; height: 34%; max-width: 64px; max-height: 64px; stroke-width: 1.2; }

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