/* Juninho Variedades. Paleta: papel quente, marrom de tinta e acento vermelho-tijolo. */
:root {
  --bg: #FBF6EE;
  --surface: #FFFFFF;
  --ink: #2A1D14;
  --muted: #7A6A5C;
  --line: #EADFCF;
  --tint: #F3E9D8;
  --accent: #A8402A;
  --accent-ink: #FFF8F0;
  --gold: #E3A93B;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B130E; --surface: #261B14; --ink: #F6EEE3; --muted: #B3A191;
    --line: #3A2C22; --tint: #2F221A; --accent: #E0765C; --accent-ink: #1B130E;
    --gold: #E9B65A; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.45;
  padding: 0 16px 110px;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Cabeçalho */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px;
  padding: 14px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; max-width: 1120px; margin: 0 auto; }
.brand > div { min-width: 0; flex: 1; }
.brand h1 { font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 700; }
.brand p { font-size: 13px; color: var(--muted); }
.mono {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 15px;
}

main { max-width: 1120px; margin: 0 auto; padding-top: 22px; }
.lead { color: var(--muted); max-width: 62ch; font-size: 15px; }
.tools { display: grid; gap: 14px; margin-top: 18px; }
.search input {
  width: 100%; padding: 13px 16px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 14px; color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { margin-top: 18px; font-size: 13px; color: var(--muted); }
.ghead { font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 700; margin: 30px 0 12px; }

/* Grade de produtos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.media {
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: var(--tint); overflow: hidden;
}
.media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; background: var(--surface); }
.media.ph { color: var(--accent); font-family: "Fraunces", Georgia, serif; font-size: 44px; font-weight: 600; opacity: 0.85; }
.body { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; min-width: 0; }
.cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.card h3 { font-size: 15px; font-weight: 600; text-wrap: balance; }
.row { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-family: "Fraunces", Georgia, serif; font-size: 19px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.price.soft { font-family: "DM Sans", system-ui, sans-serif; font-size: 13px; font-weight: 500; color: var(--muted); }
.empty { margin-top: 40px; text-align: center; color: var(--muted); }

/* Botões */
.btn {
  font-size: 14px; font-weight: 600; border-radius: 10px; padding: 10px 14px;
  cursor: pointer; text-decoration: none; text-align: center; border: 1px solid transparent;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { color: var(--accent); }
.btn.sm { padding: 7px 10px; font-size: 13px; }
.btn.wide { display: block; width: 100%; }
.btn.plus {
  flex: none; width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-size: 22px; line-height: 1;
  display: grid; place-items: center;
}
.btn:disabled { opacity: 0.5; cursor: default; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; background: var(--tint); color: var(--ink); border: 0; cursor: pointer; font-size: 18px; }
.stepper span { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .stepper button { width: 32px; height: 32px; font-size: 16px; }
.card .stepper span { min-width: 26px; }

/* Barra do carrinho */
.cartbar {
  position: fixed; z-index: 15; left: 16px; right: 16px; bottom: 14px;
  max-width: 1088px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 18px; background: var(--ink); color: var(--bg);
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.cartbar > div { display: flex; flex-direction: column; min-width: 0; }
.cartbar span { font-size: 13px; opacity: 0.8; }
.cartbar strong { font-family: "Fraunces", Georgia, serif; font-size: 18px; font-variant-numeric: tabular-nums; }
.cartbar .btn.primary { background: var(--gold); color: var(--ink); }

/* Painéis (pedido e administração) */
.sheet {
  position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto;
  padding: 20px 16px 40px;
}
.sheet-inner { max-width: 620px; margin: 0 auto; display: grid; gap: 16px; }
.sheet-inner.wide { max-width: 800px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-head h2 { font-family: "Fraunces", Georgia, serif; font-size: 24px; font-weight: 700; }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lines li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lines .name { font-weight: 600; font-size: 15px; min-width: 0; }
.lines .unit { font-size: 13px; color: var(--muted); grid-column: 1; }
.lines .sub { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.lines .stepper { grid-column: 1; justify-self: start; margin-top: 6px; }
.sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sum strong { font-family: "Fraunces", Georgia, serif; font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.note, .hint { font-size: 13px; color: var(--muted); }
.order-actions { display: grid; gap: 10px; }
textarea.preview {
  width: 100%; min-height: 170px; padding: 12px; font-size: 13px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; resize: vertical;
}

.adm-title { font-family: "Fraunces", Georgia, serif; font-size: 18px; font-weight: 700; margin-top: 10px; }
.adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.adm-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.adm-row input, .adm-row select, .adm-add input, .adm-add select, .login input {
  font-size: 14px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0;
}
.adm-row .cn, .adm-row .pn { flex: 1 1 180px; }
.adm-row .pc { flex: 0 1 180px; }
.adm-row .pp { width: 110px; }
.adm-add { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-add input[type="text"], .adm-add input:not([type]) { flex: 1 1 200px; }
.adm-msg { font-size: 14px; color: var(--muted); min-height: 1.4em; }
.login { max-width: 360px; margin: 60px auto; display: grid; gap: 12px; }
.login input { padding: 12px 14px; }

@media (min-width: 700px) {
  body { padding-bottom: 96px; }
  .brand h1 { font-size: 24px; }
  .tools { grid-template-columns: minmax(0, 360px) 1fr; align-items: center; }
}
