:root {
  --bg: #10151c;
  --card: #1a222d;
  --card2: #223041;
  --text: #e8edf3;
  --muted: #8a99ab;
  --accent: #4fc2f8;
  --accent-dark: #1090d8;
  --danger: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }

.screen { padding: 12px 14px 24px; }
.hidden { display: none !important; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 14px;
}
.topbar h1 { font-size: 22px; font-weight: 700; flex: 1; }

.icon-btn {
  background: var(--card); color: var(--text);
  border: none; border-radius: 10px;
  width: 38px; height: 38px; font-size: 24px; line-height: 1;
  cursor: pointer;
}

/* --- категории --- */
.cat-list { list-style: none; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.cat-list li {
  background: var(--card); border-radius: var(--radius);
  padding: 16px 12px; font-size: 16px; font-weight: 600;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  transition: background .15s;
}
.cat-list li:active { background: var(--card2); }
.cat-list .count { color: var(--muted); font-size: 14px; font-weight: 400; flex-shrink: 0; }
.cat-list .cat-all {
  grid-column: 1 / -1;
  background: var(--accent); color: #06222f;
  padding: 18px 16px; font-size: 22px; font-weight: 700;
}
.cat-list .cat-all:active { background: var(--accent-dark); }
.cat-list .cat-all .count { color: #06222f; opacity: .7; font-size: 15px; }
.cat-all-col { display: flex; flex-direction: column; gap: 2px; }
.cat-all-note { font-size: 17px; font-weight: 400; opacity: .85; }
.cat-empty { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }

/* --- список товаров --- */
.prod-list { list-style: none; display: grid; gap: 10px; }
.prod-list li {
  background: var(--card); border-radius: var(--radius);
  display: flex; gap: 12px; padding: 10px; cursor: pointer;
  align-items: center;
}
.prod-list img { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; background: var(--card2); flex-shrink: 0; }
.prod-list .thumb-ph { width: 68px; height: 68px; border-radius: 10px; background: var(--card2); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.prod-info { flex: 1; min-width: 0; }
.prod-name { font-size: 17px; font-weight: 600; }
.prod-meta { display: flex; justify-content: space-between; margin-top: 6px; }

.price { color: var(--accent); font-weight: 700; font-size: 16px; }
.stock { font-size: 14px; }
.stock--мало { color: var(--danger); }
.stock--достаточно { color: var(--text); }
.stock--много { color: #6ee7a7; }
.stock--none { color: var(--muted); }

/* --- карточка --- */
.photos { display: grid; gap: 10px; }
.photos img { width: 100%; border-radius: var(--radius); background: var(--card2); min-height: 140px; object-fit: contain; }

.price-row { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 6px; }
.price-row .price { font-size: 26px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 18px; }

.desc { color: var(--muted); line-height: 1.5; margin-bottom: 14px; white-space: pre-wrap; }
.card-stock { margin-bottom: 18px; }

.buy-btn {
  width: 100%; padding: 15px; border: none; border-radius: var(--radius);
  background: var(--accent); color: #06222f; font-size: 17px; font-weight: 700;
  cursor: pointer;
}
.buy-btn:active { background: var(--accent-dark); }

/* --- прочее --- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card2); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: 14px;
  max-width: 90%; text-align: center;
}

.gate { text-align: center; padding-top: 35dvh; }
.gate__emoji { font-size: 44px; }
.gate__text { margin-top: 12px; font-size: 19px; font-weight: 600; }
.gate__hint { margin-top: 6px; color: var(--muted); font-size: 14px; }

.skeleton { text-align: center; color: var(--muted); padding: 40px 0; }
