:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #424242;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #ecfdf5;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --danger: #ef4444;
  --warning: #f97316;
  --shadow: 0 18px 60px rgba(15, 23, 42, .08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --header-top-pad: max(12px, env(safe-area-inset-top, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}
button, a { -webkit-tap-highlight-color: transparent; outline: none; }
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity .35s ease;
}
.splash-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.splash-screen--hidden {
  opacity: 0;
  pointer-events: none;
}
@media (min-width: 981px) {
  .splash-screen { display: none; }
}
body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  touch-action: pan-y;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
@media (min-width: 981px) {
  /* hidden creates a non-scrolling body scrollport and breaks sticky children. */
  body { overflow-x: clip; }
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
a { color: inherit; text-decoration: none; }

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding-bottom: 116px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: var(--header-top-pad);
  padding-bottom: 12px;
  padding-left: max(0px, var(--safe-left));
  padding-right: max(0px, var(--safe-right));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: fit-content;
}
.brand__logo {
  display: block;
  width: auto;
  height: 52px;
  max-width: min(58vw, 260px);
  object-fit: contain;
}
.location b { font-size: 15px; }
.cart-button span { font-size: 14px; font-weight: 500; }
.cart-button b { font-size: 15px; }
.location small,
.pay-note,
.delivery-widget small,
.contact-card small { color: var(--muted); }

.location {
  position: relative;
  z-index: 5;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.location__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-dark);
}
.location > span:last-child {
  min-width: 0;
  overflow: hidden;
}
.pwa-install-header-button {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-dark);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}
.pwa-install-header-button[hidden] { display: none !important; }
.pwa-install-header-button__label {
  display: none;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}
.pwa-install-header-button svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pwa-install-header-button:hover,
.pwa-install-header-button:focus-visible,
.pwa-install-header-button:active {
  border-color: var(--accent);
  background: var(--soft);
}

@media (min-width: 1320px) {
  .header.header { gap: 10px; }
  .header .pwa-install-header-button {
    width: auto;
    min-width: 0;
    padding: 0 14px;
    gap: 7px;
    border-radius: 999px;
  }
  .pwa-install-header-button__label { display: inline; }
}
.location small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.location b {
  display: block;
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cart-button,
.favorite-header-button {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 56px 12px 18px;
  background: #ffffff;
  color: #424242;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.cart-button {
  margin-left: 0;
  min-width: 190px;
}
.cart-button span,
.cart-button b {
  flex: 0 0 auto;
  white-space: nowrap;
}
.favorite-header-button {
  margin-left: auto;
  color: var(--muted);
  padding-right: 42px;
}
.favorite-header-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-header-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: #ffffff;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15,23,42,.04);
  white-space: nowrap;
}
.contact-header-button svg {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-header-button svg.icon-phone {
  fill: currentColor;
  stroke: none;
}
.contact-header-button:hover,
.contact-header-button:focus-visible,
.contact-header-button:active,
.contact-header-button.active,
.favorite-header-button:hover,
.favorite-header-button:focus-visible,
.favorite-header-button:active,
.favorite-header-button.active {
  color: var(--accent-dark);
  border-color: var(--accent);
}
.cart-button:hover,
.cart-button:focus-visible,
.cart-button:active,
.cart-button.active {
  border-color: #f97316;
}
.cart-button i,
.favorite-header-button i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  min-width: 28px;
  height: 25px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  font-style: normal;
}
.cart-button i {
  min-width: 48px;
  background: rgba(249, 115, 22, .16);
  color: #f97316;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-card__image--fallback {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.82) 0 16%, transparent 17%),
    linear-gradient(145deg, var(--fallback-a, #f0fdf4), var(--fallback-b, #dcfce7));
}
.product-card__image--fallback[data-family="dairy"] { --fallback-a: #f8fafc; --fallback-b: #dbeafe; --fallback-c: #2563eb; }
.product-card__image--fallback[data-family="drink"] { --fallback-a: #ecfeff; --fallback-b: #bae6fd; --fallback-c: #0284c7; }
.product-card__image--fallback[data-family="meat"] { --fallback-a: #fff1f2; --fallback-b: #fecdd3; --fallback-c: #e11d48; }
.product-card__image--fallback[data-family="sweets"],
.product-card__image--fallback[data-family="tea"] { --fallback-a: #fff7ed; --fallback-b: #fed7aa; --fallback-c: #c2410c; }
.product-card__image--fallback[data-family="bakery"] { --fallback-a: #fffbeb; --fallback-b: #fde68a; --fallback-c: #b45309; }
.product-card__image--fallback[data-family="hygiene"],
.product-card__image--fallback[data-family="pharmacy"] { --fallback-a: #f8fafc; --fallback-b: #e2e8f0; --fallback-c: #64748b; }
.product-card__image--fallback[data-family="baby"] { --fallback-a: #fdf2f8; --fallback-b: #fbcfe8; --fallback-c: #db2777; }
.product-card__image--fallback[data-family="pets"] { --fallback-a: #f5f3ff; --fallback-b: #ddd6fe; --fallback-c: #7c3aed; }
.product-card__image--fallback[data-family="sauce"],
.product-card__image--fallback[data-family="fruit"] { --fallback-a: #f0fdf4; --fallback-b: #bbf7d0; --fallback-c: #16a34a; }
.product-card__image--fallback[data-family="grocery"] { --fallback-a: #f7fee7; --fallback-b: #d9f99d; --fallback-c: #65a30d; }
.product-fallback__glow {
  position: absolute;
  inset: auto auto -18% -12%;
  width: 54%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
}
.product-fallback__pack {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78%, 138px);
  min-height: 82px;
  margin: auto;
  border: 1px dashed color-mix(in srgb, var(--fallback-c, var(--accent)) 36%, #ffffff);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
  overflow: hidden;
}
.product-fallback__cap {
  display: none;
}
.product-fallback__label {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 10px;
  color: #475569;
  text-align: center;
  min-width: 0;
}
.product-fallback__label b,
.product-fallback__label small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.product-fallback__label b {
  -webkit-line-clamp: 1;
  width: max-content;
  max-width: 100%;
  justify-self: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fallback-c, var(--accent)) 12%, #ffffff);
  color: color-mix(in srgb, var(--fallback-c, var(--accent)) 78%, #0f172a);
  font-size: 10px;
  line-height: 1.1;
  text-transform: uppercase;
}
.product-fallback__label small {
  -webkit-line-clamp: 2;
  color: #64748b;
  font-size: 9px;
  line-height: 1.2;
}

.cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill {
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--soft);
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 13px;
}
.primary-link,
.secondary-link,
.pay-btn,
.load-more {
  border: none;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary-link,
.pay-btn {
  background: var(--accent);
  color: #fff;
}
.primary-link:hover,
.pay-btn:hover { background: var(--accent-dark); }
.pay-btn { gap: 10px; }
.pay-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.pay-btn--robokassa {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.pay-btn--robokassa:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.kaspi-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: none;
  flex: 0 0 auto;
}
.pay-btn--kaspi .kaspi-logo { display: inline-block; }
.secondary-link,
.load-more {
  background: #f1f5f9;
  color: var(--ink);
}
.full { width: 100%; }

.search-panel {
  position: sticky;
  top: calc(56px + var(--header-top-pad));
  z-index: 18;
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 24px;
  padding: 12px;
  margin-bottom: 20px;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .22s ease;
  will-change: transform;
}

/* Скрытие панели при скролле вниз (общее для десктопа) */
.search-panel.search-panel--hidden {
  transform: translateY(calc(-100% - var(--header-top-pad) - 60px));
  opacity: 0;
  pointer-events: none;
}
.search-box {
  flex: 1 1 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 50px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}
.photo-file-input {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.photo-search-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 301;
}
.photo-search-menu[hidden],
.photo-search-menu-overlay[hidden] { display: none; }
.photo-search-menu {
  position: fixed;
  z-index: 302;
  width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15,23,42,.16);
  padding: 6px;
  display: grid;
  gap: 4px;
  animation: popup-in .15s ease;
}
.photo-search-menu__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.photo-search-menu__btn:hover,
.photo-search-menu__btn:active {
  background: #f1f5f9;
}
.photo-search-menu__btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.photo-search-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.photo-search-btn svg {
  width: 22px;
  height: 22px;
}
.photo-search-btn--loading {
  animation: photo-search-spin 0.9s linear infinite;
}
@keyframes photo-search-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.photo-search-clear-btn {
  order: -1;
  grid-column: 1 / -1;
}
/* Поиск, перенесённый в шапку (десктоп) */
.search-box--header {
  flex: 1 1 auto;
  max-width: 620px;
  min-height: 46px;
  margin: 0 6px;
  background: var(--card);
}
.search-hints {
  flex-basis: 100%;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 0;
  scrollbar-width: none;
}
.search-hints::-webkit-scrollbar { display: none; }
.search-hints span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-chip,
.category-btn {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 15px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}
.filter-chip.active,
.category-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.category-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  contain: inline-size;
  isolation: isolate;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-scroll .filter-chip {
  flex-shrink: 0;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
.sidebar-stack {
  position: sticky;
  top: 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: top .24s ease;
}
.sidebar {
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 12px 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: min(620px, calc(100dvh - 190px));
}
.sidebar h2 { 
  margin: 0 0 8px; 
  font-size: 15px; 
  color: #424242; 
  font-weight: 700; 
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; transition: gap .28s ease; min-height: 0; overflow-y: auto; }
.category-btn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border-radius: 10px;
  padding: 5px 8px;
  text-align: left;
  color: #424242;
  font-weight: 500;
  font-size: 12.5px;
  border: 0;
  background: transparent;
}
.category-btn span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.category-btn small {
  flex: 0 0 auto;
  min-width: 28px;
  text-align: right;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.category-btn.active {
  font-weight: 600;
}
.delivery-widget {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--soft);
  display: grid;
  gap: 2px;
  font-size: 12px;
}
.delivery-widget__address {
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.delivery-widget__address:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.catalog-area {
  border-radius: var(--radius-xl);
  padding: 20px 0;
}

body.catalog-search-hidden .sidebar-stack {
  top: 76px;
}
.section-title {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: start;
  gap: 20px;
  margin-bottom: 24px;
}
.section-title > div:first-child {
  grid-column: 1;
}
.section-title h2 { margin: 0 0 4px; font-size: 28px; letter-spacing: -.03em; color: #424242; font-weight: 800; }
.section-title p { margin: 0; color: #64748b; font-size: 14px; }

#sortSelect {
  grid-column: 2;
  width: 100%;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 12px 16px;
  color: #424242;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.section-title select,
.checkout-card input,
.checkout-card select,
.checkout-card textarea,
dialog select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 13px;
  outline: 0;
  width: 100%;
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 12px;
}
.product-card {
  background-color: #ffffff;
  border: 1px solid #e6e8eb;
  border-radius: 18px;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.product-card--in-cart {
  border: 2px solid var(--accent);
  background-color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
  transform: translateY(-2px);
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(162, 187, 155, 0.2);
}
.product-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 28px;
}
.product-code {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 3px 8px;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.favorite-btn {
  position: static;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: #94a3b8;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0;
  line-height: 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s ease, background .15s ease;
}
.favorite-btn:hover {
  transform: scale(1.08);
}
.favorite-btn svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-card--favorite .favorite-btn {
  color: #f97316;
  border-color: #ffedd5;
  background: #fff7ed;
}
.product-card--favorite .favorite-btn svg {
  fill: currentColor;
  stroke: currentColor;
}
.product-card h3 {
  margin: 2px 0 0;
  color: #334155;
  font-size: 13.5px;
  line-height: 1.35;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
  height: auto;
}
.product-card__image-wrap {
  position: relative;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 2px 0;
}
.product-card__podlozhka {
  grid-area: 1 / 1;
  width: min(68%, 170px);
  aspect-ratio: 1.16 / 1;
  background: none;
  border-radius: 50%;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}
.product-card__image {
  grid-area: 1 / 1;
  border: 0;
  width: 76%;
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.product-category {
  display: none;
}
.product-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  min-width: 0;
  width: 100%;
}
.price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
}
.price-old {
  min-height: 14px;
  color: #94a3b8;
  text-decoration: line-through;
  font-size: 12px;
}
.product-card__bottom strong,
.price-current {
  font-size: 17px;
  color: #0f172a;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.price-unit {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  margin-top: 2px;
}
.product-qty-mini {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background-color: #eef2f6;
}
.product-card--in-cart .product-qty-mini {
  background: #bbf7d0;
  box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .28);
}
.product-card--in-cart .product-qty-mini b {
  color: #14532d;
}
.product-qty-mini b {
  min-width: 16px;
  padding: 0 4px;
  white-space: nowrap;
  text-align: center;
  font-size: 12px;
  color: #334155;
  font-weight: 700;
}
.product-qty-mini button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background-color: #cbd5e1;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s;
}
.product-qty-mini button svg {
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}
.product-qty-mini .qty-plus {
  background-color: var(--accent);
  color: #ffffff;
}
.product-qty-mini .qty-minus:not(:disabled) {
  background-color: var(--accent);
  color: #ffffff;
  cursor: pointer;
}
.product-qty-mini .qty-minus:not(:disabled):hover,
.product-qty-mini .qty-plus:hover {
  background-color: var(--accent-dark);
}
.product-qty-mini button:active {
  transform: scale(0.9);
}
.product-qty-mini button:disabled { 
  background-color: transparent;
  color: #cbd5e1;
  cursor: default;
}
.product-status {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  display: none;
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(21, 128, 61, .32);
}
.product-status--cart,
.product-status--soldout {
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}
.product-status--bought {
  left: auto;
  right: 7px;
  transform: none;
  color: #475569;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 14px rgba(15,23,42,.08);
}
.product-card--in-cart .product-status--cart,
.product-card--bought:not(.product-card--in-cart) .product-status--bought {
  display: inline-flex;
}
.product-status--soldout {
  background: #64748b;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .28);
}
.product-card--soldout .product-status--soldout {
  display: inline-flex;
}
.product-card--soldout .product-card__image-wrap {
  opacity: .55;
  filter: grayscale(.5);
}
.product-card--soldout .price-box {
  opacity: .55;
}
.product-card--soldout .qty-plus {
  background-color: #cbd5e1;
  color: #94a3b8;
  cursor: default;
}
.load-more {
  width: 100%;
  margin-top: 16px;
}

.empty-state {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong { display: block; color: var(--ink); font-size: 20px; }
.hidden { display: none !important; }

body.overlay-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(15, 23, 42, .42);
}
.drawer {
  position: fixed;
  z-index: 50;
  right: 14px;
  top: 14px;
  bottom: 14px;
  width: min(460px, calc(100vw - 28px));
  background: #fff;
  border-radius: 28px;
  padding: 18px;
  box-shadow: 0 40px 100px rgba(15,23,42,.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.drawer__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.drawer__head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.clear-cart-btn {
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 13px;
  font-weight: 700;
}
.drawer h2 { margin: 0; }
.drawer p { margin: 3px 0 0; color: var(--muted); }
.icon-btn {
  width: 36px;
  height: 36px;
  font-size: 24px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}
.cart-items {
  display: grid;
  gap: 10px;
  min-height: 80px;
  flex: 0 0 auto;
}
.cart-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.cart-item__img {
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--soft);
  font-size: 28px;
  overflow: hidden;
  contain: paint;
}
.cart-item > div:nth-child(2) { min-width: 0; }
.cart-item h3 { font-size: 14px; margin: 0 0 4px; }
.cart-item span,
.cart-item small { color: var(--muted); font-size: 12px; display: block; }
.cart-item--stock-issue {
  border-color: #fecaca;
  background: #fffafa;
}
.cart-item small.cart-item__stock-warning {
  margin-top: 5px;
  color: #dc2626;
  font-weight: 800;
}
.cart-item__remove {
  margin-top: 6px;
  padding: 0;
  border: 0;
  color: #b91c1c;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty button { width: 28px; height: 28px; }
.checkout-card {
  display: grid;
  gap: 8px;
  border-radius: 22px;
  padding: 14px;
  box-shadow: none;
}
.checkout-contact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.checkout-contact-row > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.label-hint {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}
.delivery-calc {
  display: block;
  margin: -2px 0 2px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 12.5px;
}
.delivery-calc.is-unavailable {
  color: var(--danger);
}
.saved-addresses,
.purchase-history {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}
.saved-addresses > span,
.purchase-history__head b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.saved-addresses__list,
.purchase-history__list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.saved-addresses__list::-webkit-scrollbar,
.purchase-history__list::-webkit-scrollbar { display: none; }
.saved-address-chip,
.purchase-chip {
  flex: 0 0 auto;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
}
.saved-address-chip b,
.purchase-chip span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 800;
}
.saved-address-chip small,
.purchase-history__head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.purchase-history {
  flex: 0 0 auto;
}
.purchase-history__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.purchase-chip b {
  color: var(--accent-dark);
  font-size: 11px;
}
.address-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.address-row input { flex: 1 1 auto; min-width: 0; }
.geo-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent-dark);
  border-radius: 14px;
  padding: 0 12px;
  font-weight: 800;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.geo-btn:hover { background: #e7f6ee; }
@media (max-width: 560px) {
  .address-row { flex-direction: column; }
  .geo-btn { padding: 11px 12px; }
}
.checkout-card label,
dialog label { font-weight: 800; font-size: 13px; }
.address-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.address-extra > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.time-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.time-slot-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}
.time-slot-chip:hover {
  border-color: var(--accent);
}
.time-slot-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.time-slot-chip:disabled {
  background: #f1f5f9;
  border-color: var(--line);
  color: #94a3b8;
  cursor: not-allowed;
  text-decoration: line-through;
}
@media (max-width: 420px) {
  .time-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.summary {
  border-radius: 22px;
  padding: 15px;
  box-shadow: none;
  display: grid;
  gap: 10px;
}
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.summary span { color: var(--muted); }
.summary__total {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 20px;
}
.pay-btn:disabled { background: #cbd5e1; }
.append-order-btn {
  min-height: 46px;
  color: var(--accent-dark);
  background: var(--soft);
}

.mobile-tabs {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 300;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 7px;
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  box-shadow:
    0 14px 40px rgba(15,23,42,.18),
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -1px 6px rgba(15,23,42,.05);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}
.mobile-tabs__indicator {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: rgba(66, 66, 66, .82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(15,23,42,.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .38s cubic-bezier(.34,1.4,.4,1), width .38s cubic-bezier(.34,1.4,.4,1);
  will-change: transform, width;
  pointer-events: none;
  z-index: 0;
}
.mobile-tab {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  transition: color .25s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.mobile-tab span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  line-height: 0;
}
.mobile-tab svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-tab b { display: none; }
.mobile-tab.active {
  color: #fff;
}
.mobile-fav-badge,
.mobile-cart-badge {
  position: absolute;
  top: 5px;
  right: 10px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}

dialog {
  border: 0;
  padding: 0;
  border-radius: 28px;
  width: min(440px, calc(100vw - 28px));
  background: var(--card);
  box-shadow: 0 24px 90px rgba(15, 23, 42, .22);
}
.delivery-modal {
  width: min(720px, calc(100vw - 28px));
}
.geo-access-modal {
  width: min(420px, calc(100vw - 28px));
}
.age-verify-modal {
  width: min(380px, calc(100vw - 28px));
}
.age-verify__icon {
  font-size: 42px;
  text-align: center;
  line-height: 1;
  margin-bottom: 4px;
}
.age-verify__question {
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  text-align: center;
  margin-top: 4px !important;
}
.age-verify__actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
dialog::backdrop { background: rgba(15,23,42,.58); }
dialog form {
  position: relative;
  border-radius: 28px;
  padding: 24px;
  display: grid;
  gap: 14px;
  max-height: min(92dvh, 800px);
  overflow: auto;
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .95);
  box-shadow: none;
}
dialog h2 { margin: 0; padding-right: 40px; }
dialog p { margin: 0; color: var(--muted); line-height: 1.5; }
.modal-close { position: absolute; right: 16px; top: 16px; }
.map-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.delivery-map {
  min-height: 280px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 700;
}
.map-status {
  color: var(--muted);
  line-height: 1.35;
}
.zone-result {
  border-radius: 18px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  line-height: 1.45;
}
.zone-result.is-unavailable {
  color: var(--danger);
  background: #fff1f2;
  border-color: #fecdd3;
}
.qr-box {
  width: 220px;
  height: 220px;
  margin: 6px auto;
  padding: 10px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}
.qr-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.payment-progress {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: #f8fafc;
}
.payment-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.payment-step span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #fff;
  font-size: 13px;
}
.payment-step span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}
.payment-step.done,
.payment-step.active {
  color: var(--ink);
}
.payment-step.done span,
.payment-step.active span {
  background: var(--accent);
}
.payment-step.done span::before {
  content: "✓";
  width: auto;
  height: auto;
  background: transparent;
  color: #fff;
  font-weight: 900;
}
.payment-step.error {
  color: var(--danger);
}
.payment-step.error span {
  background: var(--danger);
}
.payment-progress-note {
  border-radius: 14px;
  padding: 10px 12px;
  background: #ecfdf5;
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
}
.payment-progress-note.error {
  background: #fef2f2;
  color: var(--danger);
}
.receipt-upload {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px dashed #86efac;
  border-radius: 18px;
  padding: 12px;
  background: #f0fdf4;
  color: var(--accent-dark);
  font-weight: 900;
  text-align: center;
}
.receipt-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.pay-confirm-btn {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(22, 163, 74, .22);
}
.pay-confirm-btn:hover {
  background: var(--accent-dark);
}
.payment-modal--receipt-screen .qr-box,
.payment-modal--receipt-screen #kaspiLink {
  display: none;
}
.payment-modal--receipt-screen form {
  text-align: center;
}
.payment-modal--receipt-screen #paymentText {
  color: var(--text);
  font-weight: 800;
}
.payment-modal--receipt-screen .pay-confirm-btn {
  margin-top: 4px;
  min-height: 58px;
  font-size: 16px;
}
.payment-modal--receipt-screen #paidNote {
  display: block;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}
.contact-actions { display: grid; gap: 10px; }
.contact-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 12px;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.contact-card--phone {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.contact-card--wa {
  border-color: #d6f3e0;
  background: var(--soft);
  color: var(--accent-dark);
}
.contact-card--phone small,
.contact-card--wa small { color: inherit; opacity: .78; }
.contact-number-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  line-height: 1.35;
  white-space: nowrap;
}
.contact-number-list a {
  flex-shrink: 0;
  color: inherit;
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.contact-card > span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.contact-card--phone > span { background: #dbeafe; }
.contact-card--wa > span { background: #dff6e9; }
.contact-card > span svg,
.contact-popup__btn > span svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-card > span .whatsapp-icon,
.contact-popup__btn > span .whatsapp-icon {
  fill: currentColor;
  stroke: none;
}
.contact-card b { display: block; }
.contact-requisites {
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #d6f3e0;
  border-radius: 20px;
  background: var(--soft);
}
.contact-requisites__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.contact-requisites h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}
.contact-requisites__copy {
  flex: 0 0 auto;
  border: 1px solid #d6f3e0;
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-dark);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15,23,42,.06);
  transition: transform .15s ease;
}
.contact-requisites__copy:active { transform: scale(.95); }
.contact-requisites p {
  margin: 3px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.contact-legal-links {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #bbf7d0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-legal-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: underline;
  transition: opacity 0.15s ease;
}
.contact-legal-link:hover {
  opacity: 0.85;
}

.checkout-oferta-note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
  padding: 0 4px;
}

.checkout-privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.checkout-privacy-check:hover {
  background: rgba(22, 163, 74, 0.05);
}
.checkout-privacy-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkout-privacy-check.error-shake {
  animation: privacyShake 0.4s ease;
  background: #fef2f2;
  border-color: #fca5a5;
}
@keyframes privacyShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.checkout-legal-link,
.checkout-privacy-link {
  color: var(--accent-dark);
  text-decoration: underline;
  font-weight: 600;
}
.checkout-legal-link:hover,
.checkout-privacy-link:hover {
  color: var(--accent);
}

/* Full-screen overlay modals for offer and privacy policy */
.legal-modal {
  border: none;
  border-radius: 24px;
  padding: 0;
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 40px);
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.35);
  background: #ffffff;
  overflow: hidden;
}
.legal-modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
}
.legal-modal__head {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}
.legal-modal__head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.legal-modal__body {
  padding: 24px 24px 32px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  line-height: 1.6;
  color: #334155;
  font-size: 14px;
}
.legal-modal__body h1 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 28px 0 6px;
  text-align: center;
}
.legal-modal__body > h1:first-child {
  margin-top: 0;
}
.legal-modal__body .doc-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  margin-bottom: 24px;
}
.legal-modal__body h2 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 24px;
  margin-bottom: 10px;
  border-bottom: 2px solid #ecfdf5;
  padding-bottom: 4px;
}
.legal-modal__body h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 18px 0 8px;
}
.legal-modal__body p,
.legal-modal__body li {
  margin-bottom: 10px;
  font-size: 13.5px;
}
.legal-modal__body ul {
  margin-left: 20px;
  margin-bottom: 12px;
}
.legal-modal__body .table-req {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  margin-bottom: 14px;
}
.legal-modal__body .table-req td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  font-size: 13px;
}
.legal-modal__body .table-req td:first-child {
  font-weight: 600;
  background: #f8fafc;
  width: 40%;
}

/* Centered notification toast overlay */
.center-toast-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 20px;
  animation: centerToastFadeIn 0.2s ease;
  cursor: pointer;
}
.center-toast-overlay.hidden {
  display: none !important;
}
.center-toast {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--line);
  max-width: 360px;
  width: 100%;
  animation: centerToastPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.center-toast__text {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}
@keyframes centerToastFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes centerToastPopIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Contact popup above mobile nav */
.contact-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
}
.contact-popup[hidden],
.contact-popup-overlay[hidden] { display: none; }
.contact-popup {
  position: fixed;
  left: 14px;
  right: 14px;
  width: auto;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 200;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(15,23,42,.2);
  padding: 18px 16px 16px;
  display: grid;
  gap: 14px;
  animation: popup-in .22s cubic-bezier(.34,1.2,.4,1);
  max-height: 80vh;
  overflow-y: auto;
}
.contact-popup__handle { display: none; }
.contact-popup__head {
  display: grid;
  gap: 3px;
  padding: 0 2px;
  text-align: center;
}
.contact-popup__head b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}
.contact-popup__head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.contact-popup__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
@keyframes popup-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.contact-popup__btn {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 82px;
  padding: 12px;
  border-radius: 18px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 12.5px;
  color: #1d4ed8;
  font-weight: 800;
  text-decoration: none;
  cursor: default;
}
.contact-popup__btn > span {
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  font-size: 18px;
  line-height: 1;
}
.contact-popup__btn b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}
.contact-popup__btn small {
  min-width: 0;
  overflow: visible;
  color: inherit;
  opacity: .75;
  font-size: 10.5px;
  font-weight: 700;
  white-space: normal;
}
.contact-popup__btn--wa {
  background: var(--soft);
  border-color: #d6f3e0;
  color: var(--accent-dark);
}
.contact-popup__btn--wa span { background: #dff6e9; }
@media (min-width: 768px) {
  .contact-popup, .contact-popup-overlay { display: none !important; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + var(--safe-bottom));
  z-index: 80;
  transform: translateX(-50%);
  width: min(360px, calc(100% - 28px));
  border-radius: 999px;
  padding: 13px 16px;
  text-align: center;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 20px 60px rgba(15,23,42,.3);
}

@media (min-width: 981px) {
  .shell {
    width: min(1280px, calc(100% - 28px));
  }
  .header {
    width: min(1980px, calc(100vw - 18px));
    margin-left: 50%;
    transform: translateX(-50%);
    gap: 14px;
    padding: 20px 18px;
    margin-top: 8px;
    margin-bottom: 42px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(226,232,240,.72);
    border-radius: 0;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
    backdrop-filter: blur(18px);
  }
  .brand {
    width: 150px;
    flex: 0 0 150px;
  }
  .brand__logo {
    height: 56px;
    max-width: 150px;
  }
  .brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 18px;
  }
  .brand strong {
    font-size: 16px;
  }
  .brand small {
    font-size: 10px;
  }
  .search-box--header {
    margin-left: 0;
    margin-right: 0;
    flex: 1 1 520px;
    min-width: 360px;
    max-width: none;
    min-height: 50px;
    height: 50px;
    padding: 0 18px;
    gap: 12px;
    border-color: #dbe3ee;
    border-width: 1px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
  }
  .search-box--header span {
    color: #475569;
    font-size: 20px;
    line-height: 1;
  }
  .search-box--header input {
    color: #475569;
    font-size: 14.5px;
    font-weight: 500;
  }
  .search-box--header input::placeholder {
    color: #64748b;
  }
  .location {
    position: relative;
    flex: 0 1 340px;
    max-width: 380px;
    border: 0;
    background: #edf8f1;
    box-shadow: 0 8px 22px rgba(22, 101, 52, .06);
    padding: 0 12px;
    min-height: 50px;
    height: 50px;
    gap: 10px;
    align-items: center;
  }
  .location__icon {
    width: 36px;
    height: 36px;
    background: #ffffff;
    color: var(--accent-dark);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(22, 101, 52, .08);
  }
  .location__icon svg { width: 18px; height: 18px; }
  .location > span:not(.location__icon) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
  }
  .location small {
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
  }
  .location b {
    max-width: 240px;
    font-weight: 800;
    font-size: 13px;
    color: var(--ink);
  }
  .contact-header-button,
  .favorite-header-button,
  .cart-button.desktop-only {
    min-height: 50px;
    height: 50px;
    border-width: 1px;
    border-color: #dbe3ee;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
  }
  .pwa-install-header-button {
    width: 50px;
    height: 50px;
    border-color: #dbe3ee;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
  }
  .contact-header-button {
    margin-left: auto;
    padding: 0 16px;
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 700;
  }
  .contact-header-button svg {
    width: 18px;
    height: 18px;
  }
  .favorite-header-button.desktop-only {
    margin-left: 0;
    flex: 0 0 auto;
    min-width: 150px;
    padding: 0 40px 0 16px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
  }
  .favorite-header-button svg {
    width: 20px;
    height: 20px;
    color: var(--accent-dark);
  }
  .favorite-header-button i {
    right: 14px;
    min-width: 24px;
    height: 24px;
    color: var(--accent-dark);
    background: #dff6e9;
    font-size: 12px;
  }
  .cart-button.desktop-only {
    flex: 0 0 auto;
    min-width: 160px;
    padding: 0 42px 0 16px;
    color: #111827;
    font-size: 14px;
    font-weight: 500;
  }
  .cart-button__icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: #f97316;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .cart-button b {
    color: #111827;
    font-size: 13px;
    font-weight: 900;
  }
  .cart-button i {
    right: 14px;
    min-width: 24px;
    height: 24px;
    color: #f97316;
    background: rgba(249, 115, 22, .16);
    font-size: 12px;
  }
  .favorite-header-button.desktop-only:hover,
  .favorite-header-button.desktop-only:focus-visible,
  .favorite-header-button.desktop-only:active,
  .favorite-header-button.desktop-only.active {
    color: var(--accent-dark);
    border-color: var(--accent);
  }
  .cart-button.desktop-only:hover,
  .cart-button.desktop-only:focus-visible,
  .cart-button.desktop-only:active,
  .cart-button.desktop-only.active {
    border-color: #f97316;
  }
  .search-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
  }
  .search-panel > .filter-chip[data-category="all"],
  .search-panel > .category-scroll {
    display: none;
  }
  #categoryScroll {
    gap: 12px;
  }
  .layout {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
  }
  .sidebar-stack {
    top: 128px;
  }
  .sidebar {
    border-radius: 14px;
    height: min(620px, calc(100dvh - 158px));
    padding: 10px 12px 14px;
    background: rgba(255, 255, 255, .82);
    border-color: transparent;
    box-shadow: none;
  }
  .sidebar h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 12px;
  }
  .sidebar nav {
    gap: 4px;
  }
  .sidebar .category-btn {
    align-items: flex-start;
    font-size: 14px;
    font-weight: 500;
    padding: 7px 6px;
    gap: 10px;
  }
  .sidebar .category-btn span {
    line-height: 1.25;
  }
  .sidebar .category-btn.active {
    font-weight: 800;
  }
  .sidebar .category-btn small {
    align-self: flex-start;
    min-width: 34px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
  }
  .catalog-area {
    padding-top: 8px;
  }
  .section-title {
    grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.1fr);
    align-items: start;
    gap: 18px;
    margin-bottom: 18px;
  }
  .section-title h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
  }
  #sortSelect {
    max-width: 368px;
    justify-self: end;
    margin-left: auto;
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 7px;
    border-radius: 8px;
    font-size: 13px;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
  }
  .product-card {
    border-radius: 14px;
    padding: 12px;
  }
  .product-card h3 {
    font-size: 14px;
    min-height: 38px;
  }
  .product-card__bottom strong {
    font-size: 18px;
  }
}

@media (max-width: 980px) {
  .desktop-only { display: none !important; }
  .shell { width: min(100% - 24px, 720px); }
  .header { gap: 10px; }
  .section-title {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .section-title > div:first-child,
  #sortSelect {
    grid-column: 1;
  }
  #sortSelect {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    margin-left: 0;
  }
  .brand__logo { height: 46px; max-width: min(50vw, 220px); }
  .location { margin-left: auto; width: 54vw; max-width: 54vw; flex: 0 1 54vw; }
  .desktop-card { display: none; }
  .search-panel {
    top: calc(56px + var(--header-top-pad));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border-radius: 24px;
    padding: 10px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .08);
  }
  .search-panel.search-panel--hidden {
    transform: translateY(calc(-100% - var(--header-top-pad) - 70px));
    opacity: 0;
    pointer-events: none;
  }
  .search-box {
    grid-column: 1 / -1;
    min-width: 0;
    min-height: 46px;
  }
  .search-hints { display: none; }
  .search-panel > .filter-chip[data-category="all"] {
    grid-column: 1;
    grid-row: 2;
    padding: 11px 16px;
  }
  .category-scroll {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1px;
    contain: inline-size;
  }
  .category-scroll .filter-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 11px 14px;
    font-size: inherit;
  }
  .layout { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
  .mobile-tabs { display: grid; }
  .payment-modal--receipt-screen {
    width: 100vw;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .payment-modal--receipt-screen form {
    min-height: 100dvh;
    max-height: none;
    justify-content: center;
    border-radius: 0;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .payment-modal--receipt-screen h2 {
    font-size: 26px;
  }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 18px); padding-bottom: calc(76px + var(--safe-bottom)); }
  .header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding-top: var(--header-top-pad);
    padding-left: max(0px, var(--safe-left));
    padding-right: max(0px, var(--safe-right));
  }
  .brand {
    min-width: 0;
  }
  .brand__logo { height: 38px; max-width: min(40vw, 150px); }
  .pwa-install-header-button { width: 40px; height: 40px; }
  .pwa-install-header-button svg { width: 19px; height: 19px; }
  .map-actions { grid-template-columns: 1fr; }
  .delivery-map { min-height: 220px; }
  .location {
    position: relative;
    z-index: 5;
    justify-self: end;
    margin-left: 0;
    min-height: 44px;
    width: 150px;
    max-width: 150px;
    padding: 7px 9px;
    gap: 6px;
    cursor: pointer;
    touch-action: manipulation;
  }
  .location small { display: none; }
  .location__icon { width: 30px; height: 30px; }
  .location b { max-width: 94px; font-size: 14px; }
  .search-panel {
    top: calc(56px + var(--header-top-pad));
    margin-left: -2px;
    margin-right: -2px;
    border-radius: 22px;
  }
  .search-panel.search-panel--hidden {
    transform: translateY(calc(-100% - var(--header-top-pad) - 60px));
  }
  .search-box {
    padding: 0 12px;
    min-height: 44px;
  }
  .search-box input {
    font-size: 15px;
  }
  .search-panel > .filter-chip[data-category="all"] {
    padding: 10px 15px;
  }
  .category-scroll .filter-chip {
    padding: 10px 13px;
  }
  .catalog-area { padding: 12px 0; border-radius: 24px; }
  .section-title {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .section-title > div:first-child,
  #sortSelect {
    grid-column: 1;
  }
  .section-title h2 { font-size: 27px; }
  .section-title select,
  #sortSelect { width: 100%; max-width: none; justify-self: stretch; margin-left: 0; }
  .product-card { border-radius: 18px; padding: 12px; gap: 8px; }
  .product-card__image-wrap { gap: 6px; margin: 2px 0; }
  .product-card__podlozhka { width: min(68%, 150px); }
  .product-card__image { font-size: 45px; width: 74%; }
  .product-card h3 { font-size: 13px; min-height: 34px; height: auto; font-weight: 400; }
  .product-code { font-size: 10px; padding: 3px 7px; }
  .product-card__bottom strong,
  .price-current { font-size: 16px; font-weight: 600; }
  .product-qty-mini { display: flex; align-items: center; gap: 3px; padding: 3px; }
  .product-qty-mini button { width: 28px; height: 28px; font-size: 16px; }
  .drawer { right: 0; left: 0; top: auto; bottom: 0; width: 100%; max-height: 86vh; border-radius: 22px 22px 0 0; padding: 12px; padding-bottom: calc(96px + var(--safe-bottom)); gap: 9px; }
  .checkout-card { padding: 10px; gap: 6px; border-radius: 16px; }
  .checkout-card label,
  dialog label { font-size: 12px; }
  .checkout-card input,
  .checkout-card textarea { min-height: 38px; }
  .address-extra { gap: 6px; }
  .summary { padding: 10px; gap: 7px; border-radius: 16px; }
  .summary__total { font-size: 17px; padding-top: 7px; }
  .pay-btn,
  .append-order-btn { min-height: 42px; padding: 11px 14px; }
  dialog form { padding: 18px; gap: 10px; border-radius: 22px; }
  .delivery-modal { width: min(520px, calc(100vw - 18px)); }
  .zone-result { min-height: 46px; font-size: 13px; border-radius: 14px; padding: 12px; }
  .cart-item { grid-template-columns: 52px minmax(0, 1fr) 104px; gap: 8px; }
  .cart-item__img { width: 52px; height: 52px; min-width: 52px; min-height: 52px; border-radius: 14px; }
  .cart-item h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
    line-height: 1.18;
  }
  .qty { gap: 5px; }
  .qty button { width: 26px; height: 26px; }
}

@media (max-width: 390px) {
  .shell { width: calc(100% - 14px); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { padding: 10px; gap: 6px; border-radius: 16px; }
  .product-card__image-wrap { gap: 4px; margin: 2px 0; }
  .product-card__podlozhka { width: min(68%, 130px); }
  .product-card__image { width: 74%; }
  .product-card h3 { font-size: 12px; min-height: 32px; height: auto; font-weight: 400; }
  .product-code { font-size: 9px; padding: 2px 6px; }
  .product-card__bottom strong,
  .price-current { font-size: 15px; font-weight: 600; }
  .product-qty-mini { display: flex; align-items: center; gap: 2px; padding: 2px; }
  .product-qty-mini button { width: 26px; height: 26px; font-size: 15px; }
  .cart-item {
    grid-template-columns: 46px minmax(0, 1fr) 96px;
    gap: 7px;
    padding: 8px;
  }
  .cart-item__img { width: 46px; height: 46px; min-width: 46px; min-height: 46px; }
  .cart-item h3 { font-size: 13px; }
  .cart-item span,
  .cart-item small { font-size: 11.5px; }
  .qty { justify-content: flex-end; gap: 4px; }
  .qty b {
    min-width: 26px;
    text-align: center;
    font-size: 15px;
    white-space: nowrap;
  }
}

@media (max-width: 350px) {
  .shell { width: calc(100% - 10px); }
  .product-grid { gap: 6px; }
  .product-card { padding: 7px; border-radius: 15px; }
  .favorite-btn {
    top: 68px;
    right: 6px;
    width: 28px;
    height: 28px;
  }
  .favorite-btn svg {
    width: 16px;
    height: 16px;
  }
  .product-card__top { padding-right: 0; }
  .product-card h3 { font-size: 11.5px; min-height: 31px; height: auto; }
  .product-code { font-size: 8px; padding: 3px 5px; }
  .product-card__bottom { gap: 5px; }
  .product-card__bottom strong { font-size: 14px; }
  .product-qty-mini { gap: 3px; padding: 3px; }
  .product-qty-mini b { min-width: 15px; font-size: 11px; }
  .product-qty-mini button { width: 26px; height: 26px; font-size: 16px; }
  .cart-item {
    grid-template-columns: 42px minmax(0, 1fr) 88px;
    gap: 6px;
  }
  .cart-item__img { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
  .cart-item h3 { font-size: 12.5px; -webkit-line-clamp: 2; }
  .qty button { width: 24px; height: 24px; }
  .qty b { min-width: 24px; font-size: 13px; }
}

/* ===== PWA: баннер установки ===== */
.install-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -140%);
  z-index: 130;
  width: min(560px, calc(100% - 20px));
  margin-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  cursor: pointer;                 /* весь баннер кликабелен */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;              /* свайп по баннеру обрабатываем сами */
}
.install-banner.is-visible { transform: translate(-50%, 0); }
.install-banner[hidden] { display: none; }
.install-banner__icon img { display: block; border-radius: 12px; }
.install-banner__text { flex: 1; min-width: 0; line-height: 1.25; }
.install-banner__text b { display: block; font-size: 14px; }
.install-banner__text small { color: var(--muted); font-size: 12px; }
.install-banner__btn {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
}
.install-banner__btn:hover { background: var(--accent-dark); }
.install-banner__close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 480px) {
  .install-banner { gap: 10px; padding: 10px 12px; }
  .install-banner__icon img { width: 38px; height: 38px; }
  .install-banner__text b { font-size: 13px; line-height: 1.2; }
  .install-banner__text small { display: none; }
  .install-banner__btn { padding: 8px 12px; font-size: 12.5px; }
  .install-banner__close { width: 28px; height: 28px; font-size: 18px; }
}

/* Десктоп: тонкая полоса скролла у ленты категорий — видна только при наведении */
@media (min-width: 981px) {
  .category-scroll {
    scrollbar-width: thin;                 /* Firefox: резервируем место */
    scrollbar-color: transparent transparent;
    padding-bottom: 6px;
  }
  .category-scroll:hover { scrollbar-color: rgba(148, 163, 184, .6) transparent; }
  .category-scroll::-webkit-scrollbar { display: block; height: 7px; }
  .category-scroll::-webkit-scrollbar-track { background: transparent; }
  .category-scroll::-webkit-scrollbar-thumb {
    background: transparent;               /* по умолчанию невидима, место занято */
    border-radius: 999px;
  }
  .category-scroll:hover::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .6); }
  .category-scroll:hover::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .8); }
}

/* Промо-баннер на главной (управляется из CMS / data/settings.json) */
.promo-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 6px 18px rgba(21, 128, 61, .25);
}
.promo-slot[hidden] { display: none; }
.promo-slot__text {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  color: #fff;
  text-decoration: none;
}
.promo-slot__content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: #fff;
}
.promo-slot__img {
  max-height: 48px;
  max-width: 140px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.promo-slot--has-image {
  padding: 8px 14px;
}
.promo-slot--image-only {
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  position: relative;
}
.promo-slot--image-only .promo-slot__img {
  max-height: 140px;
  max-width: 100%;
  width: 100%;
  border-radius: 14px;
  display: block;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.promo-slot--image-only .promo-slot__close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.45);
}
a.promo-slot__text { text-decoration: underline; text-underline-offset: 2px; }
.promo-slot__close {
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.promo-slot__close:hover { background: rgba(255, 255, 255, .32); }

/* ==========================================================
   Order Tracker & Payment Status Modals (Choco / Samokat style)
   ========================================================== */
.order-tracker-modal {
  border: none;
  border-radius: 28px;
  padding: 0;
  max-width: 540px;
  width: calc(100% - 24px);
  max-height: calc(100vh - 32px);
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.4);
  background: #ffffff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
}
.order-tracker-modal::backdrop {
  background: rgba(15, 23, 42, 0.65);
}
.payment-check-spinner {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 5px solid #dcfce7;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: spinStep 0.9s linear infinite;
}
.active-order-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: #15803d;
  box-shadow: 0 12px 30px rgba(21, 128, 61, 0.28);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.active-order-button__pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #86efac;
  box-shadow: 0 0 0 0 rgba(134, 239, 172, 0.7);
  animation: activeOrderPulse 1.8s infinite;
}
@keyframes activeOrderPulse {
  70% { box-shadow: 0 0 0 9px rgba(134, 239, 172, 0); }
  100% { box-shadow: 0 0 0 0 rgba(134, 239, 172, 0); }
}
.tracker-card {
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tracker-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tracker-header__badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 6px;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.2);
  animation: scaleInCheck 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.tracker-header__badge--fail {
  background: #fef2f2;
  color: #ef4444;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}
@keyframes scaleInCheck {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.tracker-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
}
.tracker-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}
.tracker-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-top: 4px;
}
.tracker-meta__num {
  color: #15803d;
}
.tracker-meta__dot {
  color: #cbd5e1;
}

/* Stepper (Этапы доставки) */
.tracker-stepper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.tracker-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  opacity: 0.45;
  transition: opacity 0.3s ease;
}
.tracker-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: -12px;
  width: 2px;
  background: #cbd5e1;
  z-index: 1;
}
.tracker-step.completed,
.tracker-step.current {
  opacity: 1;
}
.tracker-step.completed:not(:last-child)::after {
  background: #16a34a;
}
.tracker-step__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}
.tracker-step.completed .tracker-step__icon {
  background: #16a34a;
  color: #ffffff;
}
.tracker-step.current .tracker-step__icon {
  background: #ecfdf5;
  color: #15803d;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2);
}
.tracker-step.current .tracker-step__icon .step-spinner {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #16a34a;
  animation: spinStep 1.2s linear infinite;
}
@keyframes spinStep {
  to { transform: rotate(360deg); }
}
.tracker-step__info {
  flex: 1;
  min-width: 0;
}
.tracker-step__title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.tracker-step__desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.3;
}
.tracker-step.current .tracker-step__title {
  color: #15803d;
}

/* Info Box */
.tracker-info-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tracker-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}
.tracker-info-label {
  color: #64748b;
  font-weight: 600;
  flex-shrink: 0;
}
.tracker-info-val {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

/* Items list */
.tracker-items-section {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
}
.tracker-items-header {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  display: flex;
  justify-content: space-between;
}
.tracker-items-list {
  max-height: 170px;
  overflow-y: auto;
  padding: 8px 18px;
}
.tracker-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 10px;
  font-size: 13px;
  border-bottom: 1px dashed #f1f5f9;
}
.tracker-item-row:last-child {
  border-bottom: none;
}
.tracker-item-row__left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.tracker-item-row__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1e293b;
  font-weight: 600;
}
.tracker-item-row__qty {
  color: #64748b;
  font-weight: 600;
  flex-shrink: 0;
}
.tracker-item-row__price {
  font-weight: 700;
  color: #0f172a;
  flex-shrink: 0;
}

/* Actions buttons */
.tracker-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.tracker-actions[hidden] {
  display: none;
}
.tracker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.tracker-btn--whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.25);
}
.tracker-btn--whatsapp:hover {
  background: #20bd5a;
}
.tracker-btn--retry {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.25);
}
.tracker-btn--retry:hover {
  background: #15803d;
}
.tracker-btn--home {
  background: #f1f5f9;
  color: #334155;
}
.tracker-btn--home:hover {
  background: #e2e8f0;
}
@media (max-width: 640px) {
  .active-order-button {
    right: 14px;
    bottom: calc(92px + var(--safe-bottom));
  }
  .order-tracker-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
    margin-bottom: 0;
  }
  .tracker-card {
    padding: 20px 16px 28px;
  }
}

/* ==========================================================
   Customer order history
   ========================================================== */
.orders-open-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #dbe3ee;
  border-radius: 13px;
  color: #334155;
  background: #f8fafc;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.orders-open-btn:hover,
.orders-open-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--soft);
}
.orders-open-btn b {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border-radius: 999px;
  color: #15803d;
  background: #dcfce7;
  font-size: 11px;
}
.orders-modal {
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  background: #ffffff;
}
.orders-modal__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}
.orders-modal__head h2 {
  margin: 0;
  padding: 0;
  color: #0f172a;
  font-size: 22px;
}
.orders-modal__head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}
.orders-modal__head .icon-btn {
  position: static;
  flex: 0 0 auto;
}
.orders-list {
  display: grid;
  gap: 10px;
  max-height: calc(min(760px, 100vh - 28px) - 92px);
  padding: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.orders-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 52px 20px;
  text-align: center;
  color: #64748b;
}
.orders-empty > div {
  font-size: 42px;
  line-height: 1;
}
.orders-empty strong {
  color: #0f172a;
  font-size: 16px;
}
.orders-empty p {
  margin: 0;
  font-size: 13px;
}
.order-history-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 17px;
  background: #ffffff;
}
.order-history-card__top,
.order-history-card__middle,
.order-history-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.order-history-card__top strong {
  color: #0f172a;
  font-size: 14px;
}
.order-history-card__top span,
.order-history-card__middle > span:last-child,
.order-history-card__bottom small {
  color: #64748b;
  font-size: 12px;
}
.order-history-card__middle > span:last-child {
  text-align: right;
}
.order-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px !important;
  font-weight: 800;
}
.order-status--paid,
.order-status--collecting,
.order-status--delivering,
.order-status--delivered {
  color: #15803d;
  background: #dcfce7;
}
.order-status--pending {
  color: #b45309;
  background: #fef3c7;
}
.order-status--canceled {
  color: #b91c1c;
  background: #fee2e2;
}
.order-history-card__action {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: #16a34a;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.order-history-card__action:disabled {
  opacity: .6;
  cursor: wait;
}
@media (max-width: 640px) {
  .orders-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
    margin-bottom: 0;
  }
  .orders-list {
    max-height: calc(94vh - 92px);
  }
}

/* Воздух по краям пунктов бокового каталога. */
.sidebar .category-btn { padding-left: 10px; padding-right: 10px; }
