/* ============================================================
   ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ
============================================================ */
:root {
  /* Фоны */
  --bg-page: #FAF5F8;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-subtle: rgba(0, 0, 0, 0.04);
  --bg-sheet: rgba(255, 255, 255, 0.96);

  /* Текст */
  --text-primary: #1e1b2e;
  --text-secondary: #6b5b7b;
  --text-tertiary: #a296b0;

  /* Акценты */
  --accent: #FF2D92;
  --accent-soft: rgba(255, 45, 146, 0.08);
  --accent-soft-2: rgba(255, 45, 146, 0.15);
  --accent-gradient: linear-gradient(135deg, #FF2D92, #FF5AA5);
  --accent-shadow: 0 1px 4px rgba(255, 45, 146, 0.3);

  --success: #12B76A;
  --success-soft: rgba(18, 183, 106, 0.05);
  --danger: #E31B53;
  --warning: #f59e0b;

  /* Приглушённые цвета чипов */
  --chip-pink: #D48CB0;
  --chip-pink-soft: rgba(212, 140, 176, 0.15);
  --chip-blue: #8CA8CE;
  --chip-blue-soft: rgba(140, 168, 206, 0.15);
  --chip-green: #8CC0A8;
  --chip-green-soft: rgba(140, 192, 168, 0.15);

  /* Границы */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);

  /* Тени */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.15);

  /* Оверлеи */
  --overlay-bg: rgba(0, 0, 0, 0.3);
  --toast-bg: rgba(30, 27, 46, 0.92);
  --toast-fg: #ffffff;

  /* Скругления */
  --radius-card: 8px;
  --radius-menu: 8px;
  --radius-pill: 999px;

  /* Переходы */
  --transition: 0.25s ease-in-out;
  --transition-fast: 0.15s ease;

  /* Отступы */
  --page-padding: 16px;
}

body.dark {
  --bg-page: #1E1B2E;
  --bg-card: #2A2740;
  --bg-elevated: #3A3653;
  --bg-subtle: rgba(255, 255, 255, 0.06);
  --bg-sheet: rgba(42, 39, 64, 0.98);

  --text-primary: #FFFFFF;
  --text-secondary: #B0AAC0;
  --text-tertiary: #7A7490;

  --accent-soft: rgba(255, 45, 146, 0.15);
  --accent-soft-2: rgba(255, 45, 146, 0.25);
  --success-soft: rgba(18, 183, 106, 0.1);

  --chip-pink: #B87A9A;
  --chip-pink-soft: rgba(184, 122, 154, 0.25);
  --chip-blue: #7A92B8;
  --chip-blue-soft: rgba(122, 146, 184, 0.25);
  --chip-green: #7AA890;
  --chip-green-soft: rgba(122, 168, 144, 0.25);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 10px 30px rgba(0, 0, 0, 0.55);

  --overlay-bg: rgba(0, 0, 0, 0.55);
  --toast-bg: rgba(255, 255, 255, 0.96);
  --toast-fg: #1e1b2e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Manrope', 'Inter', -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 0 var(--page-padding) 100px var(--page-padding);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

button {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  font-family: inherit;
}

.app {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding-top: 12px;
  position: relative;
  overflow-x: clip;
}

/* ============================================================
   ХЕДЕР
============================================================ */
.header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 10px 0;
  min-height: 44px;
}

.header-back {
  display: none;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: -8px;
  border-radius: 50%;
  transition: background var(--transition-fast);
}
.header-back.visible { display: flex; }
.header-back:active { background: var(--bg-subtle); }
.header-back svg { width: 22px; height: 22px; }

.header-title {
  flex: 1 1 0;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-back.visible ~ .header-title { cursor: pointer; }

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 20px;
  font-weight: 300;
  box-shadow: var(--accent-shadow);
  cursor: pointer;
  transition: transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-btn:active { transform: scale(0.95); }
.action-btn svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
}

.action-btn--small {
  width: 32px;
  height: 32px;
  font-size: 18px;
}
.action-btn--small svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   ЭКРАНЫ
============================================================ */
.screen { display: none; }
.screen.active { display: block; }

/* ============================================================
   ПОИСК
============================================================ */
.search-section {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 4px 0;
  margin-bottom: 4px;
  background: var(--bg-page);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.search-section.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-menu);
  padding: 6px 14px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  padding: 6px 0;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  min-width: 0;
}
.search-bar input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}
.search-bar svg.search-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  margin-right: 8px;
}
.search-bar .clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  color: var(--text-secondary);
  font-size: 18px;
}
.search-bar .clear-btn:active { color: var(--accent); }

/* Чипсы */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 6px;
  padding-bottom: 4px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 14px;
  border-radius: var(--radius-menu);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.chip:active:not(.active) { background: var(--bg-subtle); }
.chip.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* ============================================================
   АКТИВНЫЕ ЧИПЫ: разные цвета по контексту
============================================================ */

/* Активные фильтры */
.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 10px;
  padding-bottom: 4px;
}
.active-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-menu);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-chip .remove {
  font-size: 16px;
  line-height: 1;
  font-weight: bold;
}

/* ============================================================
   КАТАЛОГ ТОВАРОВ
============================================================ */
.catalog-wrapper,
.catalog,
.collections,
.product-list,
.history-container,
.shops-container,
.settings-container {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}

.catalog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.product-card .image {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  flex-shrink: 0;
}
.product-card .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-card .brand {
  font-size: 12px;
  color: var(--text-secondary);
}
.product-card .type {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.8;
}
.product-card .bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-right: 36px;
}
.product-card .price {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
}
.product-card .add-btn-card {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 18px;
  font-weight: 300;
  box-shadow: var(--accent-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}
.product-card .add-btn-card:active { transform: scale(0.92); }
.product-card .add-btn-card.secondary {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}
.product-card .add-btn-card.secondary svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* ============================================================
   КАТАЛОГ: ROOT + КАТЕГОРИИ
============================================================ */
.catalog-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.catalog-root__search { margin-bottom: 0; }

.category-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.category-search { margin-bottom: 0; }

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
}

.category-tile {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-fast);
  min-height: 56px;
}
.category-tile:active { transform: scale(0.97); }

.category-tile__emoji {
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-tile__name {
  font-size: 14x;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.category-all-btn {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  border: none;
  width: 100%;
  min-height: 52px;
  transition: transform var(--transition-fast);
}
.category-all-btn:active { transform: scale(0.97); }

.category-all-btn__text {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.category-all-btn__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--accent);
}
.category-all-btn:active { transform: scale(0.97); }
.category-all-btn__text {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.category-all-btn__arrow {
  color: var(--accent);
  font-size: 15px;
  flex-shrink: 0;
}

/* Toolbar в списке товаров */
.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.toolbar-icon {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-menu);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.toolbar-icon:active { color: var(--accent); border-color: var(--accent); }
.toolbar-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.toolbar-icon.has-filters::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-card);
  pointer-events: none;
}

.catalog-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.catalog-chips::-webkit-scrollbar { display: none; }

.catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-menu);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.catalog-chip:active:not(.active) { background: var(--bg-subtle); }
.catalog-chip.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* ============================================================
   КОЛЛЕКЦИИ
============================================================ */
.collections {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collections-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-page);
  padding: 4px 0;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.collections-toolbar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}
.collections-toolbar .search-bar { margin-bottom: 0; }

/* Ряд: [фильтры] [чипы] */
.collections-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.collections-filter-row .chips {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: 0;
}
.collections-filter-row .chip {
  padding: 9px 14px;
}

.collections-filter-btn {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  order: -1;
  border-radius: var(--radius-menu);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.collections-filter-btn:active { color: var(--accent); border-color: var(--accent); }
.collections-filter-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  display: block;
}
.collections-filter-btn.has-filters {
  color: var(--accent);
  border-color: var(--accent);
}
.collections-filter-btn.has-filters::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-card);
  pointer-events: none;
}

.collection-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.collection-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}
.collection-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.collection-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
.collection-meta::-webkit-scrollbar { display: none; }

.collection-meta > * {
  flex-shrink: 0;
}
.collection-meta .count {
  background: #8662D9;
  color: #FFFFFF;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
}
.collection-meta .count--sum {
  background: #8662D9;
  color: #FFFFFF;
  font-size: 12px;
}
.collection-meta .count--drop {
  background: #1B9A69;
  color: #FFFFFF;
  font-size: 12px;
}
body.dark .collection-meta .count {
  background: #8662D9;
  color: #FFFFFF;
}
body.dark .collection-meta .count--sum {
  background: #8662D9;
  color: #FFFFFF;
}
body.dark .collection-meta .count--drop {
  background: #1B9A69;
  color: #FFFFFF;
}

.collection-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  margin-left: 6px;
}
.collection-actions .share-btn,
.collection-actions .settings-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.collection-actions .share-btn:active,
.collection-actions .settings-btn:active {
  background: var(--accent-soft);
  color: var(--accent);
}
.collection-actions .share-btn svg,
.collection-actions .settings-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  color: var(--text-secondary);
  fill: none;
}

.collection-preview-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}
.collection-preview-row::-webkit-scrollbar { display: none; }
.collection-mini-item {
  flex-shrink: 0;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.collection-mini-item .mini-emoji {
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
}
.collection-mini-item .mini-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
}
.collection-mini-item.more {
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

/* ============================================================
   ДЕТАЛЬНЫЙ ПРОСМОТР КОЛЛЕКЦИИ
============================================================ */

/* Заметка */
.collection-note {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.collection-note__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.collection-note__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.collection-note__add {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 12px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.collection-note__add:active { color: var(--accent); border-color: var(--accent); }

.product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Группы внутри подборки */
.product-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-list-section + .product-list-section {
  margin-top: 12px;
}
.product-list-section__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 2px;
}

/* Карточка товара */
.product-item {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-item .left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.product-item .product-emoji {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.product-item .info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.product-item .info .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-item .info .meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-item .info .prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
}
.product-item .info .price-new {
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
}
.product-item .info .price-old {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: line-through;
}
.product-item .info .price-current {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.product-item .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.product-item .actions button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.product-item .actions button:active { transform: scale(0.9); }
.product-item .actions .add-btn-card svg,
.product-item .actions .remove-btn-card svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* ============================================================
   ШТОРКИ
============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.overlay.open { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  background: var(--bg-sheet);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding: 14px var(--page-padding) var(--page-padding) var(--page-padding);
  transition: transform var(--transition);
  z-index: 210;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.bottom-sheet.open { transform: translateX(-50%) translateY(0); }

.sheet-handle {
  position: relative;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-strong);
  margin: 4px auto 16px auto;
  flex-shrink: 0;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.sheet-handle::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -40px;
  right: -40px;
  bottom: -16px;
}
.sheet-handle:active { cursor: grabbing; }

.close-sheet {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.close-sheet:active { background: var(--bg-subtle); }

.product-detail {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.product-detail::-webkit-scrollbar { display: none; }

.product-emoji {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.product-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.product-brand { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.product-type { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.product-rating {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 13px; color: var(--text-secondary);
}
.product-rating .stars { color: var(--warning); letter-spacing: 1px; }
.product-desc { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.product-specs {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
}
.product-specs .spec-title {
  font-weight: 600; color: var(--text-primary); margin-bottom: 4px; font-size: 14px;
}
.product-specs .spec-text {
  font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}

.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  position: relative;
}
.shop-item.best-price {
  border: 1px solid var(--success);
  background: var(--success-soft);
}
.shop-item .best-badge {
  position: absolute; top: -8px; right: 12px;
  background: var(--success); color: #fff; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
}
.shop-left { display: flex; align-items: center; gap: 10px; flex: 1; }
.shop-name { font-weight: 500; color: var(--text-primary); font-size: 14px; }
.shop-rating { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.shop-price-block { text-align: right; }
.shop-price { font-weight: 600; color: var(--accent); font-size: 15px; }
.shop-oldprice {
  font-size: 12px; color: var(--text-secondary);
  text-decoration: line-through; margin-right: 6px;
}

.reviews-block { margin-top: 6px; }
.reviews-toggle {
  background: none; border: none; color: var(--accent); font-weight: 600;
  font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 0;
}
.reviews-toggle .arrow { transition: transform 0.2s; font-size: 12px; }
.reviews-toggle.open .arrow { transform: rotate(180deg); }
.reviews-list { display: none; flex-direction: column; gap: 8px; margin-top: 6px; }
.reviews-list.open { display: flex; }
.review-item {
  background: var(--bg-card); border-radius: var(--radius-card); padding: 10px 12px;
  font-size: 13px; color: var(--text-secondary);
}
.review-shop { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.review-text { line-height: 1.4; }

.sheet-actions { flex-shrink: 0; margin-top: 10px; padding: 0 4px; }
.sheet-actions .btn-add-to-collection {
  width: 100%; padding: 12px; border-radius: var(--radius-card); border: none;
  font-weight: 600; font-size: 15px; cursor: pointer;
  background: var(--accent-gradient); color: #fff;
  box-shadow: var(--accent-shadow);
  transition: opacity var(--transition-fast);
}
.sheet-actions .btn-add-to-collection:active { opacity: 0.85; }
.sheet-actions .btn-add-to-collection.secondary {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

/* Шторка выбора коллекции */
.collection-select-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.collection-select-item:last-child { border-bottom: none; }
.collection-select-item input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--accent);
}
.collection-select-item .label { font-size: 15px; color: var(--text-primary); }
.collection-select-item .count {
  font-size: 13px; color: var(--text-secondary); margin-left: auto;
}
.collection-select-actions { display: flex; gap: 12px; margin-top: 16px; }
.collection-select-actions button {
  flex: 1; padding: 12px; border-radius: var(--radius-card); border: none;
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.collection-select-actions .primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: var(--accent-shadow);
}
.collection-select-actions .secondary {
  background: var(--bg-subtle); color: var(--text-secondary);
}
.create-collection-btn {
  background: none; border: none; color: var(--accent); font-weight: 600;
  font-size: 15px; cursor: pointer; padding: 10px 0; display: flex; align-items: center; gap: 8px;
}

/* Шторка фильтров */
.filter-section { margin-bottom: 16px; }
.filter-section-title {
  font-weight: 600; font-size: 15px; color: var(--text-primary);
  margin-bottom: 10px; display: block;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filter-check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.filter-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.price-range { display: flex; gap: 12px; align-items: center; }
.price-range input {
  width: 80px; padding: 8px 10px; border-radius: var(--radius-card);
  border: 1px solid var(--border-medium); background: var(--bg-card);
  font-size: 14px; outline: none; color: var(--text-primary); font-family: inherit;
}
.price-range input:focus { border-color: var(--accent); }
.filter-actions { display: flex; gap: 12px; margin-top: 14px; }
.filter-actions button {
  flex: 1; padding: 12px; border-radius: var(--radius-card); border: none;
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.filter-actions .apply-btn {
  background: var(--accent-gradient); color: #fff;
  box-shadow: var(--accent-shadow);
}
.filter-actions .reset-btn {
  background: var(--bg-subtle); color: var(--text-secondary);
}

/* ============================================================
   НИЖНЕЕ МЕНЮ
============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  z-index: 100;
  max-width: 440px;
}
body.dark .bottom-nav {
  background: rgba(30, 27, 46, 0.9);
  border-color: var(--border-medium);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: #4A3F55;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
body.dark .nav-item {
  color: #FFFFFF;
}

.nav-item span { display: none; font-weight: 600; }
.nav-item.active {
  background: var(--accent-gradient);
  color: #FFFFFF;
}
.nav-item.active span { display: inline; }

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.nav-item.active svg {
  stroke: #FFFFFF;
}


/* ============================================================
   ИСТОРИЯ
============================================================ */
.history-container { display: flex; flex-direction: column; gap: 12px; }

.history-chips-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-page);
  padding: 10px 0 6px 0;
  margin-bottom: 6px;
  transition: background 0.3s ease;
}
.history-chips { margin-bottom: 0; }

.price-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-caret {
  font-size: 10px;
  opacity: 0.6;
  line-height: 1;
}
.chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.history-day {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-md);
}
.history-day-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.day-label { font-weight: 600; color: var(--text-primary); font-size: 16px; }
.event-count {
  font-size: 12px;
  font-weight: 500;
  color: #FFFFFF;
  background: #8662D9;
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1.3;
}
.history-events { display: flex; flex-direction: column; gap: 6px; }
.history-event {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: var(--radius-card);
}
.history-event:last-child { border-bottom: none; }
.history-event:active { background: var(--accent-soft); }
.event-emoji {
  font-size: 24px; width: 36px; height: 36px;
  border-radius: var(--radius-card); display: flex; align-items: center; justify-content: center;
}
.event-info { flex: 1; min-width: 0; }
.event-name { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.event-collection { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.event-price { text-align: right; flex-shrink: 0; }
.current-price { display: block; font-size: 14px; font-weight: 500; }
.current-price.up { color: var(--danger); }
.current-price.down { color: var(--success); }
.old-price {
  display: block; font-size: 12px; color: var(--text-secondary);
  text-decoration: line-through; margin-top: 2px; font-weight: 500;
}

/* ============================================================
   МАГАЗИНЫ
============================================================ */
.shops-container { display: flex; flex-direction: column; gap: 10px; }
.shop-card {
  background: var(--bg-card); border-radius: var(--radius-card); padding: 14px;
  box-shadow: var(--shadow-md);
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.shop-card-left { display: flex; align-items: center; gap: 12px; }
.shop-card-left .shop-icon {
  width: 44px; height: 44px; border-radius: var(--radius-card);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.shop-card-left .shop-name { font-weight: 600; color: var(--text-primary); }
.shop-card-left .shop-rating { font-size: 12px; color: var(--text-secondary); }
.shop-info-btn { background: none; border: none; font-size: 22px; color: var(--text-secondary); cursor: pointer; }

.shop-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shop-detail-icon {
  width: 56px; height: 56px; border-radius: var(--radius-card);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.shop-detail-name { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.shop-detail-rating { font-size: 13px; color: var(--text-secondary); }
.shop-detail-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.shop-detail-meta div { font-size: 14px; color: var(--text-primary); margin-bottom: 8px; }

/* ============================================================
   НАСТРОЙКИ
============================================================ */
.settings-container { display: flex; flex-direction: column; gap: 16px; }
.settings-group {
  background: var(--bg-card); border-radius: var(--radius-card); padding: 14px;
  box-shadow: var(--shadow-md);
}
.settings-group-title { font-weight: 600; color: var(--text-primary); margin-bottom: 10px; font-size: 15px; }
.settings-option {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 0;
  font-size: 14px; color: var(--text-primary);
}
.settings-option input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.settings-radio-group { display: flex; flex-direction: column; gap: 8px; }
.settings-radio {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 14px; color: var(--text-primary);
}
.settings-radio input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; }

/* Подгруппа в настройках подборок */
.settings-subgroup {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.settings-subgroup-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Ссылка «Политика конфиденциальности» */
.settings-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-fast);
}
.settings-link:active { color: var(--accent); }
.settings-link__arrow {
  color: var(--text-tertiary);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

/* ============================================================
   ДРОПДАУН
============================================================ */
.dropdown-menu {
  position: absolute;
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  padding: 4px 0;
  z-index: 400;
  min-width: 160px;
  animation: fadeIn 0.15s ease;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}
.dropdown-item:active { background: var(--accent-soft); }
.dropdown-item.selected {
  color: var(--accent);
  font-weight: 600;
}
.dropdown-item.delete { color: var(--danger); }
.dropdown-item__check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}
.dropdown-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 8px;
}

/* ============================================================
   МОДАЛКА
============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-card); border-radius: var(--radius-card); padding: 22px;
  max-width: 320px; width: calc(100% - 32px); text-align: center;
  box-shadow: var(--shadow-xl);
}
.modal-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.modal-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.4; }
.modal-actions { display: flex; gap: 12px; }
.modal-btn {
  flex: 1; padding: 12px; border-radius: var(--radius-card); border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.modal-btn.cancel { background: var(--bg-subtle); color: var(--text-secondary); }
.modal-btn.confirm { background: var(--danger); color: #fff; }

/* ============================================================
   ТОСТЫ
============================================================ */
.toast-container {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  max-width: 440px; width: calc(100% - 32px); z-index: 300;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--toast-bg);
  color: var(--toast-fg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 16px;
  border-radius: var(--radius-card);
  font-size: 14px; font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ============================================================
   СЛАЙДЕР В ШТОРКЕ ТОВАРА
============================================================ */
..product-slider {
  width: 100%;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 4px;
  background: var(--bg-card);  
} 
.slider-track {
  display: flex;
  transition: transform 0.3s ease;
}
.slider-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  background: var(--bg-card);
}
.slider-image {
  font-size: 72px;
  line-height: 1;
}
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.slider-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-strong);
}
.slider-dots .dot.active { background: var(--accent); }

.share-product-btn {
  position: absolute;
  top: 14px;
  right: 56px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.share-product-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
}

/* Выравнивание текста в шторке */
.product-title,
.product-brand,
.product-type,
.product-desc,
.product-specs,
.product-rating,
.reviews-block {
  text-align: left;
  align-self: stretch;
  width: 100%;
}

/* Модалка создания подборки – на весь экран */
#createCollectionSheet, #editCollectionSheet {
  max-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  overflow-y: auto;
  padding-bottom: 280px;
}

/* ============================================================
   ПРОЧЕЕ
============================================================ */
.empty-state {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  padding: 30px 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   АДАПТИВ
============================================================ */
@media (max-width: 420px) {
  :root { --page-padding: 14px; }
  .bottom-nav { padding: 6px; gap: 2px; }
  .nav-item { padding: 6px 10px; font-size: 13px; }
  .nav-item svg { width: 22px; height: 22px; }
  .bottom-sheet { padding: 12px var(--page-padding) var(--page-padding) var(--page-padding); }
  .catalog { gap: 8px; }
  .product-card { padding: 10px; }
}

/* ============================================================
   ШАРИНГ И ВИРАЛЬНОСТЬ
============================================================ */
.collection-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 30px;
  background: var(--bg-subtle);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  font-family: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collection-author-chip:active { background: var(--accent-soft); }
.collection-author-chip__at { opacity: 0.75; }

.shared-readonly .product-item .actions { display: none; }

.shared-save-btn {
  position: sticky;
  bottom: 16px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-card);
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--accent-shadow);
  cursor: pointer;
  transition: opacity var(--transition-fast);
  margin-top: 16px;
}
.shared-save-btn:active { opacity: 0.85; }

.expired-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  gap: 14px;
  min-height: 60vh;
}
.expired-screen__icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 6px;
}
.expired-screen__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.expired-screen__text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 280px;
}
.expired-screen__btn {
  margin-top: 14px;
  padding: 12px 26px;
  border-radius: var(--radius-card);
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--accent-shadow);
  cursor: pointer;
  font-family: inherit;
  transition: opacity var(--transition-fast);
}
.expired-screen__btn:active { opacity: 0.85; }

/* ============================================================
   СТРАНИЦА: ПОЛИТИКА КОНФИДЕНЦИАЛЬНОСТИ
============================================================ */
.privacy-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 40px;
}

.privacy-lead {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-md);
}
.privacy-lead strong { color: var(--accent); font-weight: 600; }

.privacy-section {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.privacy-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.privacy-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}
.privacy-text strong { color: var(--text-primary); font-weight: 600; }

.privacy-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}
.privacy-list li::marker { color: var(--accent); }

.privacy-footer {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  font-style: italic;
}

/* ============================================================
   УВЕДОМЛЕНИЯ В ШТОРКЕ ТОВАРА
============================================================ */
.notifications-block .spec-title {
  margin-bottom: 12px;
}
.notifications-block .filter-check {
  margin-bottom: 10px;
}
.notifications-block .filter-check:last-child {
  margin-bottom: 0;
}
.notifications-block .filter-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

/* ============================================================
   ПРЕВЬЮ ЗАМЕТКИ В КАРТОЧКЕ ПОДБОРКИ
============================================================ */
.collection-note-preview {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-primary);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  max-width: 100%;
}

/* ============================================================
   DRAG-AND-DROP ПОДБОРОК
============================================================ */
.collection-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.collection-card--dragging {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  transform: scale(1.02);
  opacity: 0.96;
  cursor: grabbing;
}

body.dark .collection-card--dragging {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.collection-placeholder {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--bg-subtle);
  opacity: 0.4;
}

/* ============================================================
   ПЛИТКИ КАТЕГОРИЙ (текст слева, шеврон справа)
============================================================ */
.category-tile {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  border: none;
  transition: transform var(--transition-fast);
  min-height: 52px;
}
.category-tile:active { transform: scale(0.97); }

.category-tile__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.category-tile__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--text-secondary);
}

/* ============================================================
   ПОДБОРКИ: тулбар, чипы, фильтры, сортировка
============================================================ */

/* Ряд контролов: [фильтры] [сортировка] [чипы...] */
.collections-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.collections-controls .chips {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: 0;
}

.collections-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-menu);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.collections-icon-btn:active { color: var(--accent); border-color: var(--accent); }
.collections-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  display: block;
}
.collections-icon-btn.has-filters {
  color: var(--accent);
  border-color: var(--accent);
}
.collections-icon-btn.has-filters::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-card);
  pointer-events: none;
}

/* Чипы подборок — чуть выше */
.collections-controls .chip {
  padding: 9px 14px;
}

/* ============================================================
   ПОЛНОЭКРАННАЯ ШТОРКА (для фильтров подборок)
============================================================ */
.bottom-sheet--full {
  max-height: 100dvh;
  height: 100dvh;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
}

.full-sheet-header {
  padding: 0 var(--page-padding) 12px;
  flex-shrink: 0;
}
.full-sheet-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.full-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--page-padding) 24px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.full-sheet-body::-webkit-scrollbar { display: none; }

.full-sheet-footer {
  flex-shrink: 0;
  padding: 12px var(--page-padding) calc(var(--page-padding) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-sheet);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
}
.full-sheet-footer button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-card);
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.full-sheet-footer .apply-btn {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--accent-shadow);
}
.full-sheet-footer .reset-btn {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* ============================================================
   БЛОКИ ФИЛЬТРОВ (вертикально, как в настройках)
============================================================ */
.filter-block {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}
.filter-block__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  display: block;
}

/* Вертикальные радиокнопки */
.filter-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.filter-radio:last-child { border-bottom: none; }
.filter-radio input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Вертикальные чекбоксы */
.filter-check-vertical {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
}
.filter-check-vertical:last-child { border-bottom: none; }
.filter-check-vertical input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.filter-check-vertical .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Диапазон «от / до» */
.filter-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-range input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-medium);
  background: var(--bg-page);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}
.filter-range input:focus { border-color: var(--accent); }
.filter-range__sep {
  color: var(--text-tertiary);
  font-size: 14px;
  flex-shrink: 0;
}
/* Активный чип-фильтр с крестиком */
.chip--active-filter {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Поиск по брендам в шторке фильтров — как основной search-bar */
.filter-search-bar {
  margin-bottom: 10px;
}
.filter-search-bar .search-icon {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  margin-right: 8px;
}
.filter-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 4px 0;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  min-width: 0;
}
.filter-search-bar input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ============================================================
   ФИЛЬТРЫ ИСТОРИИ
============================================================ */
.history-chips-wrap .history-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-chips-wrap .history-controls .chips {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: 0;
}

/* ===== Категории с подкатегориями в фильтрах ===== */
.filter-cat-group {
  border-bottom: 1px solid var(--border-subtle);
}
.filter-cat-group:last-child { border-bottom: none; }

.filter-cat-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.filter-cat-parent {
  flex: 1;
  border-bottom: none !important;
}
.filter-cat-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 6px;
}
.filter-cat-toggle:active { background: var(--bg-subtle); }
.filter-cat-chevron {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.18s ease;
}
.filter-cat-group.open .filter-cat-chevron {
  transform: rotate(90deg);
}
.filter-cat-children {
  display: none;
  padding-left: 20px;
  padding-top: 2px;
  padding-bottom: 4px;
}
.filter-cat-group.open .filter-cat-children {
  display: block;
}
.filter-check-child {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Позволяем вертикальный скролл по карточкам — drag активируется только после долгого тапа */
.collection-card {
  touch-action: pan-y;
}

/* Чипы фильтров в истории и подборках — белый текст в тёмной теме */
body.dark .history-chips .chip,
body.dark .collections-controls .chip {
  color: #FFFFFF;
}
body.dark .history-chips .chip.active,
body.dark .collections-controls .chip.active {
  color: #FFFFFF;
}