/* Витрина Man-Shop — mobile-first. Тема переключается вручную (белый/чёрный)
   кнопкой ☀/🌙; выбор хранится в localStorage. Класс html.dark включает тёмную. */
:root {                       /* светлая (по умолчанию) */
  --bg: #f4f4f7;
  --card: #ffffff;
  --text: #17181c;
  --hint: #8a8d96;
  --accent: #2f9bff;
  --accent-text: #ffffff;
  --border: rgba(128, 128, 128, .18);
}
html.dark {                   /* тёмная (чёрный фон) */
  --bg: #0e0e11;
  --card: #1b1b21;
  --text: #f2f2f4;
  --hint: #9a9da6;
  --accent: #2f9bff;
  --accent-text: #ffffff;
  --border: rgba(255, 255, 255, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }

.shop-header { padding: 16px 16px 4px; }
.head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shop-header h1 { margin: 0; font-size: 22px; font-weight: 700; }
.shop-header .about { margin: 4px 0 0; color: var(--hint); font-size: 13px; }

.lang-switch {
  flex: 0 0 auto; display: flex; gap: 0; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; background: var(--card);
}
.lang-switch a { padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--hint); }
.lang-switch a.on { background: var(--accent); color: var(--accent-text); }

.controls { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.controls.floating { position: fixed; top: 10px; right: 10px; z-index: 5; }
.controls.floating .lang-switch,
.controls.floating .theme-toggle { box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.theme-toggle {
  width: 34px; height: 30px; flex: 0 0 auto; border: 1px solid var(--border);
  border-radius: 10px; background: var(--card); color: var(--text); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0; display: grid; place-items: center;
}

.search { padding: 10px 16px 4px; }
.search input {
  width: 100%; padding: 10px 14px; border: none; border-radius: 12px;
  background: var(--card); color: var(--text); font-size: 15px; outline: none;
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 20px; background: var(--card);
  color: var(--text); font-size: 13px; white-space: nowrap; border: 1px solid var(--border);
}
.chip.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 8px 16px 24px;
}
.card {
  background: var(--card); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; border: 1px solid var(--border);
}
.card-img { aspect-ratio: 3/4; background: var(--bg); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--hint); font-size: 12px;
}
.noimg.big { aspect-ratio: 3/4; }
.card-body { padding: 8px 10px 10px; }
.card-title { font-size: 13px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.card-price { margin-top: 4px; font-weight: 700; font-size: 14px; }

.empty { padding: 60px 24px; text-align: center; color: var(--hint); }

/* ---------- карточка товара ---------- */
.product-page { padding-bottom: 90px; }
.gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  background: #000;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  flex: 0 0 100%; width: 100%; aspect-ratio: 3/4; object-fit: contain;
  scroll-snap-align: center;
}
.dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--hint); opacity: .4; }
.dots span.on { opacity: 1; background: var(--accent); }

.detail { padding: 12px 16px; }
.detail h1 { margin: 0 0 6px; font-size: 20px; }
.price { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.badge.out {
  display: inline-block; background: #ffe2e2; color: #c0392b;
  padding: 3px 10px; border-radius: 8px; font-size: 12px; margin-bottom: 8px;
}
.row { margin: 6px 0; font-size: 14px; }
.row .k { color: var(--hint); }
.desc { margin-top: 12px; white-space: pre-line; color: var(--text); }

.actions {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.btn {
  display: block; text-align: center; padding: 13px; border-radius: 12px;
  background: var(--card); color: var(--text); font-weight: 600; border: 1px solid var(--border);
}
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.hint { text-align: center; color: var(--hint); font-size: 13px; }
