/* Акции на главной — вид только из темы (--sf-*). Телефон — лента чипов с прокруткой вбок, ПК — ровная сетка.
   Приставка bof-: bo- занята блоком заказа. */
[data-sf-template] .bof { box-sizing: border-box; margin: 4px 0 16px; color: var(--sf-color-text-primary); font-family: var(--sf-font-body); }
[data-sf-template] .bof *, [data-sf-template] .bof-sheet * { box-sizing: border-box; }
[data-sf-template] .bof-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
[data-sf-template] .bof-row::-webkit-scrollbar { display: none; }
[data-sf-template] .bof-chip { flex: none; display: flex; align-items: center; gap: 10px; min-height: 60px; max-width: 300px; margin: 0; padding: 8px 10px 8px 8px;
  border: 0; border-radius: var(--sf-radius-md); background: color-mix(in srgb, var(--sf-color-brand-default) 10%, var(--sf-color-surface-default));
  font: inherit; color: inherit; text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[data-sf-template] .bof-chip.is-still { cursor: default; }
[data-sf-template] .bof-chip:active:not(.is-still) { transform: scale(.97); }
[data-sf-template] .bof-chip:focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: -2px; }
[data-sf-template] .bof-turn:focus-visible, [data-sf-template] .bof-sheet :is(button, a):focus-visible { outline: 2px solid var(--sf-color-line-focus); outline-offset: 2px; }
[data-sf-template] .bof-turn { display: none; }
@media (hover: hover) and (pointer: fine) {
  [data-sf-template] .bof-chip:hover:not(.is-still) { background: color-mix(in srgb, var(--sf-color-brand-default) 17%, var(--sf-color-surface-default)); }
  [data-sf-template] .bof-cta:hover { background: var(--sf-color-brand-hover); }
}
[data-sf-template] .bof-ico { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sf-color-surface-raised); color: var(--sf-color-brand-default); }
/* Картинки плашки: селектор сильнее правила каркаса для img (height: auto), иначе высота не держится. */
[data-sf-template] .bof-chip .bof-ico img { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
[data-sf-template] .bof-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* Название — до двух строк: чип шире 300 px не становится, длинное название переносится. */
[data-sf-template] .bof-text b { font-size: 15px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
[data-sf-template] .bof-text span { font-size: 13px; line-height: 1.3; color: var(--sf-color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-sf-template] .bof-go { flex: none; display: grid; margin-left: 2px; color: var(--sf-color-text-muted); }
/* Своя картинка акции — три вида по настройке блока. В кружке (is-thumb) — правило выше. */
/* У правого края: текст слева, фото во всю высоту плашки. */
[data-sf-template] .bof-chip.is-side { position: relative; overflow: hidden; padding-right: 78px; }
[data-sf-template] .bof-chip img.bof-side { position: absolute; top: 0; right: 0; width: 68px; height: 100%; max-width: none; object-fit: cover; }
/* На телефоне у плашки с фото справа значок убираем: текст важнее, а картинка уже говорит, что это за акция. */
@media (max-width: 899px) {
  [data-sf-template] .bof-chip.is-side { padding-left: 14px; }
  [data-sf-template] .bof-chip.is-side .bof-ico { display: none; }
}
/* Фоном: картинка под текстом и затемнение из цвета текста темы — белый текст читается на любой картинке (не меньше 4,5:1). */
[data-sf-template] .bof-chip.is-back { position: relative; overflow: hidden; padding-left: 14px; background: var(--sf-color-text-primary); color: var(--sf-color-text-inverse); }
[data-sf-template] .bof-chip img.bof-back { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
[data-sf-template] .bof-chip.is-back::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sf-color-text-primary) 80%, transparent), color-mix(in srgb, var(--sf-color-text-primary) 62%, transparent)); }
[data-sf-template] .bof-chip.is-back :is(.bof-text, .bof-go) { position: relative; z-index: 2; }
[data-sf-template] .bof-chip.is-back :is(.bof-text span, .bof-go) { color: var(--sf-color-text-inverse); }
/* Одна акция — во всю ширину, две — пополам. */
[data-sf-template] .bof-row:is(.n1, .n2) .bof-chip { flex: 1 1 0; max-width: none; min-width: 0; }
[data-sf-template] .bof-row:is(.n1, .n2) .bof-go { margin-left: auto; }
[data-sf-template] .bof-row.n2 .bof-text span { white-space: normal; overflow-wrap: anywhere; }
[data-sf-template] .bof-row.n2 .bof-text b { -webkit-line-clamp: 3; }
[data-sf-template] .bof-row.n2 .bof-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
[data-sf-template] .bof-row.n2 .bof-ico { display: none; }
[data-sf-template] .bof-row.n2 .bof-chip { padding-left: 14px; }
[data-sf-template] .bof-row.n2 .bof-chip.is-thumb { padding-left: 8px; }
[data-sf-template] .bof-row.n2 .bof-chip.is-thumb .bof-ico { display: grid; }

/* ПК: слайдер — три акции в ряд, остальные листаются стрелками (слово владельца 17.11); высота ряда не растёт,
   сколько бы акций ни было. Чип всегда в треть ряда, даже если акция одна. */
@media (min-width: 900px) {
  [data-sf-template] .bof { position: relative; margin: 0 0 24px; }
  [data-sf-template] .bof-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 3); scroll-snap-type: x mandatory; }
  [data-sf-template] .bof-chip { max-width: none; min-height: 64px; padding: 10px 12px 10px 10px; scroll-snap-align: start; }
  /* Шеврон чипа на ПК не нужен: рядом стрелка слайдера, два одинаковых значка путают; нажимаемость показывает наведение. */
  [data-sf-template] .bof-go { display: none; }
  [data-sf-template] .bof-row.n2 .bof-ico { display: grid; }
  [data-sf-template] .bof-row.n2 .bof-chip { padding-left: 10px; }
  [data-sf-template] .bof-turn { position: absolute; z-index: 1; top: calc(50% - 20px); width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
    background: var(--sf-color-surface-raised); color: var(--sf-color-text-primary); box-shadow: var(--sf-shadow-md); cursor: pointer; touch-action: manipulation; }
  [data-sf-template] .bof-turn.is-prev { left: -20px; }
  [data-sf-template] .bof-turn.is-next { right: -20px; }
  [data-sf-template] .bof-turn:active { transform: scale(.97); }
}
/* В узкой колонке меню оставляем три акции, а краткое условие переносим внутри карточки. */
@media (min-width: 900px) and (max-width: 1279px) {
  [data-sf-template] .bof-chip { min-width: 0; min-height: 72px; gap: 8px; }
  [data-sf-template] .bof-ico, [data-sf-template] .bof-chip .bof-ico img { width: 34px; height: 34px; }
  [data-sf-template] .bof-ico svg { width: 18px; height: 18px; }
  [data-sf-template] .bof-chip.is-side { padding-right: 56px; padding-left: 12px; }
  [data-sf-template] .bof-chip.is-side .bof-ico { display: none; }
  [data-sf-template] .bof-chip img.bof-side { width: 46px; }
  [data-sf-template] .bof-turn.is-prev { left: -28px; }
  [data-sf-template] .bof-turn.is-next { right: -28px; }
  [data-sf-template] .bof-chip .bof-text > :is(b, span) { display: block; -webkit-line-clamp: unset; overflow: visible; white-space: normal; overflow-wrap: anywhere; }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  [data-sf-template] .bof-row { scroll-behavior: smooth; }
  [data-sf-template] .bof-turn { transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
}

/* Шторка акции (телефон) и окно (ПК). */
[data-sf-template] .bof-veil { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center; background: var(--sf-color-surface-scrim); }
[data-sf-template] .bof-sheet { position: relative; width: 100%; max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain; padding: 12px 20px max(24px, env(safe-area-inset-bottom));
  border-radius: var(--sf-radius-lg) var(--sf-radius-lg) 0 0; background: var(--sf-color-surface-raised); color: var(--sf-color-text-primary); box-shadow: var(--sf-shadow-lg);
  outline: none; font-family: var(--sf-font-body); text-align: left; }
[data-sf-template] .bof-grab { display: block; width: 36px; height: 4px; margin: 0 auto 12px; border-radius: var(--sf-radius-pill); background: var(--sf-color-line-strong); }
[data-sf-template] .bof-x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); cursor: pointer; touch-action: manipulation; }
[data-sf-template] .bof-pic { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; margin-bottom: 14px; border-radius: var(--sf-radius-md); object-fit: cover; background: var(--sf-color-surface-sunken); }
[data-sf-template] .bof-x.on-pic { top: 36px; right: 28px; background: var(--sf-color-surface-raised); box-shadow: var(--sf-shadow-sm); }
[data-sf-template] .bof-pic ~ .bof-head { padding-right: 0; }
[data-sf-template] .bof-head { display: flex; align-items: center; gap: 12px; min-height: 48px; padding-right: 52px; }
[data-sf-template] .bof-head .bof-ico { background: color-mix(in srgb, var(--sf-color-brand-default) 10%, var(--sf-color-surface-default)); }
[data-sf-template] .bof-head h2 { min-width: 0; margin: 0; font-family: var(--sf-font-heading); font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
[data-sf-template] .bof-desc { margin: 12px 0 0; font-size: 15px; line-height: 1.45; color: var(--sf-color-text-secondary); white-space: pre-line; overflow-wrap: anywhere; }
[data-sf-template] .bof-until { margin: 6px 0 0; font-size: 13px; line-height: 1.35; color: var(--sf-color-text-muted); }
[data-sf-template] .bof-cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 20px; padding: 0 20px; border: 0; border-radius: var(--sf-radius-pill);
  background: var(--sf-color-brand-default); color: var(--sf-color-text-inverse); font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; text-align: center; cursor: pointer;
  box-shadow: var(--sf-shadow-control); touch-action: manipulation; -webkit-user-select: none; user-select: none; }
[data-sf-template] .bof-cta.is-soft { background: var(--sf-color-surface-sunken); color: var(--sf-color-text-primary); box-shadow: none; }
[data-sf-template] :is(.bof-cta, .bof-x):active { transform: scale(.97); }
@media (prefers-reduced-motion: no-preference) {
  [data-sf-template] :is(.bof-chip, .bof-cta, .bof-x) { transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
}
@media (min-width: 900px) {
  [data-sf-template] .bof-veil { align-items: center; }
  [data-sf-template] .bof-sheet { width: 480px; max-height: 86vh; max-height: 86dvh; padding: 24px; border-radius: var(--sf-radius-lg); }
  [data-sf-template] .bof-grab { display: none; }
  [data-sf-template] .bof-x { top: 20px; right: 20px; }
  [data-sf-template] .bof-x.on-pic { top: 32px; right: 32px; }
}
