:root {
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --bg: #f6f8f8;
  --card: #ffffff;
  --ink: #172026;
  --muted: #5f6d74;
  --line: #e1e7ea;
  --ok: #1f8a4c;
  --danger: #c92a2a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 26, 29, .06), 0 4px 16px rgba(31, 26, 29, .06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { line-height: 1.5; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  background: var(--brand); color: var(--brand-ink); transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(.95); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.soft { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.btn.wa { background: #1fa855; color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, white); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
label.field > small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], textarea, select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 50%, white); border-color: var(--brand); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: #d9d0d4; position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 0 0 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #1d2529; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- modal / gaveta ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 14, 17, .45); }
.modal[hidden] { display: none; }
.modal .sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow: auto;
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .2s ease-out;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.x { border: 0; background: #ecf1f2; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--ink); }
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal .sheet { border-radius: 20px; padding: 24px; }
}
@keyframes up { from { transform: translateY(30px); opacity: .5; } }

/* ---------- foto (upload) ---------- */
.photo-pick {
  display: grid; place-items: center; aspect-ratio: 1; width: 100%; max-width: 220px; margin: 0 auto 16px;
  border: 2px dashed var(--line); border-radius: var(--radius); background: #f7f9fa center/cover no-repeat;
  cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; position: relative; overflow: hidden;
}
.photo-pick.has { border-style: solid; }
.photo-pick.has .hint { background: rgba(0,0,0,.55); color: #fff; position: absolute; bottom: 0; left: 0; right: 0; padding: 6px; }
.photo-pick input { display: none; }

/* ---------- grade de produtos (vitrine) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.item { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.item .ph { aspect-ratio: 1; background: #eef2f3 center/cover no-repeat; cursor: pointer; border: 0; padding: 0; width: 100%; }
.item .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item .name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.item .code { font-size: 12px; color: var(--muted); }
.item .price { font-weight: 800; font-size: 17px; color: var(--brand); margin-top: auto; padding-top: 4px; }
.item .btn { margin-top: 8px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 99px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- compartilhar em redes ---------- */
.share { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
@media (min-width: 640px) { .share { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); } }
.share a, .share button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; text-align: center;
}
.share .ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .1s; }
.share .ic svg { width: 26px; height: 26px; }
.share a:active .ic, .share button:active .ic { transform: scale(.92); }

/* ---------- botão "Entrar com Google" ---------- */
.btn.google { background: #fff; color: #1f1a1d; border: 1px solid #dadce0; gap: 10px; }
.btn.google svg { width: 20px; height: 20px; flex: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- escolha da cor da loja (com nome) ---------- */
.swatches.named { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px 6px; }
.swatches.named button { width: auto; height: auto; border: 0; box-shadow: none; background: none; border-radius: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; }
.swatches.named button i { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatches.named button.on { box-shadow: none; }
.swatches.named button.on i { box-shadow: 0 0 0 2px var(--ink); }
.swatches.named button.on span { color: var(--ink); font-weight: 700; }

/* link discreto em forma de botão ("Esqueci minha senha") */
.link-btn { display: block; margin: 10px auto 0; background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 14px; color: var(--brand); text-decoration: underline; cursor: pointer; }
.form-note { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }
