: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-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  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: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}

.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,
.cart-button span,
.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 b {
  display: block;
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cart-button {
  margin-left: auto;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 48px 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 i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  font-style: normal;
}

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

.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;
}
/* Поиск, перенесённый в шапку (десктоп) */
.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: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 160px;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  padding: 20px;
  max-height: calc(100dvh - 180px);
  overflow: auto;
  transition: top .24s ease, max-height .24s ease;
}
.sidebar h2 { 
  margin: 0 0 12px; 
  font-size: 18px; 
  color: #424242; 
  font-weight: 700; 
}
.sidebar nav { display: grid; gap: 8px; }
.category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 16px;
  padding: 13px 14px;
  text-align: left;
  color: #424242;
  font-weight: 400;
  border: 0;
  background: transparent;
}
.category-btn.active {
  background: #f1f5f9;
  font-weight: 600;
}
.delivery-widget {
  margin-top: 18px;
  border-radius: 18px;
  padding: 16px;
  background: var(--soft);
  display: grid;
  gap: 4px;
}
.catalog-area {
  border-radius: var(--radius-xl);
  padding: 20px 0;
}

body.catalog-search-hidden .sidebar {
  top: 88px;
  max-height: calc(100dvh - 108px);
}
.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%;
  margin-left: 0;
  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(3, minmax(0, 1fr));
  gap: 14px;
}
.product-card {
  background-color: #f4f9f6;
  border: 1px solid #e2ebd5;
  border-radius: 20px;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  min-height: 0;
  transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(162, 187, 155, 0.2);
}
.product-card__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-card h3 {
  margin: 0;
  color: #424242;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}
.product-code {
  align-self: flex-start;
  border-radius: 8px;
  padding: 3px 10px;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.product-card__podlozhka {
  display: none;
}
.product-card__image {
  border: 0;
  width: 100%;
  height: 100%;
  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: 10px;
  margin-top: 15px;
}
.price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.price-old {
  min-height: 14px;
  color: #94a3b8;
  text-decoration: line-through;
  font-size: 12px;
}
.product-card__bottom strong {
  font-size: 20px;
  color: #424242;
  font-weight: 800;
}
.product-qty-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background-color: #eef2f6;
}
.product-qty-mini b {
  min-width: 18px;
  text-align: center;
  font-size: 14px;
  color: #424242;
  font-weight: 700;
}
.product-qty-mini button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background-color: var(--accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
  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;
}
.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; }

.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;
}
.drawer__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.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;
}
.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;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--soft);
  font-size: 28px;
}
.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;
}
.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;
}
.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;
}
.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; }

.mobile-tabs {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 40;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15,23,42,.22);
  backdrop-filter: blur(16px);
}
.mobile-tab {
  position: relative;
  border: 0;
  border-radius: 20px;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.mobile-tab span { font-size: 22px; line-height: 1; }
.mobile-tab b { font-size: 13px; }
.mobile-tab.active {
  background: var(--ink);
  color: #fff;
}
.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));
}
dialog::backdrop { background: rgba(15,23,42,.58); }
dialog form {
  position: relative;
  border-radius: 28px;
  padding: 24px;
  display: grid;
  gap: 14px;
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, .95);
  box-shadow: none;
}
dialog h2 { margin: 0; }
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: 320px;
  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;
}
.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:hover {
  border-color: #bbf7d0;
  background: #f8fffb;
}
.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 b { display: block; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + 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) {
  .header {
    gap: 20px;
    padding: 24px 0 20px;
  }
  .brand {
    width: 260px;
    flex: 0 0 260px;
  }
  .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;
    min-height: 40px;
    height: 40px;
  }
  .location {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-height: 40px;
    height: 40px;
    gap: 10px;
    align-items: center;
  }
  .location__icon {
    width: auto;
    height: auto;
    background: transparent;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .location span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
  }
  .location small {
    color: #64748b;
    font-weight: 400;
  }
  .location b {
    font-weight: 500;
    font-size: 14px;
    color: var(--ink);
  }
  .cart-button.desktop-only {
    min-height: 40px;
    height: 40px;
    padding: 0 42px 0 16px;
  }
  .search-panel {
    padding-left: 0;
    padding-right: 0;
    gap: 12px;
  }
  #categoryScroll {
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .desktop-only { display: none !important; }
  .shell { width: min(100% - 24px, 720px); }
  .header { gap: 10px; }
  .brand__logo { height: 46px; max-width: min(50vw, 220px); }
  .location { margin-left: auto; max-width: 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;
  }
  .layout { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 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: 108px; }
  .header { padding-top: 10px; }
  .brand__logo { height: 42px; max-width: min(56vw, 190px); }
  .map-actions { grid-template-columns: 1fr; }
  .delivery-map { min-height: 280px; }
  .location { max-width: 52vw; padding: 7px 10px; }
  .location small { display: none; }
  .location__icon { width: 30px; height: 30px; }
  .location b { max-width: 128px; 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; border-radius: 24px; }
  .section-title { align-items: start; flex-direction: column; }
  .section-title select { width: 100%; }
  .product-card { border-radius: 18px; padding: 10px; gap: 8px; }
  .product-card__image { font-size: 45px; aspect-ratio: 1.05 / 1; border-radius: 12px; }
  .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: 92vh; border-radius: 28px 28px 0 0; padding-bottom: calc(18px + var(--safe-bottom)); }
  .cart-item { grid-template-columns: 46px 1fr auto; gap: 9px; }
  .cart-item__img { width: 46px; height: 46px; border-radius: 14px; }
  .qty { gap: 5px; }
  .qty button { width: 26px; height: 26px; }
}

@media (max-width: 390px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-card { padding: 8px; gap: 6px; }
  .product-card__image { aspect-ratio: 1.05 / 1; }
  .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; }
}
