:root {
  --green: #1f5e3b;
  --green-dark: #154329;
  --green-soft: #e6efe8;
  --amber: #f2b134;
  --amber-soft: #fdf3dc;
  --red: #b83a2e;
  --red-soft: #fbe9e6;
  --ink: #1d2a22;
  --muted: #5e6b63;
  --line: #dfe3da;
  --bg: #f6f5f0;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 4px 14px rgba(20, 40, 25, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* header */
.top { background: var(--green); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: #fff; line-height: 1.1; }
.brand b { font-size: 1.35rem; letter-spacing: -.01em; }
.brand span { font-size: .78rem; opacity: .85; }
.top nav { margin-left: auto; display: flex; gap: 6px; }
.top nav a { white-space: nowrap; color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .92rem; font-weight: 600; }
.top nav a.active, .top nav a:hover { background: rgba(255,255,255,.16); }

.banner { max-width: 1100px; margin: 12px auto 0; padding: 0 16px; }
.banner div { padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: .95rem; }
.banner .closed { background: var(--amber-soft); border: 1px solid #f0d79b; color: #6b4b06; }
.banner .warn { background: var(--red-soft); border: 1px solid #f2c4bd; color: var(--red); }

main { max-width: 1100px; margin: 0 auto; padding: 14px 16px 120px; }

/* catalog */
.search { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 1rem; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px; font-size: .92rem; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.dept-title { margin: 22px 0 10px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.badge21 { font-size: .72rem; background: var(--ink); color: #fff; padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.prod { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.prod .pic { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); }
.prod .pic img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; font-weight: 800; font-size: 1.05rem; line-height: 1.15; color: var(--green-dark); background: repeating-linear-gradient(135deg, var(--green-soft), var(--green-soft) 10px, #edf3ee 10px, #edf3ee 20px); }
.prod .body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prod .name { font-size: .92rem; font-weight: 600; line-height: 1.25; }
.prod .price { font-weight: 800; }
.prod .low { font-size: .76rem; color: #8a5a00; font-weight: 600; }
.prod .row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.prod.out { opacity: .72; }
.prod.out .pic { filter: grayscale(1); }
.oos { font-size: .78rem; color: var(--red); font-weight: 600; line-height: 1.3; }

.btn { border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; background: var(--green); color: #fff; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.full { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.danger { background: var(--red); }
.btn.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.add { padding: 8px 14px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--green); border-radius: 10px; overflow: hidden; }
.stepper button { border: 0; background: #fff; color: var(--green); width: 34px; height: 34px; font-size: 1.2rem; font-weight: 800; }
.stepper span { min-width: 28px; text-align: center; font-weight: 800; }

/* cart bar */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 15; }
.cartbar a { max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; background: var(--green); color: #fff; text-decoration: none; padding: 15px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 6px 20px rgba(21, 67, 41, .35); }

/* panels */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; max-width: 640px; margin: 0 auto 14px; }
.panel h2 { margin: 0 0 12px; font-size: 1.25rem; }
.line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .n { flex: 1; font-weight: 600; }
.line .p { font-weight: 700; min-width: 64px; text-align: right; }
.totals { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 800; padding-top: 12px; }
.note { background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 12px 0; }
.idnote { background: #1d2a22; color: #fff; border-radius: 10px; padding: 12px; font-size: .92rem; margin: 12px 0; }
.idnote label { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; font-weight: 600; }
.idnote input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
label.f { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 6px; }
input.t { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 1.05rem; background: #fff; }
input.code { letter-spacing: .4em; font-size: 1.5rem; text-align: center; font-weight: 800; }
.err { color: var(--red); font-weight: 600; font-size: .92rem; margin-top: 10px; }
.ok { color: var(--green); font-weight: 600; }

/* order status */
.code-big { font-size: 2.4rem; font-weight: 900; letter-spacing: .06em; text-align: center; margin: 4px 0; }
.status-steps { display: flex; gap: 6px; margin: 16px 0; }
.status-steps div { flex: 1; text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); }
.status-steps div::before { content: ""; display: block; height: 6px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.status-steps div.on { color: var(--green); }
.status-steps div.on::before { background: var(--green); }
.ready-flag { background: var(--green); color: #fff; padding: 14px; border-radius: 12px; text-align: center; font-weight: 800; font-size: 1.15rem; }
.cancel-flag { background: var(--red-soft); color: var(--red); padding: 12px; border-radius: 12px; text-align: center; font-weight: 700; }
.eta { text-align: center; font-size: 1.05rem; }
.eta b { font-size: 1.3rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.actions .btn { flex: 1; }

footer { max-width: 1100px; margin: 30px auto 0; padding: 0 16px 30px; font-size: .82rem; color: var(--muted); }
footer table { border-collapse: collapse; }
footer td { padding: 2px 12px 2px 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

@media (max-width: 420px) { .brand span { display: none; } .top nav a { padding: 8px 10px; } }
