/*
 * Magazz Design System — Ivoire palette
 * Зафиксировано: 2026-05-02
 *
 * Использование: подключить первым в любом экране
 * <link rel="stylesheet" href="../design-system.css">
 */

/* ─────────────────────────────────────────
   1. ТОКЕНЫ ЦВЕТА
   ───────────────────────────────────────── */
:root {
  /* Фоны */
  --bg:        #FAF8F3;   /* основной фон страницы */
  --surface:   #F3F0E9;   /* поверхность карточки */
  --surface2:  #EAE6DC;   /* зона изображения / плейсхолдер */

  /* Разделители */
  --hr:        #DDD9CF;

  /* Типографика */
  --ink:       #181510;   /* основной текст */
  --ink-2:     #605C52;   /* вторичный текст */
  --ink-3:     #A09A90;   /* плейсхолдеры, метки */

  /* CTA — основная кнопка */
  --cta:        #1A1A18;
  --cta-text:   #FAF8F3;
  --cta-bg:     rgba(26, 26, 24, 0.06);
  --cta-border: rgba(26, 26, 24, 0.18);

  /* Акцент — золото (УИН-бейджи, LIVE-dot, активный элемент nav) */
  --accent:     #B8922A;
  --accent-bg:  rgba(184, 146, 42, 0.10);
  --accent-border: rgba(184, 146, 42, 0.28);

  /* Статусы */
  --success:    #1B6B3A;
  --success-bg: rgba(27, 107, 58, 0.08);
  --danger:     #C0392B;
  --danger-bg:  rgba(192, 57, 43, 0.08);
  --warning:    #B8922A;
}

/* ─────────────────────────────────────────
   2. РАДИУСЫ
   ───────────────────────────────────────── */
:root {
  --r-card:  10px;   /* карточки товаров, стримов */
  --r-btn:   8px;    /* кнопки */
  --r-tag:   99px;   /* пилюли (УИН, категории) */
  --r-sheet: 20px;   /* bottom-sheet */
}

/* ─────────────────────────────────────────
   3. ТЕНИ
   ───────────────────────────────────────── */
:root {
  --shadow-card: 0 1px 4px rgba(24, 21, 16, 0.07), 0 0 0 1px var(--hr);
  --shadow-modal: 0 16px 48px rgba(24, 21, 16, 0.18), 0 4px 12px rgba(24, 21, 16, 0.10);
}

/* ─────────────────────────────────────────
   4. ТИПОГРАФИКА
   ───────────────────────────────────────── */
:root {
  --font-ui:      'Inter', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

/* ─────────────────────────────────────────
   5. ОТСТУПЫ (базовая сетка = 4px)
   ───────────────────────────────────────── */
:root {
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
}

/* ─────────────────────────────────────────
   6. ГЛОБАЛЬНЫЙ СБРОС
   ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);   /* ivory за пределами body с max-width */
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, video {
  display: block;
  max-width: 100%;
}

button {
  font-family: var(--font-ui);
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─────────────────────────────────────────
   7. ПЕРЕИСПОЛЬЗУЕМЫЕ КОМПОНЕНТЫ
   ───────────────────────────────────────── */

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--r-btn);
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.75; }

.btn-primary {
  background: var(--cta);
  color: var(--cta-text);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--hr);
}
.btn-full { display: flex; width: 100%; }

/* --- УИН-бейдж --- */
.uin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--r-tag);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* --- LIVE-бейдж --- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--cta);
  color: var(--cta-text);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.live-badge__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  animation: live-pulse 1.4s ease infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%       { opacity: 0.3;  transform: scale(0.75); }
}

/* --- Название товара (Playfair italic) --- */
.product-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
}

/* --- Цена --- */
.price {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.price-old {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  text-decoration: line-through;
}

/* --- Карточка --- */
.card {
  background: var(--surface);
  border-radius: var(--r-card);
  border: 1px solid var(--hr);
  overflow: hidden;
}

/* --- Bottom nav --- */
.bnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  border-top: 1px solid var(--hr);
  background: var(--bg);
  z-index: 100;
}
.bnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: none;
  background: none;
}
.bnav__item.is-active { color: var(--cta); }
.bnav__icon { font-size: 20px; line-height: 1; }

/* --- Header --- */
.hdr {
  position: sticky;
  top: 0;
  height: 54px;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--hr);
  z-index: 90;
}
.hdr__logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.hdr__actions {
  display: flex;
  gap: 2px;
}
.hdr__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 18px;
  color: var(--ink-2);
  position: relative;
}
.hdr__btn-pip {
  position: absolute;
  top: 7px; right: 7px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg);
}

/* --- Section header --- */
.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}
.section-hdr__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-hdr__link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

/* --- Pill (категория) --- */
.pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-tag);
  border: 1px solid var(--hr);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.is-active {
  background: var(--cta);
  color: var(--cta-text);
  border-color: var(--cta);
}

/* --- Scroll row --- */
.scroll-row {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  padding: 0 var(--sp-4) var(--sp-4);
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
