/*
 * Каталог города — экран «Главная» приложения (mobile-app/src/screens/HomeScreen.tsx, components/RestaurantCard.tsx,
 * HomeDiscovery.tsx, FilterRow.tsx). Токены --a-* — css/app-shell.css.
 * Телефон (до 768px): один в один с приложением. Компьютер: та же раскладка — шапка с адресом и поиском,
 * три карточки подборок в ряд, строка фильтров и сетка карточек ресторанов.
 * Витрина заведения на карточке — только обложка (фото витрины) и цвет печати (--card-accent), как в приложении.
 */
body.page-catalog { margin: 0; min-height: 100dvh; background: var(--a-bg); color: var(--a-ink); font-family: var(--a-font); }
.page-catalog a { color: inherit; text-decoration: none; }
.page-catalog .wrap { width: min(1240px, 100%); margin: 0 auto; padding: 0 clamp(16px, 3.4vw, 40px); }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--a-ink); color: #fff; font-weight: 700; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ───────────── Шапка ───────────── */
.bar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--a-bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease, box-shadow .2s ease; }
.bar.is-scrolled { border-bottom-color: var(--a-line); box-shadow: 0 6px 20px rgba(70, 49, 26, .06); }
.bar .wrap { min-height: 80px; display: flex; align-items: center; gap: 14px; }
.brand { flex: none; display: block; }
.bar .vk-logo { height: 62px; transform: translateY(-9%); }
.bar-end { flex: none; display: flex; align-items: center; gap: 8px; }
.bar-end .vk-account { gap: 8px; }

/* Адрес: значок банданы, «Доставка · город», адрес крупно. */
.bar .dlw-pill { flex: 0 1 300px; min-width: 0; max-width: 300px; min-height: 52px; gap: 10px; padding: 6px 14px 6px 6px;
  border: 1px solid var(--a-line); border-radius: 18px; background: var(--a-surface); transition: border-color .15s ease, box-shadow .15s ease; }
.bar .dlw-pill:hover { border-color: var(--a-line-strong); background: var(--a-surface); box-shadow: var(--a-shadow-1); }
.bar .dlw-pill .dlw-pill-ico { width: 40px; height: 40px; border-radius: 14px; background: var(--a-green); color: #fff; }
.bar .dlw-pill .dlw-pill-ico svg { width: 20px; height: 20px; }
.bar .dlw-pill .dlw-pill-text small { color: var(--a-muted); font-size: 12px; font-weight: 600; }
.bar .dlw-pill .dlw-pill-text b { color: var(--a-ink); font-size: 15px; font-weight: 800; letter-spacing: -.1px; }
.bar .dlw-pill.is-empty .dlw-pill-text b { color: var(--a-ink); }
.bar .dlw-pill .dlw-pill-caret { color: var(--a-ink); }

/* Поиск: «Рестораны, блюда, кухни». */
.finder-search { flex: 1 1 auto; min-width: 0; max-width: 620px; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 16px;
  border: 1px solid var(--a-line); border-radius: 18px; background: var(--a-surface); cursor: text; transition: border-color .15s ease, box-shadow .15s ease; }
.finder-search:hover { border-color: var(--a-line-strong); }
.finder-search:focus-within { border-color: var(--a-green); box-shadow: 0 0 0 4px rgba(45, 128, 58, .14); }
.finder-search > svg { flex: none; width: 20px; height: 20px; color: var(--a-muted); }
.finder-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--a-ink); font-size: 15.5px; }
.finder-search input::placeholder { color: var(--a-faint); }
.finder-search input::-webkit-search-cancel-button { display: none; }
.finder-search input:focus-visible { outline: 0; box-shadow: none; }
.finder-clear { display: none; flex: none; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--a-muted); cursor: pointer; }
.finder-clear svg { width: 18px; height: 18px; }
.finder-search.has-value .finder-clear { display: inline-grid; }
.finder-clear:hover { background: var(--a-soft); color: var(--a-ink); }

/* Корзина в шапке компьютера. */
.bar .bk-open { min-height: 46px; padding: 0 16px 0 14px; border-radius: 16px; background: var(--a-wash); color: var(--a-green-strong); font-weight: 800; }
.bar .bk-open.has-items { background: var(--a-green); color: #fff; }
.bar .vk-account .oki-btn { min-height: 46px; border-radius: 16px; border-color: var(--a-line); background: var(--a-surface); color: var(--a-ink); font-weight: 750; }
.bar .vk-account .oki-btn:hover { border-color: var(--a-line-strong); background: var(--a-surface); color: var(--a-ink); }
.bar .bamboo-counter-btn { height: 46px; min-height: 46px; border-radius: 16px; }

.city-switch { position: relative; flex: none; }
.city-switch summary { list-style: none; cursor: pointer; }
.city-switch summary::-webkit-details-marker { display: none; }
.city-switch svg { width: 18px; height: 18px; color: var(--a-green); flex: none; }
.city-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; max-height: 60vh; overflow: auto; margin: 0; padding: 8px; list-style: none;
  background: var(--a-surface); border-radius: 16px; box-shadow: var(--a-shadow-3); }
.city-menu a { display: block; padding: 13px 14px; border-radius: 10px; font-weight: 650; }
.city-menu a:hover, .city-menu a[aria-current='true'] { background: var(--a-wash); color: var(--a-green-strong); }

/* ───────────── Подборки ───────────── */
.intro { padding: 30px 0 0; }
.intro-title { margin: 0 0 18px; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.08; font-weight: 800; letter-spacing: -.035em; }

.discovery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
/* Карточки — как в приложении (HomeDiscovery): цветная заливка, свой енот или блюдо (static/images/art) справа над кнопкой. */
.dsc { position: relative; min-width: 0; min-height: 224px; display: flex; flex-direction: column; align-items: flex-start; padding: 20px;
  overflow: hidden; border: 0; border-radius: var(--a-r-lg, 24px); color: #fff; font: inherit; text-align: left; cursor: pointer;
  transition: transform .2s var(--a-ease), box-shadow .2s var(--a-ease); }
.dsc:hover { transform: translateY(-2px); box-shadow: var(--a-shadow-2); }
.dsc:active { transform: scale(.985); }
.dsc:focus-visible { outline: 3px solid var(--a-green); outline-offset: 3px; }
.dsc-title { position: relative; z-index: 1; font-size: 26px; line-height: 1.1; font-weight: 900; letter-spacing: -.6px; padding-right: 150px; }
.dsc-text { position: relative; z-index: 1; margin-top: 8px; font-size: 14px; line-height: 1.35; font-weight: 700; padding-right: 150px; opacity: .92; }
/* Кнопка — короткая таблетка, как в баннере приложения («Нажмите, чтобы посмотреть ›»): нажимается вся карточка,
   полоса во всю ширину на каждой из трёх карточек читалась тремя одинаковыми кнопками. */
.dsc-cta { position: relative; z-index: 1; margin-top: auto; height: 38px; display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 14px;
  border-radius: 999px; background: #fff; color: var(--a-green-strong); font-size: 14px; font-weight: 800; transition: background .15s ease; }
.dsc:hover .dsc-cta { background: #f4efe6; }
.dsc-cta svg { width: 17px; height: 17px; transition: transform .2s var(--a-ease); }
.dsc:hover .dsc-cta svg { transform: translateX(3px); }
.dsc-text + .dsc-cta { margin-top: auto; }
.dsc > .dsc-text { margin-bottom: 14px; }
/* Каждая карточка — целая сцена (static/images/art/card-*.webp, как в приложении). Заливка — цвет верха сцены:
   на широком компьютере сцена занимает правую часть и уходит в неё, текст и кнопка — на спокойном месте слева.
   Все три сцены — один стиль и в двух версиях, как в приложении: светлая тема — дневное кафе на светлом дубе, текст тёмный;
   тёмная — вечерний ресторан, текст белый (css/theme-dark.css). Заливка и текст у всех трёх одинаковые. */
.dsc--points, .dsc--buyers, .dsc--invite { background: linear-gradient(160deg, #F8EFE0, #F2E9DC); color: #2A2016; }
.dsc .dsc-cta { background: var(--a-green); color: #fff; }
.dsc:hover .dsc-cta { background: var(--a-green-strong); }
.dsc-bg { position: absolute; z-index: 0; top: 0; right: 0; width: 62%; height: 100%; object-fit: cover; object-position: 50% 100%; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 42%); mask-image: linear-gradient(90deg, transparent 0, #000 42%); }
/* Вечерняя версия сцены — только в тёмной теме (css/theme-dark.css). */
.dsc-bg--night { display: none; }
/* Подложка под текст — только когда сцена во всю карточку (телефон, узкий компьютер). */
.dsc-scrim { display: none; position: absolute; z-index: 0; inset: 0; pointer-events: none; }
.dsc-scrim { background: linear-gradient(180deg, rgba(250, 243, 232, .9), rgba(250, 243, 232, 0) 62%); }
/* Корона — над заголовком «Выбор покупателей», по его левому краю. */
.dsc-crown { position: relative; z-index: 1; width: 30px; height: 20px; margin-bottom: 4px; pointer-events: none; }

/* «Куда доставить?» — карточка-подсказка, пока нет адреса. */
.where-nudge { width: 100%; margin-top: 16px; display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 14px;
  border: 1px solid var(--a-line); border-radius: var(--a-r-md); background: var(--a-surface); color: var(--a-ink); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease; }
.where-nudge[hidden] { display: none; }
.where-nudge:hover { border-color: var(--a-green); box-shadow: var(--a-shadow-1); }
.where-nudge-ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: var(--a-wash); color: var(--a-green-strong); }
.where-nudge-ico svg { width: 18px; height: 18px; }
.where-nudge-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.where-nudge-text b { font-size: 15.5px; font-weight: 800; }
.where-nudge-text span { color: var(--a-muted); font-size: 13px; line-height: 1.35; }
.where-nudge-go { flex: none; width: 18px; height: 18px; color: var(--a-green-strong); }

/* Фильтры и кухни (FilterRow): кнопка фильтров обведена, кухни — белые чипы, выбранная — зелёная. */
.cats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.cat-filter { position: relative; flex: none; height: 38px; min-width: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
  border: 1.5px solid var(--a-ink); border-radius: 999px; background: var(--a-surface); color: var(--a-ink); cursor: pointer; transition: background .15s ease; }
.cat-filter svg { width: 20px; height: 20px; }
.cat-filter b { min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 10px; background: #fff; color: var(--a-green); font-size: 11.5px; font-weight: 900; }
.cat-filter b[hidden] { display: none; }
.cat-filter[aria-pressed='true'] { background: var(--a-green); border-color: var(--a-green); color: #fff; }
.cat { flex: none; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--a-line); border-radius: 999px;
  background: var(--a-surface); color: var(--a-ink); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease; }
.cat:hover { border-color: var(--a-line-strong); }
.cat[aria-pressed='true'] { background: var(--a-green); border-color: var(--a-green); color: #fff; }
.cats :focus-visible { outline: 3px solid var(--a-green); outline-offset: 2px; }
.cats-hint { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--a-muted); font-size: 13.5px; font-weight: 600; }
.cats-hint[hidden] { display: none; }
.cats-hint button { min-height: 32px; padding: 0 12px; border: 1px solid var(--a-line); border-radius: 999px; background: var(--a-surface); color: var(--a-green-strong);
  font: inherit; font-weight: 800; cursor: pointer; }

/* ───────────── Список ресторанов ───────────── */
.catalog { padding-bottom: 8px; }
.catalog-head { display: flex; align-items: center; gap: 8px; margin: 30px 0 14px; }
.catalog-head h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.4px; scroll-margin-top: 110px; }
.count-pill { padding: 2px 10px; border-radius: 10px; background: var(--a-soft); color: var(--a-muted); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-pill[hidden] { display: none; }
.perk { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; color: var(--a-muted); font-size: 14px; line-height: 1.45; }
.perk img { flex: none; width: 22px; height: 22px; }
.perk strong { color: var(--a-ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; padding-bottom: 48px; }
#catalogEmpty[hidden], [data-restaurant-card][hidden] { display: none !important; }

/* Карточка ресторана (RestaurantCardView). */
.rc { --card-accent: var(--a-green); --card-tint: color-mix(in srgb, var(--card-accent) 14%, #fff);
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--a-r-lg); background: var(--a-surface);
  box-shadow: var(--a-shadow-1); color: var(--a-ink); transition: transform .22s var(--a-ease), box-shadow .22s var(--a-ease); }
a.rc:hover { transform: translateY(-3px); box-shadow: var(--a-shadow-2); }
a.rc:active { transform: scale(.98); }
a.rc:focus-visible { outline: 3px solid var(--a-green); outline-offset: 3px; }
.rc-media { position: relative; height: 196px; overflow: hidden; background-color: var(--card-tint); }
.rc-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--a-ease); }
a.rc:hover .rc-cover { transform: scale(1.03); }
.rc.has-cover .rc-media::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .38)); pointer-events: none; }
/* Без фото — точки цвета заведения и большая печать по центру. */
.rc.no-cover .rc-media { --dot: color-mix(in srgb, var(--card-accent) 16%, transparent);
  background-image: radial-gradient(circle at 8% 22%, var(--dot) 5px, transparent 5.5px), radial-gradient(circle at 37% 76%, var(--dot) 5px, transparent 5.5px),
    radial-gradient(circle at 74% 30%, var(--dot) 5px, transparent 5.5px), radial-gradient(circle at 11% 86%, var(--dot) 5px, transparent 5.5px),
    radial-gradient(circle at 48% 10%, var(--dot) 5px, transparent 5.5px), radial-gradient(circle at 85% 70%, var(--dot) 5px, transparent 5.5px); }
.rc-stamp { position: absolute; z-index: 2; left: 14px; bottom: 12px; width: 54px; height: 54px; display: grid; place-items: center; overflow: hidden;
  border: 3px solid var(--card-accent); border-radius: 50%; background: var(--a-surface); color: var(--card-accent);
  font: 900 23px/1 var(--a-font); }
.rc-stamp img { width: 100%; height: 100%; object-fit: cover; }
.rc.no-cover .rc-stamp { left: 50%; top: 50%; bottom: auto; width: 92px; height: 92px; transform: translate(-50%, -50%); font-size: 38px; }
/* Плашки: «Откроется в 11:00» — тёмная слева, «Новый» и «Акции» — справа. */
.rc-status { position: absolute; z-index: 3; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
  border-radius: 12px; background: rgba(29, 26, 21, .78); color: #fff; font-size: 12px; font-weight: 700; }
.rc-status svg { width: 13px; height: 13px; }
.rc-pills { position: absolute; z-index: 3; top: 12px; right: 12px; display: flex; gap: 6px; }
.rc-pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.rc-pill--new { background: var(--a-green); color: #fff; }
.rc-pill--new::before { content: ''; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2l1.8 5.2L17 9l-5.2 1.8L10 16l-1.8-5.2L3 9l5.2-1.8L10 2zm8 10l.9 2.1 2.1.9-2.1.9L18 18l-.9-2.1-2.1-.9 2.1-.9L18 12z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2l1.8 5.2L17 9l-5.2 1.8L10 16l-1.8-5.2L3 9l5.2-1.8L10 2zm8 10l.9 2.1 2.1.9-2.1.9L18 18l-.9-2.1-2.1-.9 2.1-.9L18 12z'/%3E%3C/svg%3E") center / contain no-repeat; }
.rc-pill--promo { background: var(--a-points-soft); color: var(--a-points-strong); }
/* «В корзине · 3» (basket.js) — в правом нижнем углу обложки. */
.rc-incart { position: absolute; z-index: 3; right: 12px; top: calc(196px - 38px); display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px;
  border-radius: 13px; background: var(--a-green); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 2px 8px rgba(31, 90, 40, .3); }
.rc-incart svg { width: 14px; height: 14px; }

.rc-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 3px; padding: 12px 16px 14px; }
.rc-title { min-width: 0; }
.rc-name { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-rating { align-self: center; display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rc-rating svg { width: 14px; height: 14px; color: #E8A317; }
.rc-rating b { font-weight: 800; }
.rc-rating span { color: var(--a-muted); font-size: 12.5px; }
.rc-cuisines { grid-column: 1 / -1; margin: 0; color: var(--a-muted); font-size: 14px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 5px 0 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-facts li { display: inline-flex; align-items: center; gap: 4px; }
.rc-facts li[hidden] { display: none; }
.rc-facts svg { flex: none; width: 15px; height: 15px; color: var(--a-muted); }
.rc-facts .warn, .rc-facts .warn svg { color: var(--a-warning); }
.rc.is-soon { opacity: .72; box-shadow: none; }
.rc.is-soon .rc-media { filter: grayscale(.5); }

/* Не доставляют по адресу: отдельная приглушённая группа — к ним можно за самовывозом. */
.far[hidden] { display: none; }
.far-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 16px 18px; border-radius: var(--a-r-md); background: var(--a-warning-soft); color: var(--a-warning); }
.far-head h2 { flex: 1 1 100%; margin: 0; font-size: 17px; font-weight: 800; color: #5f4519; }
.far-head p { flex: 1 1 320px; margin: 0; font-size: 13.5px; line-height: 1.5; }
.far-change { flex: none; min-height: 40px; padding: 0 16px; border: 1px solid #ecd9b2; border-radius: 999px; background: #fff; color: #5f4519; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.grid--far { padding-top: 16px; }
.grid--far .rc { opacity: .72; }
.grid--far a.rc:hover { opacity: .9; }

.empty { margin: 8px 0 48px; padding: 32px 20px; text-align: center; border-radius: var(--a-r-lg); background: transparent; }
.empty img { display: block; width: 150px; height: auto; margin: 0 auto; } /* tailwind делает img блочным — text-align его не центрирует */
.empty h2 { margin: 14px 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.empty p { margin: 0 auto; max-width: 40ch; color: var(--a-muted); font-size: 15px; line-height: 1.45; }
.empty .cta[hidden] { display: none; }
.empty .cta { display: inline-flex; align-items: center; min-height: 40px; margin-top: 18px; padding: 0 16px; border: 0; border-radius: var(--a-r-sm);
  background: var(--a-wash); color: var(--a-green-strong); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* Заведениям — тихий белый блок внизу. */
.partner { margin: 0 0 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; padding: 18px 20px; border: 1px solid var(--a-line);
  border-radius: var(--a-r-lg); background: var(--a-surface); }
/* Значок витрины — енот на сайте живёт только во входе, пустых экранах и знакомстве с сервисом. */
.partner-art { flex: none; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 18px; background: var(--a-wash); color: var(--a-green-strong); }
.partner-art svg { width: 36px; height: 36px; }
.partner-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.partner strong { font-size: 16px; font-weight: 800; }
.partner span { color: var(--a-muted); font-size: 14px; }
.partner-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1.5px solid var(--a-green); border-radius: 999px;
  color: var(--a-green-strong); font-weight: 800; transition: background .15s ease; }
.partner-cta:hover { background: var(--a-wash); }
.partner-cta svg { width: 18px; height: 18px; }

/* ───────────── Окна: фильтры, «Выбор покупателей», приглашение ───────────── */
dialog.flt-sheet { width: min(480px, 100vw); max-height: min(86dvh, 760px); margin: auto; padding: 0; border: 0; border-radius: var(--a-r-lg); background: var(--a-surface);
  color: var(--a-ink); font-family: var(--a-font); box-shadow: 0 30px 80px rgba(41, 37, 31, .28); overflow: hidden; }
dialog.flt-sheet[open] { display: flex; flex-direction: column; animation: flt-in .28s var(--a-ease); }
dialog.flt-sheet::backdrop { background: var(--a-scrim); }
@keyframes flt-in { from { opacity: 0; transform: translateY(18px); } }
.flt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.flt-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.flt-close { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--a-soft); color: var(--a-ink); cursor: pointer; }
.flt-close svg { width: 20px; height: 20px; }
.flt-body { padding: 4px 20px 12px; overflow: auto; display: grid; gap: 16px; }
.flt-body fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 2px; }
.flt-body legend { margin-bottom: 6px; font-size: 15px; font-weight: 800; }
.flt-body fieldset > label { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 4px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.flt-body fieldset > label:hover { background: var(--a-field); }
.flt-body input[type=radio] { width: 20px; height: 20px; accent-color: var(--a-green); }
.flt-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--a-soft); }
.flt-seg label { position: relative; cursor: pointer; }
.flt-seg input { position: absolute; opacity: 0; }
.flt-seg span { display: grid; place-items: center; min-height: 40px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--a-muted); }
.flt-seg input:checked + span { background: #fff; color: var(--a-green-strong); box-shadow: 0 1px 4px rgba(41, 37, 31, .12); }
.flt-seg input:focus-visible + span { outline: 3px solid var(--a-green); }
.flt-switch { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; }
.flt-switch > span { flex: 1; display: grid; font-weight: 700; }
.flt-switch small { color: var(--a-muted); font-weight: 500; font-size: 13px; }
.flt-switch input { position: absolute; opacity: 0; }
.flt-switch i { flex: none; width: 48px; height: 28px; border-radius: 14px; background: var(--a-line); position: relative; transition: background .18s ease; }
.flt-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s var(--a-ease); }
.flt-switch input:checked + i { background: var(--a-green); }
.flt-switch input:checked + i::after { transform: translateX(20px); }
.flt-switch input:focus-visible + i { outline: 3px solid var(--a-green); outline-offset: 2px; }
.flt-foot { display: flex; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--a-line); }
.flt-reset, .flt-apply { min-height: 52px; padding: 0 18px; border: 0; border-radius: var(--a-r-md); font: 800 16px var(--a-font); cursor: pointer; }
.flt-reset { background: var(--a-soft); color: var(--a-ink); }
.flt-apply { flex: 1; background: var(--a-green); color: #fff; }
.flt-apply:hover { background: var(--a-green-strong); }

/* «Выбор покупателей»: рестораны вкладками, блюда сеткой как в меню приложения. */
.discovery-buyer-tabs { display: flex; gap: 6px; margin: 4px 0 14px; overflow-x: auto; scrollbar-width: none; }
.discovery-buyer-tabs::-webkit-scrollbar { display: none; }
.discovery-buyer-tabs[hidden] { display: none; }
.discovery-buyer-tab { flex: none; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 0; border-radius: 19px; background: transparent;
  color: var(--a-muted); font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.discovery-buyer-tab[aria-selected=true] { background: var(--a-ink); color: var(--a-bg); }
.discovery-buyer-rating { font-size: 12.5px; opacity: .9; }
.discovery-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.discovery-product { min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 10px; border-radius: var(--a-r-md); background: var(--a-surface);
  box-shadow: 0 0 0 1px var(--a-line); }
.discovery-product-detail { flex: 1; display: flex; flex-direction: column; padding: 0 0 2px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.discovery-product-detail > img { width: 100%; aspect-ratio: 1 / .86; object-fit: cover; background: var(--a-soft); }
.discovery-product-price { display: inline-flex; align-items: center; gap: 4px; padding: 9px 10px 0; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.discovery-product-price img { width: 18px; height: 18px; }
.discovery-product-name { padding: 2px 10px 0; font-size: 14px; line-height: 18px; }
.discovery-product-weight { padding: 2px 10px 0; color: var(--a-faint); font-size: 12.5px; }
.discovery-product-add { margin: 8px 10px 0; height: 34px; display: flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 17px;
  background: var(--a-soft); color: var(--a-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.discovery-product-add svg { width: 18px; height: 18px; }
.discovery-product-add:hover { background: var(--a-wash); color: var(--a-green-strong); }
.discovery-product-add:disabled { opacity: .55; cursor: wait; }
.discovery-restaurant-menu { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 4px; border-radius: var(--a-r-sm);
  background: var(--a-wash); color: var(--a-green-strong); font-size: 14.5px; font-weight: 800; }
.discovery-state { padding: 24px 4px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: var(--a-muted); }
.discovery-state[hidden] { display: none; }
.discovery-state p { margin: 0; font-size: 15px; line-height: 1.45; }
.discovery-state-action { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--a-r-sm); background: var(--a-green); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }

.discovery-invite-dialog { border: 0; padding: 0; border-radius: var(--a-r-lg); width: min(660px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--a-bg); color: var(--a-ink); box-shadow: 0 30px 80px rgba(41, 37, 31, .28); }
.discovery-invite-dialog::backdrop { background: var(--a-scrim); }
.discovery-invite-dialog > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--a-line); }
.discovery-invite-dialog h2 { margin: 0; font-size: 20px; font-weight: 800; }
.discovery-invite-dialog header button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--a-soft); color: inherit; cursor: pointer; }
.discovery-invite-dialog header button svg { width: 20px; height: 20px; }
.discovery-invite-dialog iframe { display: block; width: 100%; height: min(650px, calc(100dvh - 118px)); border: 0; }

/* ───────────── Компьютер: шапка в две строки, первый экран короче ─────────────
 * Строка 1 — логотип и адрес слева, Вкусняшки, вход и корзина справа; строка 2 — поиск во всю ширину.
 * Заголовок и подсказка «Куда доставить?» на компьютере не показываются (адрес — в шапке), чтобы карточки
 * ресторанов были видны на первом экране ноутбука (1366×768, масштаб 125 %). */
/* Блюда по запросу поиска (restaurants.js): группа на ресторан — шапка с печатью и «Всё меню», ряд карточек блюд
   (те же .discovery-product, что у «Выбора покупателей») с прокруткой вбок. */
.dish-hits { margin: 6px 0 26px; }
.dish-hits[hidden], .dish-hits [data-dish-head][hidden] { display: none; }
.dish-group + .dish-group { margin-top: 22px; }
.dish-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--a-ink); text-decoration: none; }
.dish-group-logo { flex: none; width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--a-soft);
  box-shadow: 0 0 0 1px var(--a-line); font-weight: 900; color: var(--a-muted); }
.dish-group-logo img { width: 100%; height: 100%; object-fit: cover; }
.dish-group-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-group-text b { font-size: 17px; line-height: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-group-text small { color: var(--a-muted); font-size: 13px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-group-go { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--a-green-text, var(--a-green-strong)); font-size: 14px; font-weight: 700; }
.dish-group-go svg { width: 16px; height: 16px; }
.dish-group-head:hover .dish-group-text b { text-decoration: underline; text-underline-offset: 3px; }
.dish-group-head:focus-visible { outline: 2px solid var(--a-green); outline-offset: 4px; border-radius: 12px; }
.dish-row { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-padding: 0 16px; }
.dish-row::-webkit-scrollbar { display: none; }
.dish-row > .discovery-product { scroll-snap-align: start; }
@media (min-width: 769px) {
  .dish-row { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 2px; }
}

@media (min-width: 769px) {
  .bar .wrap { min-height: 0; display: grid; grid-template-columns: auto minmax(0, 360px) minmax(0, 1fr) auto;
    grid-template-areas: 'brand where city end' 'search search search search'; align-items: center; column-gap: 20px; row-gap: 10px;
    padding-top: 12px; padding-bottom: 12px; }
  .brand { grid-area: brand; }
  .bar .dlw-pill { grid-area: where; flex: none; max-width: none; min-height: 50px; }
  .city-switch { grid-area: city; justify-self: end; }
  .bar-end { grid-area: end; gap: 10px; }
  .bar-end .vk-account { gap: 10px; }
  .finder-search { grid-area: search; max-width: none; height: 48px; }

  .intro { padding-top: 18px; }
  .intro-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .discovery .dsc { min-height: 232px; padding: 20px; }
  .dsc-title { font-size: 25px; }
  .dsc-text { margin-top: 6px; }
  .dsc > .dsc-text { margin-bottom: 12px; }
  .where-nudge { display: none; }
  .cats { margin-top: 16px; }
  .catalog-head { margin: 22px 0 12px; }
}

/* ───────────── Компьютер поуже ───────────── */
@media (max-width: 1100px) and (min-width: 769px) {
  .bar .vk-account .oki-btn > span { display: none; }
  .bar .dlw-pill { flex-basis: 240px; }
  .discovery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  /* Карточки поуже — раскладка приложения: текст сверху, картинка по нижнему краю, кнопки нет (нажимается вся карточка). */
  /* Пропорция сцены 3:4 — картинка целиком, енот не заходит под текст. */
  .discovery .dsc { min-height: 0; height: auto; aspect-ratio: 3 / 4; padding: 16px; }
  .dsc--points .dsc-text { display: none; }
  .dsc-cta { display: none; }
  .dsc-title { font-size: 20px; line-height: 1.15; padding-right: 0; }
  .dsc-text { font-size: 13px; padding-right: 0; }
  /* Сцена во всю карточку, как в приложении; сверху — подложка под текст. */
  .dsc-bg { width: 100%; -webkit-mask-image: none; mask-image: none; }
  .dsc-scrim { display: block; }
}

/* ───────────── Телефон: экран «Главная» приложения ───────────── */
@media (max-width: 768px) {
  .page-catalog .wrap { padding: 0 16px; }
  .bar { position: sticky; top: 0; background: var(--a-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; }
  .bar.is-scrolled { border-bottom-color: transparent; box-shadow: var(--a-shadow-2); }
  .bar .wrap { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'where end' 'search search';
    gap: 10px; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 10px; }
  .brand, .city-switch, .bar .bk-open, .bar .vk-account [data-role='login-button'], .bar #profileBlock { display: none !important; }
  .bar .dlw-pill { grid-area: where; flex: none; max-width: none; min-height: 48px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .bar .dlw-pill:hover { box-shadow: none; }
  .bar-end { grid-area: end; }
  .bar .bamboo-counter-btn { height: 42px; min-height: 42px; border-radius: 14px; }
  .finder-search { grid-area: search; max-width: none; height: 46px; gap: 10px; padding: 0 4px 0 14px; border-radius: var(--a-r-md); }
  .finder-search:focus-within { box-shadow: none; }
  .finder-search > svg { width: 19px; height: 19px; }
  .finder-search input { font-size: 16px; }

  .intro { padding-top: 0; }
  .intro-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  /* Лента карточек — один в один с приложением (HomeDiscovery): три карточки одной ширины и высоты 204, две целиком
     и край третьей; текст сверху, картинка по нижнему краю, кнопки нет. */
  .discovery { display: flex; gap: 10px; margin: 12px -16px 0; padding: 0 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .discovery::-webkit-scrollbar { display: none; }
  .dsc { flex: 0 0 clamp(150px, 42vw, 200px); height: 204px; min-height: 0; padding: 14px; scroll-snap-align: start; }
  .dsc:hover { transform: none; box-shadow: none; }
  .dsc:active { transform: scale(.98); }
  .dsc-title { font-size: 18px; line-height: 21px; padding-right: 0; letter-spacing: -.3px; }
  /* Не больше двух строк — иначе подпись заходит на картинку. */
  .dsc-text { margin-top: 5px; font-size: 12px; line-height: 15px; padding-right: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .dsc > .dsc-text { margin-bottom: 0; }
  .dsc-cta { display: none; }
  .dsc-crown { width: 27px; height: 18px; }
  /* В приложении на этом месте баланс; подпись в две строки зашла бы на енота. */
  .dsc--points .dsc-text { display: none; }
  .dsc-bg { width: 100%; -webkit-mask-image: none; mask-image: none; }
  .dsc-scrim { display: block; }

  .where-nudge { margin-top: 12px; padding: 14px; }
  .where-nudge:hover { border-color: var(--a-line); box-shadow: none; }

  .cats { flex-wrap: nowrap; margin: 14px -16px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
  .cats::-webkit-scrollbar { display: none; }
  .cat:hover { border-color: var(--a-line); }

  .catalog-head { margin: 18px 0 12px; }
  .catalog-head h2 { font-size: 20px; line-height: 25px; letter-spacing: -.3px; }
  .count-pill { padding: 2px 9px; font-size: 14px; }
  .perk { display: none; }
  .grid { grid-template-columns: 1fr; gap: 16px; padding-bottom: 24px; }
  a.rc:hover { transform: none; box-shadow: var(--a-shadow-1); }
  a.rc:hover .rc-cover { transform: none; }
  .rc-media { height: 168px; }
  .rc-incart { top: calc(168px - 38px); }
  .rc-name { font-size: 18px; line-height: 23px; }
  .rc-cuisines { font-size: 13.5px; }
  .rc-facts { margin-top: 6px; }
  .rc-facts svg { width: 14px; height: 14px; }

  .far-change { flex: 1 1 100%; }
  .partner { margin-bottom: 24px; padding: 16px; }
  .partner-art { width: 60px; height: 60px; }
  .partner-art svg { width: 30px; height: 30px; }
  .partner-cta { flex: 1 1 100%; justify-content: center; }
  dialog.flt-sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--a-r-sheet) var(--a-r-sheet) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .discovery-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  a.rc:hover, a.rc:hover .rc-cover, .dsc:hover, .dsc:hover .dsc-cta svg { transform: none; }
  dialog.flt-sheet[open] { animation: none; }
}
