:root {
  --bg: #F9F9F9;
  --card: #ffffff;
  --ink: #242326;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #fde8e8;
  --accent: #D81F26;
  --accent-dark: #b3141a;
  --danger: #ef4444;
  --warning: #f97316;
  --shadow: 0 18px 60px rgba(15, 23, 42, .08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; overflow-x: clip; }
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;
  max-width: 100vw;
  overflow-x: clip;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
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: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: fit-content;
}
.brand__logo {
  display: block;
  width: 200px;
  height: auto;
  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 {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.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(--ink);
  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; }
  .header .location {
    width: auto;
    flex: 0 1 340px;
    max-width: 380px;
    border-radius: 999px;
    padding: 0 12px;
    gap: 10px;
    justify-content: flex-start;
  }
  .header .location > span:not(.location__icon) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
  }
}
.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(--ink);
  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: var(--accent);
}
.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(216, 31, 38, .12);
  color: var(--accent);
}

.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; }
.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: 72px;
  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% - 80px));
  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-search-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 299;
}
.photo-search-menu[hidden],
.photo-search-menu-overlay[hidden] { display: none; }
.photo-search-menu {
  position: fixed;
  z-index: 300;
  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: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.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;
}
/* Поиск, перенесённый в шапку (десктоп) */
.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;
  gap: 8px;
  overflow: auto;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.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: auto;
}
.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; }
.category-btn {
  display: flex;
  align-items: center;
  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 {
  min-width: 0;
  white-space: normal;
  line-height: 1.12;
}
.category-btn small {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
}
.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: 16px;
  overflow: hidden;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-height: 0;
  min-width: 0;
  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: linear-gradient(160deg, #fee2e2 0%, #fef2f2 100%);
  box-shadow:
    0 0 0 3px rgba(216, 31, 38, .12),
    0 12px 36px rgba(155, 28, 28, .12);
  transform: translateY(-2px);
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(162, 187, 155, 0.2);
}
.favorite-btn {
  position: absolute;
  z-index: 3;
  top: 47px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #64748b;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0;
  line-height: 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}
.favorite-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.product-card--favorite .favorite-btn {
  color: #F48120;
  border-color: #fdd9b5;
  background: #fff7ef;
}
.product-card--favorite .favorite-btn svg {
  fill: currentColor;
  stroke: currentColor;
}
.product-card__top {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 0;
  min-width: 0;
}
.product-card h3 {
  margin: 0;
  color: #424242;
  font-size: 13.5px;
  line-height: 1.3;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
  height: auto;
}
.product-code {
  align-self: flex-start;
  border-radius: 8px;
  padding: 3px 8px;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.product-card__image-wrap {
  position: relative;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 4px 0 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: 72%;
  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: 8px;
  margin-top: 2px;
  min-width: 0;
}
.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 {
  font-size: 17px;
  color: #424242;
  font-weight: 600;
  line-height: 1.12;
  white-space: nowrap;
}
.product-qty-mini {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  padding: 3px;
  border-radius: 999px;
  background-color: #eef2f6;
}
.product-card--in-cart .product-qty-mini {
  background: #fde8e8;
  box-shadow: inset 0 0 0 1px rgba(216, 31, 38, .2);
}
.product-card--in-cart .product-qty-mini b {
  color: #9b1c1c;
}
.product-qty-mini b {
  min-width: 17px;
  text-align: center;
  font-size: 12px;
  color: #424242;
  font-weight: 700;
}
.product-qty-mini button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background-color: #111827;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.15s;
}
.product-qty-mini button:active {
  transform: scale(0.9);
}
.product-qty-mini button:disabled { 
  background-color: #cbd5e1;
  color: #94a3b8;
  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: var(--accent);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(216, 31, 38, .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);
  backdrop-filter: blur(4px);
}
.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; }
.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: var(--soft); }
@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(36, 35, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  box-shadow:
    0 14px 40px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 6px rgba(0,0,0,0.1);
  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: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(216, 31, 38, .4);
  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: rgba(255, 255, 255, 0.55);
  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: var(--soft);
  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--phone:hover { border-color: #93c5fd; background: #dbeafe; }
.contact-card--wa {
  border-color: #d6f3e0;
  background: var(--soft);
  color: var(--accent-dark);
}
.contact-card--wa:hover { border-color: #a7e8bd; background: #e2f8ea; }
.contact-card--phone small,
.contact-card--wa small { color: inherit; opacity: .78; }
.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 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) 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: 70px;
  padding: 12px;
  border-radius: 18px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 12.5px;
  color: #1d4ed8;
  font-weight: 800;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.contact-popup__btn:active { transform: scale(.97); }
.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: hidden;
  color: inherit;
  opacity: .75;
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border: 0;
    background: var(--soft);
    box-shadow: 0 8px 22px rgba(216, 31, 38, .04);
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .location__icon {
    width: 36px;
    height: 36px;
    background: #ffffff;
    color: var(--accent-dark);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(216, 31, 38, .08);
  }
  .location__icon svg { width: 18px; height: 18px; }
  .location > span:not(.location__icon) {
    display: none;
  }
  .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(--ink);
    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: var(--soft);
    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: var(--accent-dark);
    background: var(--soft);
    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: var(--accent);
  }
  .search-panel {
    position: static;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .search-panel > .filter-chip[data-category="all"],
  .search-panel > .category-scroll {
    display: none;
  }
  #categoryScroll {
    gap: 12px;
  }
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
  }
  .sidebar-stack {
    top: 128px;
  }
  .sidebar {
    border-radius: 14px;
    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 {
    font-size: 14px;
    font-weight: 500;
    padding: 7px 4px;
  }
  .sidebar .category-btn.active {
    font-weight: 800;
  }
  .sidebar .category-btn small {
    font-size: 14px;
    font-weight: 600;
  }
  .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: 72px;
    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% - 88px));
    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: auto;
    min-width: 0;
    padding-bottom: 1px;
  }
  .category-scroll .filter-chip {
    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: 10px;
  }
  .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 { justify-self: end; margin-left: 0; width: 150px; max-width: 150px; padding: 7px 9px; gap: 6px; }
  .location small { display: none; }
  .location__icon { width: 30px; height: 30px; }
  .location b { max-width: 94px; font-size: 14px; }
  .search-panel {
    top: 62px;
    margin-left: -2px;
    margin-right: -2px;
    border-radius: 22px;
  }
  .search-panel.search-panel--hidden {
    transform: translateY(calc(-100% - 76px));
  }
  .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: 20px; padding: 12px; gap: 8px; }
  .product-card__image-wrap { gap: 6px; }
  .product-card__podlozhka { width: min(68%, 150px); }
  .product-card__image { font-size: 45px; width: 70%; }
  .product-card h3 { font-size: 13px; height: 34px; }
  .product-code { font-size: 10px; padding: 4px 7px; }
  .product-card__bottom strong { font-size: 16px; }
  .product-qty-mini { grid-template-columns: 30px minmax(24px, auto) 30px; gap: 5px; padding: 5px; }
  .product-qty-mini button { width: 30px; height: 30px; font-size: 18px; }
  .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; }
  .product-card__image-wrap { gap: 4px; }
  .product-card__podlozhka { width: min(68%, 130px); }
  .product-card__image { width: 72%; }
  .product-card h3 { font-size: 12px; height: 32px; }
  .product-code { font-size: 9px; padding: 4px 6px; }
  .product-card__bottom strong { font-size: 15px; }
  .product-qty-mini { grid-template-columns: 28px minmax(20px, auto) 28px; gap: 4px; padding: 4px; }
  .product-qty-mini button { width: 28px; height: 28px; font-size: 17px; }
  .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, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 6px 18px rgba(216, 31, 38, .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;
}
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); }

/* --- FOOTER REDESIGN --- */
.footer {
  background: #242326;
  color: #e2e8f0;
  padding: 40px 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  margin-top: 40px;
}
.footer__inner {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}
.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__logo {
  width: 160px;
  height: auto;
}
.footer__tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  margin: 0;
}
.footer__info,
.footer__requisites {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__info h4,
.footer__requisites h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
}
.footer__link {
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer__link:hover {
  color: var(--accent);
}
.footer__requisites p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13.5px;
  line-height: 1.4;
}
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

@media (max-width: 980px) {
  .footer {
    padding-bottom: calc(40px + var(--safe-bottom));
  }
}
