/* «Лучшее из доставок» — блоки главной. Вид только из темы: var(--sf-*). */
[data-sf-template] .bhm-h2 { margin: 0; font-family: var(--sf-font-heading); font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; color: var(--sf-color-text-primary); }
[data-sf-template] .bhm-h2.is-section { font-size: 26px; }
[data-sf-template] .bhm-empty { display: block; width: 100%; height: 100%; background: var(--sf-color-surface-sunken); }
[data-sf-template] .bhm-catalog-badges {
  position: absolute; inset-inline: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none;
}
[data-sf-template] .bhm-catalog-tag {
  display: block; max-width: 100%; box-sizing: border-box; padding: 2px 8px; border-radius: var(--sf-radius-pill);
  background: var(--sf-color-text-primary); color: var(--sf-color-text-inverse); font-size: 12px; font-weight: 600; line-height: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-sf-template] .bhm-catalog-badges.is-epic { z-index: 2; }
[data-sf-template] .bhm-catalog-badges.is-epic .bhm-catalog-tag { color: var(--sf-color-surface-default); }
[data-sf-template] .bhm-off { color: var(--sf-color-text-muted); font-size: 14px; font-weight: 600; }
/* Блюдо закончилось: фото приглушено, название серое (макет States2). */
[data-sf-template] .bhm-row-card.is-off img, [data-sf-template] .bhm-big.is-off img { opacity: .45; }
[data-sf-template] .bhm-row-card.is-off .bhm-row-name, [data-sf-template] .bhm-big.is-off .bhm-big-name { color: var(--sf-color-text-muted); }
/* Плашка «Сейчас закрыто» (site-notice): фон — цвет предупреждения темы поверх фона, нового цвета в теме нет. */
[data-sf-template] .bhm-shut { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 16px; border-radius: var(--sf-radius-lg);
  background: color-mix(in srgb, var(--sf-color-signal-warning) 12%, var(--sf-color-surface-default)); color: var(--sf-color-text-primary); }
[data-sf-template] .bhm-shut-icon { flex: none; display: flex; align-self: flex-start; padding-top: 1px; color: var(--sf-color-signal-warning); }
[data-sf-template] .bhm-shut-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.4; }
[data-sf-template] .bhm-shut-text b { font-size: 17px; }
[data-sf-template] .bhm-shut-btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-default);
  color: var(--sf-color-text-primary); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
[data-sf-template] .bhm-shut-btn:focus-visible { outline: 2px solid var(--sf-color-brand-default); outline-offset: 2px; }

/* order-current */
[data-sf-template] .bhm-order { padding: var(--sf-space-sm) 0; }
[data-sf-template] .bhm-order-card { display: flex; align-items: center; gap: 14px; padding: 16px 16px 16px 18px; border-radius: var(--sf-radius-lg);
  background: var(--sf-color-surface-raised); box-shadow: var(--sf-shadow-md); color: var(--sf-color-text-primary); text-decoration: none; max-width: 560px; }
[data-sf-template] .bhm-order-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
[data-sf-template] .bhm-order-title { font-family: var(--sf-font-heading); font-size: 21px; line-height: 1.15; letter-spacing: -0.01em; }
[data-sf-template] .bhm-order-sub { color: var(--sf-color-text-muted); font-size: 14px; }
[data-sf-template] .bhm-order-more { align-self: flex-start; margin-top: 6px; min-height: 34px; display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 14px;
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken); font-size: 14px; font-weight: 600; }
[data-sf-template] .bhm-ring { position: relative; flex: none; width: 60px; height: 60px; color: var(--sf-color-brand-default); }
[data-sf-template] .bhm-ring svg { position: absolute; inset: 0; }
[data-sf-template] .bhm-ring-base { fill: none; stroke: var(--sf-color-surface-sunken); stroke-width: 5; }
[data-sf-template] .bhm-ring-fill { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; }
[data-sf-template] .bhm-ring-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
[data-sf-template] .bhm-order-card.is-success .bhm-ring { color: var(--sf-color-signal-success); }
[data-sf-template] .bhm-order-card.is-warning .bhm-ring { color: var(--sf-color-signal-warning); }
[data-sf-template] .bhm-order-card.is-danger .bhm-ring { color: var(--sf-color-signal-danger); }
[data-sf-template] .bhm-order-card:focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }

/* chips */
[data-sf-template] .bhm-chips { min-width: 0; padding: var(--sf-space-sm) 0; }
/* ПК v3: метки — в ленте разделов («Ещё» — подборки, «Фильтры» — состав), строка чипов только на телефоне. */
@media (min-width: 900px) { [data-sf-template] .bhm-chips { display: none; } }
[data-sf-template] .bhm-chips-row { list-style: none; margin: 0; padding: 2px; display: flex; gap: var(--sf-space-sm); overflow-x: auto; scrollbar-width: none; }
[data-sf-template] .bhm-chips-row::-webkit-scrollbar { display: none; }
[data-sf-template] .bhm-chips-row li { flex: none; }
[data-sf-template] .bhm-chip { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; border: 1px solid var(--sf-color-line-default);
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-raised); color: var(--sf-color-text-primary); font: inherit; font-size: 14px; font-weight: 600;
  text-decoration: none; white-space: nowrap; cursor: pointer; }
[data-sf-template] .bhm-chip svg { flex: none; color: var(--sf-color-brand-default); }
/* Чип не шире экрана: длинная метка обрезается, полное название — на карточках блюд. */
[data-sf-template] .bhm-chip { max-width: min(280px, 78vw); }
[data-sf-template] .bhm-chip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-sf-template] .bhm-chip.is-on { background: var(--sf-color-text-primary); border-color: var(--sf-color-text-primary); color: var(--sf-color-text-inverse); }
[data-sf-template] .bhm-chip.is-on svg { color: var(--sf-color-text-inverse); }
[data-sf-template] .bhm-chip:focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }

/* Restaurant recommendations reuse the same menu card as order history. */
[data-sf-template] .bhm-featured { display: flex; flex-direction: column; gap: 10px; padding: var(--sf-space-md) 0; min-width: 0; }
[data-sf-template] .bhm-feature-slider { position: relative; --bhm-feature-width: clamp(114px, 35vw, 128px); }
[data-sf-template] .bhm-feature-track { display: flex; gap: 10px; margin: 0; padding: 4px 0 9px; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
[data-sf-template] .bhm-feature-track::-webkit-scrollbar { display: none; }
[data-sf-template] .bhm-feature-track > li { flex: 0 0 var(--bhm-feature-width); min-width: 0; scroll-snap-align: start; }
[data-sf-template] .bhm-feature-track .bd-card-buy { padding-top: 10px; }
[data-sf-template] .bhm-feature-track .bd-price { gap: 4px; padding-inline: 8px; font-size: 14px; }
[data-sf-template] .bhm-feature-track .bd-price:has(s) { display: inline-grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 3px;
  height: auto; min-height: 30px; padding-block: 4px; }
[data-sf-template] .bhm-feature-track .bd-price s { grid-column: 1 / -1; }
[data-sf-template] .bhm-feature-track :is(.bd-card-photo, .bd-card-name, .bhm-mini-photo, .bhm-mini-name):focus-visible {
  outline: 2px solid var(--sf-color-line-focus); outline-offset: -2px; }
[data-sf-template] .bhm-feature-arrow { display: none; }
@media (pointer: fine) {
  [data-sf-template] .bhm-feature-track.is-scrollable { cursor: grab; user-select: none; }
  [data-sf-template] .bhm-feature-track :is(a[href], button:enabled) { cursor: pointer; }
  [data-sf-template] .bhm-feature-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
  [data-sf-template] .bhm-feature-track.is-dragging :is(a, button, img) { cursor: grabbing; }
}
@media (min-width: 900px) {
  [data-sf-template] .bhm-feature-slider { --bhm-feature-width: clamp(132px, 15vw, 156px); }
  [data-sf-template] .bhm-feature-track { gap: 12px; }
  [data-sf-template] .bhm-feature-arrow { position: absolute; z-index: 1; inset-block-start: calc((var(--bhm-feature-width) - 44px) / 2 + 4px);
    width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--sf-radius-pill);
    color: var(--sf-color-text-primary); background: var(--sf-color-surface-sunken); cursor: pointer; }
  [data-sf-template] .bhm-feature-arrow.is-prev { inset-inline-start: -42px; }
  [data-sf-template] .bhm-feature-arrow.is-next { inset-inline-end: -42px; }
  [data-sf-template] .bhm-feature-arrow.is-prev svg { transform: rotate(180deg); }
  [data-sf-template] .bhm-feature-arrow[aria-disabled="true"] { color: var(--sf-color-text-muted); cursor: default; }
  [data-sf-template] .bhm-feature-arrow:focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: -2px; }
}
/* The shortcut belongs to the history block and follows its visibility. */
[data-sf-template]:not(:has(#sf-reorder)) .bhm-chips-row > li:has(a[href="#sf-reorder"]) { display: none; }

/* big card: highlighted catalog dishes */
[data-sf-template] .bhm-big { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--sf-radius-lg); overflow: hidden;
  background: color-mix(in srgb, var(--sf-color-brand-default) 12%, var(--sf-color-surface-raised)); }
[data-sf-template] .bhm-big-photo { position: relative; display: block; height: 200px; }
[data-sf-template] .bhm-big-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
[data-sf-template] .bhm-big-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
[data-sf-template] .bhm-big-name { min-height: 44px; font-family: var(--sf-font-heading); font-size: 20px; font-weight: 700; line-height: 1.15;
  color: var(--sf-color-text-primary); text-decoration: none; }
[data-sf-template] .bhm-big-text { color: var(--sf-color-text-muted); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
[data-sf-template] .bhm-big-buy { align-self: flex-start; margin-top: 4px; min-height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 18px; border: 0;
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
[data-sf-template] .bhm-big-buy s { color: var(--sf-color-text-muted); font-weight: 500; }
[data-sf-template] .bhm-big-buy svg { color: var(--sf-color-brand-default); }
@media (hover: hover) and (pointer: fine) {
  [data-sf-template] .bhm-big-buy:hover { background: color-mix(in srgb, var(--sf-color-brand-default) 10%, var(--sf-color-surface-sunken)); }
}
[data-sf-template] .bhm-big-buy:focus-visible, [data-sf-template] .bhm-big-photo:focus-visible, [data-sf-template] .bhm-big-name:focus-visible {
  outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }
@media (min-width: 900px) {
  [data-sf-template] .bhm-big.is-wide { display: grid; grid-template-columns: minmax(0, 340px) minmax(240px, 1fr); }
  [data-sf-template] .bhm-big.is-wide .bhm-big-photo { height: auto; aspect-ratio: 1 / 1; }
  [data-sf-template] .bhm-big.is-wide .bhm-big-body { padding: 24px 32px; justify-content: center; }
  [data-sf-template] .bhm-big.is-wide .bhm-big-name { font-size: 26px; }
}

/* reorder and ribbons */
[data-sf-template] .bhm-reorder { display: flex; flex-direction: column; gap: 14px; padding: var(--sf-space-md) 0; min-width: 0; scroll-margin-top: 96px; }
[data-sf-template] .bhm-ribbon { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
[data-sf-template] .bhm-ribbon::-webkit-scrollbar { display: none; }
[data-sf-template] .bhm-ribbon > li { flex: none; width: 132px; }
@media (min-width: 900px) { [data-sf-template] .bhm-ribbon > li { width: 168px; } [data-sf-template] .bhm-ribbon { gap: 16px; } }

/* our own small card, when no menu-card block is assigned */
[data-sf-template] .bhm-mini { display: flex; flex-direction: column; gap: 6px; }
[data-sf-template] .bhm-mini-photo { display: block; aspect-ratio: 1; border-radius: var(--sf-radius-lg); overflow: hidden; background: var(--sf-color-surface-sunken); }
[data-sf-template] .bhm-mini-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
[data-sf-template] .bhm-mini-name { color: var(--sf-color-text-primary); text-decoration: none; font-size: 13px; line-height: 1.25; }
[data-sf-template] .bhm-mini-buy { align-self: flex-start; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; border: 0;
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); font: inherit; font-weight: 600; cursor: pointer; }

/* catalog */
[data-sf-template] .bhm-cat { display: flex; flex-direction: column; gap: var(--sf-space-2xl); padding: var(--sf-space-md) 0 var(--sf-space-2xl); min-width: 0; }
[data-sf-template] .bhm-cat.is-loading { min-height: 60vh; }
[data-sf-template] .bhm-section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* Keep the section heading next to the pinned navigation, including browser fragment links. */
[data-sf-template] .bhm-cat > .bhm-section {
  scroll-margin-top: calc(var(--bhm-sticky-height, var(--bhm-sticky-fallback, 0px)) + var(--sf-space-md));
}
@media (min-width: 900px) {
  [data-sf-template]:has(.d-bar) .bhm-cat { --bhm-sticky-fallback: 69px; }
}
[data-sf-template] .bhm-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
[data-sf-template] .bhm-grid > .is-wide, [data-sf-template] .bhm-grid > .is-row, [data-sf-template] .bhm-grid > .is-banner { grid-column: 1 / -1; }
[data-sf-template] .bhm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
[data-sf-template] .bhm-item { min-width: 0; }
@media (min-width: 900px) {
  [data-sf-template] .bhm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; }
  [data-sf-template] .bhm-grid > .is-wide { grid-column: span 2; }
  [data-sf-template] .bhm-grid > .is-row { grid-column: span 2; }
  [data-sf-template] .bhm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
  [data-sf-template] .bhm-list > .is-wide { grid-column: 1 / -1; }
}
[data-sf-template] .bhm-banner { display: block; border-radius: var(--sf-radius-lg); overflow: hidden; }
[data-sf-template] .bhm-banner img { display: block; width: 100%; height: auto; }

/* row card: photo left, composition, price */
[data-sf-template] .bhm-row-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: center; }
[data-sf-template] .bhm-row-photo { position: relative; display: block; width: 116px; height: 116px; border-radius: var(--sf-radius-lg); overflow: hidden; background: var(--sf-color-surface-sunken); }
[data-sf-template] .bhm-row-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
[data-sf-template] .bhm-row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
[data-sf-template] .bhm-row-name { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 44px;
  font-size: 16px; font-weight: 700; color: var(--sf-color-text-primary); text-decoration: none; overflow-wrap: anywhere; }
[data-sf-template] .bhm-row-text { color: var(--sf-color-text-muted); font-size: 13px; font-weight: 400; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
[data-sf-template] .bhm-row-buy { align-self: flex-start; margin-top: 4px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; border: 0;
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
[data-sf-template] .bhm-row-buy s { color: var(--sf-color-text-muted); font-weight: 500; }
[data-sf-template] .bhm-row-buy svg { color: var(--sf-color-brand-default); }
[data-sf-template] .bhm-row-buy:focus-visible, [data-sf-template] .bhm-row-photo:focus-visible, [data-sf-template] .bhm-row-name:focus-visible,
[data-sf-template] .bhm-mini-buy:focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }
@media (min-width: 900px) { [data-sf-template] .bhm-row-card { grid-template-columns: 140px minmax(0, 1fr); } [data-sf-template] .bhm-row-photo { width: 140px; height: 140px; } }
/* ПК, проверка вёрстки 16.11: в двух колонках списка названия соседей на одной линии (было по центру фото — при разной
   длине описания они расходились); широкая карточка растягивается на высоту ряда — под ней оставалась дыра. */
@media (min-width: 900px) {
  [data-sf-template] .bhm-row-card { align-items: start; }
  [data-sf-template] .bhm-row-body { padding-top: 10px; }
  [data-sf-template] .bhm-item.is-wide { display: flex; }
  [data-sf-template] .bhm-item.is-wide > .bhm-big.is-wide { flex: 1; min-width: 0; }
  [data-sf-template] .bhm-item.is-wide > .bhm-big.is-wide .bhm-big-photo { height: 100%; aspect-ratio: auto; min-height: 340px; }
}

/* Compact desktop grid: keep the featured dish beside the regular card at comparable heights. */
@media (min-width: 900px) and (max-width: 1119px) {
  [data-sf-template] .bhm-grid > .bhm-item.is-wide:is(:not(.is-epic), .is-epic-left) > .bhm-big.is-wide {
    grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
    align-items: center;
  }
  [data-sf-template] .bhm-grid > .bhm-item.is-wide:is(:not(.is-epic), .is-epic-left) > .bhm-big.is-wide .bhm-big-photo {
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    margin-inline-start: 10px;
    overflow: hidden;
    border-radius: var(--sf-radius-md);
  }
  [data-sf-template] .bhm-grid > .bhm-item.is-wide:is(:not(.is-epic), .is-epic-left) > .bhm-big.is-wide .bhm-big-photo img {
    aspect-ratio: 1;
    object-fit: contain;
  }
  [data-sf-template] .bhm-grid > .bhm-item.is-wide:is(:not(.is-epic), .is-epic-left) > .bhm-big.is-wide .bhm-big-body {
    min-width: 0;
    gap: 4px;
    padding: 30px 12px 14px;
  }
  [data-sf-template] .bhm-grid > .bhm-item.is-wide:is(:not(.is-epic), .is-epic-left) > .bhm-big.is-wide .bhm-big-name {
    min-height: 0;
    font-size: 20px;
    overflow-wrap: anywhere;
  }
  [data-sf-template] .bhm-grid > .bhm-item.is-wide:is(:not(.is-epic), .is-epic-left) > .bhm-big.is-wide .bhm-big-text {
    font-size: 13px;
  }
}

/* link section and states */
[data-sf-template] .bhm-link { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--sf-radius-lg); background: var(--sf-color-surface-raised);
  border: 1px solid var(--sf-color-line-default); color: var(--sf-color-text-primary); text-decoration: none; font-size: 18px; }
[data-sf-template] .bhm-link img { width: 64px; height: 64px; border-radius: var(--sf-radius-md); object-fit: cover; }
[data-sf-template] .bhm-link b { flex: 1; }
[data-sf-template] .bhm-state { align-items: center; text-align: center; gap: 12px; padding: var(--sf-space-2xl) var(--sf-space-lg); }
[data-sf-template] .bhm-state-btn { min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken);
  color: var(--sf-color-text-primary); font: inherit; font-weight: 600; cursor: pointer; }

/* Телефон (навык mobile-native, 16.11.2026): отклик на нажатие, подпись кнопки не выделяется долгим нажатием. */
[data-sf-template] :is(.bhm-big-buy, .bhm-row-buy, .bhm-mini-buy, .bhm-state-btn, .bhm-chip) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[data-sf-template] :is(.bhm-big-buy, .bhm-row-buy, .bhm-mini-buy, .bhm-state-btn, .bhm-chip):active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: no-preference) {
  [data-sf-template] :is(.bhm-big-buy, .bhm-row-buy, .bhm-mini-buy, .bhm-state-btn, .bhm-chip) { transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
}
[data-sf-template] .bhm-big-buy { white-space: nowrap; }

/* ПК: три колонки рядом с колонкой корзины (макет v3), четыре — на очень широком экране. */
@media (min-width: 1600px) { [data-sf-template] .bhm-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Эпичная карточка (16.11): фото — весь фон, блюдо сверху; квадрат и горизонталь — ниже то же фото, отражённое и размытое.
   Карточка на 14 px ниже ячейки: цена с внутренним отступом встаёт на одну линию с ценами обычных карточек ряда. */
[data-sf-template] .bhm-item.is-epic { display: flex; }
/* Reserve the same grid cell when a failed photo switches to the standard menu card. */
[data-sf-template] .bhm-item.is-epic:not(.is-wide) { display: grid; grid-template-columns: minmax(0, 1fr); }
[data-sf-template] .bhm-item.is-epic:not(.is-wide)::before { content: ''; grid-area: 1 / 1; aspect-ratio: 7 / 10; margin-bottom: -14px; pointer-events: none; }
[data-sf-template] .bhm-item.is-epic:not(.is-wide) :is(.bhm-epic, .bd-card, .bhm-mini) { grid-area: 1 / 1; min-width: 0; }
[data-sf-template] .bhm-grid > .bhm-item.is-epic:not(.is-wide) > .bhm-epic { width: 100%; }
[data-sf-template] .bhm-grid > .bhm-item.is-epic:not(.is-wide) .bhm-epic-buy { position: relative; }
[data-sf-template] .bhm-grid > .bhm-item.is-epic:not(.is-wide) .bhm-epic-buy::after {
  content: ""; position: absolute; inset: -7px 0;
}
[data-sf-template] .bhm-item.is-epic.is-wide { min-height: 460px; }
[data-sf-template] .bhm-epic { position: relative; flex: 1; min-width: 0; aspect-ratio: 7 / 10; height: calc(100% + 14px); margin-bottom: -14px; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: flex-end; border-radius: var(--sf-radius-card); overflow: hidden; isolation: isolate;
  background: var(--sf-color-text-primary); color: var(--sf-color-text-inverse); font-size: 13px; line-height: 16px; }
[data-sf-template] .bhm-epic-photo { position: absolute; inset: 0; z-index: 0; display: block; overflow: hidden; }
/* .bhm-epic в селекторе — сильнее правила каркаса .fm-root img { height: auto }: подложка на всю карточку. */
[data-sf-template] .bhm-epic .bhm-epic-fill { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transform: scale(1.3, -1.3); filter: blur(24px) saturate(1.15); }
[data-sf-template] .bhm-epic-img { position: absolute; left: 0; top: 0; display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, var(--sf-color-text-primary) 76%, transparent); mask-image: linear-gradient(to bottom, var(--sf-color-text-primary) 76%, transparent); }
[data-sf-template] .bhm-epic.is-tall .bhm-epic-img { height: 100%; object-fit: cover; object-position: top; -webkit-mask-image: none; mask-image: none; }
[data-sf-template] .bhm-epic-body { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 14px; }
[data-sf-template] .bhm-epic-body::before { content: ''; position: absolute; inset: -56px 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--sf-color-text-primary) 76%, transparent) 56px); }
[data-sf-template] .bhm-epic .bhm-epic-name { padding: 0 2px; color: inherit; font-weight: 400; text-decoration: none; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
[data-sf-template] .bhm-epic-text { padding: 0 2px; }
[data-sf-template] .bhm-epic .bhm-off { color: var(--sf-color-text-inverse); }
[data-sf-template] .bhm-epic-buy { align-self: flex-start; margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 12px; border: 0;
  border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); font: inherit; font-size: 15px; line-height: 1;
  font-weight: 600; white-space: nowrap; cursor: pointer; touch-action: manipulation; }
[data-sf-template] .bhm-epic-buy svg { color: var(--sf-color-brand-default); stroke-width: 1.8; }
[data-sf-template] .bhm-epic-buy s { color: var(--sf-color-text-muted); font-weight: 400; font-size: 13px; }
[data-sf-template] .bhm-epic.is-big { aspect-ratio: auto; height: auto; margin-bottom: 0; }
[data-sf-template] .bhm-epic.is-big .bhm-epic-body { padding: 20px; gap: 8px; }
[data-sf-template] .bhm-epic.is-big .bhm-epic-name { font-size: 26px; line-height: 1.15; font-weight: 700; }
[data-sf-template] .bhm-epic.is-big .bhm-epic-text { font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Крупная эпичная: название целиком до трёх строк (по нему заказывают), описание — две; на телефоне текст не ложится на блюдо. */
[data-sf-template] .bhm-epic.is-big .bhm-epic-name { -webkit-line-clamp: 3; }
[data-sf-template] .bhm-epic.is-big.is-long .bhm-epic-name { font-size: 20px; -webkit-line-clamp: 4; }
[data-sf-template] .bhm-item.is-epic > :not(.bhm-epic) { flex: 1; min-width: 0; }
[data-sf-template] .bhm-state-text { color: var(--sf-color-text-secondary); font-size: 15px; }
/* Две колонки зависят от места под карточку, которое сужается рядом с корзиной. */
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout { padding-top: min(72vw, 264px); }
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout .bhm-epic-body { max-width: none; padding: 20px; }
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout .bhm-epic-body::before { right: 0; -webkit-mask-image: none; mask-image: none; }
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout .bhm-epic-photo:focus-visible { outline-offset: -3px; }
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout.is-tall .bhm-epic-img {
  left: 0; right: auto; width: 100%; height: 100%; object-fit: cover; object-position: top;
  -webkit-mask-image: none; mask-image: none;
}
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout:not(.is-tall) .bhm-epic-img {
  left: 0; right: 0; margin: 0 auto; width: min(80%, 290px); height: auto; object-fit: contain;
  -webkit-mask-image: linear-gradient(to bottom, var(--sf-color-text-primary) 76%, transparent), linear-gradient(to right, transparent, var(--sf-color-text-primary) 14%, var(--sf-color-text-primary) 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, var(--sf-color-text-primary) 76%, transparent), linear-gradient(to right, transparent, var(--sf-color-text-primary) 14%, var(--sf-color-text-primary) 86%, transparent);
  mask-composite: intersect;
}
@media (max-width: 899px) {
  [data-sf-template] .bhm-item.is-epic.is-wide > .bhm-big > .bhm-big-photo { flex: 1 0 200px; }
}
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout.is-side { padding-top: 0; }
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout.is-side:is(.is-tall, .is-square, .is-wide) .bhm-epic-img {
  left: auto; right: 0; top: 50%; margin: 0; width: auto; height: auto; max-width: 53%; max-height: 100%; translate: 0 -50%;
  -webkit-mask-image: linear-gradient(to right, transparent, var(--sf-color-text-primary) 20%), linear-gradient(to bottom, transparent, var(--sf-color-text-primary) 9%, var(--sf-color-text-primary) 91%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, var(--sf-color-text-primary) 20%), linear-gradient(to bottom, transparent, var(--sf-color-text-primary) 9%, var(--sf-color-text-primary) 91%, transparent);
  mask-composite: intersect;
}
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout.is-side .bhm-epic-body { box-sizing: border-box; max-width: 47%; padding: 32px; }
[data-sf-template] .bhm-epic.is-big.bhm-epic-layout.is-side .bhm-epic-body::before { right: -96px;
  -webkit-mask-image: linear-gradient(to right, var(--sf-color-text-primary) 68%, transparent);
  mask-image: linear-gradient(to right, var(--sf-color-text-primary) 68%, transparent);
}
/* In a desktop list a promoted dish uses the same grid cell as its neighbours. */
@media (min-width: 900px) and (max-width: 1119px) {
  [data-sf-template] .bhm-list:has(> .is-epic-compact) { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 900px) {
  [data-sf-template] .bhm-list > .bhm-item.is-wide.is-epic-compact {
    --bhm-compact-media: min(44%, 152px);
    grid-column: auto; min-height: 148px;
  }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big.bhm-epic-layout { padding-top: 0; }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big::before {
    content: ''; position: absolute; z-index: 1; inset: 0; pointer-events: none;
    background: linear-gradient(to right,
      color-mix(in srgb, var(--sf-color-text-primary) 79%, transparent),
      color-mix(in srgb, var(--sf-color-text-primary) 71%, transparent) calc(100% - var(--bhm-compact-media) - 10px),
      transparent calc(100% - var(--bhm-compact-media) + 48px));
  }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big.bhm-epic-layout .bhm-epic-body {
    box-sizing: border-box; width: calc(100% - var(--bhm-compact-media)); max-width: none;
    padding: 32px 14px 12px; gap: 4px;
  }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big .bhm-epic-body::before { content: none; }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big .bhm-epic-name {
    font-size: 18px; line-height: 1.2; min-height: 24px; -webkit-line-clamp: 2;
  }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big .bhm-epic-text { font-size: 13px; line-height: 17px; }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big.bhm-epic-layout:is(.is-square, .is-tall, .is-wide) .bhm-epic-img {
    left: auto; right: 8px; top: 50%; margin: 0;
    width: auto; height: auto; max-width: calc(var(--bhm-compact-media) - 8px); max-height: calc(100% - 16px);
    translate: 0 -50%; object-fit: contain;
    -webkit-mask-image: linear-gradient(to right, transparent, var(--sf-color-text-primary) 20%), linear-gradient(to bottom, transparent, var(--sf-color-text-primary) 8%, var(--sf-color-text-primary) 92%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, var(--sf-color-text-primary) 20%), linear-gradient(to bottom, transparent, var(--sf-color-text-primary) 8%, var(--sf-color-text-primary) 92%, transparent);
    mask-composite: intersect;
  }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-big-buy { height: auto; min-height: 32px; margin-top: 3px; font-size: 14px; padding: 4px 10px; }
  [data-sf-template] .bhm-item.is-epic-compact > .bhm-big.is-wide { display: flex; flex-direction: row; align-items: center; gap: 0; }
  [data-sf-template] .bhm-list > .bhm-item.is-wide.is-epic-compact > .bhm-big.is-wide .bhm-big-photo { flex: 0 0 140px; height: 140px; min-height: 0; aspect-ratio: 1; }
  [data-sf-template] .bhm-item.is-epic-compact > .bhm-big.is-wide .bhm-big-body { flex: 1; min-width: 0; padding: 10px 14px; gap: 4px; }
  [data-sf-template] .bhm-item.is-epic-compact > .bhm-big.is-wide .bhm-big-name { font-size: 18px; min-height: 24px; }
  [data-sf-template] .bhm-item.is-epic-compact > .bhm-big.is-wide .bhm-big-text { font-size: 13px; line-height: 17px; }
}

@media (min-width: 1120px) {
  [data-sf-template] .bhm-list > .bhm-item.is-wide.is-epic-compact {
    --bhm-compact-media: min(49%, 280px);
    /* Two 140 px dish rows plus the 28 px gap of the desktop list. */
    grid-row: span 2; min-height: 308px;
  }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big.bhm-epic-layout { justify-content: center; }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big.bhm-epic-layout .bhm-epic-body { padding-block: 16px; }
  [data-sf-template] .bhm-item.is-epic-compact .bhm-epic.is-big .bhm-epic-text { -webkit-line-clamp: 3; }
}
/* The same photo supplies the backdrop and the foreground, with room for the dish on the left. */
[data-sf-template] .bhm-item.is-epic.is-wide.is-epic-left {
  --bhm-left-media: min(44%, 320px);
  min-height: 0;
}
[data-sf-template] .is-epic-left .bhm-epic.is-big.bhm-epic-layout {
  min-height: 180px;
  padding-top: 0;
  justify-content: center;
}
[data-sf-template] .is-epic-left .bhm-epic-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to left,
    color-mix(in srgb, var(--sf-color-text-primary) 84%, transparent),
    color-mix(in srgb, var(--sf-color-text-primary) 76%, transparent) calc(100% - var(--bhm-left-media) - 12px),
    transparent calc(100% - var(--bhm-left-media) + 40px));
}
[data-sf-template] .is-epic-left .bhm-epic-img { z-index: 2; }
[data-sf-template] .is-epic-left .bhm-epic.is-big.bhm-epic-layout:is(.is-tall, .is-square, .is-wide) .bhm-epic-img {
  inset: 50% auto auto 0;
  margin: 0;
  width: var(--bhm-left-media);
  height: auto;
  max-height: 100%;
  translate: 0 -50%;
  object-fit: contain;
  -webkit-mask-image: linear-gradient(to right, var(--sf-color-text-primary) 88%, transparent),
    linear-gradient(to bottom, transparent, var(--sf-color-text-primary) 9%, var(--sf-color-text-primary) 91%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, var(--sf-color-text-primary) 88%, transparent),
    linear-gradient(to bottom, transparent, var(--sf-color-text-primary) 9%, var(--sf-color-text-primary) 91%, transparent);
  mask-composite: intersect;
}
[data-sf-template] .is-epic-left .bhm-epic.is-big.bhm-epic-layout .bhm-epic-body {
  box-sizing: border-box;
  margin-inline-start: var(--bhm-left-media);
  width: calc(100% - var(--bhm-left-media));
  max-width: none;
  padding: 16px 12px;
  gap: 4px;
  pointer-events: none;
}
[data-sf-template] .is-epic-left .bhm-epic-body :is(a, button) { pointer-events: auto; }
[data-sf-template] .is-epic-left .bhm-epic.is-big.bhm-epic-layout .bhm-epic-body::before { content: none; }
[data-sf-template] .is-epic-left .bhm-epic.is-big .bhm-epic-name {
  min-height: 0;
  font-size: clamp(18px, 2vw, 26px);
}
[data-sf-template] .is-epic-left .bhm-epic.is-big .bhm-epic-text {
  font-size: 13px;
  -webkit-line-clamp: 3;
}
[data-sf-template] .bhm-epic :is(a, button):focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  [data-sf-template] .bhm-epic-buy:hover { background: color-mix(in srgb, var(--sf-color-brand-default) 10%, var(--sf-color-surface-sunken)); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  [data-sf-template] .bhm-epic-img { transition: transform 600ms cubic-bezier(.23, 1, .32, 1); transform-origin: 50% 30%; }
  [data-sf-template] .bhm-epic:hover .bhm-epic-img { transform: scale(1.04); }
}
[data-sf-template] .bhm-epic-buy:active:not(:disabled) { transform: scale(.97); }
/* Нажатие, проход 2 (16.11): отклик у всего, что нажимается; при prefers-reduced-motion переходов нет. */
[data-sf-template] :is(.bhm-shut-btn):active:not(:disabled) { transform: scale(.97); }
[data-sf-template] :is(.bhm-banner, .bhm-big-name, .bhm-big-photo, .bhm-epic-name, .bhm-epic-photo, .bhm-link, .bhm-mini-name, .bhm-mini-photo, .bhm-order-card, .bhm-row-name, .bhm-row-photo):active { opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  [data-sf-template] :is(.bhm-shut-btn) { transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
  [data-sf-template] :is(.bhm-banner, .bhm-big-name, .bhm-big-photo, .bhm-epic-name, .bhm-epic-photo, .bhm-link, .bhm-mini-name, .bhm-mini-photo, .bhm-order-card, .bhm-row-name, .bhm-row-photo) { transition: opacity 120ms cubic-bezier(.23, 1, .32, 1); }
}
/* Зона нажатия цены не меньше 44 px: кнопка остаётся 32 px в строке и 42 px у крупной, зона растянута невидимым
   слоем (честный замер uicheck 17.11). */
[data-sf-template] :is(.bhm-row-buy, .bhm-big-buy) { position: relative; }
[data-sf-template] .bhm-row-buy::after { content: ""; position: absolute; inset: -6px 0; }
[data-sf-template] .bhm-big-buy::after { content: ""; position: absolute; inset: -1px 0; }
