/* Base compartilhada: cores vêm do config.js / painel */
:root {
  --primary: #e4202b;
  --bg: #141414;
  --surface: #1f1f1f;
  --surface-2: color-mix(in srgb, var(--surface) 82%, var(--text));
  --text: #f5f5f5;
  --muted: color-mix(in srgb, var(--text) 58%, var(--bg));
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --primary-soft: color-mix(in srgb, var(--primary) 16%, transparent);
  --ok: #22c55e;
  --warn: #f5a524;
  --danger: #ef4444;
  --radius: 14px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.price { font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  background: var(--surface-2); color: var(--text); transition: filter .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--bg); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.logo, .logo-initials {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--line); background: #fff;
}
.logo-initials {
  display: grid; place-items: center; background: var(--primary); color: #fff;
  font-weight: 700; font-size: 22px; letter-spacing: .5px;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--surface-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Janelas (modais) */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s;
}
.modal {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: up .2s ease-out;
}
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .modal { border-radius: 20px; }
}
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); flex: none; font-size: 18px;
}
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(30px); opacity: 0 } }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); opacity: 0;
  background: #111; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 100;
  font-size: 14px; pointer-events: none; transition: .2s; box-shadow: 0 8px 30px rgba(0,0,0,.4);
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

.qty { display: inline-flex; align-items: center; background: #fff; color: #111; border-radius: 99px; padding: 3px; }
.qty button { width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: #111; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }

.switch { position: relative; width: 44px; height: 24px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-2); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 42px; margin-bottom: 6px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
