/* Tagam Go — unified partner storefront */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #e8e8e8;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.sf-preview-bar {
  background: #111;
  color: #fff;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
}

.sf-app {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1320px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.sf-content-gutter {
  --sf-gutter: clamp(1.25rem, 4.5vw, 4rem);
}

/* ── Sticky chrome: app banner + header ── */
.sf-chrome {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
}

/* ── Header ── */
.sf-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem var(--sf-gutter, clamp(1.25rem, 4.5vw, 4rem));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #f0f0f0;
}

.sf-header__left,
.sf-header__right {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.sf-header__right { justify-content: flex-end; }

/* Mobile Flutter: ☰ | Brand | 🔍 — desktop: full toolbar */
.sf-header__mobile-only { display: inline-flex; }
.sf-header__desktop-only { display: none !important; }

@media (min-width: 900px) {
  .sf-header__mobile-only { display: none !important; }
  .sf-header__desktop-only { display: inline-flex !important; }
  .sf-header__contacts.sf-header__desktop-only { display: inline-flex !important; }
  .sf-header__phone.sf-header__desktop-only:not([hidden]) { display: inline-flex !important; }
  .sf-cart-pill.sf-header__desktop-only:not([hidden]) { display: inline-flex !important; }
}

.sf-header__phone {
  display: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
  padding: 0.35rem 0.45rem;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.sf-header__phone[hidden] { display: none !important; }

.sf-header__contacts {
  display: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: #333;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  white-space: nowrap;
}

.sf-header__contacts:hover { background: #f5f5f5; }

.sf-header__brand {
  display: flex;
  justify-content: center;
  align-items: center;
}

.sf-header__logo { height: 26px; width: auto; object-fit: contain; }

.sf-header__title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sf-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
}

.sf-icon-btn:hover { background: #f5f5f5; }
.sf-icon-btn svg { width: 20px; height: 20px; }

.sf-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #333;
}

.sf-login-btn:hover { background: #f5f5f5; }
.sf-login-btn svg { width: 18px; height: 18px; }

.sf-login-btn span { display: none; }

@media (min-width: 900px) {
  .sf-login-btn.is-logged-in span { display: none; }
  .sf-login-btn:not(.is-logged-in) span { display: inline; }
}

.sf-cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--sf-primary, #111);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: 0.2rem;
}

.sf-cart-pill[hidden] { display: none !important; }
.sf-cart-pill svg { width: 17px; height: 17px; }

/* ── Search ── */
.sf-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem var(--sf-gutter, clamp(1.25rem, 4.5vw, 4rem)) 0.75rem;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.sf-search-bar[hidden] { display: none !important; }

.sf-search-bar input {
  flex: 1;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  outline: none;
  background: #fafafa;
}

.sf-search-bar__close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.3rem;
  color: #666;
}

/* ── Page shell ── */
.sf-page {
  min-width: 0;
}

/* ── Layout: cart pushes content on desktop ── */
.sf-main {
  display: flex;
  flex-direction: column;
  padding: 0 var(--sf-gutter, clamp(1.25rem, 4.5vw, 4rem)) 2rem;
  width: 100%;
  margin: 0 auto;
}

/*
  Desktop (TagamGo wide): баннеры → адрес → заказ → категории → меню
  Mobile: адрес → заказ → баннеры → категории → меню
*/
.sf-main > .sf-banners { order: 1; }
.sf-main > .sf-qr-banner { order: 2; }
.sf-main > .sf-closed-banner { order: 2; }
.sf-main > .sf-service-bar { order: 2; }
.sf-main > .sf-active-orders { order: 3; }
.sf-main > .sf-free-delivery { order: 3; }
.sf-main > .sf-categories { order: 4; }
.sf-main > .sf-subcategories { order: 4; }
.sf-main > .sf-menu { order: 5; }

@media (max-width: 899px) {
  .sf-main > .sf-qr-banner { order: 1; }
  .sf-main > .sf-closed-banner { order: 1; }
  .sf-main > .sf-service-bar { order: 1; }
  .sf-main > .sf-active-orders { order: 2; }
  .sf-main > .sf-free-delivery { order: 2; }
  .sf-main > .sf-banners { order: 3; }
  .sf-main > .sf-categories { order: 4; }
  .sf-main > .sf-subcategories { order: 4; }
  .sf-main > .sf-menu { order: 5; }
}

/* ── Banners ── */
/* Баннеры: формат партнёра card | wide (как Flutter / TagamGo) */
.sf-banners {
  margin: 0.35rem 0 0.85rem;
  overflow: hidden;
}

.sf-banners__track {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0 0 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.sf-banners__track::-webkit-scrollbar { display: none; }

.sf-banner-card {
  border: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #f0f0f0;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex-shrink: 0;
}

.sf-banner-card:active {
  transform: scale(0.985);
}

.sf-banner-card img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  pointer-events: none;
}

.sf-banners__dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.sf-banners__dot,
.sf-banners__dots span {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #ddd;
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.sf-banners__dot.is-active,
.sf-banners__dots span.is-active {
  background: #999;
  width: 16px;
}

/* Карточки: квадратная лента (image_card 1:1 / 1080×1080) */
.sf-banners--card .sf-banner-card {
  width: 168px;
  height: 168px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
}

/* Широкий: карусель на всю ширину контента, 3:1 */
.sf-banners--wide .sf-banners__track {
  gap: 0.75rem;
}

.sf-banners--wide .sf-banner-card {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 2.6 / 1;
  min-height: 118px;
  border-radius: 16px;
}

.sf-banners--wide .sf-banners__dots {
  display: flex;
}

@media (min-width: 600px) {
  .sf-banners--card .sf-banner-card {
    width: 196px;
    height: 196px;
    border-radius: 18px;
  }
}

@media (max-width: 899px) {
  .sf-banners--wide .sf-banner-card {
    aspect-ratio: 2.6 / 1;
    border-radius: 14px;
  }
}

@media (min-width: 900px) {
  .sf-banners--card .sf-banner-card {
    width: 248px;
    height: 248px;
    border-radius: 20px;
  }

  .sf-banners--wide .sf-banner-card {
    flex: 0 0 100%;
    aspect-ratio: 3 / 1;
    min-height: 0;
    max-height: none;
    border-radius: 20px;
  }
}

@media (min-width: 1200px) {
  .sf-banners--card .sf-banner-card {
    width: 268px;
    height: 268px;
  }
}

/* ── Service bar (Flutter mobile: white pill tabs) ── */
.sf-service-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin: 0.85rem 0 0.75rem;
}

@media (min-width: 900px) {
  .sf-service-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.sf-service-tabs {
  display: flex;
  width: 100%;
  gap: 0.2rem;
  padding: 0.25rem;
  background: #ececec;
  border-radius: 16px;
  flex-shrink: 0;
}

/* Главная: Доставка / Самовывоз / В зале — как TagamGo */
.sf-service-tabs--bar {
  width: 100%;
  flex-shrink: 0;
}

.sf-service-tabs--bar .sf-service-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0.7rem 0.35rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  line-height: 1.15;
}

.sf-service-tabs--bar .sf-service-tab.is-active {
  background: #fff;
  color: #111;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 900px) {
  .sf-service-tabs--bar {
    width: auto;
    min-width: 22rem;
    display: inline-flex;
    border-radius: 14px;
  }

  .sf-service-tabs--bar .sf-service-tab {
    min-height: 40px;
    padding: 0.58rem 1rem;
    font-size: 0.88rem;
  }
}

.sf-service-tabs--cart {
  display: flex;
  width: calc(100% - 2rem);
  margin: 0 1rem 0.75rem;
  padding: 0.25rem;
  background: #ececec;
  border-radius: 16px;
}

.sf-service-tabs--cart .sf-service-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  text-align: center;
  padding: 0.7rem 0.3rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
}

.sf-service-tabs--cart .sf-service-tab.is-active {
  background: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sf-service-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0.7rem 0.35rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  text-align: center;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.sf-service-tab.is-active {
  background: #fff;
  color: #111;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sf-address {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  background: #f5f5f5;
  border: none;
  border-radius: 16px;
  text-align: left;
  color: #333;
  font-size: 0.85rem;
  font-weight: 500;
}

.sf-context-btn {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  background: #f5f5f5;
  border: none;
  border-radius: 16px;
  text-align: left;
  color: #111;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.sf-cart__address {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: calc(100% - 2rem);
  max-width: calc(100% - 2rem);
  margin: 0 1rem 0.55rem;
  padding: 0.78rem 0.9rem;
  border: none;
  border-radius: 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #222;
  text-align: left;
  background: #efefef;
  cursor: pointer;
  box-sizing: border-box;
}

.sf-cart__address-icon[data-service="delivery"] {
  color: var(--sf-btn-bg, #d32f2f);
}

.sf-context-btn__icon,
.sf-cart__address-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: #8a8a8a;
}

.sf-context-btn__icon svg,
.sf-cart__address-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.sf-context-btn__texts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sf-context-btn__kind {
  font-size: 0.72rem;
  font-weight: 500;
  color: #9a9a9a;
  line-height: 1.2;
}

.sf-context-btn__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
}

/* ── Active orders ── */
.sf-active-orders {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 0 0.85rem;
  padding-bottom: 0.05rem;
  position: relative;
  z-index: 2;
}

.sf-active-orders::-webkit-scrollbar {
  display: none;
}

.sf-active-orders[hidden] {
  display: none !important;
}

.sf-active-order {
  display: block;
  flex: 1 0 min(100%, 300px);
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.85rem 1rem 0.95rem;
  border: 0;
  border-radius: 16px;
  background: #f3f3f4;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  z-index: 2;
}

.sf-active-orders:has(> :only-child) .sf-active-order {
  flex: 1 1 auto;
  min-width: 100%;
}

.sf-active-order:hover {
  background: #ececee;
}

.sf-active-order[hidden] {
  display: none !important;
}

.sf-active-order__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.sf-active-order__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  color: var(--sf-accent, #5E4AE3);
}

.sf-active-order__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.sf-active-order__info {
  flex: 1;
  min-width: 0;
}

.sf-active-order__info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111;
}

.sf-active-order__info span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #777;
}

.sf-active-order__chev {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
  color: #bbb;
}

.sf-order-timeline {
  margin-top: 0.85rem;
  padding-top: 0.15rem;
}

.sf-order-timeline__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  position: relative;
}

.sf-order-timeline__track::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: #ddd;
  z-index: 0;
}

.sf-order-timeline__step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.sf-order-timeline__dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #d0d0d0;
  box-sizing: border-box;
}

.sf-order-timeline__step.is-done .sf-order-timeline__dot {
  background: var(--sf-accent, #5E4AE3);
  border-color: var(--sf-accent, #5E4AE3);
}

.sf-order-timeline__step.is-current .sf-order-timeline__dot {
  background: #fff;
  border-color: var(--sf-accent, #5E4AE3);
  box-shadow: inset 0 0 0 3.5px var(--sf-accent, #5E4AE3);
}

.sf-order-timeline__label {
  font-size: 0.68rem;
  line-height: 1.2;
  color: #999;
  text-align: center;
  max-width: 100%;
  padding: 0 0.15rem;
}

.sf-order-timeline__step.is-done .sf-order-timeline__label,
.sf-order-timeline__step.is-current .sf-order-timeline__label {
  color: var(--sf-accent, #5E4AE3);
  font-weight: 700;
}

.sf-order-timeline__track::after {
  content: none;
}

.sf-cart__address span:not(.sf-cart__address-icon) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-address__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-address__chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #999;
}

.sf-address svg:first-of-type,
.sf-cart__address svg:first-of-type {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #8a8a8a;
}

/* ── Categories ── */
.sf-categories {
  position: sticky;
  top: var(--sf-chrome-h, 56px);
  z-index: 30;
  margin: 0 calc(-1 * var(--sf-gutter, clamp(1.25rem, 4.5vw, 4rem))) 1rem;
  padding: 0.4rem var(--sf-gutter, clamp(1.25rem, 4.5vw, 4rem));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.sf-categories__scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.sf-categories__scroll::-webkit-scrollbar { display: none; }

.sf-chip {
  flex-shrink: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--sf-chip-inactive-bg, #f2f2f2);
  color: var(--sf-chip-inactive-text, #212121);
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.sf-chip.is-active {
  background: var(--sf-chip-active-bg, #d32f2f);
  color: var(--sf-chip-active-text, #fff);
}

.sf-chip--filter {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 999px;
}

.sf-chip--filter svg { width: 18px; height: 18px; }

/* ── Categories panel: desktop side / mobile bottom sheet ── */
.sf-cat-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.sf-cat-panel[hidden] {
  display: none !important;
}

.sf-cat-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.sf-cat-panel__sheet {
  position: absolute;
  top: 0;
  left: 0;
  width: min(22rem, 88vw);
  height: 100%;
  height: 100dvh;
  background: #fff;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(-104%);
  transition: transform 0.28s ease;
}

.sf-cat-panel.is-open .sf-cat-panel__sheet {
  transform: translateX(0);
}

.sf-cat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.sf-cat-panel__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #111;
}

.sf-cat-panel__title-mobile {
  display: none;
}

.sf-cat-panel__close--text {
  display: none;
  border: 0;
  background: none;
  padding: 0.35rem 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
}

.sf-cat-panel__close--icon {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sf-cat-panel__close--icon svg {
  width: 20px;
  height: 20px;
}

.sf-cat-panel__close--icon:hover {
  background: #f3f3f3;
}

.sf-cat-panel__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.65rem 1rem;
}

.sf-cat-panel__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.95rem 0.85rem;
  border: 0;
  border-bottom: 1px solid #f2f2f2;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sf-cat-panel__item:last-child {
  border-bottom: 0;
}

.sf-cat-panel__item.is-active,
.sf-cat-panel__item:hover {
  background: #f3f3f3;
}

.sf-cat-panel__chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #bbb;
}

body.sf-cat-panel-open {
  overflow: hidden;
}

@media (max-width: 899px) {
  .sf-cat-panel__sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: min(78dvh, 640px);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.14);
    transform: translateY(105%);
  }

  .sf-cat-panel.is-open .sf-cat-panel__sheet {
    transform: translateY(0);
  }

  .sf-cat-panel__head {
    padding: 0.85rem 1.15rem 0.65rem;
  }

  .sf-cat-panel__head::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0.45rem;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #ddd;
  }

  .sf-cat-panel__head {
    position: relative;
    padding-top: 1.15rem;
  }

  .sf-cat-panel__title-desktop {
    display: none;
  }

  .sf-cat-panel__title-mobile {
    display: inline;
  }

  .sf-cat-panel__close--icon {
    display: none;
  }

  .sf-cat-panel__close--text {
    display: inline;
  }

  .sf-cat-panel__list {
    padding: 0.15rem 0.85rem max(1rem, env(safe-area-inset-bottom));
  }

  .sf-cat-panel__item {
    border-radius: 0;
    border-bottom: 1px solid #efefef;
    padding: 1rem 0.35rem;
  }

  .sf-cat-panel__chev {
    display: none;
  }
}

/* ── Glass shimmer (skeleton + unloaded photos) ── */
.sf-glass-shimmer {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(232, 238, 246, 0.48) 42%,
      rgba(255, 255, 255, 0.28) 100%
    ),
    linear-gradient(180deg, #e9eef5 0%, #f4f6f9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.sf-glass-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 32%,
    rgba(255, 255, 255, 0.08) 42%,
    rgba(255, 255, 255, 0.62) 50%,
    rgba(255, 255, 255, 0.12) 58%,
    transparent 68%
  );
  background-size: 220% 100%;
  animation: sf-glass-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sf-glass-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

/* ── Menu skeleton (fast first paint) ── */
.sf-menu-skeleton {
  padding: 0.25rem 0 2rem;
}

.sf-menu-skeleton__title {
  width: min(10rem, 40%);
  height: 1.5rem;
  margin: 0 0 1rem;
  border-radius: 10px;
  background:
    linear-gradient(
      105deg,
      rgba(255, 255, 255, 0.7) 0%,
      rgba(232, 238, 246, 0.45) 45%,
      rgba(255, 255, 255, 0.7) 100%
    ),
    #eef1f5;
  background-size: 220% 100%, auto;
  animation: sf-glass-shimmer 1.4s ease-in-out infinite;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sf-menu-skeleton__card {
  min-height: 220px;
  border-radius: 18px;
}

/* ── Menu ── */
.sf-menu-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--sf-chrome-h, 56px) + 3.4rem);
}

.sf-menu-section__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
}

.sf-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  align-items: stretch;
}

.sf-item-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.sf-item-card[hidden] { display: none !important; }

.sf-item-card__top {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sf-item-card__hit {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.sf-item-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(232, 238, 246, 0.48) 42%,
      rgba(255, 255, 255, 0.28) 100%
    ),
    linear-gradient(180deg, #e9eef5 0%, #f4f6f9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Стеклянный блик, пока фото ещё не загрузилось */
.sf-item-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
  background: linear-gradient(
    105deg,
    transparent 32%,
    rgba(255, 255, 255, 0.08) 42%,
    rgba(255, 255, 255, 0.62) 50%,
    rgba(255, 255, 255, 0.12) 58%,
    transparent 68%
  );
  background-size: 220% 100%;
  animation: sf-glass-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sf-item-card__media:has(img.is-loaded)::after,
.sf-item-card__media:has(.sf-item-card__placeholder)::after {
  opacity: 0;
  animation: none;
}

.sf-item-card__media img.sf-item-card__img {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.22s ease;
  will-change: opacity;
}

.sf-item-card__media img.sf-item-card__img.is-loaded {
  opacity: 1;
}

.sf-item-card__fav {
  display: none;
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.sf-item-card__fav svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sf-item-card__fav.is-active {
  color: var(--sf-btn-bg, #d32f2f);
}

.sf-item-card__fav.is-active svg {
  fill: currentColor;
}

.sf-item-card__add {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f2f2f2;
  color: #111;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sf-item-card__add svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sf-item-card__add:active {
  transform: scale(0.94);
  background: #e8e8e8;
}

.sf-item-card__badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.sf-promo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sf-promo-tag {
  display: inline-block;
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  background: var(--sf-btn-bg, #d32f2f);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.sf-promo-tag--timer {
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.sf-item-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-item-card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: #ccc;
}

.sf-item-card__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.sf-item-card__hit:hover .sf-item-card__name { color: #333; }

.sf-item-card__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.25em * 2);
}

.sf-item-card__portion {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  color: #666;
}

.sf-item-card__desc {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: #888;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.4em * 2);
}

.sf-item-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.55rem;
}

.sf-item-card__price-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.05rem;
  min-width: 5.5rem;
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: 12px;
  background: #f0f0f0;
  color: #111;
  cursor: pointer;
  font: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, background 0.12s ease;
}

.sf-item-card__price-btn:active {
  transform: scale(0.96);
  background: #e8e8e8;
}

.sf-price { font-size: 0.95rem; font-weight: 800; line-height: 1.2; }

.sf-price-old {
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
  color: #aaa;
  text-decoration: line-through;
  font-weight: 500;
}

.sf-opt-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 0.3rem;
  padding: 0.08rem 0.38rem;
  border-radius: 6px;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.sf-price--opt {
  color: #6d28d9;
}

.sf-item-card__price-btn .sf-opt-badge {
  display: block;
  width: fit-content;
  margin: 0 0 0.12rem;
}

.sf-b2b-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.22rem;
  margin: 0 0 0.7rem;
  border-radius: 14px;
  background: #f4f4f4;
}

.sf-b2b-tab {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 0.55rem 0.4rem;
  background: transparent;
  color: #666;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.sf-b2b-tab.is-active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sf-b2b-auth,
.sf-b2b-profile,
.sf-b2b-checkout {
  margin: 0.85rem 0;
}

.sf-b2b-auth__label,
.sf-b2b-checkout__title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
}

.sf-b2b-auth__fields .sf-field {
  margin-bottom: 0.55rem;
}

.sf-b2b-profile {
  padding: 0.85rem 0.95rem;
  border: 1px solid #ececec;
  border-radius: 16px;
  background: #faf8ff;
}

.sf-b2b-profile__type {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 750;
}

.sf-b2b-profile__meta {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.78rem;
  color: #777;
}

.sf-b2b-profile__meta:empty { display: none; }

.sf-b2b-cart-banner {
  margin: 0 1rem 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 0.78rem;
  font-weight: 700;
}

.sf-b2b-cart-banner[hidden] { display: none; }

.sf-order-opt-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.38rem;
  border-radius: 6px;
  background: #f3e8ff;
  color: #6d28d9;
  font-size: 0.62rem;
  font-weight: 800;
  vertical-align: middle;
}

.sf-fly-qty {
  position: fixed;
  z-index: 90;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--sf-btn-bg, #d32f2f);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.55s ease;
  will-change: transform, opacity;
}

.sf-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  background: var(--sf-btn-bg, #d32f2f);
  padding: 0.18rem 0.4rem;
  border-radius: 5px;
}

/* ── Cart panel (Flutter «Мой заказ») ── */
.sf-cart {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 380px);
  height: 100vh;
  height: 100dvh;
  background: #fff;
  border-left: 1px solid #ececec;
  z-index: 45;
  transform: translateX(100%);
  transition: transform 0.28s ease, visibility 0.28s;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.06);
  visibility: hidden;
}

.sf-cart__view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sf-cart__view[hidden] {
  display: none !important;
}

.sf-cart__view--checkout .sf-cart__header--checkout h2 {
  flex: 1;
  text-align: center;
  padding-right: 38px;
}

.sf-cart__header--checkout {
  justify-content: flex-end;
  position: relative;
}

.sf-cart__header--checkout h2 {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

.sf-app.sf-cart-open .sf-cart {
  visibility: visible;
  transform: translateX(0);
}

.sf-cart__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sf-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.65rem;
}

.sf-cart__header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.sf-cart__header-actions { display: flex; gap: 0.1rem; }

.sf-cart__service-tabs { padding: 0; }

.sf-cart-extra {
  padding: 0 1rem 0.65rem;
}

.sf-checkout-table {
  padding: 0 0 0.85rem;
}

.sf-cart-extra__label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sf-pickup-times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sf-pickup-chip {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: #444;
}

.sf-pickup-chip.is-active {
  border-color: var(--sf-btn-bg, #e32400);
  background: rgba(227, 36, 0, 0.08);
  color: var(--sf-btn-bg, #e32400);
}

.sf-table-input {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 0.72rem 0.85rem;
  outline: none;
  font-size: 0.88rem;
  font-weight: 600;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sf-table-input:focus {
  border-color: #999;
}

.sf-table-input[readonly] {
  background: #f5f5f5;
  color: #111;
  cursor: default;
  font-weight: 800;
  box-shadow: none;
}

.sf-qr-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.75rem 0 0;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  background: #f5f5f5;
  color: #111;
}

@media (min-width: 900px) {
  .sf-qr-banner {
    width: max-content;
    max-width: 100%;
    min-width: 22rem;
  }
}

.sf-qr-banner[hidden] { display: none; }

.sf-closed-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.75rem 0 0;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  background: #fff4e5;
  color: #7a4a00;
}

.sf-closed-banner[hidden] { display: none; }

.sf-closed-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffe8c2;
}

.sf-closed-banner__icon svg { width: 20px; height: 20px; }

.sf-closed-banner__texts {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.sf-closed-banner__texts strong {
  font-size: 0.92rem;
  font-weight: 750;
}

.sf-closed-banner__texts span {
  font-size: 0.78rem;
  line-height: 1.35;
}

.sf-subcategories {
  margin: 0.35rem 0 0;
}

.sf-subcategories[hidden] { display: none; }

.sf-item-card.is-oos {
  opacity: 0.62;
}

.sf-item-card.is-oos .sf-item-card__add,
.sf-item-card.is-oos .sf-item-card__price-btn {
  pointer-events: none;
}

.sf-item-card__oos {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  padding: 0.18rem 0.45rem;
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.sf-gift-row {
  margin-top: 0.45rem;
}

.sf-gift-row[hidden] { display: none; }

.sf-gift-row__pick {
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #f6efe4;
  color: #5c3d12;
  font-size: 0.88rem;
  font-weight: 700;
}

.sf-gift-row__chosen {
  margin-top: 0.4rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #eef7ee;
  color: #1b5e20;
  font-size: 0.86rem;
  font-weight: 650;
}

.sf-gift-row__chosen[hidden] { display: none; }

.sf-gift-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.sf-gift-option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.7rem;
  border-radius: 14px;
  border: 1px solid #ececec;
  background: #fff;
  text-align: left;
}

.sf-gift-option.is-selected {
  border-color: #2e7d32;
  background: #f3faf3;
}

.sf-gift-option img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}

.sf-gift-option__title {
  font-size: 0.82rem;
  font-weight: 700;
}

.sf-gift-option__meta {
  font-size: 0.72rem;
  color: #777;
}

.sf-gift-option__btn {
  margin-top: auto;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
  font-size: 0.78rem;
  font-weight: 700;
}

.sf-qr-banner__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--sf-btn-bg, #e32400);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.sf-qr-banner__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.sf-qr-banner__texts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.sf-qr-banner__kind {
  font-size: 0.72rem;
  font-weight: 500;
  color: #9a9a9a;
  line-height: 1.2;
}

.sf-qr-banner strong {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sf-qr-banner__hint {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #9a9a9a;
}

@media (max-width: 420px) {
  .sf-qr-banner__hint { display: none; }
}

.sf-service-tab.is-locked,
.sf-service-tab:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.sf-free-delivery {
  margin: 0.15rem 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: #f6f6f6;
}

.sf-free-delivery[hidden] { display: none; }

.sf-free-delivery__text {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #333;
}

.sf-free-delivery.is-done .sf-free-delivery__text {
  color: #2e7d32;
}

.sf-free-delivery__track,
.sf-cart-progress__track {
  height: 6px;
  border-radius: 999px;
  background: #e6e6e6;
  overflow: hidden;
}

.sf-free-delivery__track i,
.sf-cart-progress__track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--sf-btn-bg, #d32f2f);
  transition: width 0.25s ease;
}

.sf-free-delivery.is-done .sf-free-delivery__track i,
.sf-cart-progress__row.is-done .sf-cart-progress__track i {
  background: #2e7d32;
}

.sf-cart-progress {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
}

.sf-cart-progress[hidden] { display: none; }

.sf-cart-progress__row {
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: #f6f6f6;
}

.sf-cart-progress__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #333;
}

.sf-cart-progress__head strong {
  white-space: nowrap;
  color: #111;
}

.sf-cart-progress__row.is-done .sf-cart-progress__head {
  color: #2e7d32;
}

.sf-cart__fees {
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: #111;
  line-height: 1.45;
  font-weight: 700;
}

.sf-cart__fees strong {
  color: #111;
  font-weight: 800;
}

.sf-cart__items {
  flex: 1;
  overflow: auto;
  padding: 0.15rem 1rem 0.5rem;
}

.sf-cart-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0;
  margin-bottom: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #ececec;
}

.sf-cart-line:last-child {
  border-bottom: 0;
}

.sf-cart-line__img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: #ebebeb;
  flex-shrink: 0;
}

.sf-cart-line__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sf-cart-line__top {
  display: block;
}

.sf-cart-line__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.sf-cart-line__name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111;
}

.sf-cart-line__tags {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.sf-cart-line__foot {
  margin-top: 0.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.sf-cart-line__meta {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.sf-cart-line__price {
  font-size: 0.88rem;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}

.sf-cart-line__qty {
  align-self: center;
  flex-shrink: 0;
}

.sf-cart-line__foot .sf-price-old {
  font-size: 0.78rem;
  order: -1;
}

.sf-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: #ececec;
  border-radius: 999px;
  padding: 0.18rem 0.2rem;
}

.sf-qty button {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 500;
  color: #333;
  box-shadow: none;
}

.sf-qty button:active {
  background: rgba(0, 0, 0, 0.05);
}

.sf-qty span {
  min-width: 1.1rem;
  padding: 0 0.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: #111;
  white-space: nowrap;
}

.sf-cart__footer {
  padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom));
  background: #fff;
  border-top: none;
}

.sf-cart__footer--checkout {
  padding-top: 0.65rem;
}

.sf-cart__summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.84rem;
  color: #777;
}

.sf-cart__summary strong {
  font-size: 1.15rem;
  color: #111;
  font-weight: 800;
  white-space: nowrap;
}

.sf-checkout-btn {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--sf-btn-bg, #d32f2f) 35%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.1rem;
}

.sf-checkout-btn__spinner {
  display: none;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid color-mix(in srgb, var(--sf-btn-text, #fff) 35%, transparent);
  border-top-color: var(--sf-btn-text, #fff);
  border-radius: 50%;
  flex-shrink: 0;
  animation: sf-spin 0.7s linear infinite;
}

.sf-checkout-btn.is-loading .sf-checkout-btn__spinner {
  display: inline-block;
}

.sf-checkout-btn.is-loading {
  opacity: 0.92;
  cursor: wait;
}

.sf-checkout-btn:disabled:not(.is-loading) { opacity: 0.4; cursor: not-allowed; }

@keyframes sf-spin {
  to { transform: rotate(360deg); }
}

.sf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 44;
}

.sf-overlay[hidden] { display: none !important; }

.sf-empty { color: #888; font-size: 0.88rem; grid-column: 1 / -1; }
.sf-empty--large { padding: 3rem 1rem; text-align: center; }
.sf-menu-section[hidden] { display: none !important; }

/* ── Mobile FABs: корзина + наверх (без нижнего меню) ── */
.sf-fabs {
  display: none;
  position: fixed;
  right: max(0.9rem, env(safe-area-inset-right));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  z-index: 38;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  pointer-events: none;
}

.sf-fab {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.sf-fab svg {
  width: 22px;
  height: 22px;
  display: block;
}

.sf-fab--cart {
  width: auto;
  min-width: 52px;
  height: 52px;
  padding: 0 1rem 0 0.9rem;
  gap: 0.45rem;
  border-radius: 999px;
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
}

.sf-fab--cart svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sf-fab__total {
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sf-fab--top {
  background: #fff;
  color: #333;
  border: 1px solid #ececec;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.sf-fab__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25rem;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

.sf-fab__badge[hidden] { display: none !important; }

.sf-fab[hidden] { display: none !important; }

/* Когда открыта корзина / модалки — FAB не мешают */
.sf-app.sf-cart-open .sf-fabs,
body.sf-drawer-open .sf-fabs,
body.sf-legal-panel-open .sf-fabs,
body.sf-campaign-open .sf-fabs {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sf-app-banner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.7rem 0.55rem 0.7rem 0.95rem;
  background: #1c1c1c;
  color: #fff;
}

html.sf-app-banner-dismissed .sf-app-banner,
.sf-app-banner[hidden] { display: none !important; }

body.sf-app-banner-on .sf-categories {
  top: var(--sf-chrome-h, 118px);
}

html.sf-app-banner-dismissed body.sf-app-banner-on .sf-categories {
  top: var(--sf-chrome-h, 56px);
}

.sf-app-banner__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
  color: inherit;
}

.sf-app-banner__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.sf-app-banner__copy strong {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sf-app-banner__copy em {
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.72);
}

.sf-app-banner__logo {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sf-app-banner__logo img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.sf-app-banner__close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sf-app-banner__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Кампания «подарок»: стили шита — после .sf-modal, иначе align-items:center перебивает */

/* ── Desktop ── */
@media (min-width: 900px) {
  .sf-menu-grid,
  .sf-app.sf-cart-open .sf-menu-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sf-fabs { display: none !important; }

  .sf-app.sf-cart-open {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: start;
  }

  .sf-app.sf-cart-open .sf-page {
    grid-column: 1;
    min-width: 0;
    width: 100%;
  }

  .sf-app.sf-cart-open .sf-cart {
    position: sticky;
    top: 0;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: 400px;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    transform: none;
    visibility: visible;
    z-index: 1;
    transition: none;
  }

  .sf-app.sf-cart-open .sf-overlay { display: none !important; }
}

@media (max-width: 899px) {
  .sf-fabs { display: flex; }
  .sf-main { padding-bottom: 5.5rem; }

  /* Корзина на весь экран — как в приложении */
  .sf-cart {
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-left: none;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(105%);
    visibility: hidden;
    z-index: 55;
  }

  .sf-app.sf-cart-open .sf-cart {
    transform: translateY(0);
    visibility: visible;
  }

  .sf-cart__inner {
    height: 100%;
    min-height: 0;
    border-radius: inherit;
    overflow: hidden;
  }

  .sf-cart__header {
    padding-top: 0.85rem;
    position: relative;
  }

  .sf-cart__header::before {
    display: none;
  }

  .sf-cart__footer {
    padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  }

  body.sf-cart-sheet-open {
    overflow: hidden;
  }

  html {
    scroll-padding-top: calc(var(--sf-chrome-h, 56px) + 3.4rem);
  }

  .sf-app {
    --sf-gutter: 0.75rem;
  }

  .sf-main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-bottom: 7rem;
  }

  .sf-menu-section__title {
    display: none;
  }

  .sf-menu-section {
    margin-bottom: 0.85rem;
    scroll-margin-top: calc(var(--sf-chrome-h, 56px) + 3.4rem);
  }

  .sf-menu-grid {
    gap: 0.55rem;
    align-items: stretch;
  }

  .sf-item-card {
    height: 100%;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: none;
  }

  .sf-item-card__top {
    flex: 1 1 auto;
    min-height: 0;
  }

  .sf-item-card__hit {
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
  }

  .sf-item-card__media {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
    box-shadow: none;
    border: none;
    background: #fff;
    aspect-ratio: 1 / 1;
    overflow: hidden;
  }

  .sf-item-card__media::after {
    display: none;
  }

  .sf-item-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
  }

  .sf-item-card--no-img .sf-item-card__media {
    display: block;
  }

  .sf-menu-skeleton__card {
    min-height: 220px;
    aspect-ratio: auto;
    border-radius: 16px;
    border: 1px solid #ececec;
  }

  .sf-item-card__body {
    flex: 1 1 auto;
    padding: 0.62rem 0.7rem 0;
  }

  .sf-item-card__fav {
    display: inline-flex;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: transparent;
    box-shadow: none;
    color: #c8c8c8;
  }

  .sf-item-card__fav svg {
    width: 22px;
    height: 22px;
    stroke: #c8c8c8;
    stroke-width: 1.65;
    fill: none;
  }

  .sf-item-card__fav.is-active {
    color: #e53935;
  }

  .sf-item-card__fav.is-active svg {
    stroke: #e53935;
    fill: #e53935;
  }

  .sf-item-card__badges {
    top: 8px;
    left: 8px;
    gap: 0;
  }

  .sf-promo-chip {
    display: inline-flex;
    align-items: stretch;
    overflow: hidden;
    border-radius: 8px;
  }

  .sf-item-card__badges .sf-promo-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 0.28rem 0.48rem;
    border-radius: 8px;
    box-shadow: none;
  }

  .sf-item-card__badges .sf-promo-chip .sf-promo-tag {
    border-radius: 0;
  }

  .sf-item-card__badges .sf-promo-tag--discount {
    background: #ff6a2b;
    color: #fff;
  }

  .sf-item-card__badges .sf-promo-chip .sf-promo-tag--discount:only-child {
    border-radius: 8px;
  }

  .sf-item-card__badges .sf-promo-tag--timer {
    background: #2b2b2b;
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
  }

  .sf-item-card__badges .sf-promo-tag--sale,
  .sf-item-card__badges .sf-promo-tag--hit,
  .sf-item-card__badges .sf-promo-tag--new,
  .sf-item-card__badges .sf-promo-tag--custom {
    background: #1c1c1c;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.55rem;
  }

  .sf-item-card__name {
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.22;
    color: #111;
    min-height: calc(1.22em * 2);
    -webkit-line-clamp: 2;
  }

  .sf-item-card__portion {
    display: none;
  }

  .sf-item-card__desc {
    margin-top: 0.22rem;
    font-size: 0.74rem;
    line-height: 1.35;
    color: #9a9a9a;
    font-weight: 500;
    min-height: 0;
    -webkit-line-clamp: 2;
  }

  .sf-item-card__desc:empty {
    display: none;
  }

  .sf-item-card__footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    margin-top: auto;
    flex-shrink: 0;
    padding: 0.55rem 0.7rem 0.75rem;
  }

  .sf-item-card__price-btn {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    align-self: flex-start;
    gap: 0.38rem;
    width: fit-content;
    min-width: 0;
    padding: 0.4rem 0.78rem;
    border-radius: 999px;
    background: #f1f1f1;
  }

  .sf-item-card__price-btn .sf-opt-badge {
    display: inline;
    margin: 0;
  }

  .sf-item-card__price-btn .sf-price-old {
    display: inline;
    font-size: 0.72rem;
    color: #e57373;
    text-decoration: line-through;
    font-weight: 600;
  }

  .sf-item-card__price-btn .sf-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #111;
  }

  .sf-item-card__add {
    display: none !important;
  }

  .sf-chip {
    padding: 0.52rem 0.95rem;
    font-size: 0.76rem;
  }
}

/* ── Modals ── */
.sf-modal[hidden] { display: none !important; }

.sf-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-right: max(1rem, env(safe-area-inset-right));
}

/* Подарок / кампания — нижний шит как в приложении */
#sfCampaignModal.sf-modal {
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.sf-campaign-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 1rem 1.15rem max(1.25rem, env(safe-area-inset-bottom));
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.16);
  animation: sfCampaignSheetIn 0.32s ease;
}

@keyframes sfCampaignSheetIn {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

.sf-campaign-sheet__close {
  position: absolute;
  top: 1.15rem;
  right: 1.3rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  font-size: 1.2rem;
  line-height: 1;
  color: #333;
}

.sf-campaign-sheet__media {
  margin: 0 0 1rem;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f4f4;
}

.sf-campaign-sheet__media[hidden] { display: none; }

.sf-campaign-sheet__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}

.sf-campaign-sheet__title {
  margin: 0 0 0.4rem;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.sf-campaign-sheet__sub {
  margin: 0 0 1.15rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #888;
  text-align: center;
}

.sf-campaign-sheet .sf-btn {
  width: 100%;
  min-height: 3.15rem;
  border-radius: 16px;
  font-size: 1rem;
}

@media (max-width: 899px) {
  #sfCampaignModal.sf-modal {
    align-items: flex-end;
    padding: 0;
  }

  #sfCampaignModal .sf-campaign-sheet {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    margin: 0;
  }
}

@media (min-width: 900px) {
  #sfCampaignModal.sf-modal {
    align-items: center;
    padding: 1.5rem;
  }

  #sfCampaignModal .sf-campaign-sheet {
    width: min(100%, 440px);
    border-radius: 22px;
    animation: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  }
}

@media (min-width: 900px) {
  .sf-app.sf-cart-open .sf-modal:not(.sf-modal--card-sheet) {
    padding-right: calc(400px + 1rem);
  }
}

.sf-modal__close--map {
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
}

.sf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.sf-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.sf-modal__panel--map {
  width: min(100%, 920px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.sf-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem;
}

.sf-modal__header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.sf-modal__header .sf-icon-btn {
  font-size: 1.5rem;
  line-height: 1;
}

.sf-modal__body { padding: 0.5rem 1rem 1rem; }

.sf-modal__body--map {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
}

.sf-modal__hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.45;
}

.sf-modal__error {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #c62828;
}

.sf-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.sf-field span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
}

.sf-field input {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  outline: none;
}

.sf-field input:focus { border-color: #999; }

.sf-btn {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

.sf-btn--primary {
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
}

.sf-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.sf-auth-channels {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
}

.sf-auth-channels[hidden] {
  display: none;
}

.sf-auth-channels .sf-btn {
  width: 100%;
  min-height: 3.05rem;
}

.sf-map-search {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  outline: none;
}

.sf-map-container {
  width: 100%;
  height: min(52vh, 420px);
  border-radius: 14px;
  overflow: hidden;
  background: #eee;
}

.sf-map-status {
  margin: 0;
  font-size: 0.82rem;
  color: #666;
  min-height: 1.2em;
}

.sf-map-status.is-error { color: #c62828; }
.sf-map-status.is-ok { color: #2e7d32; }

/* ── Item detail modal ── */
.sf-modal__panel--item {
  width: min(100%, 920px);
  max-height: min(92vh, 720px);
  padding: 0;
  overflow: hidden;
}

.sf-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1.4rem;
  line-height: 1;
  color: #666;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sf-modal__close:hover { background: #fff; }

.sf-item-modal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: min(72vh, 560px);
  max-height: inherit;
}

.sf-item-modal__media {
  position: relative;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-x pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.sf-item-modal__dots {
  display: none;
}

.sf-item-modal__media img {
  width: min(100%, 420px);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  border-radius: 18px;
  margin: 1.5rem;
  background: #fff;
}

.sf-item-modal__dots span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.sf-item-modal__dots span.is-active {
  background: rgba(0, 0, 0, 0.55);
}

.sf-item-modal__fav {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #222;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.sf-item-modal__close-mobile {
  display: none;
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  color: #222;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.sf-item-modal__close-mobile svg {
  width: 20px;
  height: 20px;
  display: block;
}

.sf-item-modal__fav svg {
  width: 24px;
  height: 24px;
  display: block;
}

.sf-item-modal__fav.is-active {
  color: var(--sf-btn-bg, #d32f2f);
}

.sf-item-modal__fav.is-active svg {
  fill: currentColor;
}

.sf-item-modal__slide {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sf-item-modal__body {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.sf-item-modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.15rem 1.15rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sf-item-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.sf-item-modal__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #111;
}

.sf-item-modal__price,
.sf-item-modal__meta {
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111;
  white-space: normal;
  padding-top: 0.1rem;
}

.sf-item-modal__portion {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #666;
}

.sf-item-modal__desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #777;
}

.sf-item-modal__stock {
  margin: 0;
  font-size: 0.78rem;
  color: #999;
}

.sf-mod-group { margin-top: 0.35rem; }

.sf-mod-group__title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #444;
}

.sf-mod-group__hint {
  font-weight: 500;
  color: #999;
  font-size: 0.75rem;
}

.sf-mod-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sf-mod-option {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  font-size: 0.78rem;
  font-weight: 600;
  color: #444;
  background: #fff;
}

.sf-mod-option.is-active {
  border-color: var(--sf-btn-bg, #e32400);
  background: rgba(227, 36, 0, 0.08);
  color: var(--sf-btn-bg, #e32400);
}

.sf-mod-option__price {
  opacity: 0.7;
  font-weight: 500;
}

.sf-item-modal__footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.75rem 1.1rem max(0.85rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.sf-qty--lg {
  padding: 0.15rem;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.sf-qty--lg button {
  width: 36px;
  height: 36px;
  background: transparent;
  box-shadow: none;
  font-size: 1.15rem;
  color: #333;
}

.sf-qty--lg span {
  min-width: 2.4rem;
  padding: 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.sf-item-modal__add {
  flex: 1;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--sf-btn-bg, #e32400);
  color: var(--sf-btn-text, #fff);
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
}

.sf-item-modal__add:disabled { opacity: 0.45; cursor: not-allowed; }

.sf-cart-line__sub {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: #888;
  line-height: 1.3;
}

/* ── Auth modal ── */
.sf-modal__panel--auth {
  width: min(100%, 400px);
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  position: relative;
}

.sf-auth-sheet-handle {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #ddd;
  margin: 0 auto 0.85rem;
}

.sf-auth-back {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 1.1rem;
  color: #666;
  z-index: 2;
}

.sf-auth-back:hover { background: #f5f5f5; }

/* Mobile: нижняя панель как в TagamGo */
@media (max-width: 899px) {
  #sfAuthModal.sf-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  #sfAuthModal .sf-modal__panel--auth {
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    margin: 0;
    padding:
      0.55rem 1.2rem
      max(1.25rem, env(safe-area-inset-bottom));
    max-height: min(92dvh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sfAuthModal .sf-auth-sheet-handle {
    display: block;
  }

  #sfAuthModal .sf-auth-close-desktop {
    display: none;
  }

  #sfAuthModal .sf-auth-back {
    top: 0.95rem;
    left: 0.75rem;
  }

  #sfAuthModal .sf-auth-step h2 {
    font-size: 1.2rem;
  }

  #sfAuthModal .sf-btn {
    width: 100%;
    min-height: 3.05rem;
    border-radius: 14px;
  }

  #sfAuthModal .sf-phone-input {
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
  }

  #sfAuthModal .sf-otp-input {
    border-radius: 16px;
    padding: 1rem;
  }
}

.sf-auth-logo {
  height: 42px;
  width: auto;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.sf-auth-logo--text {
  font-size: 1.1rem;
  font-weight: 800;
  height: auto;
}

.sf-auth-step h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.sf-auth-step .sf-field { text-align: left; }

.sf-phone-input {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: #fafafa;
}

.sf-phone-input__prefix {
  font-weight: 700;
  color: #333;
  flex-shrink: 0;
}

.sf-phone-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
}

.sf-auth-legal {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  text-align: left;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #666;
}

.sf-auth-legal input { margin-top: 0.15rem; flex-shrink: 0; }
.sf-auth-legal a { color: var(--sf-btn-bg, #e32400); }

.sf-btn--whatsapp,
.sf-btn--telegram,
.sf-btn--sms {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.sf-btn--whatsapp::before,
.sf-btn--telegram::before,
.sf-btn--sms::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: center / contain no-repeat;
}

.sf-btn--whatsapp::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.435 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z'/%3E%3C/svg%3E");
}

.sf-btn--telegram::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z'/%3E%3C/svg%3E");
}

.sf-btn--sms::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z'/%3E%3C/svg%3E");
}

.sf-auth-lock { font-size: 1.75rem; margin-bottom: 0.35rem; }

.sf-auth-phone-display {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.sf-auth-channel-hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: #888;
}

.sf-otp-input {
  width: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  margin-bottom: 0.75rem;
  background: #fafafa;
}

.sf-link-btn {
  margin-top: 0.65rem;
  color: #1976d2;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Address / branch modal ── */
.sf-modal__panel--address {
  width: min(calc(100% - 420px - 2rem), 820px);
  max-width: 820px;
  max-height: min(86vh, 500px);
  padding: 0;
  overflow: hidden;
}

.sf-address-modal {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  height: min(72vh, 460px);
  min-height: 360px;
}

/* В разметке карта первая, на десктопе форма слева */
.sf-address-modal__form {
  grid-column: 1;
  grid-row: 1;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: auto;
  min-height: 0;
}

.sf-address-modal__map {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  min-height: 0;
  height: 100%;
}

.sf-address-modal__title {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.sf-service-tabs--modal {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  padding: 0.25rem;
  background: #ececec;
  border-radius: 16px;
}

.sf-service-tabs--modal .sf-service-tab {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 0.7rem 0.3rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  text-align: center;
}

.sf-service-tabs--modal .sf-service-tab.is-active {
  background: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sf-map-search {
  font-size: 0.82rem;
  padding: 0.6rem 0.75rem;
}

.sf-map-delivery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #f8f8f8;
  font-size: 0.82rem;
}

.sf-map-delivery-row strong {
  font-size: 0.9rem;
  font-weight: 800;
}

.sf-map-status {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  min-height: 2.5em;
}

.sf-btn--continue {
  margin-top: auto;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  border-radius: 14px;
}

.sf-city-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.2rem;
  background: #f0f0f0;
  border-radius: 999px;
  align-self: flex-start;
}

.sf-city-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #666;
}

.sf-city-tab.is-active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sf-address-extra {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.sf-address-extra__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.sf-address-extra__field span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
}

.sf-address-extra input,
.sf-address-extra__field input {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  outline: none;
  font-size: 0.82rem;
  background: #f5f5f5;
  width: 100%;
  box-sizing: border-box;
}

.sf-address-extra input:focus,
.sf-address-extra__field input:focus {
  background: #fff;
  border-color: #ccc;
}

.sf-address-modal__map .sf-map-container {
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

/* Список сохранённых адресов */
.sf-modal__panel--address-picker {
  width: min(100%, 420px);
  max-height: min(86vh, 640px);
  padding: 1.25rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sf-address-picker__title {
  margin: 0 0 0.35rem;
  padding-right: 2rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.sf-address-picker__hint {
  margin: 0 0 0.95rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #888;
}

.sf-address-picker__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.95rem;
}

.sf-address-picker__row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.sf-address-picker__pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  padding: 0.9rem 0.95rem;
  border: 0;
  border-radius: 16px;
  background: #f3f3f3;
  text-align: left;
  cursor: pointer;
  color: #111;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.sf-address-picker__pick:active {
  background: #ebebeb;
}

.sf-address-picker__row.is-active .sf-address-picker__pick {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sf-btn-bg, #d32f2f) 55%, #ddd);
  background: color-mix(in srgb, var(--sf-btn-bg, #d32f2f) 8%, #f3f3f3);
}

.sf-address-picker__delete {
  flex-shrink: 0;
  width: 48px;
  border: 0;
  border-radius: 16px;
  background: #f3f3f3;
  color: #999;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sf-address-picker__delete:hover,
.sf-address-picker__delete:active {
  background: #fdecec;
  color: #c62828;
}

.sf-address-picker__delete svg {
  width: 18px;
  height: 18px;
}

.sf-address-picker__pin,
.sf-address-picker__chev {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #999;
}

.sf-address-picker__text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.sf-address-picker__add {
  flex-shrink: 0;
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
}

/* Мобилка: нижняя панель, карта сверху, форма снизу — как TagamGo */
@media (max-width: 899px) {
  #sfAddressPickerModal.sf-modal,
  #sfMapModal.sf-modal,
  #sfBranchModal.sf-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  #sfAddressPickerModal .sf-modal__panel--address-picker {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: min(88dvh, 760px);
    border-radius: 22px 22px 0 0;
    margin: 0;
    padding:
      1rem 1.1rem
      max(1.1rem, env(safe-area-inset-bottom));
  }

  #sfMapModal .sf-modal__panel--address,
  #sfBranchModal .sf-modal__panel--address {
    width: 100%;
    max-width: 100%;
    height: min(94dvh, 920px);
    max-height: min(94dvh, 920px);
    border-radius: 22px 22px 0 0;
    margin: 0;
  }

  #sfMapModal .sf-address-modal,
  #sfBranchModal .sf-address-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  #sfMapModal .sf-address-modal__map,
  #sfBranchModal .sf-address-modal__map {
    grid-column: auto;
    grid-row: auto;
    flex: 0 0 auto;
    height: min(36dvh, 280px);
    min-height: 200px;
  }

  #sfMapModal .sf-address-modal__map .sf-map-container,
  #sfBranchModal .sf-address-modal__map .sf-map-container {
    height: 100%;
    min-height: 200px;
    border-radius: 22px 22px 0 0;
  }

  #sfMapModal .sf-address-modal__form,
  #sfBranchModal .sf-address-modal__form {
    grid-column: auto;
    grid-row: auto;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.85rem 1.05rem max(0.85rem, env(safe-area-inset-bottom));
    gap: 0.65rem;
  }

  #sfMapModal .sf-address-modal__title {
    display: none;
  }

  #sfMapModal .sf-service-tabs--modal,
  #sfBranchModal .sf-service-tabs--modal {
    width: 100%;
  }

  #sfMapModal .sf-service-tabs--modal .sf-service-tab,
  #sfBranchModal .sf-service-tabs--modal .sf-service-tab {
    flex: 1 1 0;
    min-height: 44px;
    text-align: center;
    padding: 0.7rem 0.3rem;
    font-size: 0.95rem;
  }

  #sfMapModal .sf-city-tabs,
  #sfBranchModal .sf-city-tabs {
    width: 100%;
    justify-content: stretch;
  }

  #sfMapModal .sf-city-tab,
  #sfBranchModal .sf-city-tab {
    flex: 1;
    text-align: center;
  }

  #sfMapModal .sf-field span {
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
  }

  #sfMapModal .sf-map-search {
    background: #f5f5f5;
    border-radius: 14px;
    border-color: transparent;
    padding: 0.8rem 0.9rem;
    font-size: 0.9rem;
  }

  #sfMapModal .sf-address-extra {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #sfMapModal .sf-btn--continue,
  #sfBranchModal .sf-btn--continue {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 0.35rem;
    border-radius: 999px;
    box-shadow: 0 -8px 16px #fff;
  }

  #sfBranchModal .sf-branch-list--picker {
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* Mobile item sheet — как TagamGo: фото целиком + свайп по категории */
@media (max-width: 899px) {
  #sfItemModal.sf-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  .sf-modal__panel--item {
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 920px);
    border-radius: 22px 22px 0 0;
    margin: 0;
    overflow: hidden;
  }

  .sf-item-modal__close-desktop {
    display: none;
  }

  .sf-item-modal {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: min(94dvh, 920px);
  }

  .sf-item-modal__media {
    flex: 0 0 auto;
    width: 100%;
    height: min(48dvh, 360px);
    max-height: min(48dvh, 360px);
    aspect-ratio: auto;
    background: #fff;
    overflow: hidden;
    touch-action: pan-x;
  }

  .sf-item-modal__slide {
    width: 100%;
    height: 100%;
    padding: 2.4rem 1.1rem 1rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sf-item-modal__media img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    object-fit: contain;
    object-position: center;
  }

  .sf-item-modal__media .sf-item-card__placeholder {
    width: min(70%, 220px);
    aspect-ratio: 1;
    height: auto;
    border-radius: 999px;
    font-size: 3rem;
  }

  .sf-item-modal__media.is-swipeable {
    cursor: grab;
  }

  .sf-item-modal__dots {
    display: flex;
    position: absolute;
    top: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    gap: 0.22rem;
    width: min(78%, 260px);
    pointer-events: none;
  }

  .sf-item-modal__dots span {
    height: 2.5px;
    background: rgba(0, 0, 0, 0.14);
  }

  .sf-item-modal__dots span.is-active {
    background: rgba(0, 0, 0, 0.55);
  }

  .sf-item-modal__close-mobile {
    display: inline-flex;
  }

  .sf-item-modal__body {
    flex: 1 1 auto;
    min-height: 0;
  }

  .sf-item-modal__scroll {
    padding: 1rem 1.1rem 0.35rem;
  }

  .sf-item-modal__title {
    font-size: 1.18rem;
  }

  .sf-item-modal__price {
    font-size: 1.05rem;
  }

  .sf-item-modal__desc {
    font-size: 0.86rem;
  }

  .sf-item-modal__add {
    border-radius: 14px;
  }
}

/* ── Branch picker modal ── */
.sf-branch-modal__hint {
  margin: 0;
  font-size: 0.78rem;
  color: #888;
  line-height: 1.45;
}

.sf-branch-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: auto;
  min-height: 0;
}

.sf-branch-list--picker {
  flex: 1;
  max-height: none;
}

.sf-branch-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #ececec;
  border-radius: 14px;
  text-align: left;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  cursor: pointer;
}

.sf-branch-card:hover {
  border-color: #ccc;
}

.sf-branch-card.is-active {
  border-color: var(--sf-btn-bg, #e32400);
  background: rgba(227, 36, 0, 0.04);
}

.sf-branch-card__radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.1rem;
  border: 2px solid #ccc;
  border-radius: 50%;
  position: relative;
}

.sf-branch-card.is-active .sf-branch-card__radio {
  border-color: var(--sf-btn-bg, #e32400);
}

.sf-branch-card.is-active .sf-branch-card__radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--sf-btn-bg, #e32400);
}

.sf-branch-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sf-branch-card__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
}

.sf-branch-card__meta {
  font-size: 0.76rem;
  color: #888;
  line-height: 1.4;
}

.sf-branch-card__status {
  font-size: 0.72rem;
  font-weight: 600;
  color: #2e7d32;
}

.sf-branch-card__status.is-closed {
  color: #c62828;
}

/* ── Checkout (sidebar) ── */
.sf-checkout-body {
  flex: 1;
  overflow: auto;
  padding: 0 1rem 1rem;
}

.sf-checkout-profile {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem;
  background: #ececec;
  border-radius: 16px;
}

.sf-checkout-profile-card {
  margin-bottom: 0.85rem;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.sf-checkout-profile-row {
  padding: 0.8rem 0.95rem 0.85rem;
}

.sf-checkout-profile-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 0.95rem;
}

.sf-required {
  color: #e32400;
  font-style: normal;
  font-weight: 700;
}

.sf-checkout-field__inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #111;
}

.sf-checkout-field__inline svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #888;
}

.sf-checkout-field__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
}

.sf-checkout-field__box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #111;
}

.sf-checkout-field__box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #888;
}

.sf-checkout-block {
  margin-bottom: 0.85rem;
}

.sf-timing-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.25rem;
  background: #ececec;
  border-radius: 14px;
}

.sf-timing-tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  background: transparent;
  color: #666;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.sf-timing-tab.is-active {
  background: #111;
  color: #fff;
}

.sf-checkout-select__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
}

.sf-checkout-select__box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border-radius: 14px;
}

.sf-checkout-select__box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #888;
}

.sf-checkout-select__input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #111;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.sf-checkout-dropdown {
  position: relative;
}

.sf-checkout-dropdown__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border-radius: 14px;
  text-align: left;
}

.sf-checkout-dropdown__toggle svg:first-child {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #888;
}

.sf-checkout-dropdown__hint,
.sf-checkout-dropdown__value,
.sf-scheduled-field__label,
.sf-scheduled-field__value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111;
}

.sf-checkout-dropdown__hint {
  flex: 1;
  color: #666;
  font-weight: 500;
}

.sf-checkout-dropdown__value {
  margin-left: auto;
  white-space: nowrap;
}

.sf-checkout-dropdown__chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #aaa;
  transition: transform 0.2s;
}

.sf-checkout-dropdown.is-open .sf-checkout-dropdown__chev {
  transform: rotate(180deg);
}

.sf-checkout-dropdown__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 220px;
  overflow: auto;
}

.sf-checkout-dropdown__option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #111;
  text-align: left;
}

.sf-checkout-dropdown__option:hover {
  background: #fafafa;
}

.sf-checkout-dropdown__option.is-active {
  color: var(--sf-btn-bg, #e32400);
}

.sf-checkout-dropdown__option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sf-checkout-dropdown__empty {
  display: block;
  padding: 0.75rem 0.95rem;
  font-size: 0.82rem;
  color: #888;
}

.sf-scheduled-warn {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #c62828;
}

.sf-scheduled-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.sf-scheduled-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  text-align: left;
  min-height: 64px;
}

.sf-scheduled-field__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
}

.sf-scheduled-field__value {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.sf-scheduled-field svg {
  align-self: flex-end;
  width: 16px;
  height: 16px;
  color: #888;
  margin-top: auto;
}

.sf-checkout-dropdown--compact .sf-checkout-dropdown__toggle {
  flex-direction: column;
  align-items: flex-start;
  min-height: 64px;
  position: relative;
  padding-right: 2rem;
}

.sf-checkout-dropdown--compact .sf-checkout-dropdown__value {
  margin-left: 0;
}

.sf-checkout-dropdown--compact .sf-checkout-dropdown__chev {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

.sf-checkout-dropdown--compact.is-open .sf-checkout-dropdown__chev {
  transform: translateY(-50%) rotate(180deg);
}

.sf-checkout-dropdown--compact .sf-checkout-dropdown__toggle > svg:first-child {
  display: none;
}

.sf-checkout-accordion {
  margin-bottom: 0.55rem;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.sf-checkout-accordion__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  color: #111;
}

.sf-checkout-accordion__head svg:first-child {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #888;
}

.sf-checkout-accordion__title {
  flex: 1;
}

.sf-checkout-accordion__value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.sf-checkout-comment-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: #fff;
  border-radius: 14px;
}

.sf-checkout-comment-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #9333ea;
  color: #fff;
  flex-shrink: 0;
}

.sf-checkout-comment-row__icon svg {
  width: 16px;
  height: 16px;
}

.sf-checkout-comment-row__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: #111;
  outline: none;
}

.sf-checkout-comment-row__input::placeholder {
  color: #888;
}

.sf-kaspi-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-weight: 800;
}

.sf-kaspi-logo {
  color: #F14635;
  letter-spacing: -0.02em;
}

.sf-kaspi-dot {
  color: #111;
  font-weight: 700;
}

.sf-checkout-accordion .sf-payment-method__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f4f4f4;
  color: #444;
  overflow: hidden;
}

.sf-checkout-accordion .sf-payment-method__icon svg {
  width: 20px;
  height: 20px;
}

.sf-checkout-accordion .sf-payment-method__icon--kaspi {
  background: #F14635;
  padding: 0;
}

.sf-checkout-accordion .sf-payment-method__icon--kaspi img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sf-checkout-accordion .sf-payment-method__icon--cash {
  background: #e8f5e9;
  color: #2e7d32;
}

.sf-checkout-accordion .sf-payment-method__icon--card {
  background: #eef2ff;
  color: #3949ab;
}

.sf-checkout-accordion .sf-payment-method__check-slot {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sf-checkout-summary__items strong {
  font-weight: 800;
  color: #111;
}

.sf-checkout-accordion__chev {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #aaa;
  transition: transform 0.2s;
}

.sf-checkout-accordion.is-open .sf-checkout-accordion__chev {
  transform: rotate(180deg);
}

.sf-checkout-accordion__body {
  padding: 0 0.85rem 0.85rem;
}

.sf-checkout-accordion.is-open .sf-checkout-accordion__body {
  padding-top: 0;
}

#sfPaymentAccordion .sf-checkout-accordion__head {
  padding-bottom: 0.45rem;
}

#sfPaymentAccordion.is-open .sf-checkout-accordion__body {
  padding-top: 0;
  padding-bottom: 0.35rem;
}

.sf-checkout-accordion__body[hidden] {
  display: none !important;
}

.sf-checkout-accordion .sf-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sf-checkout-accordion .sf-payment-method {
  border: none;
  border-radius: 0;
  padding: 0.7rem 0;
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  text-align: left;
}

.sf-checkout-accordion .sf-payment-method__label {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111;
}

.sf-checkout-accordion .sf-payment-method__badge {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #f0f0f0;
  color: #888;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sf-checkout-accordion .sf-payment-method__check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--sf-btn-bg, #d32f2f);
}

.sf-cash-change {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #f0f0f0;
}

.sf-cash-change__input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fafafa;
  font-size: 0.9rem;
  font-weight: 600;
}

.sf-cash-change__input:focus {
  outline: none;
  border-color: var(--sf-btn-bg, #d32f2f);
  background: #fff;
}

.sf-cash-change__hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
}

.sf-cash-change__hint.is-error { color: #c62828; }
.sf-cash-change__hint.is-ok { color: #2e7d32; }

.sf-checkout-accordion .sf-payment-method.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sf-checkout-accordion .sf-payment-method.is-disabled .sf-payment-method__label {
  color: #888;
}

.sf-checkout-accordion .sf-payment-method:last-child {
  border-bottom: none;
}

.sf-checkout-accordion .sf-payment-method.is-active {
  background: transparent;
  color: #111;
}

.sf-checkout-accordion .sf-order-comment {
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fafafa;
}

.sf-cashback-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 0.85rem 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--sf-accent, #5E4AE3) 12%, #fff);
}

.sf-cashback-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sf-cashback-card__text strong {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--sf-accent, #5E4AE3);
}

.sf-cashback-card__text span {
  font-size: 0.76rem;
  color: color-mix(in srgb, var(--sf-accent, #5E4AE3) 75%, #333);
}

.sf-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.sf-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sf-switch__slider {
  display: block;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: #ddd;
  transition: background 0.2s;
  position: relative;
}

.sf-switch__slider::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, 0.15);
  transition: transform 0.2s;
}

.sf-switch input:checked + .sf-switch__slider {
  background: var(--sf-accent, #5E4AE3);
}

.sf-switch input:checked + .sf-switch__slider::after {
  transform: translateX(18px);
}

.sf-checkout-summary {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
}

.sf-checkout-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #666;
}

.sf-checkout-summary__row s {
  color: #aaa;
  margin-right: 0.3rem;
}

.sf-checkout-summary__row + .sf-checkout-summary__row {
  margin-top: 0.45rem;
}

.sf-checkout-summary__row--total {
  margin-top: 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111;
}

.sf-checkout-summary__row--total span:last-child {
  font-size: 1.05rem;
}

.sf-checkout-note {
  margin: 0.45rem 0 0;
  font-size: 0.76rem;
  color: #888;
}

.sf-field--compact span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
}

.sf-checkout-extras {
  margin: 0.55rem 0;
}

.sf-date-picker {
  width: min(100%, 520px);
  padding: 0;
  overflow: hidden;
}

.sf-date-picker__layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  min-height: 320px;
}

.sf-date-picker__preview {
  display: flex;
  align-items: flex-end;
  padding: 1.25rem 1rem;
  background: #f5f5f5;
}

.sf-date-picker__preview-label {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: #111;
}

.sf-date-picker__calendar {
  padding: 1rem 1.1rem 0.75rem;
}

.sf-date-picker__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sf-date-picker__month {
  font-size: 0.88rem;
  font-weight: 700;
}

.sf-date-picker__nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.2rem;
  color: #666;
}

.sf-date-picker__nav-btn:hover {
  background: #f5f5f5;
}

.sf-date-picker__weekdays,
.sf-date-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.sf-date-picker__weekdays {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  text-align: center;
}

.sf-date-picker__day,
.sf-date-picker__cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
}

.sf-date-picker__day {
  border-radius: 999px;
}

.sf-date-picker__day:hover:not(:disabled) {
  background: #f5f5f5;
}

.sf-date-picker__day.is-selected {
  background: #111;
  color: #fff;
}

.sf-date-picker__day.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sf-date-picker__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid #eee;
}

@media (max-width: 520px) {
  .sf-date-picker__layout {
    grid-template-columns: 1fr;
  }

  .sf-date-picker__preview {
    align-items: center;
    justify-content: center;
    min-height: 72px;
  }

  .sf-scheduled-row {
    grid-template-columns: 1fr;
  }
}

.sf-modal__panel--checkout {
  width: min(100%, 460px);
  padding: 1.25rem;
}

.sf-modal__panel--success {
  width: min(100%, 400px);
  padding: 2rem 1.5rem;
  text-align: center;
}

.sf-checkout__title {
  margin: 0 0 1rem;
  padding-right: 2rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.sf-checkout__section {
  margin: 1rem 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sf-checkout-preview {
  background: #f8f8f8;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  line-height: 1.55;
}

.sf-checkout-preview__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.sf-checkout-preview__row + .sf-checkout-preview__row {
  margin-top: 0.35rem;
}

.sf-checkout-preview__row--total {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e8e8e8;
  font-weight: 800;
  font-size: 0.95rem;
}

.sf-checkout-preview__warn {
  margin-top: 0.55rem;
  color: #c62828;
  font-size: 0.78rem;
}

.sf-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sf-payment-method {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  background: #fff;
}

.sf-payment-method.is-active {
  border-color: var(--sf-btn-bg, #e32400);
  background: rgba(227, 36, 0, 0.06);
}

.sf-order-comment {
  width: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  min-height: 64px;
  outline: none;
  font: inherit;
}

.sf-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 1.6rem;
  line-height: 56px;
  font-weight: 700;
}

.sf-success-text {
  margin: 0 0 1.25rem;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.45;
}

.sf-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(120%);
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.25s ease;
  pointer-events: none;
}

.sf-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.sf-toast[hidden] { display: block; }
.sf-toast:not(.is-visible) { opacity: 0; }
.sf-toast.is-visible { opacity: 1; }

/* ── Online payments (Kaspi / card) ── */
.sf-modal__panel--pay {
  width: min(100%, 420px);
  padding: 1.25rem;
}

.sf-pay__title {
  margin: 0 0 0.35rem;
  padding-right: 2rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.sf-pay__amount {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 800;
}

.sf-pay__status {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
}

.sf-kaspi-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.85rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
}

.sf-kaspi-qr canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.sf-kaspi-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: #666;
  text-align: center;
}

.sf-kaspi-mobile {
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.08), #fff);
  border: 1px solid rgba(234, 88, 12, 0.2);
  text-align: center;
}

.sf-btn--kaspi {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
  text-decoration: none;
}

.sf-btn--ghost {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  background: transparent;
  border: 1px solid #e5e5e5;
  color: #444;
}

.sf-kaspi-retry,
.sf-kaspi-simulate {
  font-size: 0.82rem;
}

.sf-modal--card-sheet {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.sf-card-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 400px);
  height: 100%;
  height: 100dvh;
  background: #fff;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
  animation: sfCardSheetIn 0.24s ease;
}

@keyframes sfCardSheetIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (max-width: 899px) {
  .sf-card-sheet {
    width: 100%;
  }
}

.sf-card-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.1rem 0.85rem;
  flex-shrink: 0;
}

.sf-card-sheet__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.sf-card-sheet__amount {
  margin: 0.28rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #666;
}

.sf-card-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.15rem 1.1rem 0.4rem;
}

.sf-card-sheet__foot {
  flex-shrink: 0;
  padding: 0.85rem 1.1rem max(1rem, env(safe-area-inset-bottom));
  border-top: 1px solid #f0f0f0;
  background: #fff;
}

.sf-card-sheet__foot .sf-btn {
  width: 100%;
}

.sf-card-sheet__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #999;
  text-align: center;
}

.sf-card-sheet__secure svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sf-card-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sf-card-form[hidden] { display: none !important; }

.sf-card-form .sf-field {
  margin-bottom: 0;
}

.sf-card-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.sf-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
}

.sf-saved-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.sf-pay-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 0.95rem;
  border: 1px solid #ececec;
  border-radius: 16px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.sf-pay-card.is-active {
  border-color: var(--sf-btn-bg, #e32400);
}

.sf-pay-card__radio {
  width: 18px;
  height: 18px;
  border: 2px solid #d0d0d0;
  border-radius: 999px;
  flex-shrink: 0;
  position: relative;
}

.sf-pay-card.is-active .sf-pay-card__radio {
  border-color: var(--sf-btn-bg, #e32400);
}

.sf-pay-card.is-active .sf-pay-card__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--sf-btn-bg, #e32400);
}

.sf-pay-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f5f5f5;
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sf-pay-card__icon svg {
  width: 18px;
  height: 18px;
}

.sf-pay-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.sf-pay-card__body strong {
  font-size: 0.95rem;
  font-weight: 750;
  color: #111;
}

.sf-pay-card__body em {
  font-style: normal;
  font-size: 0.78rem;
  color: #888;
}

.sf-3ds-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.sf-3ds-overlay[hidden] { display: none; }

.sf-3ds-overlay__box {
  width: min(100%, 480px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.sf-3ds-overlay__title {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 1px solid #eee;
}

.sf-3ds-frame {
  width: 100%;
  height: min(70vh, 520px);
  border: 0;
}

@media (min-width: 768px) {
  .sf-kaspi-mobile { display: none !important; }
}

@media (max-width: 767.98px) {
  .sf-kaspi-qr { display: none !important; }
}

/* ── Profile menu ── */
.sf-modal__panel--menu {
  width: min(100%, 420px);
  max-height: min(92vh, 720px);
  padding: 1.35rem 1.25rem 1.5rem;
  overflow-y: auto;
  position: relative;
}

.sf-profile-sheet-handle {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #ddd;
  margin: 0 auto 0.85rem;
}

.sf-profile-subview[hidden],
.sf-profile-menu[hidden] {
  display: none !important;
}

.sf-profile-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0.65rem;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
}

.sf-profile-subview__title {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sf-profile-menu__count {
  margin-left: 0.35rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #f0f0f0;
  color: #666;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sf-profile-cashback-summary {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: #f3f3f3;
  margin-bottom: 0.85rem;
}

.sf-profile-cashback-summary__balance {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.55rem;
  font-weight: 800;
}

.sf-profile-cashback-summary p {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.4;
}

.sf-favorites-list,
.sf-cashback-tx-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sf-favorite-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.sf-favorite-row:last-child { border-bottom: 0; }

.sf-favorite-row__img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #ebebeb;
}

.sf-favorite-row__name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #111;
}

.sf-favorite-row__price {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #666;
}

.sf-favorite-row__chev {
  width: 18px;
  height: 18px;
  color: #bbb;
}

.sf-cashback-tx {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.sf-cashback-tx:last-child { border-bottom: 0; }

.sf-cashback-tx__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
  color: #111;
}

.sf-cashback-tx__meta {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #999;
}

.sf-cashback-tx__delta {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.sf-cashback-tx__delta.is-earn { color: #2e7d32; }
.sf-cashback-tx__delta.is-spend { color: #c62828; }

/* Mobile: bottom sheet как в TagamGo */
@media (max-width: 899px) {
  #sfProfileModal.sf-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  #sfProfileModal .sf-modal__panel--menu {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, 860px);
    border-radius: 22px 22px 0 0;
    margin: 0;
    padding:
      0.55rem 1.15rem
      max(1.15rem, env(safe-area-inset-bottom));
  }

  #sfProfileModal .sf-profile-sheet-handle {
    display: block;
  }

  #sfProfileModal .sf-profile-menu__close-desktop {
    display: none;
  }

  #sfProfileModal .sf-profile-menu__name-row strong {
    font-size: 1.22rem;
  }
}

.sf-profile-menu__head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.sf-profile-menu__avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  flex-shrink: 0;
}

.sf-profile-menu__avatar svg {
  width: 28px;
  height: 28px;
}

.sf-profile-menu__identity {
  flex: 1;
  min-width: 0;
}

.sf-profile-menu__name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sf-profile-menu__name-row strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sf-profile-menu__edit {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #888;
}

.sf-profile-menu__edit:hover {
  background: #f3f3f3;
}

.sf-profile-menu__edit svg {
  width: 16px;
  height: 16px;
}

.sf-profile-menu__phone {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  color: #666;
}

.sf-profile-menu__cashback {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #f3f3f3;
}

.sf-profile-menu__cashback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sf-profile-menu__cashback-tier {
  font-size: 1rem;
  font-weight: 800;
}

.sf-profile-menu__cashback-info {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #888;
}

.sf-profile-menu__cashback-info svg {
  width: 18px;
  height: 18px;
}

.sf-profile-menu__cashback-balance {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.55rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sf-profile-menu__coin {
  font-size: 1.2rem;
  color: #f5a623;
}

.sf-profile-menu__cashback-note {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #888;
}

.sf-profile-menu__nav {
  display: flex;
  flex-direction: column;
}

.sf-profile-menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.95rem 0;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  cursor: pointer;
}

.sf-profile-menu__item:last-child {
  border-bottom: 0;
}

.sf-profile-menu__item:hover {
  color: #333;
}

.sf-profile-menu__item-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #666;
  flex-shrink: 0;
}

.sf-profile-menu__item-icon svg {
  width: 20px;
  height: 20px;
}

.sf-profile-menu__item-chev {
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: #bbb;
  flex-shrink: 0;
}

.sf-profile-menu__item--danger {
  color: #e32400;
}

.sf-profile-menu__item--danger .sf-profile-menu__item-icon {
  color: #e32400;
}

.sf-profile-menu__item--danger .sf-profile-menu__item-chev {
  display: none;
}

/* legacy profile blocks kept for order history modal */
.sf-modal__panel--profile {
  width: min(100%, 480px);
  max-height: min(92vh, 720px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sf-profile__title {
  margin: 0 0 0.85rem;
  padding-right: 2rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.sf-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.sf-profile-phone {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.sf-profile-name {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: #666;
}

.sf-profile-balance {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #f8f8f8;
  font-size: 0.85rem;
}

.sf-profile-balance strong {
  font-weight: 800;
}

.sf-logout-btn {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
}

.sf-profile-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding: 0.2rem;
  background: #f2f2f2;
  border-radius: 12px;
}

.sf-profile-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #666;
  cursor: pointer;
}

.sf-profile-tab.is-active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.sf-profile-pane {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: min(52vh, 420px);
}

.sf-profile-empty {
  margin: 1.5rem 0;
  text-align: center;
  color: #888;
  font-size: 0.85rem;
}

.sf-order-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.sf-order-card:hover {
  border-color: #ddd;
}

.sf-order-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}

.sf-order-card__num {
  font-weight: 800;
  font-size: 0.92rem;
}

.sf-order-card__total {
  font-weight: 800;
  white-space: nowrap;
}

.sf-order-card__meta {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #777;
  line-height: 1.4;
}

.sf-order-status {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sf-order-status--active {
  background: #e3f2fd;
  color: #1565c0;
}

.sf-order-status--done {
  background: #e8f5e9;
  color: #2e7d32;
}

.sf-order-status--cancel {
  background: #ffebee;
  color: #c62828;
}

.sf-order-back {
  border: 0;
  background: none;
  padding: 0;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
}

.sf-order-detail__head {
  margin-bottom: 0.85rem;
}

.sf-order-detail__head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.sf-order-detail__meta {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.45;
}

.sf-order-detail__lines {
  border-top: 1px solid #eee;
  padding-top: 0.65rem;
}

.sf-order-detail-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #f5f5f5;
}

.sf-order-detail-line__name {
  font-weight: 600;
}

.sf-order-detail-line__sub {
  font-size: 0.75rem;
  color: #888;
}

.sf-order-detail__totals {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
}

.sf-cashback-tx {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.82rem;
}

.sf-cashback-tx__delta--plus {
  color: #2e7d32;
  font-weight: 700;
}

.sf-cashback-tx__delta--minus {
  color: #c62828;
  font-weight: 700;
}

.sf-cashback-tx__note {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.15rem;
}

/* ── Order history modal ── */
.sf-modal__panel--history {
  width: min(100%, 520px);
  max-height: min(92vh, 760px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#sfOrderHistoryListView,
#sfHistoryOrderDetailView {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#sfHistoryOrderDetailView {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sf-order-history__title {
  margin: 0 0 1rem;
  padding-right: 2rem;
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sf-order-history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: min(68vh, 620px);
  padding-right: 0.15rem;
}

.sf-order-history-card {
  margin-bottom: 0.85rem;
  padding: 1rem;
  border: 1px solid #ececec;
  border-radius: 18px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.sf-order-history-card.is-highlight,
.sf-order-history-card.is-expanded {
  border-color: #ddd;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.sf-order-history-card__main {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  font: inherit;
}

.sf-order-history-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.sf-order-history-card__head .sf-order-status {
  margin-top: 0;
  flex-shrink: 0;
}

.sf-order-history-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: #111;
}

.sf-order-history-card__meta {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #888;
  line-height: 1.4;
}

.sf-order-history-card__context {
  margin-top: 0.65rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: #333;
}

.sf-order-history-card__type {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: #666;
}

.sf-order-history-card__items {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sf-order-history-item__more {
  padding-left: 3.4rem;
  font-size: 1.1rem;
  line-height: 1;
  color: #999;
  letter-spacing: 0.08em;
}

.sf-order-history-extra {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sf-order-history-extra__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #666;
}

.sf-order-history-extra__row strong {
  font-weight: 700;
  color: #111;
  text-align: right;
}

.sf-order-history-extra__comment {
  margin-top: 0.25rem;
  font-size: 0.84rem;
  color: #666;
}

.sf-order-history-extra__comment span {
  display: block;
  margin-bottom: 0.2rem;
}

.sf-order-history-extra__comment p {
  margin: 0;
  color: #333;
  line-height: 1.4;
}

.sf-order-history-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sf-order-history-item__thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  overflow: hidden;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
}

.sf-order-history-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-order-history-item__body {
  flex: 1;
  min-width: 0;
}

.sf-order-history-item__name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
}

.sf-order-history-item__variant {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: #888;
}

.sf-order-history-item__price {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #666;
}

.sf-order-history-card__foot {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f0f0f0;
}

.sf-order-history-card__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: #666;
}

.sf-order-history-card__total strong {
  font-size: 1rem;
  color: #111;
}

.sf-order-history-card__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.sf-order-history-card__repeat {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: #f2f2f2;
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
  cursor: pointer;
}

.sf-order-history-card__repeat:hover {
  background: #ebebeb;
}

.sf-order-history-card__info {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #f2f2f2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #666;
  cursor: pointer;
}

.sf-order-history-card__info.is-active {
  background: color-mix(in srgb, var(--sf-btn-bg, #d32f2f) 14%, #fff);
  color: var(--sf-btn-bg, #d32f2f);
}

.sf-order-history-card__info svg {
  width: 18px;
  height: 18px;
}

.sf-reviews-panel {
  display: flex;
  flex-direction: column;
}

.sf-reviews-head__meta {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.82rem;
  color: #888;
}

.sf-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  padding-bottom: 0.75rem;
}

.sf-review-card {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: #f6f6f6;
}

.sf-review-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.sf-review-card__name {
  font-weight: 800;
  font-size: 0.92rem;
}

.sf-review-card__date {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: #888;
}

.sf-review-card__status {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b26a00;
}

.sf-review-stars {
  display: inline-flex;
  gap: 0.12rem;
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1;
}

.sf-review-stars--pick {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.4rem 0 1rem;
  font-size: 1.85rem;
}

.sf-review-star {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: default;
  line-height: 1;
}

.sf-review-stars--pick .sf-review-star {
  cursor: pointer;
  color: #e0e0e0;
}

.sf-review-star.is-on {
  color: #f5a623;
}

.sf-review-card__body {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #333;
}

.sf-review-card__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.sf-review-card__photos img,
.sf-review-photo-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
}

.sf-review-reply {
  margin-top: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #fff;
}

.sf-review-reply__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sf-btn-bg, #d32f2f);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sf-review-reply p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #333;
}

.sf-reviews-write-btn {
  flex-shrink: 0;
  min-height: 50px;
  border-radius: 999px;
}

.sf-reviews-write__hint {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: #888;
}

.sf-review-body {
  width: 100%;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  resize: vertical;
  outline: none;
  font: inherit;
}

.sf-review-body:focus { border-color: #999; }

.sf-review-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.sf-review-photo-preview {
  position: relative;
}

.sf-review-photo-preview button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 0.7rem;
  line-height: 20px;
}

.sf-review-attach {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-bottom: 0.85rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--sf-btn-bg, #d32f2f);
  cursor: pointer;
}

@media (max-width: 899px) {
  #sfReviewsModal.sf-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  #sfReviewsModal .sf-modal__panel--history {
    width: 100%;
    max-width: 100%;
    height: min(92dvh, 860px);
    max-height: min(92dvh, 860px);
    border-radius: 22px 22px 0 0;
    margin: 0;
    padding:
      0.85rem 1.1rem
      max(1.1rem, env(safe-area-inset-bottom));
  }
}

/* История заказов — нижняя панель на мобиле, список скроллится */
@media (max-width: 899px) {
  #sfOrderHistoryModal.sf-modal {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }

  #sfOrderHistoryModal .sf-modal__panel--history {
    width: 100%;
    max-width: 100%;
    height: min(92dvh, 860px);
    max-height: min(92dvh, 860px);
    border-radius: 22px 22px 0 0;
    margin: 0;
    padding:
      0.85rem 1.1rem
      max(1.1rem, env(safe-area-inset-bottom));
  }

  #sfOrderHistoryModal .sf-order-history-list {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
}

.sf-order-history-detail__head h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.sf-order-history-detail__head p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #666;
}

.sf-order-history-detail__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
}

.sf-order-history-detail__repeat {
  width: 100%;
  margin-top: 0.85rem;
}

.sf-support-panel {
  padding-bottom: 0.85rem;
}

.sf-support-head {
  padding-right: 2rem;
  margin-bottom: 0.65rem;
}

.sf-support-head__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #777;
}

.sf-support-head__wa {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #128c7e;
}

.sf-support-head__wa[hidden] { display: none; }

.sf-support-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
  padding: 0.22rem;
  border-radius: 14px;
  background: #f4f4f4;
}

.sf-support-tabs[hidden] { display: none; }

.sf-support-tab {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 0.55rem 0.4rem;
  background: transparent;
  color: #666;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.sf-support-tab.is-active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sf-support-closed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: #f6f6f6;
  color: #555;
  font-size: 0.82rem;
  font-weight: 600;
}

.sf-support-closed[hidden] { display: none; }

.sf-support-closed__btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.sf-support-history {
  min-height: 220px;
  max-height: min(58vh, 520px);
  overflow-y: auto;
}

.sf-support-form[hidden],
.sf-support-composer[hidden] { display: none; }

.sf-support-log {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: min(52vh, 460px);
  overflow-y: auto;
  padding: 0.75rem 0.15rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sf-support-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.sf-support-msg--me {
  align-self: flex-end;
  align-items: flex-end;
}

.sf-support-msg--them {
  align-self: flex-start;
  align-items: flex-start;
}

.sf-support-bubble {
  padding: 0.65rem 0.8rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.sf-support-msg--me .sf-support-bubble {
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
}

.sf-support-msg--them .sf-support-bubble {
  background: #f3f3f3;
  color: #111;
}

.sf-support-bubble img {
  width: min(180px, 100%);
  border-radius: 10px;
  margin-bottom: 0.35rem;
}

.sf-support-time {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: #999;
}

.sf-support-composer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid #eee;
}

.sf-support-attach {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f4f4f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sf-support-attach svg {
  width: 20px;
  height: 20px;
}

.sf-support-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
}

.sf-support-send {
  flex: 0 0 auto;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
  font-size: 0.82rem;
  font-weight: 700;
}

.sf-support-send:disabled {
  opacity: 0.45;
}

.sf-support-preview {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #666;
}

.sf-support-preview[hidden] { display: none; }

/* ── Saved cards / Messages (drawer screens) ── */
.sf-cards-list,
.sf-messages-list {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: min(68vh, 620px);
  padding-right: 0.15rem;
}

.sf-card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 0.95rem;
  margin-bottom: 0.55rem;
  border: 1px solid #ececec;
  border-radius: 16px;
  background: #fff;
  text-align: left;
}

.sf-card-row__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f4f4f4;
  color: #444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sf-card-row__icon svg {
  width: 22px;
  height: 22px;
}

.sf-card-row__body {
  flex: 1;
  min-width: 0;
}

.sf-card-row__title {
  font-size: 0.95rem;
  font-weight: 750;
  color: #111;
}

.sf-card-row__meta {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #888;
}

.sf-card-row__badge {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #f0eefc;
  color: #5b4fd6;
  font-size: 0.68rem;
  font-weight: 700;
}

.sf-card-row__actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sf-card-row__btn {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: #333;
  white-space: nowrap;
}

.sf-card-row__btn:hover { background: #fafafa; }
.sf-card-row__btn--danger { color: #e53935; border-color: #f0cfcf; }

.sf-message-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.95rem 1rem;
  margin-bottom: 0.55rem;
  border: 1px solid #ececec;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
}

.sf-message-row:hover { border-color: #ddd; }
.sf-message-row.is-unread {
  border-color: #e0d9ff;
  background: #fbfaff;
}

.sf-message-row__top {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: flex-start;
}

.sf-message-row__title {
  font-size: 0.95rem;
  font-weight: 750;
  color: #111;
}

.sf-message-row__dot {
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: #e53935;
  flex-shrink: 0;
}

.sf-message-row__body {
  margin-top: 0.3rem;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sf-message-row__date {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #999;
}

.sf-message-detail {
  padding-top: 0.35rem;
}

.sf-message-detail__title {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.sf-message-detail__date {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: #888;
}

.sf-message-detail__body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #222;
  white-space: pre-wrap;
}

.sf-message-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.sf-message-detail__actions .sf-btn {
  width: auto;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.sf-message-detail__actions .sf-btn--primary {
  background: #111;
  color: #fff;
}

.sf-message-detail__actions .sf-btn--ghost {
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
}

/* ── Checkout promocode (Flutter: поле + «Применить») ── */
.sf-checkout-extras {
  margin: 0.75rem 0;
}

.sf-promo-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sf-promo-block__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
}

.sf-promo-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.sf-promo-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #fff;
  outline: none;
}

.sf-promo-input:focus {
  border-color: var(--sf-btn-bg, #d32f2f);
}

.sf-promo-input:disabled {
  background: #f7f7f7;
  color: #333;
}

.sf-promo-apply,
.sf-promo-clear {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0 0.95rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sf-promo-apply {
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
  border: none;
}

.sf-promo-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sf-promo-clear {
  background: #fff;
  color: #555;
  border: 1px solid #e0e0e0;
}

.sf-promo-clear[hidden],
.sf-promo-apply[hidden] {
  display: none !important;
}

.sf-promo-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.sf-promo-hint.is-ok { color: #2e7d32; }
.sf-promo-hint.is-error { color: #c62828; }

.sf-cashback-check {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f8f8f8;
}

/* ── Side drawer (1:1 Flutter Web: mobile + desktop) ── */
.sf-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 120;
}

.sf-drawer-root[hidden] {
  display: none !important;
}

.sf-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sf-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  /* Mobile Flutter: почти на всю ширину */
  width: min(20rem, 86vw);
  max-width: 100%;
  background: var(--sf-drawer-bg, #fff);
  color: var(--sf-drawer-text, #1a1a1a);
  background-image: var(--sf-drawer-bg-image, none);
  background-size: cover;
  background-position: center;
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  transform: translateX(-104%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding:
    max(0.65rem, env(safe-area-inset-top))
    0
    max(0.75rem, env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  .sf-drawer {
    width: 300px;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.12);
  }
}

.sf-drawer-root.is-open .sf-drawer__backdrop { opacity: 1; }
.sf-drawer-root.is-open .sf-drawer { transform: translateX(0); }

.sf-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem 0.85rem 1.25rem;
  flex-shrink: 0;
}

.sf-drawer__brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--sf-drawer-text, #111);
  line-height: 1.15;
}

.sf-drawer__close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sf-drawer-text, #222);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.sf-drawer__close:active {
  background: color-mix(in srgb, var(--sf-drawer-text, #111) 12%, transparent);
}
.sf-drawer__close svg { width: 20px; height: 20px; }

@media (hover: hover) {
  .sf-drawer__close:hover {
    background: color-mix(in srgb, var(--sf-drawer-text, #111) 10%, transparent);
  }
}

.sf-drawer__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.15rem 0.35rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.sf-drawer__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding: 0.7rem 1rem;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 450;
  color: #1a1a1a;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

a.sf-drawer__item,
.sf-drawer__item { color: var(--sf-drawer-text, #1a1a1a); }
a.sf-drawer__item { text-decoration: none; }

.sf-drawer__item:active {
  background: color-mix(in srgb, var(--sf-drawer-text, #111) 12%, transparent);
}
.sf-drawer__item[hidden] { display: none !important; }

@media (hover: hover) {
  .sf-drawer__item:hover {
    background: color-mix(in srgb, var(--sf-drawer-text, #111) 10%, transparent);
  }
}

.sf-drawer__label {
  flex: 0 1 auto;
  line-height: 1.25;
}

.sf-drawer__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sf-drawer-icon, #1c1c1c);
  flex-shrink: 0;
}

.sf-drawer__icon svg { width: 22px; height: 22px; display: block; }
.sf-drawer__icon--danger { color: #e53935; }

.sf-drawer__badge {
  margin-left: 0.45rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.sf-drawer__foot {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--sf-drawer-text, #111) 16%, transparent);
  margin-top: auto;
}

.sf-drawer__apps {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sf-drawer__app {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--sf-drawer-text, #111);
  text-decoration: none;
  line-height: 1.35;
}

.sf-drawer__app:active {
  opacity: 0.7;
}

.sf-drawer__link {
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--sf-drawer-text, #111) 58%, transparent);
  font-weight: 500;
  line-height: 1.35;
  align-self: flex-start;
  text-decoration: none;
}

.sf-drawer__link:active {
  color: var(--sf-drawer-text, #111);
}
.sf-drawer__link[hidden] { display: none !important; }

@media (hover: hover) {
  .sf-drawer__link:hover {
    color: var(--sf-drawer-text, #111);
  }
}

.sf-drawer__logout {
  width: calc(100% + 0.5rem);
  margin: 0.35rem -0.25rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 52px;
  padding: 0.7rem 0.85rem;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #e53935;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.sf-drawer__logout:active { background: rgba(229, 57, 53, 0.06); }
.sf-drawer__logout[hidden] { display: none !important; }

@media (hover: hover) {
  .sf-drawer__logout:hover { background: rgba(229, 57, 53, 0.05); }
}

body.sf-drawer-open { overflow: hidden; }

/* Mobile: drawer чуть шире + крупнее тач-зоны (как Flutter phone) */
@media (max-width: 899px) {
  .sf-drawer {
    width: min(21.5rem, 88vw);
  }

  .sf-drawer__item,
  .sf-drawer__logout {
    min-height: 54px;
    font-size: 1.02rem;
  }

  .sf-header {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .sf-header__title {
    font-size: 1.12rem;
    font-weight: 800;
  }

  .sf-header__logo { height: 24px; }
}

.sf-modal__panel--text {
  max-width: 480px;
  width: min(92vw, 480px);
  max-height: min(80vh, 640px);
  overflow: auto;
  padding: 1.5rem 1.35rem 1.35rem;
}

.sf-text-modal__body {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #333;
  white-space: pre-wrap;
}

.sf-text-modal__body:has(.sf-banner-viewer__img) {
  white-space: normal;
}

.sf-text-modal__body:has(.sf-drawer-page__figure),
.sf-text-modal__body:has(.sf-drawer-page__btn) {
  white-space: normal;
}

.sf-drawer-page__heading {
  margin: 1rem 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #111;
}

.sf-drawer-page__heading:first-child {
  margin-top: 0;
}

.sf-drawer-page__text {
  margin: 0 0 0.75rem;
  white-space: pre-wrap;
}

.sf-drawer-page__figure {
  margin: 0.85rem 0 1rem;
}

.sf-drawer-page__image {
  display: block;
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  background: #f3f3f3;
}

.sf-drawer-page__caption {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #666;
  text-align: center;
}

.sf-drawer-page__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin: 0.65rem 0;
  padding: 0.65rem 1rem;
  border-radius: 14px;
  background: var(--sf-btn-bg, #d32f2f);
  color: var(--sf-btn-text, #fff);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.sf-drawer-page__link {
  display: inline-block;
  margin: 0.35rem 0 0.75rem;
  color: var(--sf-btn-bg, #d32f2f);
  font-weight: 600;
  text-decoration: underline;
}

.sf-banner-viewer__img {
  display: block;
  width: 100%;
  max-height: min(70vh, 640px);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  object-fit: contain;
  background: #f3f3f3;
}

.sf-banner-viewer__text {
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 899px) {
  #sfTextModal.sf-modal:has(.sf-banner-viewer__img) {
    align-items: flex-end;
    padding: 0;
  }

  #sfTextModal.sf-modal:has(.sf-banner-viewer__img) .sf-modal__panel--text {
    width: 100%;
    max-width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: min(88dvh, 760px);
    margin: 0;
  }
}

/* ── Legal document pages (privacy / offer) ── */
.sf-legal-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 80% at 10% -10%, color-mix(in srgb, var(--sf-btn-bg, #d32f2f) 12%, transparent), transparent 55%),
    #f7f7f8;
  color: #111;
}

.sf-legal-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: rgba(247, 247, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #ececec;
}

.sf-legal-back {
  font-size: 0.88rem;
  font-weight: 600;
  color: #666;
  text-decoration: none;
  white-space: nowrap;
}

.sf-legal-back:hover { color: #111; }

.sf-legal-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #111;
  font-weight: 800;
  font-size: 0.95rem;
}

.sf-legal-brand img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.sf-legal-main {
  flex: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.sf-legal-doc {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 1.1rem;
  padding: 1.5rem 1.35rem 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.sf-legal-doc h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.sf-legal-updated {
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  font-size: 0.8rem;
  color: #888;
}

.sf-legal-body {
  font-size: 0.94rem;
  line-height: 1.65;
  color: #444;
  word-break: break-word;
}

.sf-legal-body br + br { display: block; content: ""; margin-top: 0.35rem; }

.sf-legal-foot {
  padding: 1.25rem 1rem 1.75rem;
  text-align: center;
  border-top: 1px solid #ececec;
  background: #fff;
}

.sf-legal-foot__nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.65rem;
}

.sf-legal-foot__nav a {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-decoration: none;
}

.sf-legal-foot__nav a:hover,
.sf-legal-foot__nav a.is-active {
  color: var(--sf-btn-bg, #d32f2f);
}

.sf-legal-foot__nav a.is-active { font-weight: 800; }

.sf-legal-foot__name {
  margin: 0;
  font-size: 0.75rem;
  color: #aaa;
}

@media (max-width: 640px) {
  .sf-legal-doc {
    padding: 1.2rem 1rem 1.4rem;
    border-radius: 0.95rem;
  }
}

/* ── Mobile legal document panel (privacy / offer) ── */
.sf-legal-panel {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: #fff;
}

.sf-legal-panel[hidden] {
  display: none !important;
}

.sf-legal-panel__sheet {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.sf-legal-panel__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding:
    max(0.55rem, env(safe-area-inset-top))
    0.75rem
    0.55rem
    0.35rem;
  border-bottom: 1px solid #efefef;
  flex-shrink: 0;
  background: #fff;
}

.sf-legal-panel__back {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.sf-legal-panel__back svg {
  width: 22px;
  height: 22px;
}

.sf-legal-panel__back:active {
  background: #f3f3f3;
}

.sf-legal-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #111;
}

.sf-legal-panel__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.1rem 1.15rem max(1.5rem, env(safe-area-inset-bottom));
  font-size: 0.94rem;
  line-height: 1.65;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

body.sf-legal-panel-open { overflow: hidden; }

/* На десктопе панель не нужна — открываются отдельные страницы */
@media (min-width: 900px) {
  .sf-legal-panel { display: none !important; }
}

.sf-cart-totals,
.sf-cart-gift,
.sf-drawer__powered,
.sf-drawer__icon--guest {
  display: none;
}

.sf-promo-tag--hit { background: #ff8a00; color: #fff; }
.sf-promo-tag--new { background: #7c4dff; color: #fff; }
.sf-promo-tag--sale { background: var(--sf-btn-bg, #d32f2f); }

@media (max-width: 899px) {
  body:not(.sf-logged-in) .sf-drawer__item--auth { display: none !important; }
  body:not(.sf-logged-in) .sf-drawer__icon--guest { display: inline-flex; }
  body:not(.sf-logged-in) .sf-drawer__icon--user { display: none; }
  body:not(.sf-logged-in) .sf-drawer__apps { display: none; }

  .sf-drawer {
    width: min(82vw, 22rem);
  }
  .sf-drawer__close { display: none; }
  .sf-drawer__head {
    padding: 1.15rem 1.35rem 0.65rem;
  }
  .sf-drawer__brand {
    font-size: 1.55rem;
  }
  .sf-drawer__item {
    min-height: 50px;
    font-size: 1.05rem;
    font-weight: 500;
  }
  .sf-drawer__powered {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid color-mix(in srgb, var(--sf-drawer-text, #111) 14%, transparent);
    font-size: 0.78rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--sf-drawer-text, #fff) 55%, transparent);
    line-height: 1.35;
  }
  .sf-drawer__powered strong {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--sf-drawer-text, #fff);
  }

  .sf-cart__summary { display: none !important; }
  .sf-cart__fees { display: none !important; }
  .sf-cart-progress { display: none !important; }
  .sf-cart-totals:not([hidden]) {
    display: block;
    margin: 0 0 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid #ececec;
    border-radius: 16px;
    background: #fff;
  }
  .sf-cart-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.28rem 0;
    font-size: 0.88rem;
    color: #555;
  }
  .sf-cart-totals__row strong {
    font-weight: 800;
    color: #111;
    font-variant-numeric: tabular-nums;
  }
  .sf-cart-totals__row--total {
    margin-top: 0.25rem;
    padding-top: 0.55rem;
    border-top: 1px solid #ececec;
    font-size: 1.02rem;
    font-weight: 700;
    color: #111;
  }
  .sf-cart-totals__delivery {
    font-weight: 700;
    color: #111;
  }
  .sf-cart-totals__delivery s {
    color: #b0b0b0;
    font-weight: 600;
    margin-right: 0.35rem;
  }
  .sf-cart-totals__delivery em {
    font-style: normal;
    font-weight: 800;
    color: #16a34a;
  }

  .sf-cart-gift:not([hidden]) {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: calc(100% - 2rem);
    margin: 0 1rem 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 0;
    border-radius: 14px;
    background: #f6f1e8;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
  }
  .sf-cart-gift__tag {
    flex-shrink: 0;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: #e8d5b5;
    color: #6b4f1d;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: lowercase;
  }
  .sf-cart-gift__text {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #222;
  }
  .sf-cart-gift__go {
    flex-shrink: 0;
    font-size: 0.86rem;
    font-weight: 700;
    color: #888;
  }

  .sf-cart__address {
    margin: 0 1rem 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: #f4f4f4;
    border: 0;
  }

  .sf-cart-line {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    padding: 0.85rem 0;
    border-bottom: 0;
  }
  .sf-cart-line__img {
    width: 72px;
    height: 72px;
    border-radius: 14px;
  }
  .sf-qty {
    background: #f0f0f0;
    padding: 0.22rem 0.28rem;
  }

  .sf-cart__header h2 {
    font-size: 1.2rem;
    font-weight: 800;
  }

  .sf-checkout-btn {
    border-radius: 16px;
    min-height: 3.25rem;
    font-size: 1rem;
  }
}
