/* ПРАЙМ — стили страниц витрины (главная, категория, товар, поиск, меню).
   Токены и базовые компоненты — в site.css. Mobile-first. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ============ меню категорий (.hdr-nav) ============ */
/* мобайл: полоса скрыта, открывается бургером (база вешает .nav-open на #hdr-nav) */
.hdr-nav { display: none; }
.hdr-nav.nav-open { display: block; max-height: 72vh; overflow-y: auto; }

.nav-cats { margin: 0; padding: 0; }

/* --- десктопная горизонталь с hover-выпадашками --- */
.nav-desktop { display: none; list-style: none; flex-wrap: wrap; }
.nav-desktop > li { position: relative; }
.nav-desktop > li > a {
  display: block; padding: 11px 13px; font-size: 13.5px; font-weight: 600;
  letter-spacing: .01em; color: var(--txt-2); white-space: nowrap;
}
.nav-desktop > li:hover > a { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.nav-drop {
  position: absolute; left: 0; top: 100%; z-index: 60; display: none;
  min-width: 260px; max-width: 340px; max-height: 62vh; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 0 0 var(--r) var(--r); box-shadow: var(--shadow-up); padding: 8px;
}
.nav-desktop > li:hover .nav-drop { display: block; }
.nav-drop a {
  display: block; padding: 8px 10px; border-radius: var(--r-s);
  font-size: 13.5px; color: var(--txt);
}
.nav-drop a:hover { background: var(--brand-soft); color: var(--brand-hot); }

/* --- мобильный вертикальный список (details/summary) --- */
.nav-mobile { display: block; padding: 4px 0 14px; }
.nav-mobile details { border-bottom: 1px solid var(--line); }
.nav-mobile summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 12px 4px;
  font-weight: 600; font-size: 14.5px; color: var(--ink);
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary::after {
  content: "›"; color: var(--txt-3); font-size: 17px;
  transform: rotate(90deg); transition: transform .15s;
}
.nav-mobile details[open] summary::after { transform: rotate(-90deg); }
.nav-mobile .nav-sub { display: flex; flex-direction: column; padding: 0 4px 12px 16px; }
.nav-mobile .nav-sub a { padding: 7px 0; font-size: 14px; color: var(--txt-2); }
.nav-mobile .nav-sub a:hover { color: var(--brand-hot); }
.nav-mobile .nav-all { color: var(--brand); font-weight: 600; }
.nav-mobile .nav-plain {
  display: block; padding: 12px 4px; border-bottom: 1px solid var(--line);
  font-weight: 600; font-size: 14.5px; color: var(--ink);
}

@media (min-width: 1024px) {
  .hdr-nav { display: block; max-height: none; overflow: visible; }
  .nav-desktop { display: flex; }
  .nav-mobile { display: none; }
}

/* ============ главная: HERO (карта, две колонки, техно-арт) ============ */
.hero {
  position: relative; overflow: hidden; margin-top: 16px;
  background: var(--bg-soft); border-radius: var(--r-lg);
  padding: clamp(26px, 5vw, 52px);
}
@media (min-width: 900px) {
  .hero {
    display: grid; grid-template-columns: 1.12fr .88fr;
    align-items: center; gap: 34px;
  }
}
.hero-copy { position: relative; z-index: 2; max-width: 620px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 12.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--brand-hot);
}
.hero-eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--brand); border-radius: 1px; }
.hero-copy h1 {
  font-size: clamp(28px, 5.4vw, 50px); font-weight: 700; color: var(--ink);
  letter-spacing: .02em; line-height: 1.06; margin: 0 0 12px;
}
.hero-copy h1 em { font-style: normal; color: var(--brand); }
.hero-copy > p {
  margin: 0 0 22px; font-size: clamp(14.5px, 1.8vw, 17px);
  color: var(--txt-2); max-width: 500px;
}
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

/* технологичный арт справа: тёмная плитка с 9-точечным мотивом и сеткой */
.hero-art {
  position: relative; display: none; align-self: stretch;
  min-height: 300px; border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(120% 120% at 70% 20%, #232B34 0%, var(--ink) 55%);
}
@media (min-width: 900px) { .hero-art { display: block; } }
.hero-art::before {  /* сетка-грид */
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(80% 80% at 60% 40%, #000 40%, transparent 78%);
}
.hero-art::after {  /* оранжевое свечение */
  content: ""; position: absolute; width: 280px; height: 280px;
  right: -40px; top: 50%; transform: translateY(-50%);
  background: radial-gradient(circle, var(--brand-glow), transparent 65%);
  filter: blur(50px);
}
/* центральный мотив 9 точек + орбита */
.hero-nine {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 168px; height: 168px; transform: translate(-50%, -50%);
  background-image: radial-gradient(circle, var(--brand) 26%, transparent 28%);
  background-size: 33.34% 33.34%;
  filter: drop-shadow(0 8px 24px var(--brand-glow));
}
.hero-ring {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: 250px; height: 250px; transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(245,91,15,.35); border-radius: 50%;
  animation: hero-spin 26s linear infinite;
}
.hero-ring::before {
  content: ""; position: absolute; top: -5px; left: 50%; margin-left: -5px;
  width: 10px; height: 10px; background: var(--brand); border-radius: 50%;
  box-shadow: 0 0 12px var(--brand);
}
@keyframes hero-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ============ трест-плашки под hero (реальные факты) ============ */
.hero-trust {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px;
}
@media (min-width: 700px) { .hero-trust { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.htile {
  display: flex; align-items: center; gap: 11px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 15px;
}
.htile-ic {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-hot); border-radius: 11px;
}
.htile b { display: block; font-size: 13.5px; color: var(--ink); line-height: 1.2; }
.htile span { font-size: 12px; color: var(--txt-3); }

/* ============ главная: плитки категорий ============ */
#cats { scroll-margin-top: 90px; }
.cat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { .cat-tiles { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .cat-tiles { grid-template-columns: repeat(4, 1fr); } }
.cat-tile {
  display: flex; align-items: center; gap: 13px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; transition: border-color .16s, box-shadow .16s, transform .16s;
}
.cat-tile:hover { border-color: transparent; box-shadow: var(--shadow-up); transform: translateY(-2px); }
.cat-tile-ic {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--bg-soft); border-radius: 13px; color: var(--brand-hot);
  transition: background .16s, color .16s;
}
.cat-tile:hover .cat-tile-ic { background: var(--brand); color: #fff; }
.cat-tile-tx { min-width: 0; flex: 1; }
.cat-tile b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--txt); overflow-wrap: anywhere; }
.cat-tile span { font-size: 12.5px; color: var(--txt-3); }
.cat-tile:hover b { color: var(--brand-hot); }

/* ============ промо-баннер (тёмный, → ДИСКОНТ) ============ */
.promo {
  position: relative; overflow: hidden; margin: 8px 0 4px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  background: var(--ink); color: #fff; border-radius: var(--r-lg);
  padding: clamp(22px, 4vw, 34px) clamp(22px, 4vw, 40px);
}
.promo::before {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-glow), transparent 65%); filter: blur(45px);
}
.promo-tx { position: relative; z-index: 1; flex: 1; min-width: 240px; }
.promo-tag {
  display: inline-block; margin-bottom: 8px; padding: 4px 11px;
  background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; border-radius: 999px;
}
.promo-tx h2 { color: #fff; margin: 0 0 6px; }
.promo-tx h2 em { font-style: normal; color: var(--brand); }
.promo-tx p { margin: 0; color: #A7B0BA; font-size: 14.5px; }
.promo .btn { position: relative; z-index: 1; }

/* ============ бренды ============ */
.brands { display: flex; flex-wrap: wrap; gap: 10px; }
.brand-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--font-d); font-weight: 600; font-size: 15px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--txt-2);
  transition: border-color .15s, color .15s, box-shadow .15s;
}
.brand-pill small { font-family: var(--font-b); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 11.5px; color: var(--txt-3); }
.brand-pill:hover { border-color: var(--brand); color: var(--brand-hot); box-shadow: var(--shadow-sm); }

/* ============ статистика (плашки) ============ */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  background: var(--bg-soft); border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 30px);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--font-d); font-weight: 700; font-size: clamp(26px, 4vw, 38px); color: var(--ink); line-height: 1; }
.stat b em { font-style: normal; color: var(--brand); }
.stat span { display: block; margin-top: 6px; font-size: 13px; color: var(--txt-2); }

/* ============ чипы (подкатегории, бренды, сортировка, вендоры) ============ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--txt);
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-hot); }
.chip small { font-size: 11.5px; color: var(--txt-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on:hover { color: #fff; }
.chip.on small { color: rgba(255, 255, 255, .65); }
.brand-chips { margin-bottom: 10px; }
.brand-chips .chip { padding: 9px 16px; font-weight: 600; }

/* ============ категория / поиск ============ */
.cat-count { margin: -6px 0 10px; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin: 12px 0 4px;
}
.sort-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sort-line .lbl { font-size: 12.5px; color: var(--txt-3); }
.vendors-line { margin: 6px 0 14px; }
.toolbar + .grid, .sort-line + .grid { margin-top: 10px; }

.empty { text-align: center; color: var(--txt-2); padding: 36px 16px; margin-top: 14px; }
.empty a { color: var(--brand-hot); font-weight: 600; }
.hint { margin-top: 10px; }
.hint p { margin: 0 0 8px; }
.hint p:last-child { margin-bottom: 0; }

.pager .gap { border: 0; background: transparent; color: var(--txt-3); }

/* карточка: столбик цен + плейсхолдер «нет фото» (мелкий, не спорит с фото) */
.price-wrap { display: flex; flex-direction: column; min-width: 0; }
.card-img .noimg { max-width: 88px; max-height: 88px; opacity: .55; }

/* ============ страница товара ============ */
.prod { display: grid; gap: 16px; margin-top: 10px; }
@media (min-width: 900px) {
  /* галерея — фиксированная колонка: без неё слот раздувался до 700px и фото
     терялось в пустом квадрате */
  .prod { grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 32px; align-items: start; }
}
/* жёсткий квадрат + фото абсолютом: вертикальные снимки не раздувают слот */
.gal-main {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); aspect-ratio: 1; max-width: 460px;
}
.gal-main img {
  position: absolute; inset: 0; margin: auto;
  max-width: calc(100% - 36px); max-height: calc(100% - 36px);
  width: auto; height: auto;
}
.gal-main .noimg { max-width: 150px; max-height: 150px; opacity: .5; }
.gal-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gal-thumbs button {
  width: 64px; height: 64px; padding: 6px; display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s);
  transition: border-color .15s, box-shadow .15s;
}
.gal-thumbs button img { max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.gal-thumbs button:hover { border-color: var(--brand); }
.gal-thumbs button.cur { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(245, 91, 15, .2); }

.prod-vendor {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-3); margin-bottom: 6px;
}
.prod-info h1 {
  font-family: var(--font-b); font-weight: 700; text-transform: none;
  letter-spacing: 0; line-height: 1.3; font-size: clamp(17px, 2.6vw, 22px);
  margin-bottom: 10px;
}
.prod-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--txt-2); }
.prod-stock { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 14px 0; }
.stock-lc { font-size: 13px; color: var(--txt-2); }

.prod-price-row { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 10px; }
.prod-price { font-size: clamp(26px, 4vw, 34px); }
.prod-price-row .price-old { font-size: 15px; }
.pack-note {
  display: inline-block; margin-bottom: 12px; padding: 6px 10px;
  background: var(--warn-soft); color: var(--warn);
  border-radius: var(--r-s); font-size: 13px; font-weight: 500;
}
.buy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-top: 6px; }
.buy-row .qty-box { min-height: 48px; }
.prod-inactive { margin-top: 8px; }
.prod-inactive p { margin: 0 0 12px; color: var(--bad); font-weight: 600; }

.desc { font-size: 14.5px; line-height: 1.65; }
.desc p { margin: 0 0 10px; }
.spec-panel { padding: 6px 16px; }
@media (min-width: 768px) { .spec-panel { padding: 8px 22px; } }
.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec tr:last-child td { border-bottom: 0; }
.spec td:first-child { color: var(--txt-2); width: 42%; }

/* ============ панель фильтров категории (DNS-style) ============ */
/* десктоп ≥1024: левая колонка с панелью; мобайл: шторка поверх (.open) */
.cat-layout { margin-top: 4px; }
@media (min-width: 1024px) {
  .cat-layout {
    display: grid; grid-template-columns: 272px minmax(0, 1fr);
    gap: 24px; align-items: start;
  }
}
.cat-main { min-width: 0; }

.fpanel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 6px 16px 14px;
}
.fpanel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 6px; font-size: 15px;
}
.fpanel-head b { font-family: var(--font-d); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); }
.fclose {
  display: none; width: 36px; height: 36px; border: 0; border-radius: var(--r-s);
  background: var(--bg-soft); color: var(--txt-2); font-size: 16px;
}
.fclose:hover { background: var(--brand-soft); color: var(--brand-hot); }

/* группы панели */
.fgroup { border-top: 1px solid var(--line); padding: 4px 0; }
.fgroup summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 9px 0;
  font-weight: 600; font-size: 14px; color: var(--ink);
}
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::after {
  content: "›"; color: var(--txt-3); font-size: 16px;
  transform: rotate(90deg); transition: transform .15s;
}
.fgroup[open] summary::after { transform: rotate(-90deg); }
.fgroup-body { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 10px; }

/* строка-чекбокс со счётчиком */
.fchk {
  display: flex; align-items: center; gap: 9px; padding: 5px 4px;
  border-radius: var(--r-s); font-size: 13.5px; cursor: pointer;
}
.fchk:hover { background: var(--brand-soft); }
.fchk input {
  width: 17px; height: 17px; margin: 0; flex: none;
  accent-color: var(--brand); cursor: inherit;
}
.fchk-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchk-n { font-size: 11.5px; color: var(--txt-3); }
/* значение обнулилось из-за других фильтров — серое, недоступное */
.fchk.dis { opacity: .45; cursor: default; }
.fchk.dis:hover { background: transparent; }

/* от/до (цена, range-фасеты) */
.frange { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.frange input {
  width: 100%; min-width: 0; min-height: 38px; padding: 6px 10px;
  background: var(--paper); border: 1.5px solid var(--line-2);
  border-radius: var(--r-s); color: var(--txt); font-size: 13.5px;
  -moz-appearance: textfield; appearance: textfield;
}
.frange input::-webkit-outer-spin-button, .frange input::-webkit-inner-spin-button { -webkit-appearance: none; }
.frange input::placeholder { color: var(--txt-3); }
.frange input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(245,91,15,.15); }
.frange .sep { color: var(--txt-3); flex: none; }

/* «Показать все / Свернуть» */
.fmore summary {
  list-style: none; cursor: pointer; padding: 7px 4px;
  font-size: 13px; font-weight: 600; color: var(--brand-hot);
}
.fmore summary::-webkit-details-marker { display: none; }
.fmore .less-t { display: none; }
.fmore[open] .more-t { display: none; }
.fmore[open] .less-t { display: inline; }
.fmore-body { display: flex; flex-direction: column; gap: 1px; }

/* Применить / Сбросить */
.fpanel-actions { display: flex; gap: 8px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.fpanel-actions .btn, .fpanel-actions .btn-ghost { flex: 1; min-height: 40px; font-size: 14px; }

/* кнопка «Фильтры (N)» в тулбаре (только мобайл/планшет) */
.fopen-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px;
  padding: 7px 14px; background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--line-2); border-radius: var(--r-s);
  font-weight: 600; font-size: 13.5px;
}
.fopen-btn:hover { border-color: var(--brand); color: var(--brand-hot); }
.fopen-btn .n {
  min-width: 19px; height: 19px; display: inline-grid; place-items: center;
  padding: 0 5px; background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 700; border-radius: 10px;
}
@media (min-width: 1024px) { .fopen-btn { display: none; } }

/* чипы выбранных фильтров над выдачей */
.fchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.fchip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
  background: var(--brand-soft); color: var(--brand-hot);
  border: 1px solid rgba(245, 91, 15, .35); border-radius: 20px;
  font-size: 13px; font-weight: 500;
}
.fchip:hover { border-color: var(--brand); color: var(--brand-hot); }
.fchip .x { font-weight: 700; font-size: 12px; }
.fchip.clear-all { background: transparent; color: var(--txt-2); border-color: var(--line-2); }
.fchip.clear-all:hover { color: var(--bad); border-color: var(--bad); }
.fchips + .grid { margin-top: 10px; }

/* мобайл: панель — шторка на весь экран */
@media (max-width: 1023.98px) {
  .fpanel {
    position: fixed; inset: 0; z-index: 90; border: 0; border-radius: 0;
    padding: 0 16px; transform: translateX(-103%);
    transition: transform .25s ease; visibility: hidden;
    display: flex; flex-direction: column;
  }
  .fpanel.open { transform: none; visibility: visible; box-shadow: var(--shadow-up); }
  .fpanel-head {
    flex: none; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px;
  }
  .fclose { display: grid; place-items: center; }
  .fpanel form { flex: 1; overflow-y: auto; padding-bottom: 12px; }
  .fpanel-actions {
    position: sticky; bottom: 0; background: var(--paper);
    padding: 12px 0; margin-top: 8px;
  }
  body.flock { overflow: hidden; }
}
