/* Цвета вывески магазина «Мясной»: малиновый на белом */
:root {
  --bg: #f7f5f6; --card: #ffffff; --text: #1f1a1c; --muted: #75696e; --line: #ebe3e6;
  --accent: #d6004a; --accent-2: #b8003f; --accent-soft: #fde4ec; --ok: #2f7d4b; --warn: #a15c00; --warn-soft: #fff1dc;
  --head-bg: #ffffff; --head-text: #d6004a;
  --radius: 14px; --shadow: 0 2px 10px rgba(60, 10, 30, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161214; --card: #211b1e; --text: #f3edf0; --muted: #a8999f; --line: #362c31;
    --accent: #ff3d78; --accent-2: #ff6b98; --accent-soft: #3d1f2a; --ok: #5cc285; --warn: #f0b35a; --warn-soft: #3a2c17;
    --head-bg: #211b1e; --head-text: #ff3d78; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #161214; --card: #211b1e; --text: #f3edf0; --muted: #a8999f; --line: #362c31;
  --accent: #ff3d78; --accent-2: #ff6b98; --accent-soft: #3d1f2a; --ok: #5cc285; --warn: #f0b35a; --warn-soft: #3a2c17;
  --head-bg: #211b1e; --head-text: #ff3d78;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body.has-cartbar { padding-bottom: 90px; }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 19px; margin: 0 0 10px; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px 24px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--head-bg); color: var(--head-text); padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 3px solid var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--head-text); text-decoration: none; font-weight: 700; }
.brand img { width: 40px; height: 40px; }
.brand .word { font: italic 700 26px/1 Georgia, "Times New Roman", serif; letter-spacing: .01em; }
.brand small { display: block; font: 400 11px/1.2 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--muted); }
.call { font-size: 22px; text-decoration: none; }

.hero { padding: 14px 0 6px; }
.hero h1 { margin-bottom: 6px; }
.hero p { margin: 0 0 8px; color: var(--muted); }
.warn { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 10px; }
.my-orders { font-size: 15px; }
.flash { background: var(--accent-soft); padding: 10px 12px; border-radius: 10px; margin: 12px 0; }

.chips { position: sticky; top: 59px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 0;
  background: var(--bg); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 7px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 14px; white-space: nowrap; }
.group { scroll-margin-top: 110px; margin-top: 14px; }

.products { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line); }
.product { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); min-height: 64px; }
.product:last-child { border-bottom: 0; }
.info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.thumb { flex: none; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.product.out .info, .product.out .thumb { opacity: .45; }
.out-label { flex: none; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 10px; white-space: nowrap; }
.thumb.none { display: grid; place-items: center; font-size: 26px; opacity: .35; border: 1px solid var(--line); }
.info b { font-weight: 600; overflow-wrap: anywhere; }
.info span { color: var(--muted); font-size: 14px; }
.ctl { flex: none; }
.add { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 22px;
  cursor: pointer; }
.stepper { display: flex; align-items: center; border: 1px solid var(--accent); border-radius: 22px; overflow: hidden; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--accent-soft); color: var(--accent);
  font-size: 20px; cursor: pointer; }
.stepper span { min-width: 64px; text-align: center; font-weight: 600; font-size: 15px; }

/* ---- Каталог: поиск, полоса групп, карточки в две колонки ---- */
.shelf { position: sticky; top: 59px; z-index: 5; margin: 0 -16px; padding: 10px 16px 0; background: var(--card);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; padding: 11px 0;
  color: var(--text); outline: none; }
.search svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.tabs { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; padding: 12px 2px 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding-bottom: 10px; color: var(--muted); text-decoration: none; font-size: 16px; white-space: nowrap;
  border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.group { scroll-margin-top: 170px; margin-top: 22px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow); }
.pic { position: relative; aspect-ratio: 1 / 0.75; background: linear-gradient(135deg, #f6e3e1, #f1d6cf); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nopic { position: absolute; inset: 0; display: grid; place-items: center; font-size: 42px; opacity: .35; }
.tag { position: absolute; top: 8px; left: 8px; padding: 4px 9px; border-radius: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: #fff; background: rgba(214, 0, 74, .9); }
.tag.out { background: rgba(60, 50, 48, .75); }
.body { display: flex; flex-direction: column; flex: 1; padding: 10px 12px 12px; }
.body h3 { font-size: 15px; font-weight: 500; line-height: 1.3; margin: 2px 0 8px; overflow-wrap: anywhere; flex: 1; }
.price { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.price b { color: var(--text); font-size: 19px; font-weight: 800; }
.pack { margin: -6px 0 10px; color: var(--muted); font-size: 13px; }
.pcard .ctl { width: 100%; }
.pcard .add, .buy { width: 100%; height: 42px; border-radius: 10px; font-size: 24px; line-height: 1; }
.buy { border: 0; background: var(--line); color: var(--muted); font: inherit; font-size: 14px; }
.pcard .stepper { width: 100%; justify-content: space-between; border-radius: 10px; height: 42px; }
.pcard .stepper button { height: 42px; width: 44px; }
.pcard .stepper span { min-width: 0; white-space: nowrap; }
.pcard.out .pic, .pcard.out h3, .pcard.out .price { opacity: .5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pic { background: #2c2321; } }

/* ---- Фото товара крупно ---- */
.pic[data-zoom] { cursor: zoom-in; }
.zoom-hint { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 16px; pointer-events: none; }
body.noscroll { overflow: hidden; }
.viewer { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; border: 0;
  background: #000; color: #fff; display: none; flex-direction: column; }
.viewer[open] { display: flex; }
.viewer::backdrop { background: #000; }
.viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-size: 20px; cursor: pointer; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: 0 0; will-change: transform;
  cursor: zoom-in; -webkit-touch-callout: none; }
.viewer-info { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #111; }
.viewer-info > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.viewer-name { font-size: 17px; }
.viewer-price { color: #bbb; font-size: 14px; }
.viewer-ctl { flex: none; min-width: 140px; }
.viewer-ctl .add { width: 100%; height: 44px; border-radius: 10px; font-size: 24px; }
.viewer-ctl .stepper { background: #fff; }
.viewer-tip { margin: 0; padding: 0 16px max(12px, env(safe-area-inset-bottom)); background: #111; color: #888; font-size: 12px;
  text-align: center; }

/* ---- Установка приложения ---- */
.install-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.install-bar img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.install-bar div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-bar span { color: var(--muted); font-size: 13px; }
.install-bar .btn { padding: 9px 14px; font-size: 14px; flex: none; }
.install-bar .close { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 4px; cursor: pointer; }
.install-hero { text-align: center; padding: 22px 0 6px; }
.install-hero img { border-radius: 20px; box-shadow: var(--shadow); }
.install-hero h1 { margin: 12px 0 6px; }
.steps-ios { padding-left: 22px; margin: 0 0 10px; line-height: 1.8; }
.ios-share { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; }
.push-box { display: flex; align-items: center; gap: 10px; }
.push-box p { margin: 0; flex: 1; }

.cartbar { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20;
  max-width: 696px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-radius: 16px; background: var(--accent); color: #fff; text-decoration: none;
  box-shadow: 0 6px 20px rgba(214, 0, 74, .35); }
.cartbar .go { font-weight: 700; }

.about { margin: 20px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.about summary { font-weight: 600; cursor: pointer; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }

.back { display: inline-block; margin: 14px 0 4px; text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  margin: 12px 0; box-shadow: var(--shadow); }
.card .products { box-shadow: none; border: 0; }
.card .product { padding-left: 0; padding-right: 0; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.form label { display: block; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.form input, .form textarea { display: block; width: 100%; margin-top: 4px; padding: 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; }
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); }
.form .choice { margin: 0; }
.error { color: var(--accent); font-weight: 600; }
.btn { display: inline-block; padding: 12px 18px; border-radius: 12px; border: 0; background: var(--accent); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn.big { width: 100%; padding: 16px; font-size: 18px; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }

.steps { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { font-size: 12px; text-align: center; color: var(--muted); padding-top: 10px; border-top: 4px solid var(--line); }
.steps li.done { border-color: var(--ok); color: var(--text); }
.steps li.now { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.steps li.off { text-decoration: line-through; }
.status-text { font-size: 17px; margin: 8px 0 0; }
.lines { list-style: none; margin: 0 0 6px; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
