/* Витрина. Три макета: night (тёмный, сетка карточек, корзина-шторка),
   market (светлый, меню слева, корзина всегда видна справа), bright (яркий, крупные карточки, плавающая корзина).
   Цвета и шрифты — только через переменные ниже. Свой акцентный цвет задаётся в админке (--accent). */

:root, [data-layout="night"] {
  --bg: #14110f; --surface: #1f1a16; --surface-2: #2a231e; --line: #3a3029;
  --fg: #f7f0e9; --muted: #b5a698; --accent: #ff6a13; --accent-fg: #ffffff; --accent-2: #ffb347;
  --ok: #4ade80; --warn: #fbbf24; --danger: #f87171;
  --radius: 22px; --radius-sm: 14px; --shadow: 0 18px 50px rgba(0,0,0,.45);
  --font-d: "Unbounded", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-b: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hdr: rgba(20,17,15,.92); --img-bg: transparent; --wrap: 1280px;
  color-scheme: dark;
}
[data-layout="market"] {
  --bg: #eef2ec; --surface: #ffffff; --surface-2: #e5ebe2; --line: #d3dccf;
  --fg: #17261c; --muted: #5b6b5f; --accent: #1d7a46; --accent-fg: #ffffff; --accent-2: #e2552d;
  --ok: #15803d; --warn: #b45309; --danger: #c2410c;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 10px 30px rgba(23,38,28,.14);
  --font-d: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-b: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hdr: rgba(255,255,255,.95); --img-bg: #f3f6f1; --wrap: 1360px;
  color-scheme: light;
}
[data-layout="bright"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #fff0e1; --line: #f1dcc8;
  --fg: #2b1409; --muted: #7d5c49; --accent: #e5383b; --accent-fg: #ffffff; --accent-2: #ffb703;
  --ok: #16a34a; --warn: #c2410c; --danger: #dc2626;
  --radius: 28px; --radius-sm: 18px; --shadow: 0 16px 40px rgba(124,45,18,.16);
  --font-d: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-b: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hdr: rgba(255,255,255,.94); --img-bg: #fff0e1; --wrap: 1240px;
  color-scheme: light;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.5 var(--font-b); -webkit-font-smoothing: antialiased; }
body.lock { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-d); line-height: 1.15; margin: 0; text-wrap: balance; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.price, .row, .ci-price, .kbju b { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-weight: 700; padding: 14px 22px; text-decoration: none; transition: transform .12s, filter .12s; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-primary.block { width: 100%; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 16px; font-weight: 600; }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Шапка ---------- */
.notice { background: var(--accent-2); color: #1a1a1a; font-weight: 600; font-size: 14px; padding: 8px 0; text-align: center; }
.hdr { position: sticky; top: 0; z-index: 30; background: var(--hdr); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.hdr-in { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.logo-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); font: 800 24px/1 var(--font-d); flex: none; }
.logo-img { height: 46px; width: auto; }
.logo-txt { display: flex; flex-direction: column; min-width: 0; }
.logo-txt b { font: 700 19px/1.1 var(--font-d); white-space: nowrap; }
.logo-txt small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.hdr-meta { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); min-width: 0; flex: 1; }
.hdr-meta > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-open { color: var(--fg); font-weight: 600; }
.hdr-addr svg { flex: none; }
.hdr-phone { display: flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-fg); padding: 12px 18px; font-weight: 700; position: relative; white-space: nowrap; }
.cart-count:empty { display: none; }
.cart-count { background: var(--accent-fg); color: var(--accent); border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; font-size: 12px; }
.cart-btn.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.12); } }

.act-order { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--accent); text-decoration: none; }
.act-order .go { margin-left: auto; color: var(--accent); font-weight: 700; }

/* ---------- Верх меню: hero и баннеры ---------- */
.top-area { display: grid; gap: 16px; padding-top: 20px; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 24px; padding: 32px; border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.hero h1 { font-size: clamp(28px, 4vw, 48px); }
.hero p { color: var(--muted); font-size: 17px; margin: 12px 0 0; max-width: 46ch; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; font-size: 13px; color: var(--muted); }
.hero-facts b { display: block; color: var(--fg); font: 700 20px/1.2 var(--font-d); }
.hero-art { position: relative; height: 220px; }
.hero-art img { position: absolute; width: 200px; height: 200px; }
.hero-art img:first-child { right: 20%; top: 0; animation: spin 60s linear infinite; }
.hero-art img:last-child { right: 0; bottom: -10px; width: 150px; height: 150px; }
@keyframes spin { to { transform: rotate(360deg); } }
.banners { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.banners::-webkit-scrollbar { display: none; }
.banner { --b: var(--accent); flex: none; scroll-snap-align: start; position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; width: 230px; height: 140px; padding: 16px; border-radius: var(--radius-sm); text-decoration: none; color: #fff; background: linear-gradient(150deg, color-mix(in srgb, var(--b) 75%, #fff) 0%, var(--b) 55%, color-mix(in srgb, var(--b) 70%, #000) 100%); overflow: hidden; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner img + .banner-t, .banner img ~ .banner-s { position: relative; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.banner-t { font: 700 17px/1.15 var(--font-d); }
.banner-s { font-size: 13px; opacity: .9; }

/* ---------- Разделы меню ---------- */
.cats-bar { position: sticky; top: calc(73px + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--hdr); backdrop-filter: blur(12px); margin-top: 16px; border-bottom: 1px solid var(--line); }
.cats-in { display: flex; align-items: center; gap: 12px; }
.cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; flex: 1; }
.cats::-webkit-scrollbar { display: none; }
.cats a, .side-cats a { flex: none; text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; white-space: nowrap; color: var(--fg); }
.cats a:hover { background: var(--surface-2); }
.cats a.on { background: var(--fg); color: var(--bg); }
.search { display: block; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 16px; outline: none; }
.search input:focus { border-color: var(--accent); }
.cats-in > .search { width: 220px; flex: none; }

.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 24px; padding-bottom: 48px; }
.side, .cart-col { display: none; }
.cat-sec { scroll-margin-top: 150px; margin-bottom: 40px; }
.cat-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-h h2 { font-size: clamp(24px, 3vw, 32px); }
.cat-h p { margin: 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; }
.empty-search { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- Карточка товара в списке ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: 10px; cursor: pointer; border-radius: var(--radius); outline-offset: 4px; min-width: 0; }
.card-img { position: relative; aspect-ratio: 1; max-width: 100%; border-radius: var(--radius); background: var(--img-bg); }
.card-img > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform .25s; }
.card:hover .card-img > img { transform: scale(1.03); }
.badges { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); }
.badge.b-новинка { background: #2563eb; color: #fff; }
.badge.b-острое { background: #b91c1c; color: #fff; }
.add-fab { display: none; }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: 17px; font-family: var(--font-b); font-weight: 800; }
.card-desc { margin: 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-w { font-size: 12.5px; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-weight: 800; font-size: 17px; white-space: nowrap; }
.price s { color: var(--muted); font-weight: 500; font-size: 13px; margin-right: 6px; }
.add { border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 700; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); white-space: nowrap; }
.add:hover { background: var(--accent); color: var(--accent-fg); }
.card.soldout { opacity: .55; }
.add:disabled { background: var(--surface-2); color: var(--muted); }

/* Информационные блоки */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tblock { display: flex; gap: 14px; padding: 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.tblock img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; }
.tblock h3 { font-size: 16px; margin-bottom: 4px; }
.tblock p { margin: 0; color: var(--muted); font-size: 14px; }
#blocksBefore { display: grid; gap: 12px; margin-bottom: 24px; }
#blocksBefore:empty { display: none; }

/* ---------- Окна ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.modal-box { position: relative; width: min(960px, 100%); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); animation: pop .2s ease-out; }
@keyframes pop { from { transform: translateY(14px); opacity: 0; } }
.x { position: absolute; right: 12px; top: 12px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--fg); }
/* Высота окна задана явно: прокручивается только середина, кнопка «В корзину» всегда видна */
.pm { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); height: min(680px, calc(100vh - 48px)); height: min(680px, calc(100dvh - 48px)); overflow: hidden; }
.pm-body { overflow: hidden; }
.pm-img { display: grid; place-items: center; padding: 32px; background: var(--img-bg); border-radius: var(--radius) 0 0 var(--radius); }
.pm-img img { width: 100%; max-width: 420px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
.pm-body { display: flex; flex-direction: column; min-height: 0; }
.pm-scroll { flex: 1; overflow-y: auto; padding: 28px 28px 12px; display: flex; flex-direction: column; gap: 14px; }
.pm h2 { font-size: 26px; padding-right: 40px; }
.pm-sub { color: var(--muted); font-size: 14px; margin-top: -8px; }
.pm-desc { margin: 0; }
.pm-info { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; }
.pm-info summary { cursor: pointer; font-weight: 700; }
.pm-info p { margin: 8px 0 0; }
.kbju { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.kbju b { display: block; color: var(--fg); font-size: 17px; }
.grp { border: 0; padding: 0; margin: 0; min-width: 0; }
.grp legend { font-weight: 800; margin-bottom: 8px; padding: 0; }
.req, .hint { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg > button, .seg .opt { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 10px; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.seg > button[aria-pressed="true"], .seg .opt[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
[data-layout="night"] .seg > button[aria-pressed="true"], [data-layout="night"] .seg .opt[aria-pressed="true"] { background: #4a3e35; }
.seg > button:disabled { opacity: .4; cursor: not-allowed; }
.opt em { font-style: normal; font-size: 12px; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.opts .opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; font-size: 14px; }
.opts .opt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.opts.multi .opt[aria-pressed="true"]::after { content: "✓"; position: absolute; }
.opts .opt { position: relative; }
.opts.multi .opt[aria-pressed="true"]::after { right: 10px; top: 8px; color: var(--accent); font-weight: 900; }
.pm-foot { display: flex; gap: 12px; align-items: center; padding: 16px 28px 24px; border-top: 1px solid var(--line); }
.pm-foot .btn-primary { flex: 1; }
.qty { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.qty button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; font-weight: 700; }
.qty button:hover { background: var(--surface); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty.sm button { width: 30px; height: 30px; font-size: 17px; }

/* ---------- Корзина ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; width: min(440px, 100%); background: var(--surface); box-shadow: var(--shadow); transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; overflow-y: auto; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer.open { transform: none; }
.cart-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 12px; position: relative; }
.cart-h h2 { font-size: 20px; }
.cart-h .x { position: static; }
.cart-empty { padding: 20px; text-align: center; color: var(--muted); }
.cart-empty img { width: 140px; margin: 10px auto; opacity: .85; }
.cart-items { display: flex; flex-direction: column; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); align-items: start; }
.ci img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--img-bg); }
.ci-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-main small { color: var(--muted); font-size: 12.5px; }
.ci-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ci-price { font-weight: 800; }
.ci-del { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 8px; }
.ci-del:hover { color: var(--danger); }
.upsell { padding: 16px 20px; background: var(--surface-2); }
.upsell h3 { font-size: 16px; margin-bottom: 10px; }
.upsell-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: thin; }
.up { flex: none; width: 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; text-align: left; border: 0; border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.up img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.cart-sum { padding: 16px 20px 24px; margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.row.total { font-size: 18px; font-weight: 800; padding-top: 6px; }
.hint-line { font-size: 13px; color: var(--muted); margin: 0; }
.hint-line.warn { color: var(--warn); }
.minbar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.minbar i { display: block; height: 100%; background: var(--accent); }
.cart-bar { position: fixed; z-index: 35; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: none; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 14px 20px; background: var(--accent); color: var(--accent-fg); font-weight: 700; box-shadow: var(--shadow); }
.cart-bar .go { margin-left: auto; }
.pulse { animation: pulse .7s; }
@keyframes pulse { 30% { box-shadow: 0 0 0 4px var(--accent); } }

/* ---------- Акции и комбо ---------- */
.badge.b-sale { background: #16a34a; color: #fff; }
.badge.b-combo { background: var(--accent-2); color: #1a1a1a; }
.promo-note { margin: -4px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.promo-note.on { background: color-mix(in srgb, #16a34a 16%, transparent); color: var(--fg); font-weight: 600; }
#pmAdd s, .ci-price s, .sum-items s { opacity: .6; font-weight: 500; margin-right: 4px; }
.slot { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }
.slot h3 { font-size: 16px; font-family: var(--font-b); font-weight: 800; }
.slot-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.slot-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.slot-opt img { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; }
.slot-opt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.slot-mods { display: flex; flex-direction: column; gap: 12px; }
.slot-mods:empty { display: none; }

/* ---------- Карта в оформлении ---------- */
.map-wrap { position: relative; }
.co-map { height: 300px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); z-index: 0; }
.map-fail { padding: 20px; margin: 0; color: var(--muted); text-align: center; }
.map-locate { position: absolute; right: 10px; bottom: 10px; z-index: 500; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 14px; background: #fff; color: #111; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.zone-info { margin: 0; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.zone-info i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.zone-info.ok { color: var(--fg); font-weight: 600; }
.zone-info.bad { color: var(--danger); font-weight: 600; }
.pin { background: none; border: 0; }
.pin.me::before { content: ""; position: absolute; left: 6px; top: 0; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.pin.cafe b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #111; color: #fff; font: 800 16px/1 var(--font-d); border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.leaflet-container { font: inherit; }

/* ---------- Оформление ---------- */
.co, .ord, .doc { padding-top: 24px; padding-bottom: 60px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 12px; font-weight: 600; }
.back:hover { color: var(--accent); }
.co h1, .doc h1 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 20px; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.co-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.co-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.co-sec h2 { font-size: 19px; }
.seg.big > button { padding: 12px; font-size: 15px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.fld input, .fld select, .fld textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; outline: none; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.addr-line { display: flex; gap: 10px; align-items: end; }
.grow { flex: 1; }
.geo { height: 47px; flex: none; }
.saved { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 7px 12px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--accent); }
.note { margin: 0; font-size: 13px; color: var(--muted); }
.pickup-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.pickup-box div { display: flex; flex-direction: column; }
.pickup-box span { color: var(--muted); font-size: 14px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin-top: 1px; }
.chk a { color: var(--accent); }
.form-err { margin: 0; padding: 12px 16px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); font-weight: 600; }
.co-sum { position: sticky; top: 96px; }
.co-sum-in { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.co-sum h2 { font-size: 19px; }
.sum-items { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sum-items li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sum-items small { display: block; color: var(--muted); font-size: 12.5px; }
.sum-items b { white-space: nowrap; }
.fine { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint-line a { color: inherit; }

/* ---------- Статус заказа ---------- */
.ord-head { padding: 28px; border-radius: var(--radius); background: var(--surface-2); margin-bottom: 20px; }
.ord-head h1 { font-size: clamp(26px, 4vw, 42px); margin-top: 6px; }
.ord-head p { margin: 8px 0 0; color: var(--muted); }
.ord-head.canceled { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }
.ord-head.done { background: color-mix(in srgb, var(--ok) 18%, var(--surface)); }
.ord-num { font-weight: 800; color: var(--accent); }
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 0 4px; }
.steps li i { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); border: 3px solid var(--line); position: relative; z-index: 1; }
.steps li::before { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.steps li:first-child::before { display: none; }
.steps li.done, .steps li.cur { color: var(--fg); font-weight: 600; }
.steps li.done i, .steps li.cur i { background: var(--accent); border-color: var(--accent); }
.steps li.done::before, .steps li.cur::before { background: var(--accent); }
.steps li.cur i { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); animation: beat 1.6s infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 8%, transparent); } }
.ord-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ord-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ord-box h2 { font-size: 19px; }
.dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.dl a { color: var(--accent); font-weight: 700; }
.ord-box .btn-ghost { align-self: flex-start; margin-top: 8px; }
.loading { padding: 40px 0; color: var(--muted); }

/* ---------- Документы ---------- */
.doc-body { max-width: 72ch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.doc-body h2 { font-size: 20px; margin: 22px 0 8px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body a { color: var(--accent); }

/* ---------- Подвал ---------- */
.ftr { background: var(--surface); border-top: 1px solid var(--line); padding: 36px 0 calc(90px + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
.ftr-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ftr-col { display: flex; flex-direction: column; gap: 6px; }
.ftr-col p { margin: 0; color: var(--muted); }
.ftr-col a { color: var(--muted); text-decoration: none; }
.ftr-col a:hover { color: var(--accent); }
.ftr-name { font: 700 18px var(--font-d); }
.hours { border-collapse: collapse; color: var(--muted); font-variant-numeric: tabular-nums; }
.hours td { padding: 1px 14px 1px 0; }
.ftr-legal { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- Cookie и уведомления ---------- */
/* z-index ниже затемнения (40): открытое окно блюда/корзина всегда поверх плашки cookie */
.cookie { position: fixed; z-index: 39; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 760px; margin: 0 auto; display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px; }
.cookie p { margin: 0; flex: 1; }
.cookie a { color: var(--accent); }
.cookie-btns { display: flex; gap: 8px; flex: none; }
.cookie .btn-primary, .cookie .btn-ghost { padding: 9px 14px; font-size: 13.5px; }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =============== МАКЕТ «NIGHT» (по умолчанию) =============== */
[data-layout="night"] #hero { display: none; }
[data-layout="night"] .banner { width: 168px; height: 210px; }
[data-layout="night"] .cats-in > .search { display: none; }
[data-layout="night"] .cats a.on { background: var(--surface-2); color: var(--accent); }
[data-layout="night"] .card-img { background: radial-gradient(circle at 50% 55%, #2c241e 0%, transparent 70%); }
[data-layout="night"] .card { padding: 14px; background: var(--surface); border-radius: var(--radius); }
[data-layout="night"] .card-img > img { border-radius: 50%; }

/* =============== МАКЕТ «MARKET» =============== */
[data-layout="market"] .hdr { border-bottom: 1px solid var(--line); }
[data-layout="market"] .logo-mark { border-radius: 10px; }
[data-layout="market"] .hero { grid-template-columns: 1fr auto; padding: 22px 28px; background: var(--accent); color: var(--accent-fg); }
[data-layout="market"] .hero p, [data-layout="market"] .hero-facts { color: color-mix(in srgb, var(--accent-fg) 80%, transparent); }
[data-layout="market"] .hero-facts b { color: var(--accent-fg); }
[data-layout="market"] .hero-art { height: 150px; width: 260px; }
[data-layout="market"] .hero-art img:first-child { width: 150px; height: 150px; right: 90px; }
[data-layout="market"] .hero-art img:last-child { width: 110px; height: 110px; bottom: 0; }
[data-layout="market"] .banner { height: 96px; width: 260px; }
[data-layout="market"] .cats a.on { background: var(--accent); color: var(--accent-fg); }
[data-layout="market"] .grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
[data-layout="market"] .card { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: 14px; row-gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
[data-layout="market"] .card:hover { border-color: var(--accent); }
[data-layout="market"] .card-img { grid-row: 1 / 3; border-radius: var(--radius-sm); }
[data-layout="market"] .card-img > img { border-radius: var(--radius-sm); }
[data-layout="market"] .badges { left: 6px; top: 6px; }
[data-layout="market"] .badge { font-size: 9.5px; padding: 3px 6px; }
[data-layout="market"] .card h3 { font-size: 15.5px; }
[data-layout="market"] .add { background: var(--accent); color: var(--accent-fg); padding: 8px 14px; border-radius: var(--radius-sm); }
[data-layout="market"] .side-cats { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
[data-layout="market"] .side-cats a { border-radius: var(--radius-sm); padding: 9px 12px; }
[data-layout="market"] .side-cats a:hover { background: var(--surface); }
[data-layout="market"] .side-cats a.on { background: var(--surface); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
[data-layout="market"] .side-info { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; padding: 14px; border-radius: var(--radius); background: var(--surface); font-size: 13px; color: var(--muted); }
[data-layout="market"] .side-info a { color: var(--accent); font-weight: 700; text-decoration: none; }
[data-layout="market"] .cart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 110px); overflow-y: auto; }
[data-layout="market"] .info-grid .tblock { border-left: 4px solid var(--accent); }
@media (min-width: 1000px) {
  [data-layout="market"] .cats-bar { display: none; }
  [data-layout="market"] .menu-layout { grid-template-columns: 220px minmax(0, 1fr); }
  [data-layout="market"] .side { display: block; position: sticky; top: 96px; align-self: start; }
  [data-layout="market"] .cat-sec { scroll-margin-top: 96px; }
}
@media (min-width: 1100px) {
  [data-layout="market"] .menu-layout { grid-template-columns: 210px minmax(0, 1fr) 340px; }
  [data-layout="market"] .cart-col { display: block; position: sticky; top: 92px; align-self: start; }
  [data-layout="market"] .cart-panel .upsell-row { flex-wrap: nowrap; }
}

/* =============== МАКЕТ «BRIGHT» =============== */
[data-layout="bright"] .logo-mark { border-radius: 50%; background: var(--accent-2); color: var(--fg); }
[data-layout="bright"] .cart-btn { background: var(--fg); color: #fff; }
[data-layout="bright"] .cart-count { color: var(--fg); }
[data-layout="bright"] .hero { background: var(--accent); color: #fff; padding: 40px; min-height: 280px; }
[data-layout="bright"] .hero h1 { font-weight: 800; font-size: clamp(32px, 5.4vw, 64px); letter-spacing: -.02em; }
[data-layout="bright"] .hero p, [data-layout="bright"] .hero-facts { color: rgba(255,255,255,.85); }
[data-layout="bright"] .hero-facts b { color: var(--accent-2); }
[data-layout="bright"] .hero-art img:first-child { width: 250px; height: 250px; top: -20px; }
[data-layout="bright"] .banner { width: 300px; height: 120px; border-radius: var(--radius-sm); }
[data-layout="bright"] .cats a { background: var(--surface-2); }
[data-layout="bright"] .cats a.on { background: var(--accent-2); color: var(--fg); }
[data-layout="bright"] .cat-h h2 { font-weight: 800; font-size: clamp(28px, 3.6vw, 40px); }
[data-layout="bright"] .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 20px; }
[data-layout="bright"] .card-img { padding: 18px; }
[data-layout="bright"] .card-img > img { border-radius: 50%; object-fit: contain; }
[data-layout="bright"] .add-fab { display: grid; place-items: center; position: absolute; right: 12px; bottom: 12px; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--accent-2); color: var(--fg); font: 700 30px/1 var(--font-b); box-shadow: 0 6px 16px rgba(0,0,0,.18); transition: transform .15s; }
[data-layout="bright"] .add-fab:hover { transform: scale(1.1) rotate(90deg); }
[data-layout="bright"] .add-fab:disabled { display: none; }
[data-layout="bright"] .card .add { display: none; }
[data-layout="bright"] .card h3 { font-size: 19px; font-family: var(--font-d); font-weight: 700; }
[data-layout="bright"] .price { font-size: 21px; color: var(--accent); }
[data-layout="bright"] .cart-bar { display: flex; max-width: 520px; margin: 0 auto; background: var(--fg); color: #fff; }
[data-layout="bright"] .cart-bar[hidden] { display: none; }
[data-layout="bright"] .cart-bar b { color: var(--accent-2); }
[data-layout="bright"] .tblock { background: var(--surface-2); border: 0; }
[data-layout="bright"] .co-sec, [data-layout="bright"] .co-sum-in, [data-layout="bright"] .ord-box { border: 0; background: var(--surface-2); }
[data-layout="bright"] .fld input, [data-layout="bright"] .fld select, [data-layout="bright"] .fld textarea { background: #fff; }
[data-layout="bright"] .seg { background: #fff; }
[data-layout="bright"] .seg > button[aria-pressed="true"], [data-layout="bright"] .seg .opt[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ---------- Телефоны и планшеты ---------- */
@media (max-width: 999px) {
  .hdr-meta { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .hdr-in { min-height: 60px; gap: 10px; }
  .logo-mark, .logo-img { width: 40px; height: 40px; }
  .logo-txt small { display: none; }
  .logo-txt b { font-size: 16px; white-space: normal; }
  .hdr-phone span { display: none; }
  .hdr-phone { width: 40px; height: 40px; justify-content: center; border-radius: 50%; background: var(--surface-2); margin-left: auto; }
  .cart-btn { padding: 10px 14px; }
  .cart-btn-label { display: none; }
  .cats-bar { top: calc(61px + env(safe-area-inset-top, 0px)); margin-top: 12px; }
  .cats-in > .search { display: none; }
  .cat-sec { scroll-margin-top: 120px; }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .hero-art { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .card h3 { font-size: 15px; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .add { width: 100%; }
  [data-layout="night"] .card { padding: 10px; }
  [data-layout="night"] .banner { width: 128px; height: 160px; }
  [data-layout="market"] .grid { grid-template-columns: minmax(0, 1fr); }
  [data-layout="market"] .card { grid-template-columns: 96px minmax(0, 1fr); }
  [data-layout="market"] .card-foot { flex-direction: row; align-items: center; }
  [data-layout="market"] .add { width: auto; }
  [data-layout="bright"] .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  [data-layout="bright"] .card h3 { font-size: 16px; }
  [data-layout="bright"] .card-img { padding: 8px; }
  [data-layout="bright"] .add-fab { width: 42px; height: 42px; font-size: 24px; right: 4px; bottom: 4px; }
  [data-layout="bright"] .hero { padding: 26px; min-height: 0; }
  [data-layout="bright"] .price { font-size: 18px; }
  .cart-bar:not([hidden]) { display: flex; }
  .modal { padding: 0; place-items: end stretch; }
  .modal-box { border-radius: var(--radius) var(--radius) 0 0; width: 100%; animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(40%); } }
  .pm { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; max-height: 94vh; max-height: 94dvh; min-height: 0; overflow-y: auto; }
  .pm-body { overflow: visible; }
  .pm-img { padding: 16px 16px 0; border-radius: var(--radius) var(--radius) 0 0; background: transparent; }
  .pm-img img { max-width: 260px; }
  .pm-scroll { overflow: visible; padding: 16px 18px 8px; }
  .pm-body { min-height: auto; }
  .pm-foot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .drawer { width: 100%; }
  .co-grid, .ord-grid { grid-template-columns: minmax(0, 1fr); }
  .co-sum { position: static; }
  .co-sec { padding: 18px; }
  .row2 { grid-template-columns: 1fr; }
  .row4 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-auto-flow: row; gap: 14px; }
  .steps li { flex-direction: row; text-align: left; gap: 12px; }
  .steps li::before { left: 9.5px; top: -14px; width: 3px; height: 22px; }
  .steps li small { margin-left: auto; }
  .ftr-in { grid-template-columns: 1fr; }
  .cookie { flex-direction: column; align-items: stretch; }
  .cookie-btns > * { flex: 1; justify-content: center; }
  .tblock { padding: 16px; }
}
@media (max-width: 380px) {
  .grid { gap: 14px 10px; }
  .seg .opt, .seg > button { font-size: 13px; padding: 9px 6px; }
}
