/* ============================================================
   DigitalStore — стили
   Современный адаптивный дизайн, тёмная тема
   ============================================================ */

/* Атрибут hidden всегда должен скрывать элемент,
   даже если у него задан display (flex/grid и т.п.). */
[hidden] {
  display: none !important;
}

:root {
  /* --- Тёмная тема (по умолчанию) --- */
  --bg: #0e1117;
  --bg-soft: #151a22;
  --card: #1a2130;
  --card-hover: #202942;
  --border: #2a3550;
  --text: #e8ecf3;
  --text-muted: #93a1b8;
  --accent: #4f7bff;
  --accent-hover: #3c63e0;
  --accent-2: #38e08a;
  --danger: #ff5c7a;
  --warning: #ffb547;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(13, 16, 23, 0.45);
  --font: 'system-ui', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  /* Фоновые поверхности (жёсткие тёмные значения сводим в переменные) */
  --bg-body-grad-a: #0c1017;
  --bg-body-grad-b: #10161f;
  --bg-body-grad-c: #0e1319;
  --bg-header: rgba(14, 18, 24, 0.92);
  --bg-media: #1d2740;
  --bg-media-2: #232f4e;
  --bg-chip: rgba(20, 24, 34, 0.85);
  --bg-overlay: rgba(10, 13, 20, 0.66);
  --bg-cart-thumb: #1d2740;
  --bg-keys: #11161f;
  --bg-key-value: #0c1017;
  --bg-toast: #10161f;
  --bg-detail-image: #1a2236;
  --bg-thumb: #1c2640;
  --bg-desc: #121824;
  --bg-tile-active-a: #24344f;
  --bg-tile-active-b: #1c2740;
  --key-text: rgba(0, 0, 0, 0.3);
  --badge-border: var(--bg);
}

/* --- Светлая тема --- */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #eef2f9;
  --border: #dfe5f0;
  --text: #1a2233;
  --text-muted: #5d6b85;
  --accent: #3d6bff;
  --accent-hover: #2f58e0;
  --accent-2: #17b26a;
  --danger: #e2445f;
  --warning: #e2992a;
  --shadow: 0 8px 24px rgba(30, 45, 90, 0.12);

  --bg-body-grad-a: #eef1f8;
  --bg-body-grad-b: #f4f6fb;
  --bg-body-grad-c: #e9edf6;
  --bg-header: rgba(255, 255, 255, 0.92);
  --bg-media: #e6ebf5;
  --bg-media-2: #dde4f2;
  --bg-chip: rgba(255, 255, 255, 0.9);
  --bg-overlay: rgba(23, 32, 54, 0.42);
  --bg-cart-thumb: #e6ebf5;
  --bg-keys: #f0f3f9;
  --bg-key-value: #e9eef7;
  --bg-toast: #ffffff;
  --bg-detail-image: #eef2f8;
  --bg-thumb: #e6ebf5;
  --bg-desc: #f6f8fc;
  --bg-tile-active-a: #e3ebff;
  --bg-tile-active-b: #dbe5ff;
  --key-text: rgba(255, 255, 255, 0.4);
  --badge-border: var(--bg-soft);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(160deg, var(--bg-body-grad-a) 0%, var(--bg-body-grad-b) 55%, var(--bg-body-grad-c) 100%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent); color: #fff; }

/* ============================ Header ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  max-width: 1280px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 1.25rem; font-weight: 800; }
.logo-icon { font-size: 1.4rem; }
.logo-text { color: var(--text); }
.logo-accent { color: var(--accent); }

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
}
.search-icon { color: var(--text-muted); }
.search-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}
.search-form input::placeholder { color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Переключатель темы */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--card-hover); transform: translateY(-1px); border-color: var(--accent); }
.theme-toggle .theme-icon { font-size: 1.15rem; line-height: 1; }
/* В тёмной теме показываем «солнце» (переключить на светлую), в светлой — «луну» */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: inline; }
[data-theme="light"] .theme-icon-sun { display: inline; }
[data-theme="light"] .theme-icon-moon { display: none; }

/* Значок корзины — граница бейджа под тему */
.cart-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.cart-button:hover { background: var(--card-hover); transform: translateY(-1px); }
.cart-icon { font-size: 1.15rem; }
.cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--badge-border);
}

/* ============================ Main ============================ */
.main-content { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 18px 22px; }

.catalog-header { margin-bottom: 20px; }
.catalog-title { font-size: 1.6rem; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.sort-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sort-label { font-size: 0.86rem; color: var(--text-muted); }
.sort-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ============================ Catalog grid ============================ */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 20px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.card-media {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, var(--bg-media), var(--bg-media-2));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-image-fallback { font-size: 3rem; }
.category-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--bg-chip);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.card-body { padding: 13px 15px 14px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 1.02rem; font-weight: 700; line-height: 1.3; margin: 0; }
.card-description {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-rating { display: flex; align-items: center; gap: 5px; font-size: 0.82rem; color: var(--text-muted); }
.rating-star { color: var(--warning); }
.rating-value { color: var(--text); font-weight: 600; }

.price-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.price-current { font-size: 1.18rem; font-weight: 800; color: var(--text); }
.price-current small { font-size: 0.8rem; color: var(--text-muted); }
.price-old { font-size: 0.82rem; color: var(--text-muted); text-decoration: line-through; }

.add-button {
  width: 100%;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 0;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.add-button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.add-button.added { background: var(--accent-2); }
.add-button.added::after { content: ' ✓'; }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-emoji { font-size: 3rem; }
.empty-title { font-size: 1.2rem; font-weight: 700; margin: 10px 0 4px; }
.empty-hint { color: var(--text-muted); margin: 0; }
.reset-filters {
  margin-top: 14px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 20px;
  cursor: pointer;
}
.reset-filters:hover { border-color: var(--accent); }

/* ============================ Overlays ============================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

/* Корзина (drawer справа) */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100%;
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  padding: 18px;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-header { display: flex; align-items: center; justify-content: space-between; }
.drawer-title { font-size: 1.25rem; font-weight: 800; margin: 0; }
.drawer-count { color: var(--text-muted); font-size: 0.9rem; }
.drawer-close {
  background: var(--card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
}
.drawer-close:hover { color: var(--text); border-color: var(--accent); }

.cart-items { flex: 1; overflow-y: auto; margin-top: 14px; }
.cart-empty { color: var(--text-muted); text-align: center; padding: 30px 10px; }

.cart-item {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.cart-item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-cart-thumb);
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.88rem; font-weight: 600; margin: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.84rem; color: var(--text-muted); margin-top: 3px; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.qty-button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
}
.qty-button:hover { border-color: var(--accent); }
.qty-value { font-weight: 700; min-width: 22px; text-align: center; }
.remove-item {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.remove-item:hover { background: rgba(255, 92, 122, 0.12); }

.cart-footer { padding-top: 14px; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; }
.cart-total { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.checkout-button {
  width: 100%;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 0;
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s;
}
.checkout-button:hover { background: var(--accent-hover); }

/* Модалка оформления */
.checkout-modal {
  width: min(520px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.checkout-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}
.checkout-summary p { margin: 0 0 6px; }
.checkout-summary strong { color: var(--text); }

.field-label { display: block; font-size: 0.86rem; font-weight: 600; margin: 12px 0 6px; color: var(--text); }
.field-input,
.field-select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
.field-input:focus,
.field-select:focus { border-color: var(--accent); outline: none; }

.form-error {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 0.88rem;
}

.pay-button {
  width: 100%;
  background: var(--accent-2);
  border: none;
  color: #07130d;
  border-radius: var(--radius-sm);
  padding: 13px 0;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 16px;
  transition: transform 0.1s, opacity 0.15s;
}
.pay-button:disabled { opacity: 0.6; cursor: wait; }
.pay-button:hover:not(:disabled) { transform: translateY(-1px); }
.pay-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--key-text);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.secure-note { text-align: center; font-size: 0.78rem; color: var(--text-muted); margin: 10px 0 0; }

/* Модалка успеха */
.success-modal {
  width: min(560px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--accent-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  text-align: center;
  animation: fadeIn 0.25s ease;
}
.success-icon { font-size: 3.2rem; }
.success-title { font-size: 1.4rem; font-weight: 800; margin: 8px 0 4px; color: var(--accent-2); }
.success-subtitle { color: var(--text-muted); margin: 0 0 16px; }

.keys-box {
  background: var(--bg-keys);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
}
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.key-row-name { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-value {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.86rem;
  background: var(--bg-key-value);
  border: 1px dashed var(--accent);
  border-radius: 6px;
  padding: 5px 9px;
  color: var(--accent-2);
  cursor: pointer;
  user-select: all;
}
.copy-key-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}
.copy-key-btn:hover { border-color: var(--accent); color: var(--accent); }

.success-note { font-size: 0.84rem; color: var(--text-muted); margin: 12px 0; }
.continue-button {
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 11px 28px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
}

/* ============================ Toasts ============================ */
.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast {
  background: var(--bg-toast);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: fadeIn 0.2s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--accent-2); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.info { border-color: var(--accent); }

/* ============================ Footer ============================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 18px;
}

/* Загрузка каталога */
.loading-state { text-align: center; padding: 60px 20px; }
.loading-spinner {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 4px solid rgba(79, 123, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-text { color: var(--text-muted); margin-top: 14px; }

/* ============================ Responsive ============================ */
@media (max-width: 900px) {
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .search-form { order: 3; width: 100%; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .card-description { display: none; }
  .cart-drawer { width: 100%; }
  .main-content { padding: 14px 12px; }
}
@media (max-width: 420px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .card-media { height: 180px; }
}

/* ==================== Карточка товара (детали) ==================== */
.product-detail-modal {
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.detail-header { display: flex; align-items: center; justify-content: space-between; }
.detail-title { font-size: 1.2rem; font-weight: 800; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-layout { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.detail-main-image {
  flex: 1 1 45%;
  min-width: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-detail-image);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 220px;
}
.detail-main-image img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.detail-gallery { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-thumb {
  width: 52px;
  height: 52px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-thumb);
  transition: border-color 0.15s;
}
.detail-thumb.active { border-color: var(--accent); }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { flex: 1 1 45%; min-width: 240px; }
.detail-h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.detail-h4 { font-size: 0.92rem; font-weight: 700; margin: 0 0 6px; color: var(--text-muted); }
.detail-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.detail-price { margin: 6px 0 10px; }
.detail-price .price-current { font-size: 1.4rem; }
.detail-description { margin-top: 12px; }
.detail-description p {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-desc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.detail-stat-line { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.detail-add-btn { margin-top: 12px; }

.detail-reviews { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.detail-reviews .review-count {
  background: var(--card);
  color: var(--accent-2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
}
.review-stats { font-size: 0.85rem; color: var(--text-muted); margin: 6px 0 12px; }
.review-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.review-bad { border-color: rgba(255, 92, 122, 0.4); }
.review-head { display: flex; align-items: center; gap: 8px; }
.review-badge { font-size: 1rem; }
.review-date { font-size: 0.75rem; color: var(--text-muted); }
.review-text { font-size: 0.88rem; color: var(--text); margin: 4px 0 0; line-height: 1.4; }
.show-all-reviews {
  display: block;
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 0;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
}
.show-all-reviews:hover { border-color: var(--accent); color: var(--accent); }

/* ==================== Категории (плитки) ==================== */
.category-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.16s, border-color 0.16s, background 0.16s, box-shadow 0.16s;
  text-align: center;
}
.category-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.category-tile.active {
  background: linear-gradient(135deg, var(--bg-tile-active-a), var(--bg-tile-active-b));
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 123, 255, 0.35), var(--shadow);
}
.tile-icon { font-size: 2rem; line-height: 1; }
.tile-name { font-size: 0.88rem; font-weight: 700; }
.tile-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-chip);
  border-radius: 999px;
  padding: 2px 9px;
}

@media (max-width: 640px) {
  .detail-layout { flex-direction: column; }
  .detail-main-image { min-height: 180px; }
  .category-tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .category-tile { padding: 10px 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}