:root {
  --bg: #F7F4EE;
  --card: #FFFFFF;
  --ink: #1A1D1A;
  --mut: #8A8F88;
  --line: #E7E1D5;
  --acc: #2E7D51;
  --acc-soft: #E4F0E8;
  --lime: #8ED637;
  --danger: #C0392B;
  --r: 16px;
}
body.dark {
  --bg: #131514;
  --card: #1E211F;
  --ink: #E8EAE4;
  --mut: #9AA098;
  --line: #2C302C;
  --acc: #4CAF72;
  --acc-soft: #223528;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 15px;
  padding-bottom: 110px;
  min-height: 100vh;
}

/* header */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.toprow {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; gap: 10px;
}
.logo { height: 40px; width: 40px; border-radius: 12px; object-fit: cover; }
.langs { display: flex; gap: 6px; }
.lang {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer;
}
.lang.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.banner img { width: 100%; height: 170px; object-fit: cover; display: block; }

/* category chips */
.cats {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px;
  background: var(--bg);
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 999px; padding: 8px 14px;
  font-size: 14px; cursor: pointer; white-space: nowrap;
}
.cat.active { background: var(--acc); border-color: var(--acc); color: #fff; }
.cat .note { color: var(--mut); font-size: 11px; margin-left: 4px; }
.cat.active .note { color: rgba(255,255,255,.75); }

/* menu cards */
.menu { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
}
.card-img {
  width: 96px; height: 96px; flex: 0 0 96px; border-radius: 12px;
  object-fit: cover; background: var(--acc-soft);
}
.card-emoji {
  width: 96px; height: 96px; flex: 0 0 96px; border-radius: 12px;
  background: var(--acc-soft); display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-name { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.card-desc { color: var(--mut); font-size: 13px; line-height: 1.35; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.pill {
  background: var(--bg); border: 1px solid var(--line); color: var(--mut);
  border-radius: 8px; padding: 2px 7px; font-size: 11.5px; white-space: nowrap;
}
.card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.price { font-weight: 800; font-size: 17px; }
.price small { font-weight: 600; font-size: 12px; color: var(--mut); }

/* stepper */
.stepper { display: flex; align-items: center; gap: 8px; }
.step-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--acc-soft); color: var(--acc); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.step-btn.minus { display: none; }
.qty { min-width: 18px; text-align: center; font-weight: 700; font-size: 15px; }
.stepper.has .step-btn.minus { display: flex; }
.stepper.has .step-btn.plus { background: var(--acc); color: #fff; }

/* cart bar */
.cartbar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  background: var(--ink); color: var(--bg);
  border-radius: 18px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.cartbar-info { display: flex; align-items: center; gap: 10px; }
.cartbar-count {
  background: var(--lime); color: #141614; font-weight: 800;
  border-radius: 999px; min-width: 26px; height: 26px; padding: 0 7px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.cartbar-total { font-weight: 800; font-size: 16px; }
.cartbar-btn {
  background: var(--lime); color: #141614; border: none; border-radius: 12px;
  padding: 10px 18px; font-weight: 800; font-size: 14px; cursor: pointer;
}

/* sheet */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--bg); border-radius: 22px 22px 0 0;
  max-height: 84vh; display: flex; flex-direction: column;
  transform: translateY(105%); transition: transform .25s ease;
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
}
.sheet.open { transform: translateY(0); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px; font-weight: 800; font-size: 17px;
}
.sheet-close {
  border: none; background: var(--card); color: var(--mut);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px;
}
.sheet-body { overflow-y: auto; padding: 4px 18px calc(18px + env(safe-area-inset-bottom)); }

/* cart items */
.cart-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item .ci-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 52px; }
.cart-item .ci-emoji { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px; background: var(--acc-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.ci-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.ci-price { color: var(--mut); font-size: 12.5px; margin-top: 2px; }
.ci-del { border: none; background: none; color: var(--mut); cursor: pointer; font-size: 15px; padding: 6px; }

/* checkout form */
.sheet-section { font-weight: 800; font-size: 14px; margin: 16px 0 8px; color: var(--acc); }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12.5px; color: var(--mut); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 15px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  outline: none; font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--acc); }
.promo-row { display: flex; gap: 8px; }
.promo-row input { flex: 1; }
.promo-row button {
  border: none; border-radius: 12px; padding: 0 16px; cursor: pointer;
  background: var(--acc); color: #fff; font-weight: 700; font-size: 14px;
}
.promo-ok { color: var(--acc); font-weight: 700; font-size: 13px; margin-top: 6px; }
.promo-err { color: var(--danger); font-weight: 600; font-size: 13px; margin-top: 6px; }
.promo-ok button { border: none; background: none; color: var(--danger); font-size: 13px; cursor: pointer; padding: 0 4px; }

.totals { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.totals-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--mut); padding: 3px 0; }
.totals-row.disc { color: var(--acc); font-weight: 700; }
.totals-row.grand { color: var(--ink); font-weight: 800; font-size: 17px; padding-top: 6px; }
.paynote { font-size: 12.5px; color: var(--mut); margin-top: 10px; }

.btn-big {
  width: 100%; border: none; border-radius: 14px; padding: 15px;
  background: var(--acc); color: #fff; font-size: 16px; font-weight: 800;
  cursor: pointer; margin-top: 14px;
}
.btn-big:disabled { background: var(--line); color: var(--mut); cursor: default; }
.btn-back {
  border: none; background: none; color: var(--mut); cursor: pointer;
  font-size: 14px; padding: 8px 0; margin-top: 10px;
}

.empty { text-align: center; color: var(--mut); padding: 40px 0; font-size: 15px; }

.hidden { display: none !important; }
