/* Палитра «Лимонад» (№12) */
:root {
  --bg: #fdfff0;
  --fg: #1f2a10;
  --head: #2b4410;
  --card: #ffffff;
  --soft: #e7f78a;
  --muted: #6c7650;
  --line: #edf2c9;
  --accent: #2e9d2a;
  --accent-dark: #237a20;
  --on: #ffffff;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 var(--font);
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.app {
  max-width: 640px; margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}

/* header */
.head {
  position: sticky; top: 0; z-index: 3; background: var(--bg);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 12px;
}
.logo { width: 52px; height: 52px; flex: none; border-radius: 50%; }
.brand { flex: 1; min-width: 0; }
.name { font-size: 26px; font-weight: 700; color: var(--head); line-height: 1.1; letter-spacing: -.01em; }
.tag { font-size: 14px; color: var(--muted); }
.call {
  flex: none; text-decoration: none; color: var(--accent); font-weight: 600; font-size: 14px;
  border: 1.5px solid var(--accent); border-radius: 999px; padding: 7px 14px;
}

/* banner + steps */
.banner { background: var(--soft); border-radius: 22px; padding: 16px 18px; display: grid; gap: 2px; color: var(--head); }
.banner b { font-size: 20px; font-weight: 700; }
.banner span { font-size: 14px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 16px; }
.how div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: grid; gap: 6px; align-content: start; font-size: 13px; line-height: 1.3; }
.how i { font-style: normal; width: 24px; height: 24px; border-radius: 999px; background: var(--accent); color: var(--on); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
@media (max-width: 380px) { .how { grid-template-columns: 1fr; } .how div { grid-template-columns: 24px 1fr; align-items: center; } }

/* search + cats */
.search input {
  width: 100%; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 12px 14px; outline: none;
}
.search input:focus { border-color: var(--accent); }
.catbar {
  position: sticky; top: calc(66px + env(safe-area-inset-top, 0px)); z-index: 2; background: var(--bg);
}
.cats {
  display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none;
  margin-top: 8px; border-bottom: 1px solid var(--line);
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; border: 0; background: none; color: var(--muted); font-weight: 500; font-size: 15px;
  padding: 10px 0 10px; cursor: pointer; border-bottom: 2.5px solid transparent;
}
.cat.on { color: var(--fg); border-bottom-color: var(--accent); }
.subs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.subs[hidden] { display: none; }
.subs::-webkit-scrollbar { display: none; }
.sub {
  flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--fg);
  font: 500 14px/1 var(--font); padding: 8px 13px; border-radius: 999px; cursor: pointer;
}
.sub.on { background: var(--soft); border-color: var(--accent); color: var(--head); }

/* list */
.list { display: grid; }
.item {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.pic {
  width: 92px; height: 92px; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 50px; cursor: pointer; overflow: hidden;
}
.pic img, .big img { width: 100%; height: 100%; object-fit: cover; }
.info { cursor: pointer; min-width: 0; }
.iname { font-size: 15px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; }
.iprice { font-size: 18px; font-weight: 700; color: var(--fg); margin-top: 4px; }
.add {
  border: 1.5px solid var(--accent); background: none; color: var(--accent); font-weight: 600; font-size: 14px;
  border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
}
.qty { display: flex; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty button {
  width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on);
  font-size: 18px; font-weight: 600; cursor: pointer; line-height: 1;
}
.empty { padding: 30px 0; color: var(--muted); text-align: center; }
.nothave { margin: 16px 0; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px dashed var(--accent); font-size: 14px; }
.foot { padding: 8px 0 24px; font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }

/* bottom bar */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.cta {
  display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 604px; margin: 0 auto;
  border: 0; border-radius: 999px; padding: 15px 22px; background: var(--accent); color: var(--on);
  font-weight: 600; font-size: 16px; cursor: pointer;
}
.cta:active, .send:active { background: var(--accent-dark); }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(20, 30, 10, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.card {
  background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 12px; animation: up .25s ease;
}
.grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line); justify-self: center; }
.big { aspect-ratio: 1; width: 100%; max-width: 420px; justify-self: center; border-radius: 24px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; font-size: 150px; overflow: hidden; }
.card h3 { margin: 0; font-size: 22px; font-weight: 600; color: var(--head); line-height: 1.25; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.close { border: 0; background: none; color: var(--muted); font-weight: 500; cursor: pointer; padding: 8px 0; }
.muted { color: var(--muted); font-size: 14px; }

/* cart */
.citem { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.citem .e { width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; font-size: 24px; overflow: hidden; }
.citem .e img { width: 100%; height: 100%; object-fit: cover; }
.citem .t { font-size: 14px; line-height: 1.3; }
.citem .t small { display: block; color: var(--muted); font-size: 12.5px; }
label.f { display: grid; gap: 5px; font-size: 14px; font-weight: 500; }
.f input, .f textarea { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 12px; outline: none; font-weight: 400; }
.f input:focus, .f textarea:focus { border-color: var(--accent); }
.f textarea { min-height: 70px; resize: vertical; }
.geo-btn { border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); border-radius: 12px; padding: 12px; font-weight: 600; font-size: 15px; cursor: pointer; }
.geo-btn:disabled { opacity: .6; cursor: default; }
.geo { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; padding: 11px 12px; background: var(--soft); color: var(--head); font-size: 14px; font-weight: 500; }
.geo-x { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; flex: none; }
.geo-msg { font-size: 13px; color: var(--muted); }
.when-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.when-row select, .when-row input { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 12px; font-weight: 400; min-width: 0; }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zone { position: relative; }
.zone input { position: absolute; opacity: 0; }
.zone span { display: grid; gap: 1px; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; cursor: pointer; font-size: 14px; }
.zone span b { font-size: 16px; }
.zone input:checked + span { border-color: var(--accent); background: var(--soft); }
.zone input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.total { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.total .r { display: flex; justify-content: space-between; }
.total .r.sum { font-weight: 600; font-size: 16px; }
.send { border: 0; border-radius: 999px; padding: 15px; font-weight: 600; font-size: 16px; cursor: pointer; color: #fff; }
.send.wa { background: var(--accent); }
.send.mx { background: #4b45d6; }
.send[disabled] { opacity: .45; cursor: default; }
.clear { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; justify-self: center; font-size: 14px; }
.err { color: #b3261e; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; background: var(--head); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); text-align: center; }

button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); } }
@media (prefers-reduced-motion: reduce) { .sheet, .card { animation: none; } }
div.f { display: grid; gap: 5px; }
.flabel { font-size: 14px; font-weight: 500; }
.when-note { font-size: 13px; margin-top: 6px; }
.when-row select { appearance: auto; }

.shop { display:inline-block; margin-left:5px; font-size:11px; line-height:15px; min-width:15px; text-align:center; border-radius:4px; background:#edf2c9; color:#6c7650; font-weight:600; vertical-align:2px; }
.more-sentinel { height: 1px; }

/* режим правки (правка.html) */
.pic { position: relative; }
.num { position: absolute; left: 4px; top: 4px; background: var(--head); color: #fff; font: 600 11px/1 var(--font); padding: 3px 5px; border-radius: 6px; }
.adm { display: grid; gap: 6px; }
.adm-b { border: 1.5px solid var(--line); background: var(--card); color: var(--fg); font: 500 13px/1 var(--font); padding: 8px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.adm-b.del.on { background: #fde2df; border-color: #d9493b; color: #a8261a; }
.adm-b.redraw.on { background: #e3ecff; border-color: #3b6fd9; color: #1d47a0; }
.item.marked-del { background: #fff4f2; }
.item.marked-redraw { background: #f3f6ff; }
.adm-bar { display: flex; align-items: center; gap: 8px; }
.adm-f { border: 1.5px solid var(--line); background: var(--card); font: 500 14px/1 var(--font); padding: 12px; border-radius: 14px; cursor: pointer; white-space: nowrap; }
.adm-f.on { background: var(--soft); border-color: var(--accent); }
.adm-c { font-size: 13px; color: var(--muted); white-space: nowrap; }
.adm-copy { flex: 1; justify-content: center; white-space: nowrap; }

.fgrid { display: grid; gap: 8px; }
.fgrid.g2 { grid-template-columns: 1fr 1fr; }
.fgrid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.fgrid input { min-width: 0; width: 100%; box-sizing: border-box; }
label.f small { color: var(--muted); font-weight: 400; }
.geo-help { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.geo-help ol { margin: 6px 0 4px; padding-left: 20px; }
.geo-help .muted { font-size: 12.5px; }

/* ---- подсказки при первом входе (tour.js) ---- */
.tour-back { position: fixed; inset: 0; z-index: 100; background: rgba(20, 30, 10, .55); display: grid; place-items: center; padding: 16px; }
.tour-card { background: var(--card); border-radius: 20px; padding: 22px 20px 16px; max-width: 380px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.tour-card h3 { margin: 0 0 6px; font-size: 22px; color: var(--head); }
.tour-card p { margin: 0 0 12px; }
.tour-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.tour-steps li { display: flex; gap: 10px; align-items: center; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.tour-steps i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.tour-go { display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; background: var(--accent); color: #fff; font: 600 16px var(--font); cursor: pointer; }
.tour-skip { display: block; width: 100%; border: 0; background: none; color: var(--muted); padding: 10px; font: 15px var(--font); cursor: pointer; }
.tour-hole { position: fixed; z-index: 100; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(20, 30, 10, .6); pointer-events: none; transition: all .2s; }
.tour-hole.two { box-shadow: 0 0 0 3px var(--soft); z-index: 101; }
.tour-tip { position: fixed; z-index: 102; background: var(--card); border-radius: 16px; padding: 14px 14px 10px; box-shadow: 0 12px 40px rgba(0,0,0,.3); font-size: 15px; line-height: 1.4; }
.tour-tip::before { content: ""; position: absolute; left: calc(var(--ax) - 10px); top: -10px; border: 10px solid transparent; border-top: 0; border-bottom-color: var(--card); }
.tour-tip.up::before { top: auto; bottom: -10px; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--card); }
.tour-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.tour-n { color: var(--muted); font-size: 13px; margin-right: auto; }
.tour-go.sm, .tour-skip.sm { width: auto; display: inline-block; padding: 9px 16px; font-size: 14px; }
.tour-again { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }
