/* =========================================================
   PWA — Весёлая Затея (mobile-first app shell)
========================================================= */
:root {
  --primary: #005bff;
  --primary-hover: #0047cc;
  --disc: #f91155;
  --bg: #f3f5f9;
  --bg-elev: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 64px;
  --top-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body.pwa-body {
  font-family: var(--font);
  color: var(--text);
  background: #0b1220;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { border: 0; background: none; cursor: pointer; }

.pwa-app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 30px 80px rgba(0,0,0,.45);
}

/* ===== TOP ===== */
.pwa-top {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 10px 0;
  display: grid;
  grid-template-columns: auto 1fr 40px;
  align-items: center;
  gap: 6px;
  background: rgba(243,245,249,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.pwa-top.solid { border-bottom-color: var(--line); background: rgba(255,255,255,.92); }
.pwa-top-left {
  display: flex; align-items: center; gap: 2px; min-width: 32px;
}
.pwa-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 15px; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pwa-logo { height: 26px; width: auto; object-fit: contain; }
.pwa-top-actions { display: flex; justify-content: flex-end; }
.pwa-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text);
  transition: background .15s, transform .15s;
}
.pwa-icon-btn:active { transform: scale(.94); background: rgba(0,0,0,.05); }
.pwa-icon-btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.pwa-burger {
  width: 30px; height: 30px; border-radius: 8px;
}
.pwa-burger svg { width: 15px; height: 15px; stroke-width: 2.3; }
.pwa-icon-btn[hidden] { display: none !important; }

/* ===== MAIN ===== */
.pwa-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  scroll-behavior: smooth;
}
.pwa-view { animation: viewIn .28s ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ===== TABBAR ===== */
.pwa-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 -8px 28px rgba(15,23,42,.08);
}
.pwa-tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 52px; border-radius: 14px;
  color: #9aa3b2; font-size: 10px; font-weight: 700;
  transition: color .15s, background .15s, transform .15s;
}
.pwa-tab svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.pwa-tab.active { color: var(--primary); background: rgba(0,91,255,.08); }
.pwa-tab:active { transform: scale(.96); }
.pwa-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--disc); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px #fff;
}
.pwa-badge[hidden] { display: none !important; }

/* ===== HERO SLIDER (эталон телефона) ===== */
.pwa-hero-block {
  margin: 8px 12px 0;
}
.pwa-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 18px;
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow);
}
.pwa-slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .45s ease;
}
.pwa-slide.active { opacity: 1; pointer-events: auto; }
.pwa-slide-bg {
  position: absolute; inset: 0;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.pwa-slide-link {
  position: absolute; inset: 0; z-index: 2;
  display: block; text-indent: -9999px; overflow: hidden;
}
.pwa-slide video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.pwa-slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.72) 100%);
}
.pwa-slide-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 14px 16px;
  color: #fff;
}
.pwa-slide-eye {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 4px; opacity: .95;
}
.pwa-slide-title {
  font-size: clamp(16px, 5.2vw, 22px); line-height: 1.15; font-weight: 800;
  letter-spacing: -.03em; white-space: pre-line; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pwa-slide-desc {
  font-size: 11px; line-height: 1.35; color: rgba(255,255,255,.78);
  margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pwa-slide-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pwa-chip-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; color: #fff;
}
.pwa-chip-btn.ghost {
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
}
/* точки под баннером — как на телефоне */
.pwa-hero-dots {
  display: flex; justify-content: center; align-items: center;
  gap: 5px; padding: 8px 0 2px;
  pointer-events: none;
}
.pwa-hero-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(15, 23, 42, .22);
  transition: width .2s, background .2s;
}
.pwa-hero-dot.active {
  width: 16px;
  background: #111827;
}

/* ===== ADMIN LIVE PREVIEW (iframe в макапе телефона) ===== */
/* Без переопределения hero/cats — те же стили, что на живом телефоне */
body.admin-preview {
  background: var(--bg);
  overflow: hidden;
}
body.admin-preview .pwa-app {
  max-width: none;
  width: 100%;
  min-height: 100%;
  height: 100%;
  box-shadow: none;
  border-radius: 0;
}
html.admin-preview,
html.admin-preview body.admin-preview,
html.admin-preview body.admin-preview .pwa-app {
  height: 100%;
  width: 100%;
}
body.admin-preview .pwa-ai-fab,
body.admin-preview .pwa-cookie,
body.admin-preview .pwa-drawer { display: none !important; }
/* шапка приложения: бургер · логотип · поиск — не перекрывает слайдер */
body.admin-preview .pwa-top {
  position: relative;
  top: auto;
  flex-shrink: 0;
  z-index: 2;
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
}
body.admin-preview .pwa-main {
  position: relative;
  z-index: 1;
  min-height: 0;
}
body.admin-preview .pwa-tabbar {
  left: 0;
  right: 0;
  transform: none;
  width: 100%;
  max-width: none;
}
body.admin-preview .pwa-hero-block {
  margin: 8px 12px 0;
  position: relative;
  z-index: 1;
}
body.admin-preview .pwa-hero {
  border-radius: 18px;
  aspect-ratio: 16 / 9;
  max-height: none;
}
body.admin-preview a[href],
body.admin-preview button[data-go],
body.admin-preview .pwa-tab,
body.admin-preview .pwa-cat {
  cursor: default;
}

/* ===== SECTIONS ===== */
.pwa-sec { padding: 18px 12px 0; }
.pwa-sec-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.pwa-sec-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.pwa-sec-link { font-size: 13px; font-weight: 700; color: var(--primary); }

.pwa-cats {
  display: grid; grid-auto-flow: column; grid-auto-columns: 76px;
  gap: 10px; overflow-x: auto; padding: 2px 2px 8px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.pwa-cats::-webkit-scrollbar { display: none; }
.pwa-cat {
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.pwa-cat-circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff; box-shadow: 0 6px 18px rgba(15,23,42,.08);
  display: grid; place-items: center; overflow: hidden;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}
.pwa-cat:active .pwa-cat-circle { transform: scale(.94); }
.pwa-cat.active .pwa-cat-circle { border-color: var(--primary); }
.pwa-cat-circle img { width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.12); }
.pwa-cat-fallback {
  font-size: 22px; font-weight: 800; color: var(--primary);
  line-height: 1;
}
.pwa-cat-label {
  font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2;
  color: var(--muted); max-width: 76px;
}
.pwa-sec.is-preview-focus .pwa-sec-title {
  color: var(--primary);
}

.pwa-promo-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%;
  gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.pwa-promo-row::-webkit-scrollbar { display: none; }
.pwa-promo {
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 100px;
  border-radius: 18px; overflow: hidden;
  color: #fff; box-shadow: var(--shadow);
}
.pwa-promo-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.pwa-promo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.7), rgba(0,0,0,.2));
}
.pwa-promo-body {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
}
.pwa-promo-eye { font-size: 10px; font-weight: 800; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }
.pwa-promo-title { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.pwa-promo-sub { font-size: 12px; opacity: .8; margin-top: 2px; }

.pwa-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.pwa-tabs::-webkit-scrollbar { display: none; }
.pwa-pill {
  flex: 0 0 auto;
  min-height: 34px; padding: 0 14px; border-radius: 999px;
  background: #fff; color: var(--muted); font-size: 13px; font-weight: 700;
  border: 1px solid var(--line);
  transition: .15s;
}
.pwa-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== PRODUCT GRID / CARD ===== */
.pwa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pcard {
  background: var(--bg-elev);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
  display: flex; flex-direction: column;
  transition: transform .15s;
}
.pcard:active { transform: scale(.985); }
.pcard-img {
  position: relative; aspect-ratio: 1;
  background: #f8fafc; overflow: hidden;
}
.pcard-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.pcard-badge {
  position: absolute; left: 8px; top: 8px;
  background: var(--disc); color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 4px 7px; border-radius: 8px;
}
.pcard-badge.hit { background: #111; }
.pcard-badge.new { background: #16a34a; }
.pcard-fav {
  position: absolute; right: 8px; top: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.pcard-fav svg {
  width: 16px; height: 16px; fill: none; stroke: #9ca3af; stroke-width: 2;
}
.pcard-fav.active svg { fill: var(--disc); stroke: var(--disc); }
.pcard-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pcard-price { font-size: 15px; font-weight: 800; }
.pcard-old { font-size: 11px; color: #9ca3af; text-decoration: line-through; }
.pcard-disc { font-size: 11px; font-weight: 800; color: var(--disc); }
.pcard-name {
  font-size: 12px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.pcard-meta { font-size: 11px; color: var(--muted); }
.pcard-cart {
  margin-top: auto;
  min-height: 36px; border-radius: 12px;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 800;
  transition: background .15s, transform .15s;
}
.pcard-cart:active { transform: scale(.97); background: var(--primary-hover); }

/* ===== PRODUCT PAGE ===== */
.pwa-product-gallery {
  background: #fff; aspect-ratio: 1; position: relative;
}
.pwa-product-gallery img {
  width: 100%; height: 100%; object-fit: cover;
}
.pwa-product-body { padding: 16px 14px 24px; }
.pwa-product-brand { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.pwa-product-title { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin-bottom: 10px; }
.pwa-product-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.pwa-product-price .now { font-size: 26px; font-weight: 800; }
.pwa-product-price .old { font-size: 14px; color: #9ca3af; text-decoration: line-through; }
.pwa-product-desc {
  font-size: 14px; line-height: 1.55; color: #374151; margin-bottom: 16px;
  user-select: text;
}
.pwa-specs {
  background: #fff; border-radius: 16px; padding: 4px 14px;
  border: 1px solid var(--line); margin-bottom: 18px;
}
.pwa-spec {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.pwa-spec:last-child { border-bottom: 0; }
.pwa-spec span:first-child { color: var(--muted); }
.pwa-spec span:last-child { font-weight: 700; text-align: right; }
.pwa-sticky-buy {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  display: grid; grid-template-columns: 48px 1fr; gap: 8px;
  padding: 0 2px;
}
.pwa-buy-fav, .pwa-buy-main {
  min-height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  box-shadow: 0 12px 28px rgba(15,23,42,.18);
}
.pwa-buy-fav { background: #fff; border: 1px solid var(--line); }
.pwa-buy-fav svg { width: 20px; height: 20px; fill: none; stroke: #9ca3af; stroke-width: 2; }
.pwa-buy-fav.active svg { fill: var(--disc); stroke: var(--disc); }
.pwa-buy-main {
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 800;
}

/* ===== CART / CHECKOUT / FORMS ===== */
.pwa-panel {
  margin: 12px; background: #fff; border-radius: 18px;
  padding: 14px; box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.pwa-cart-item {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.pwa-cart-item:last-child { border-bottom: 0; }
.pwa-cart-item img {
  width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: #f8fafc;
}
.pwa-cart-name { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.pwa-cart-price { font-size: 14px; font-weight: 800; }
.pwa-qty {
  display: inline-flex; align-items: center; gap: 0;
  margin-top: 8px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.pwa-qty button {
  width: 30px; height: 30px; font-weight: 800; color: var(--primary);
}
.pwa-qty span {
  min-width: 28px; text-align: center; font-size: 13px; font-weight: 800;
}
.pwa-cart-remove { color: #9ca3af; font-size: 12px; font-weight: 700; align-self: start; }
.pwa-sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 14px; margin-bottom: 8px; color: var(--muted);
}
.pwa-sum-row.total { color: var(--text); font-weight: 800; font-size: 16px; margin-top: 8px; }
.pwa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 50px; border-radius: 16px;
  background: var(--primary); color: #fff;
  font-size: 15px; font-weight: 800;
  transition: transform .15s, background .15s;
}
.pwa-btn:active { transform: scale(.985); background: var(--primary-hover); }
.pwa-btn.secondary {
  background: #eef2ff; color: var(--primary);
}
.pwa-btn.ghost {
  background: transparent; color: var(--muted); min-height: 42px;
}
.pwa-field { margin-bottom: 12px; }
.pwa-label {
  display: block; font-size: 12px; font-weight: 700; color: var(--muted);
  margin-bottom: 6px;
}
.pwa-input, .pwa-textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
  user-select: text;
}
.pwa-textarea { min-height: 96px; resize: vertical; }
.pwa-input:focus, .pwa-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,91,255,.12);
}
.pwa-pay {
  display: flex; flex-direction: column; gap: 8px;
}
.pwa-pay label {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px; border-radius: 14px;
  border: 1.5px solid var(--line); font-size: 14px; font-weight: 600;
}
.pwa-pay label.active {
  border-color: var(--primary); background: rgba(0,91,255,.05);
}
.pwa-legal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 14px;
}
.pwa-legal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.pwa-legal-row input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.pwa-legal-row a { color: var(--primary); text-decoration: underline; }

/* ===== EMPTY / SEARCH / PROFILE ===== */
.pwa-empty {
  padding: 48px 24px; text-align: center; color: var(--muted);
}
.pwa-empty h3 { color: var(--text); font-size: 18px; font-weight: 800; margin: 12px 0 6px; }
.pwa-empty p { font-size: 13px; line-height: 1.45; margin-bottom: 16px; }
.pwa-search-bar {
  position: sticky; top: 0; z-index: 5;
  padding: 8px 12px 10px;
  background: rgba(243,245,249,.92);
  backdrop-filter: blur(12px);
}
.pwa-search-input {
  width: 100%; min-height: 46px; padding: 0 16px 0 42px;
  border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
  outline: none; user-select: text;
}
.pwa-search-wrap { position: relative; }
.pwa-search-wrap svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; stroke: #9ca3af; fill: none; stroke-width: 2;
}
.pwa-profile-card {
  display: flex; align-items: center; gap: 12px;
}
.pwa-avatar {
  width: 56px; height: 56px; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 20px;
}
.pwa-menu-list { display: flex; flex-direction: column; gap: 6px; }
.pwa-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 14px; border-radius: 14px;
  background: #f8fafc; font-size: 14px; font-weight: 700;
}
.pwa-menu-item span:last-child { color: #9ca3af; font-weight: 600; }
.pwa-success {
  text-align: center; padding: 36px 16px;
}
.pwa-success-ico {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%;
  background: rgba(22,163,74,.12); color: #16a34a;
  display: grid; place-items: center;
}
.pwa-success-ico svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.4; }

/* ===== TOAST / INSTALL ===== */
.pwa-toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  transform: translateX(-50%) translateY(20px);
  z-index: 80; max-width: min(420px, calc(100% - 24px));
  background: #111827; color: #fff;
  padding: 12px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none;
  transition: .28s cubic-bezier(.34,1.4,.64,1);
}
.pwa-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pwa-install {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  transform: translateX(-50%);
  width: min(440px, calc(100% - 20px));
  z-index: 70;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
  background: #111827; color: #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  animation: installIn .35s ease;
}
@keyframes installIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.pwa-install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-install-text strong { font-size: 13px; font-weight: 800; }
.pwa-install-text span { font-size: 11px; color: rgba(255,255,255,.65); }
.pwa-install-btn {
  min-height: 36px; padding: 0 12px; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 800;
}
.pwa-install-x {
  width: 28px; height: 28px; border-radius: 50%;
  color: rgba(255,255,255,.55); font-size: 20px; line-height: 1;
}

.pwa-home-install { display: none !important; }

/* ===== DRAWER ===== */
.pwa-drawer {
  position: fixed; inset: 0; z-index: 80; display: none;
}
.pwa-drawer.open { display: block; }
.pwa-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
}
.pwa-drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(78vw, 280px);
  background: #fff;
  box-shadow: 8px 0 28px rgba(0,0,0,.16);
  display: flex; flex-direction: column;
  animation: pwaDrawerIn .22s ease;
  padding-top: var(--safe-t);
}
@keyframes pwaDrawerIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
.pwa-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line);
}
.pwa-drawer-head strong { font-size: 14px; font-weight: 800; }
.pwa-drawer-nav {
  overflow: auto; padding: 6px 0 20px;
  -webkit-overflow-scrolling: touch;
}
.pwa-drawer-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 16px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text); text-align: left;
  border: 0; background: none; border-bottom: 1px solid #f3f4f6;
  text-decoration: none; cursor: pointer;
}
.pwa-drawer-item:active { background: #f5f7ff; }
.pwa-drawer-item svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.pwa-drawer-item.install { color: var(--primary); font-weight: 800; }
.pwa-drawer-sep {
  padding: 12px 16px 4px;
  font-size: 10px; font-weight: 800; color: #9ca3af;
  text-transform: uppercase; letter-spacing: .05em;
}

/* ===== COOKIE (компактный) ===== */
.pwa-cookie {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(var(--tab-h) + max(8px, var(--safe-b)));
  z-index: 70;
  display: none;
  align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.pwa-cookie p {
  flex: 1; margin: 0; font-size: 11px; line-height: 1.3; color: var(--muted);
}
.pwa-cookie a { color: var(--primary); }
.pwa-cookie-actions { display: flex; gap: 4px; flex-shrink: 0; }
.pwa-cookie-actions button {
  height: 28px; padding: 0 10px; border-radius: 8px; border: 0;
  font: inherit; font-size: 10px; font-weight: 700;
  background: var(--primary); color: #fff; cursor: pointer;
}
.pwa-cookie-actions button.ghost {
  background: #f3f4f6; color: var(--text);
}

.pwa-ai-fab {
  position: fixed;
  right: 12px;
  bottom: calc(var(--tab-h) + 14px);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  background: linear-gradient(135deg, #0b3d91, #005bff 55%, #00a3ff);
  box-shadow: 0 8px 20px rgba(0,91,255,.32);
}
.pwa-ai-fab span.ico {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent;
}
.pwa-ai-fab svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; }

/* ===== UTILS ===== */
.pwa-page-title {
  padding: 8px 14px 0; font-size: 24px; font-weight: 800; letter-spacing: -.03em;
}
.pwa-muted { color: var(--muted); font-size: 13px; }
.pwa-map {
  width: 100%;
  min-height: 220px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: #f3f4f6;
}
.pwa-map iframe { width: 100%; height: 240px; border: 0; display: block; }

.pwa-ai-panel {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + 72px);
  height: min(58vh, 480px);
  z-index: 45;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.pwa-ai-panel.open { display: flex; }
.pwa-ai-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; color: #fff;
  background: linear-gradient(135deg, #0b3d91, #005bff);
}
.pwa-ai-head strong { font-size: 14px; }
.pwa-ai-head button {
  width: 32px; height: 32px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.16); color: #fff; font-size: 18px;
}
.pwa-ai-body { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f7f9fc; }
.pwa-ai-msg { max-width: 88%; padding: 9px 11px; border-radius: 12px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; }
.pwa-ai-msg.bot { align-self: flex-start; background: #fff; border: 1px solid #e8eaf0; }
.pwa-ai-msg.user { align-self: flex-end; background: var(--primary); color: #fff; }
.pwa-ai-msg.err { align-self: flex-start; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.pwa-ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.pwa-ai-form input {
  flex: 1; min-height: 42px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font: inherit;
}
.pwa-ai-form button {
  min-height: 42px; border: 0; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; padding: 0 14px;
}

.pwa-filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 0;
  scrollbar-width: none;
}
.pwa-filters::-webkit-scrollbar { display: none; }
.pwa-sort {
  margin: 10px 12px 0;
  min-height: 42px; width: calc(100% - 24px);
  border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; padding: 0 12px; font-weight: 600; font-size: 13px;
}

@media (min-width: 481px) {
  body.pwa-body {
    background:
      radial-gradient(60% 40% at 20% 10%, rgba(0,91,255,.25), transparent 60%),
      radial-gradient(50% 35% at 90% 20%, rgba(249,17,85,.18), transparent 55%),
      #070b14;
  }
}

@supports (padding: max(0px)) {
  .pwa-tabbar { padding-bottom: max(6px, var(--safe-b)); }
  .pwa-sticky-buy { padding-bottom: max(10px, var(--safe-b)); }
  .pwa-install { bottom: calc(var(--tab-h) + max(12px, var(--safe-b))); }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-view, .pwa-slide-bg, .pwa-toast, .pwa-hero-dot { animation: none !important; transition: none !important; }
}
