/* ── FOODSIZO — main.css v5 (design_handoff_v2: тёплый крем + зелёный акцент) ── */
:root {
  /* ── Design Tokens ── */
  --bg:         #F6F4EF;
  --surface:    #FFFFFF;
  --surface-2:  #F1EEE8;
  --brand:      #2F7A5B;
  --brand-ink:  #245F47;
  --brand-50:   #E9F2ED;
  --accent:     #2F7A5B;
  --accent-ink: #245F47;
  --ink:        #22252B;
  --muted:      #7C7F88;
  --faint:      #A7AAB2;
  --line:       #E8E5DE;
  --line-2:     #EFEDE7;
  --ok:         #2F7A5B;
  --warn:       #C98A2B;
  --danger:     #C0503F;
  --sent:       #3B4048;

  /* Legacy aliases used by existing JS/HTML */
  --border:         #E8E5DE;
  --border-light:   #EFEDE7;
  --ink-2:          #7C7F88;
  --ink-3:          #A7AAB2;
  --accent-hover:   #245F47;
  --accent-light:   #E9F2ED;
  --accent-muted:   #D6E7DE;
  --accent-100:     #D6E7DE;
  --danger-light:   #F6ECE9;
  --warn-light:     #FBF1E2;
  --success:        #2F7A5B;
  --success-light:  #E9F2ED;
  --weight-ok:      #2F7A5B;
  --weight-warn:    #C98A2B;
  --weight-danger:  #C0503F;

  /* Shadows (тёплый оттенок) */
  --sh-sm:  0 1px 2px rgba(30,28,22,.05);
  --sh-md:  0 8px 24px rgba(30,28,22,.09);
  --sh-lg:  0 18px 44px rgba(30,28,22,.16);

  /* Legacy shadow names */
  --shadow-xs: 0 1px 2px rgba(30,28,22,.05);
  --shadow-sm: 0 4px 12px rgba(30,28,22,.07);
  --shadow:    0 8px 24px rgba(30,28,22,.09);
  --shadow-lg: 0 18px 44px rgba(30,28,22,.16);

  /* Radii */
  --r-card:  16px;
  --r-input: 11px;
  --r-pill:  999px;
  --radius:  16px;
  --radius-sm: 11px;
  --radius-xs: 6px;

  /* Typography */
  --font: "Golos Text", -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --header-h:      60px;
  --bottom-tabs-h: 0px;
  --cart-bar-h:    0px;
  --cart-w:        340px;

  --transition: .15s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Kill double-tap zoom app-wide (pinch zoom stays available) */
body, body * { touch-action: manipulation; }
a  { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
img { display: block; max-width: 100%; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════════════
   HEADER (desktop)
══════════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246,244,239,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}
.app-header__inner {
  max-width: 1720px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.app-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  flex-shrink: 0;
  letter-spacing: -.025em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.app-logo__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.app-logo strong { color: var(--ink); font-size: 1rem; font-weight: 800; letter-spacing: -.02em; }
.app-logo small {
  font-size: .66rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .01em;
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}
.nav-link svg { stroke-width: 1.8; }
.nav-link:hover  { background: var(--brand-50); color: var(--brand); }
.nav-link.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }

.facility-pill {
  font-size: .7rem;
  color: var(--muted);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.cart-badge {
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════ */
.app-main {
  max-width: 1720px;
  margin: 0 auto;
  padding: 28px 24px 100px;
}
/* Узкие экраны (выбор учреждения, корзина) не растягиваем на всю ширину. */
.hero, .continue-card, .fs-sect, .facility-search, .region-accordion,
.cart-page {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* ══════════════════════════════════════════════
   PAGE TITLE
══════════════════════════════════════════════ */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.03em;
}
.page-subtitle {
  font-size: .875rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   FACILITY SCREEN
══════════════════════════════════════════════ */
.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(180deg, var(--surface), var(--accent-light));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 28px;
  box-shadow: var(--sh-sm);
  margin: 4px 0 22px;
}
.hero__art { flex: 0 0 190px; }
.hero__art svg { width: 100%; height: auto; display: block; }
.hero__tx h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.12;
  color: var(--ink);
}
.hero__tx p {
  color: var(--muted);
  margin-top: 10px;
  font-size: .95rem;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; gap: 6px; padding: 22px 20px; }
  .hero__art { flex: 0 0 auto; width: 150px; }
  .hero__tx h1 { font-size: 1.4rem; }
}

.continue-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--accent-muted);
  border-radius: var(--r-card);
  padding: 14px 18px;
  margin-bottom: 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.continue-card:hover { box-shadow: var(--sh-md); border-color: var(--accent); }
.continue-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-input);
  background: var(--accent-light);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.continue-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.continue-card__label { font-size: .72rem; color: var(--muted); }
.continue-card__name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-size: .84rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  box-shadow: 0 2px 8px rgba(47,122,91,.32);
}
@media (max-width: 640px) {
  .continue-card { flex-wrap: wrap; }
  .continue-card__btn { width: 100%; justify-content: center; }
}

.recip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1100px;
  margin: -14px auto 22px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--accent-muted);
  border-radius: var(--r-card);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.recip-row:hover { box-shadow: var(--sh-md); border-color: var(--accent); }
.recip-row__label { color: var(--muted); font-size: .82rem; }
.recip-row__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recip-row__action { color: var(--accent); font-weight: 600; font-size: .84rem; flex-shrink: 0; }

.fs-sect {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.fs-sect__meta { font-size: .78rem; font-weight: 500; color: var(--faint); }

.facility-search {
  position: relative;
  margin-bottom: 24px;
  margin-top: 20px;
}
.facility-search input {
  width: 100%;
  padding: 14px 18px 14px 52px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  box-shadow: var(--sh-sm);
  -webkit-appearance: none;
}
.facility-search input::placeholder { color: var(--muted); }
.facility-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,122,91,.14);
}
.facility-search__icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.facility-group { margin-bottom: 32px; }
.facility-group__title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 0 4px;
}
.facility-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}
.facility-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--transition);
  min-height: 60px;
}
.facility-card:last-child { border-bottom: none; }
.facility-card:hover, .facility-card:active { background: var(--brand-50); }
.facility-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.facility-card__icon svg { stroke-width: 1.8; }
.facility-card__name {
  font-size: .9375rem;
  font-weight: 500;
  flex: 1;
  line-height: 1.35;
  color: var(--ink);
}
.facility-card__arrow {
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.facility-card__arrow svg { stroke-width: 1.8; }

/* Facility card body (name + item count) */
.facility-card__body { flex: 1; min-width: 0; }
.facility-card__meta {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Region accordion (region → facilities) */
.region-accordion { display: flex; flex-direction: column; gap: 12px; }
.region-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.region-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
}
.region-header__name {
  flex: 1;
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
}
.region-header__count {
  flex-shrink: 0;
  min-width: 26px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-ink);
  font-size: .8125rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.region-header__chevron {
  flex-shrink: 0;
  color: var(--muted);
  display: flex;
  transition: transform var(--transition);
}
.region-section.is-open .region-header__chevron { transform: rotate(180deg); }
.region-section.is-open .region-header { border-bottom: 1px solid var(--line); }
.region-body .facility-list {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ══════════════════════════════════════════════
   CATALOG — LAYOUT
══════════════════════════════════════════════ */
.catalog-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.catalog-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
}
.sidebar-group {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 12px 16px 4px;
  border-top: 1px solid var(--line);
}
.sidebar-group:first-child { border-top: none; }
.sidebar-cat {
  display: block;
  padding: 9px 16px;
  font-size: .8125rem;
  color: var(--muted);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  line-height: 1.4;
}
.sidebar-cat:hover { background: var(--brand-50); color: var(--brand); }
.sidebar-cat.active {
  background: var(--brand-50);
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}

/* ── Sticky date + search block (pinned under the header on all widths) ── */
.catalog-sticky {
  min-width: 0;
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: var(--bg);
  padding-top: 8px;
}
@media (max-width: 700px) {
  .catalog-sticky {
    margin: 0 -14px;
    padding: 8px 14px 0;
  }
}

/* ── Chips row: wheel-like horizontal picker, active chip auto-centers ── */
.catalog-chips {
  display: none;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 10px;
  scroll-snap-type: x proximity;
}
.catalog-chips .chip { scroll-snap-align: center; }
.catalog-chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  font-size: .8125rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--sh-sm);
}
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47,122,91,.25);
}
.chip:hover:not(.active) { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.catalog-body { min-width: 0; }

/* ══════════════════════════════════════════════
   SHOP SHELL + PERSISTENT CART RAIL (mockup)
══════════════════════════════════════════════ */
.shop-shell {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 22px;
  align-items: start;
}
.shop-content { min-width: 0; }
.cart-rail {
  position: sticky;
  top: calc(var(--header-h) + 14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--header-h) - 26px);
}
.cart-rail__handle { display: none; }
.cart-rail__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

/* ── Weight meter ── */
.wmeter {
  background: var(--surface);
  border: 1.5px solid var(--accent-100, #D6E7DE);
  border-radius: var(--r-card);
  padding: 16px 18px;
  box-shadow: var(--sh-sm);
  flex-shrink: 0;
}
.wmeter__t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 4px;
}
.wmeter__t svg { color: var(--accent); flex-shrink: 0; }
.wmeter__lim {
  margin-left: auto;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent-ink);
  background: var(--accent-light);
  padding: 3px 8px;
  border-radius: var(--r-pill);
}
.wmeter__sub { font-size: .74rem; color: var(--muted); margin-bottom: 11px; }
.wbar {
  height: 13px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
}
.wbar__sent { background: var(--sent); height: 100%; transition: width .35s; }
.wbar__cur { background: var(--accent); height: 100%; transition: width .35s; }
.wbar__cur.over { background: var(--danger); }
.wmeter__rows { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.wmeter__row { display: flex; align-items: center; gap: 8px; font-size: .8rem; }
.wmeter__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.wmeter__row b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.wmeter__left {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
}
.wmeter__left b { font-weight: 800; }
.wmeter__over {
  margin-top: 9px;
  color: var(--danger);
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wmeter__other {
  margin-top: 7px;
  font-size: .76rem;
  color: var(--muted);
}

/* ── Cart box ── */
.cartbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.cartbox__h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line-2);
  flex-shrink: 0;
}
.cartbox__h svg { color: var(--accent); flex-shrink: 0; }
.cartbox__h b { font-weight: 800; font-size: .98rem; }
.cartbox__cnt { margin-left: auto; font-size: .78rem; color: var(--muted); font-weight: 600; }
.cartbox__open {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-light);
  border-radius: var(--r-pill);
  padding: 5px 11px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.cartbox__open:hover { background: var(--accent-100, #D6E7DE); }
.cartbox__list { overflow-y: auto; padding: 4px 16px; flex: 1; scrollbar-width: thin; }
.cartbox__empty { text-align: center; color: var(--muted); padding: 34px 12px; font-size: .85rem; }
.cartbox__empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 10px; display: inline-block; }
.cartbox__foot { border-top: 1px solid var(--line); padding: 14px 16px; flex-shrink: 0; }
.cartbox__tot { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; margin-bottom: 11px; }

/* ── Cart row inside rail ── */
.crow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.crow:last-child { border-bottom: none; }
.crow__img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--r-input);
  background: var(--surface-2);
  object-fit: contain;
}
.crow__b { min-width: 0; flex: 1; }
.crow__n {
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.crow__m { font-size: .68rem; color: var(--muted); margin-top: 2px; }
.crow__free { color: var(--warn); font-weight: 600; }
.crow__side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.crow__p { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-control--sm .qty-btn { width: 24px; height: 26px; font-size: .95rem; }
.qty-control--sm .qty-val { min-width: 20px; font-size: .8rem; }

/* ── Mobile/tablet: rail becomes a bottom drawer with an always-visible handle ── */
@media (max-width: 900px) {
  .shop-shell { grid-template-columns: 1fr; }
  .cart-rail {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: var(--bottom-tabs-h, 0px);
    z-index: 120;
    max-height: none;
    gap: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: var(--r-card) var(--r-card) 0 0;
    box-shadow: 0 -6px 24px rgba(30,28,22,.12);
    transform: translateY(calc(100% - 54px));
    transition: transform .28s ease;
  }
  .cart-rail.open { transform: none; }
  .cart-rail__handle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 6px 16px 0;
    flex-shrink: 0;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  .cart-rail__grip {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: var(--r-pill);
    background: var(--line);
  }
  .cart-rail__hl {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--ink);
    min-width: 0;
  }
  .cart-rail__hl svg { color: var(--accent); flex-shrink: 0; }
  .cart-rail__hl b { font-weight: 700; white-space: nowrap; }
  .cart-rail__hw {
    margin-left: auto;
    font-size: .76rem;
    font-weight: 600;
    color: var(--accent-ink);
    background: var(--accent-light);
    border-radius: var(--r-pill);
    padding: 4px 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .cart-rail__ht { font-size: .9rem; font-weight: 800; flex-shrink: 0; }
  .cart-rail__inner {
    max-height: min(72dvh, 560px);
    overflow-y: auto;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .wmeter { flex-shrink: 0; }
  .cartbox { flex: none; }
  .cartbox__list { max-height: 240px; }
}

/* ── Order-date bar (pick one delivery date for the whole передача) ── */
.order-date-bar {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-sm);
}
.order-date-bar__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.order-date-bar__icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--brand-50);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.order-date-bar__label {
  font-size: .84rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.order-date-bar__hint {
  color: var(--muted);
  font-size: .76rem;
  margin-left: auto;
  text-align: right;
  max-width: 54%;
  line-height: 1.35;
}
.order-date-bar__chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.order-date-bar__chips::-webkit-scrollbar { display: none; }
.date-chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
  text-align: center;
  min-width: 64px;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.date-chip__d { display: block; font-weight: 700; font-size: .8rem; }
.date-chip__w { display: block; font-size: .6rem; opacity: .72; margin-top: 1px; }
.date-chip:hover:not(.active) { border-color: var(--accent); }
.date-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(47,122,91,.32);
}

/* ── Product search ── */
.catalog-search {
  position: relative;
  margin-bottom: 12px;
}
.catalog-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.catalog-search__input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
  font-size: .9rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}
.catalog-search__input:focus { border-color: var(--accent); }

/* ── Unavailable-on-chosen-date item card ── */
.item-card--off .item-card__imgwrap,
.item-card--off .item-card__name,
.item-card--off .item-card__meta,
.item-card--off .item-card__price {
  opacity: .5;
  filter: grayscale(.4);
}
.item-card__altdate {
  font-size: .7rem;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-light, #FBF1E2);
  border-radius: var(--r-input);
  padding: 3px 8px;
  margin-top: 4px;
  line-height: 1.3;
}

/* Лимит 30 кг/мес исчерпан: весовой товар затенён, добавление заблокировано */
.item-card--limit .item-card__imgwrap,
.item-card--limit .item-card__name,
.item-card--limit .item-card__meta,
.item-card--limit .item-card__price {
  opacity: .38;
  filter: grayscale(.7);
}
.item-card--limit .btn-add,
.item-card--limit .qty-btn[data-action="inc"] {
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}
.item-card__altdate--limit {
  color: var(--danger, #B3261E);
  background: #FBE9E7;
}
.limit-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin: 10px 0 14px;
  background: #FBF1E2;
  border: 1px solid rgba(196,131,26,.35);
  border-radius: var(--r-card);
}
.limit-banner__text {
  flex: 1 1 260px;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--ink);
}
.limit-banner__btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.limit-banner__btn:hover { background: var(--accent-ink); }

/* ── Cart thumbnails (side cart + cart page) ── */
.cart-line__thumb,
.cart-item-thumb {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-input);
  overflow: hidden;
  background: var(--surface-2);
}
.cart-line__thumb img,
.cart-item-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
  z-index: 1;
}
.cart-line__thumb__ph,
.cart-item-thumb__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.cart-line__thumb__ph svg,
.cart-item-thumb__ph svg { width: 20px; height: 20px; opacity: .4; stroke-width: 1.4; }

/* ══════════════════════════════════════════════
   CATALOG — GROUP HEADERS & SECTIONS
══════════════════════════════════════════════ */
.cat-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  padding: 24px 0 12px;
  margin-top: 8px;
}
.cat-group-header:first-child {
  margin-top: 0;
  padding-top: 0;
}
.cat-group-header__icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-group-header__icon-wrap svg { stroke-width: 1.8; }
.cat-group-header__count {
  font-size: .8125rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.cat-section { margin-bottom: 32px; }
.cat-section__title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -.01em;
}

/* ══════════════════════════════════════════════
   CATALOG — PRODUCT GRID & CARDS
══════════════════════════════════════════════ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.item-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  border: 1px solid rgba(231,234,242,.8);
  touch-action: manipulation;
}
.item-card__info {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.item-card__info:hover { color: var(--accent-ink); border-color: var(--accent); }
@media (hover: hover) {
  .item-card:hover {
    box-shadow: var(--sh-md);
    transform: translateY(-2px);
  }
}
.item-card__imgwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
}
.item-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-2);
  display: block;
  padding: 8px;
  box-sizing: border-box;
  z-index: 1;
}
.item-card__img-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.item-card__img-placeholder svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.4;
  opacity: .45;
}
.item-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.item-card__name {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.item-card__meta {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}
.item-card__meta-nolimit {
  color: var(--ok);
  font-style: italic;
}
.item-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 4px;
}
.item-card__price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.015em;
}

/* Add button: rounded square accent */
.btn-add {
  width: 34px;
  height: 34px;
  border-radius: var(--r-input);
  background: var(--accent);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform .1s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(47,122,91,.32);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-add:hover { background: var(--accent-ink); }
@media (hover: hover) {
  .btn-add:active { transform: scale(.92); }
}

/* Qty stepper pill in brand-50 */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--brand-50);
  border-radius: var(--r-pill);
  padding: 2px;
}
.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-weight: 700;
}
.qty-btn:hover { background: var(--brand); color: #fff; }
.qty-val {
  font-size: .875rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  color: var(--brand);
}

/* ══════════════════════════════════════════════
   SIDE CART (drawer)
══════════════════════════════════════════════ */
.side-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.side-cart-overlay.open { opacity: 1; pointer-events: auto; }
.side-cart {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--cart-w);
  background: var(--surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--sh-lg);
  border-radius: var(--r-card) 0 0 var(--r-card);
}
.side-cart.open { transform: none; }
.side-cart__header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.side-cart__title { font-weight: 700; font-size: 1rem; letter-spacing: -.015em; }
.btn-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.btn-close:hover { background: var(--danger); color: #fff; }
.side-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  overscroll-behavior: contain;
}
.side-cart__empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: .9rem;
  line-height: 1.6;
}
.cart-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line:last-child { border-bottom: none; }
.cart-line__name {
  flex: 1;
  font-size: .8125rem;
  color: var(--ink);
  line-height: 1.4;
}
.cart-line__price { font-size: .8125rem; font-weight: 600; white-space: nowrap; color: var(--ink); }
.side-cart__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

/* ══════════════════════════════════════════════
   STICKY BOTTOM CART BAR
══════════════════════════════════════════════ */
.cart-bar {
  position: fixed;
  left: 12px; right: 12px;
  bottom: 12px;
  z-index: 120;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
  box-shadow: var(--sh-lg);
  border-radius: var(--r-card);
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .25s;
}
.cart-bar[hidden] { display: none; }
.cart-bar__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cart-bar__count {
  font-size: .75rem;
  opacity: .7;
  font-weight: 500;
}
.cart-bar__total {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.015em;
}
.cart-bar__btn {
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 10px 22px;
  font-size: .9375rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition);
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-bar__btn:hover { background: var(--brand-ink); }
.cart-bar__btn svg { stroke-width: 2; }

/* ══════════════════════════════════════════════
   BOTTOM TAB BAR (mobile only)
══════════════════════════════════════════════ */
.bottom-tabs {
  display: none;
}

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: -.01em;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 10px rgba(47,122,91,.3);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--brand-ink); box-shadow: 0 4px 16px rgba(47,122,91,.35); }
.btn-primary:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--sh-sm);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

/* ══════════════════════════════════════════════
   CART PAGE (screen 3)
══════════════════════════════════════════════ */
.cart-page {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}
.cart-left { display: flex; flex-direction: column; gap: 16px; }

.cart-section {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 20px 22px;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--line);
}
.cart-section__title {
  font-size: .9375rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.form-row { margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
  font-size: .9375rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,122,91,.14);
}
.date-group { margin-bottom: 20px; }
.date-group:last-child { margin-bottom: 0; }
.date-group__header {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-tag {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--warn-light);
  color: var(--warn);
  font-weight: 700;
}
.cart-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item-row:last-child { border-bottom: none; }
.cart-item-name { flex: 1; font-size: .875rem; color: var(--ink); line-height: 1.4; }
.cart-item-sub {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cart-item-sub--warn { color: var(--warn); }
.cp-recip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--brand-50);
  border-radius: 12px;
}
.cp-recip__name { font-size: .9rem; font-weight: 600; color: var(--ink); }
.cp-recip__birth { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.cp-recip__edit { flex-shrink: 0; padding: 7px 14px; font-size: .8125rem; }
.cart-item-weight { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.cart-item-price { font-size: .875rem; font-weight: 700; white-space: nowrap; color: var(--ink); }
.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
  touch-action: manipulation;
}
.btn-remove:hover { color: var(--danger); background: var(--danger-light); }
.date-select {
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
  font-size: .8125rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  max-width: 148px;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.date-select:focus { border-color: var(--brand); }

/* ══════════════════════════════════════════════
   WEIGHT CARD (hero feature)
══════════════════════════════════════════════ */
.weight-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 14px 16px;
  box-shadow: var(--sh-md);
  border: 1.5px solid var(--brand-50);
}
.weight-card__title {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  letter-spacing: -.015em;
}
.weight-card__title svg { color: var(--brand); stroke-width: 1.8; }
.weight-card__badge {
  background: var(--brand-50);
  color: var(--brand);
  border-radius: var(--r-pill);
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.weight-month { margin-bottom: 12px; }
.weight-month:last-child { margin-bottom: 0; }
.weight-month__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.weight-month__name { font-weight: 600; color: var(--ink); font-size: .8125rem; }
.weight-month__val {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.weight-bar {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.weight-bar__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--ok);
  transition: width .4s cubic-bezier(.4,0,.2,1), background .3s;
}
.weight-bar__fill.warn   { background: var(--warn); }
.weight-bar__fill.danger { background: var(--danger); }
.weight-over {
  margin-top: 6px;
  font-size: .75rem;
  color: var(--danger);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.weight-disclaimer {
  margin-top: 10px;
  font-size: .69rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* Компактный чекбокс «без лимита» */
.nolimit-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: .78rem;
  color: var(--muted);
  cursor: pointer;
  margin-top: 4px;
}
.nolimit-row input { accent-color: var(--brand); cursor: pointer; }
.nolimit-row__hint { color: var(--ink-3); }

/* Sticky-полоска веса (мобайл): вес виден всегда */
.weight-strip { display: none; }

/* ══════════════════════════════════════════════
   ORDER SUMMARY (sticky right col)
══════════════════════════════════════════════ */
.cart-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.order-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--sh-sm);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.summary-row.total {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  padding-top: 14px;
  border-top: 2px solid var(--line);
  margin-top: 8px;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
/* ══════════════════════════════════════════════
   PRODUCT INFO SHEET
══════════════════════════════════════════════ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30,28,22,.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.sheet-overlay.open { opacity: 1; }
.item-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 84dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-card) var(--r-card) 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--sh-lg);
  transform: translateY(24px);
  transition: transform .22s ease;
}
.sheet-overlay.open .item-sheet { transform: none; }
@media (min-width: 641px) {
  .sheet-overlay { align-items: center; padding: 24px; }
  .item-sheet { border-radius: var(--r-card); }
}
.item-sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.item-sheet__media {
  width: 132px;
  height: 132px;
  margin: 0 auto 14px;
  border-radius: var(--r-card);
  background: var(--surface-2);
  overflow: hidden;
}
.item-sheet__media:empty { display: none; }
.item-sheet__media img { width: 100%; height: 100%; object-fit: contain; }
.item-sheet__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -.01em;
  padding-right: 32px;
}
.item-sheet__price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-ink);
  margin: 6px 0 12px;
}
.item-sheet__rows { border-top: 1px solid var(--line-2); }
.item-sheet__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: .82rem;
}
.item-sheet__row span { color: var(--muted); flex-shrink: 0; }
.item-sheet__row b { font-weight: 600; color: var(--ink); text-align: right; }
.item-sheet__note {
  margin-top: 12px;
  font-size: .72rem;
  line-height: 1.45;
  color: var(--faint);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  animation: toast-in .2s ease, toast-out .3s ease 2.5s forwards;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.success { background: var(--ok); }
.toast.error   { background: var(--danger); }
@keyframes toast-in  { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform: translateY(4px); } }

/* ══════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-state__icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  color: var(--muted);
  opacity: .5;
}
.empty-state__icon svg { width: 56px; height: 56px; stroke-width: 1.3; }
/* Legacy emoji fallback */
.empty-state__icon:not(:has(svg)) { font-size: 3rem; opacity: .5; }
.empty-state__text { font-size: .9375rem; color: var(--muted); line-height: 1.6; }
.empty-state__action { margin-top: 22px; display: flex; justify-content: center; }

/* ══════════════════════════════════════════════
   SPINNER
══════════════════════════════════════════════ */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 64px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   INSTALL BANNER (PWA)
══════════════════════════════════════════════ */
.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brand-50);
  border: 1px solid var(--brand-50);
  border-radius: var(--r-card);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: .8125rem;
  color: var(--brand);
}
.install-banner__text { flex: 1; }
.install-banner__btn {
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 7px 16px;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition);
}
.install-banner__btn:hover { background: var(--brand-ink); }
.install-banner__close {
  color: var(--muted);
  font-size: 1rem;
  padding: 2px 6px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET (≤860px)
══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .cart-page { grid-template-columns: 1fr; }
  .cart-right { position: static; }
  .cart-right .weight-card { display: none; }

  /* Полоска веса прилипает под шапкой и видна при любой прокрутке корзины */
  .weight-strip {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 6px);
    z-index: 40;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 14px 10px;
    box-shadow: var(--sh-md);
    font-size: .8125rem;
    color: var(--muted);
  }
  .weight-strip--free { color: var(--ok); font-weight: 600; }
  .weight-strip__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
  }
  .weight-strip__val {
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .weight-strip__val.warn { color: var(--warn); }
  .weight-strip__val.danger { color: var(--danger); }
  .weight-strip__bar {
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    overflow: hidden;
  }
  .weight-strip__fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--ok);
    transition: width .4s cubic-bezier(.4,0,.2,1), background .3s;
  }
  .weight-strip__fill.warn { background: var(--warn); }
  .weight-strip__fill.danger { background: var(--danger); }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — NARROW TABLET (≤700px)
══════════════════════════════════════════════ */
@media (max-width: 700px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar { display: none; }
  .catalog-chips { display: flex !important; }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤640px)
══════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root {
    --header-h: 54px;
    --bottom-tabs-h: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  html { font-size: 14px; }

  .app-header__inner { padding: 0 16px; gap: 10px; }
  .app-nav { display: none; }

  .app-main {
    padding: 14px 14px calc(var(--bottom-tabs-h) + 88px);
  }

  /* 2-column product grid */
  .items-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .side-cart { width: 100%; border-radius: var(--r-card) var(--r-card) 0 0; top: auto; border-top-left-radius: var(--r-card); border-bottom-left-radius: 0; }

  .cart-item-row { flex-wrap: wrap; gap: 6px; }
  .cart-item-name { width: 100%; flex: unset; }
  .cart-item-weight { order: 3; }
  .date-select { max-width: none; width: 100%; order: 4; }
  .cart-item-price { margin-left: auto; }

  .page-title { font-size: 1.25rem; }
  .cart-page { gap: 14px; }
  .weight-bar { height: 12px; }

  /* ── BOTTOM TAB BAR ── */
  .bottom-tabs {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 130;
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 16px rgba(30,28,22,.1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: var(--bottom-tabs-h);
    align-items: stretch;
  }
  .bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: .01em;
    padding: 8px 4px;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .bottom-tab.active { color: var(--brand); }
  .bottom-tab svg { stroke-width: 1.8; }
  .bottom-tab__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  .bottom-tab__icon-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .bottom-tab__label { line-height: 1; }

  /* Badge */
  .bottom-tab-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--r-pill);
    font-size: .6rem;
    font-weight: 700;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 1.5;
    pointer-events: none;
    border: 1.5px solid var(--surface);
  }
  .bottom-tab-badge[hidden] { display: none; }

  /* Cart bar: sits above tab bar */
  .cart-bar {
    left: 8px; right: 8px;
    bottom: calc(var(--bottom-tabs-h) + 8px);
    padding-bottom: 14px;
    border-radius: var(--r-card);
  }

  /* Toast: lift above tabs */
  .toast-container {
    bottom: calc(var(--bottom-tabs-h) + 16px);
  }

  .facility-card { min-height: 64px; }
}

/* Extra narrow */
@media (max-width: 380px) {
  .items-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .item-card__price { font-size: .9375rem; }
}

/* ── Splash (PWA entry screen) ── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity .45s ease, visibility .45s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(47, 122, 91, .28);
  animation: splash-pop .55s cubic-bezier(.34, 1.4, .5, 1) both;
}
.splash__name { text-align: center; animation: splash-fade .5s .15s ease both; }
.splash__name strong { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.splash__name small { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.splash__dots { display: flex; gap: 7px; margin-top: 8px; animation: splash-fade .5s .3s ease both; }
.splash__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .25;
  animation: splash-dot 1.1s infinite ease-in-out;
}
.splash__dots i:nth-child(2) { animation-delay: .18s; }
.splash__dots i:nth-child(3) { animation-delay: .36s; }
@keyframes splash-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes splash-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes splash-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ── Recipient screen (onboarding step 2) ── */
.recip-wrap { display: flex; justify-content: center; padding: 26px 0 40px; }
.recip-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px 26px 26px;
}
.recip-card__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 14px;
}
.recip-card__title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; margin: 0 0 8px; }
.recip-card__sub { font-size: .875rem; color: var(--muted); line-height: 1.5; margin: 0 0 16px; }
.recip-fac {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .82rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-input);
  padding: 10px 12px;
  margin-bottom: 18px;
}
.recip-fac svg { color: var(--accent); flex-shrink: 0; }
.recip-fac span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recip-fac a { font-size: .8rem; font-weight: 600; color: var(--accent-ink); flex-shrink: 0; }
.recip-field { display: block; margin-bottom: 15px; }
.recip-field__label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.recip-field__label i { font-style: normal; font-weight: 400; color: var(--faint); }
.recip-field input {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .18s;
}
.recip-field input:focus { outline: none; border-color: var(--accent); }
.recip-field input.invalid { border-color: var(--danger); }
.recip-field__err { display: block; font-size: .78rem; color: var(--danger); margin-top: 5px; }
.recip-submit { display: block; width: 100%; margin-top: 6px; }

/* ── Recipient block in cart rail ── */
.rail-recip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 12px 14px;
}
.rail-recip__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}
.rail-recip__b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rail-recip__label { font-size: .72rem; color: var(--muted); }
.rail-recip__b b {
  font-size: .84rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-recip__edit { font-size: .78rem; font-weight: 600; color: var(--accent-ink); flex-shrink: 0; }
.recip-field__err[hidden] { display: none; }

/* ── Desktop birth-date picker (recipient) ─────────────────────────────────── */
.recip-field--dp { position: relative; display: block; }
.dp-trigger {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; font: inherit; font-size: 1rem; text-align: left;
  color: var(--ink, #1F2421); cursor: pointer;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .15s;
}
.dp-trigger svg { color: var(--accent); flex-shrink: 0; }
.dp-trigger:hover, .dp-trigger:focus-visible { border-color: var(--accent); outline: none; }
.dp-trigger.is-empty { color: #9AA09B; }
.dp-trigger.invalid { border-color: #C4453C; }
.dp {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
  max-width: min(660px, calc(100vw - 48px));
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(31, 36, 33, .16);
  padding: 14px 16px 16px;
}
.dp__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dp__back {
  width: 28px; height: 28px; flex-shrink: 0; border: none; cursor: pointer;
  border-radius: 8px; background: var(--accent-light); color: var(--accent-ink);
  font-size: .9375rem; line-height: 1;
}
.dp__back:hover { background: var(--accent-muted); }
.dp__title { font-weight: 600; font-size: .875rem; }
.dp__years { display: flex; gap: 6px; overflow-x: auto; }
.dp__decade { display: flex; flex-direction: column; gap: 2px; }
.dp__decade-h {
  font-size: .6875rem; font-weight: 700; color: #9AA09B;
  text-align: center; padding: 2px 0 5px; letter-spacing: .02em;
}
.dp__y, .dp__m, .dp__d {
  border: none; background: none; font: inherit; cursor: pointer;
  border-radius: 7px; color: inherit; transition: background .12s;
}
.dp__y { font-size: .8125rem; padding: 4px 9px; font-variant-numeric: tabular-nums; }
.dp__y:hover, .dp__m:hover:not(:disabled), .dp__d:hover:not(:disabled) {
  background: var(--accent-light); color: var(--accent-ink);
}
.dp__y.sel, .dp__m.sel { background: var(--accent); color: #fff; }
.dp__months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; min-width: 320px; }
.dp__m { font-size: .875rem; padding: 10px 12px; text-align: center; }
.dp__m:disabled { opacity: .35; cursor: default; }
.dp__days { display: grid; grid-template-columns: repeat(7, 38px); gap: 2px; }
.dp__wd { font-size: .6875rem; font-weight: 600; color: #9AA09B; text-align: center; padding-bottom: 4px; }
.dp__d { width: 38px; height: 34px; padding: 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
.dp__d:disabled { opacity: .3; cursor: default; }

/* ══════════════════════════════════════════════
   PAYMENT SCREEN (v26)
══════════════════════════════════════════════ */
.payment-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 60px;
}

.payment-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 32px 28px 28px;
  box-shadow: var(--sh-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.payment-card__heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
  line-height: 1.2;
}

.payment-card__sub {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 360px;
}

.payment-card__num {
  font-size: .8125rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 4px 14px;
  font-variant-numeric: tabular-nums;
}

.payment-card__hint {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Spinner inside the payment card (smaller margin than global .spinner) */
.payment-spinner {
  margin: 20px auto 8px;
}

/* Success state icon */
.payment-success__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* QR code block: white padded card, centred */
.payment-qr {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
}
.payment-qr img,
.payment-qr svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Total amount */
.payment-total {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}

/* Failed state icon */
.payment-failed__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--warn-light);
  color: var(--warn);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .payment-card {
    padding: 24px 18px 20px;
    gap: 12px;
  }
  .payment-card__heading { font-size: 1.1rem; }
}

.app-build { margin-top: 14px; text-align: center; font-size: .6875rem; color: #B9BEB9; }
