/* «Yabloko» — тёмная премиальная тема. */

:root {
  --bg: #08090a;
  --bg-2: #0e0f11;
  --surface: #121316;
  --surface-2: #17181c;
  --line: #24262b;
  --line-soft: #1c1e22;
  --text: #f5f6f7;
  --muted: #9a9da4;
  --accent: #3ddc84;
  --accent-hover: #2fc971;
  --accent-ink: #07130b;
  --danger: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --container: 1320px;
  --gutter: 24px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 .55em; line-height: 1.2; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.icon { flex: none; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: 600 15px/1 inherit;
  /* Надпись кнопки не переносится: телефон и «Позвонить» должны читаться
     одной строкой, иначе последние цифры номера уезжают вниз. */
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.chip b { margin-left: 3px; font-weight: 600; opacity: .8; }

.chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 14px/1 inherit;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { color: var(--text); border-color: #3a3d44; }
.chip.is-active { background: rgba(61, 220, 132, .12); border-color: rgba(61, 220, 132, .5); color: var(--accent); }
.chip--reset { color: var(--muted); }
.chip--reset:hover { color: var(--danger); border-color: rgba(255, 107, 107, .5); }
.chip--toggle { margin-left: 6px; }

/* ---------- уведомление ---------- */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  max-width: 340px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 15px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-visible { opacity: 1; transform: none; }

.badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.badge[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .btn:hover { transform: none; }
}

/* ---------- шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 9, 10, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header-top { display: flex; align-items: center; gap: 28px; min-height: 78px; }

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand__logo { color: var(--text); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text b { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.brand__text small { color: var(--muted); font-size: 12px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 220, 132, .12); }
.search input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}
.search input::placeholder { color: #6d7178; }
.search input::-webkit-search-cancel-button { display: none; }
.search__btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 46px;
  border: 0;
  border-radius: 0 13px 13px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search__btn:hover { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.action__icon { position: relative; display: grid; place-items: center; color: var(--muted); transition: color .16s ease; }
.action:hover .action__icon { color: var(--accent); }
.action__label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.action:hover .action__label { color: var(--text); }

/* ---------- телефоны магазина в шапке ----------
   Два номера столбиком. Видны всем — и гостю, и владельцу
   (см. index.html и syncAuthAction в js/app.js). */
.owner-phones {
  display: flex; flex-direction: column; gap: 3px;
  padding-right: 18px; margin-right: 2px;
  border-right: 1px solid var(--line);
}
.owner-phones[hidden] { display: none; }
.owner-phones__row {
  display: flex; align-items: baseline; gap: 7px;
  color: var(--text); text-decoration: none; white-space: nowrap;
  transition: color .16s ease;
}
.owner-phones__row:hover { color: var(--accent); }
.owner-phones__label { color: var(--muted); font-size: 11.5px; min-width: 62px; }
.owner-phones__row b { font-size: 13px; font-weight: 600; }

/* На узком экране два блока с номерами не влезают в шапку рядом с иконками.
   Оставляем номера, но убираем подписи «Позвонить/WhatsApp» и сжимаем отступы —
   покупателю с телефона номер нужен важнее всего, прятать его нельзя. */
@media (max-width: 880px) {
  .owner-phones { padding-right: 10px; margin-right: 0; gap: 2px; }
  .owner-phones__label { display: none; }
  .owner-phones__row b { font-size: 12px; }
}

/* На совсем узких экранах столбик из двух номеров уже мешает кнопкам —
   показываем одной строкой и прячем WhatsApp, оставляя звонок. */
@media (max-width: 560px) {
  .owner-phones { flex-direction: row; gap: 8px; align-items: center; }
  .owner-phones__row[href^="https://wa.me"] { display: none; }
}

/* Кнопка админки — заметная, чтобы владелец сразу её находил. */
.action--admin .action__icon, .action--admin .action__label { color: var(--accent); }
.action--admin:hover .action__icon { color: #6ff0a8; }
.action--admin[hidden] { display: none; }

/* ---------- плавающая кнопка «Связаться» ----------
   После начала прокрутки выезжает справа (состояние переключает js/app.js).
   По нажатию раскрывает «Позвонить» и «WhatsApp». z-index ниже модальных
   окон (60+), но выше содержимого страницы. */
.fab {
  position: fixed; right: 18px; top: 50%; z-index: 55;
  display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 12px;
  /* Закрытое состояние: уехала за правый край и не ловит клики. */
  transform: translate(calc(100% + 28px), -50%);
  opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.22, .72, .24, 1), opacity .3s ease;
}
.fab.is-visible { transform: translate(0, -50%); opacity: 1; pointer-events: auto; }

.fab__main {
  position: relative;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #22b268);
  color: var(--accent-ink);
  box-shadow: 0 12px 28px rgba(61, 220, 132, .32);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fab__main:hover { transform: scale(1.06); box-shadow: 0 14px 32px rgba(61, 220, 132, .42); }
.fab__main:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fab__main .icon { transition: transform .3s ease; }
.fab.is-open .fab__main .icon { transform: rotate(135deg) scale(.9); }

/* Мягкая пульсация вокруг кнопки: заметно, но не отвлекает. */
.fab__main::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(61, 220, 132, .45);
  animation: fab-ring 2.8s ease-out infinite;
}
.fab.is-open .fab__main::after { animation: none; opacity: 0; }
@keyframes fab-ring {
  0%   { transform: scale(.9); opacity: .7; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.fab__menu {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
.fab.is-open .fab__menu { pointer-events: auto; }

.fab__item {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  text-decoration: none; color: var(--accent-ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .38);
  /* Закрытое состояние: подъезжает справа. */
  opacity: 0; transform: translateX(22px) scale(.94);
  transition: opacity .24s ease, transform .28s cubic-bezier(.22, .72, .24, 1);
}
.fab.is-open .fab__item { opacity: 1; transform: none; }
.fab.is-open .fab__item:nth-child(1) { transition-delay: .05s; }
.fab.is-open .fab__item:nth-child(2) { transition-delay: .11s; }
.fab__item--call { background: var(--accent); }
.fab__item--wa { background: #25d366; }
.fab__item:hover { filter: brightness(1.06); }

/* Открыто окно «Связаться» — кнопку уводим, чтобы не мешала. */
body.is-modal .fab { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .fab { right: 12px; gap: 10px; }
  .fab__main { width: 52px; height: 52px; }
  .fab__item { padding: 10px 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .fab, .fab__item { transition: none; }
  .fab__main::after { animation: none; }
}

.badge.is-bump { animation: bump .45s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.burger {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.site-nav { border-top: 1px solid var(--line-soft); }
.site-nav__inner { display: flex; align-items: center; gap: 26px; height: 52px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  color: var(--muted);
  font-size: 15px;
  border-bottom: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.site-nav a:hover { color: var(--text); }
/* Активным может быть только один пункт — тот, чья категория сейчас открыта. */
.site-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- секции и заголовки ---------- */

.section { padding: 56px 0; }
.section--tight { padding: 34px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.section-title { font-size: clamp(24px, 2.4vw, 30px); }
.section-link { color: var(--muted); font-size: 15px; }
.section-link:hover { color: var(--accent); }

.page-title { font-size: clamp(28px, 3vw, 38px); margin-bottom: 6px; }
.page-sub { color: var(--muted); margin: 0; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 22px; color: var(--muted); font-size: 14px; }
.crumbs-sep { opacity: .5; }
.crumbs a:hover { color: var(--accent); }

/* ---------- главный баннер ---------- */

.hero {
  position: relative;
  padding: 46px 0 0;
  overflow: hidden;                 /* плывущие устройства не дают прокрутки */
  background:
    radial-gradient(560px 320px at 12% 6%, rgba(58, 122, 255, .14), transparent 60%),
    radial-gradient(620px 340px at 88% 4%, rgba(61, 220, 132, .12), transparent 62%);
}

/* ---------- живой фон главной (устройства плывут за текстом) ----------
   Слой декоративный и не ловит клики: ссылки и кнопки остаются рабочими.
   Двигаем только transform — так анимацию рисует видеокарта, а не процессор,
   и телефон не греется. При «уменьшить движение» в системе всё встаёт
   на месте (см. prefers-reduced-motion ниже). */

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-bg__item {
  position: absolute;
  opacity: .1;
  will-change: transform;
  animation: heroDrift 22s ease-in-out infinite alternate;
}
.hero-bg__item .art { display: block; width: 100%; height: auto; }

/* Раскладка: крупное — по краям, чтобы не спорить с текстом по центру. */
.hero-bg__item--1 { left: -3%;  top: 8%;   width: 230px; animation-duration: 26s; }
.hero-bg__item--2 { left: 26%;  top: 62%;  width: 150px; animation-duration: 19s; animation-delay: -4s; }
.hero-bg__item--3 { right: 4%;  top: 4%;   width: 190px; animation-duration: 30s; animation-delay: -8s; }
.hero-bg__item--4 { right: 26%; top: 66%;  width: 130px; animation-duration: 17s; animation-delay: -2s; }
.hero-bg__item--5 { left: 8%;   top: 58%;  width: 160px; animation-duration: 24s; animation-delay: -11s; }
.hero-bg__item--6 { right: -2%; top: 52%;  width: 130px; animation-duration: 21s; animation-delay: -6s; }

@keyframes heroDrift {
  from { transform: translate3d(0, 0, 0) rotate(-6deg) scale(1); }
  to   { transform: translate3d(26px, -34px, 0) rotate(7deg) scale(1.06); }
}

.hero-slide, .hero-dots { position: relative; z-index: 1; }

/* Правило стоит после стилей фона: иначе оно перекрылось бы ими.
   Кому в системе мешает движение — устройства просто стоят на месте. */
@media (prefers-reduced-motion: reduce) {
  .hero-bg__item { animation: none; }
}

.hero-slide {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 30px;
  min-height: 380px;
}
.hero-slide[hidden] { display: none; }
.hero-slide.is-active .hero-copy > * { animation: rise .5s ease both; }
.hero-slide.is-active .hero-lead { animation-delay: .06s; }
.hero-slide.is-active .hero-text { animation-delay: .12s; }
.hero-slide.is-active .hero-copy .btn { animation-delay: .18s; }

.hero-title { font-size: clamp(40px, 5vw, 66px); letter-spacing: -.03em; margin-bottom: .1em; }
.hero-lead { font-size: clamp(20px, 2.2vw, 28px); color: #d7dae0; margin: 0 0 12px; }
.hero-text { color: var(--muted); max-width: 46ch; margin: 0 0 26px; }
.hero-art { display: grid; place-items: center; }
.hero-art .hero-art__svg { width: 100%; max-width: 640px; height: auto; }

.hero-dots { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #33363d;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.hero-dot:hover { background: #4a4e56; }
.hero-dot.is-active { background: var(--accent); transform: scale(1.15); }

.hero-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 28px 0 34px;
  border-bottom: 1px solid var(--line-soft);
}
.hero-feature { display: flex; align-items: center; gap: 14px; }
.hero-feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--accent); flex: none; }
.hero-feature-text { display: flex; flex-direction: column; color: var(--muted); font-size: 14px; }
.hero-feature-text b { color: var(--text); font-size: 15px; font-weight: 600; }

/* ---------- товары ---------- */

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); gap: 18px; }

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { border-color: #3a3e46; transform: translateY(-4px); box-shadow: var(--shadow); }

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  height: 188px;
  padding: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .05), transparent 70%);
  border-bottom: 1px solid var(--line-soft);
}
.product-media .art { width: 112px; height: 124px; }
/* Фото товара вместо векторной картинки */
.product-photo { width: 100%; height: 100%; object-fit: cover; }

/* С фото карточка заполняется снимком целиком, без отступов вокруг. */
.product-media--photo { padding: 0; background: var(--bg-2); }
.product-media--photo .product-link { width: 100%; height: 100%; }

.badge--hit { background: rgba(61, 220, 132, .16); color: var(--accent); }
.badge--new { background: rgba(58, 122, 255, .18); color: #7fb1ff; }
.badge--sale { background: rgba(255, 107, 107, .16); color: #ff9b9b; }
.badge--used { background: rgba(255, 255, 255, .1); color: #d6d8dc; }
.badge--sold { background: rgba(255, 255, 255, .12); color: #f0f1f3; }

/* Товар уже продан (stock = 0): плашка, приглушение, неактивная кнопка. */
.product-card.is-sold { opacity: .55; }
.product-card.is-sold:hover { transform: none; box-shadow: none; border-color: var(--line); }
.btn-buy[disabled] { background: #2a2c31; color: var(--muted); cursor: not-allowed; transform: none; }

/* ---------- окно «Связаться» (вместо корзины) ---------- */
.contact-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.contact-modal[hidden] { display: none; }
.contact-modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }
.contact-modal__box {
  position: relative;
  width: min(420px, 100%);
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel, #16181c);
  box-shadow: var(--shadow);
  animation: contact-in .18s ease;
}
@keyframes contact-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.contact-modal__close {
  position: absolute; top: 12px; right: 12px;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.contact-modal__close:hover { color: var(--text); border-color: var(--accent); }
.contact-modal__title { margin: 0 40px 4px 0; font-size: 20px; line-height: 1.25; }
.contact-modal__price { margin: 0 0 12px; color: var(--accent); font-size: 17px; font-weight: 700; }
.contact-modal__note { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.contact-modal__foot { margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.contact-options { display: flex; flex-direction: column; gap: 10px; }
.contact-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, .02); color: var(--text);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.contact-option:hover { border-color: var(--accent); background: rgba(61, 220, 132, .07); }
.contact-option__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 11px; background: rgba(61, 220, 132, .14); color: var(--accent); }
.contact-option__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-option__body b { font-size: 15px; }
.contact-option__body small { color: var(--muted); font-size: 12.5px; }
body.is-modal { overflow: hidden; }

.fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(14, 15, 17, .8);
  color: var(--muted);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
.fav-btn:hover { color: var(--danger); border-color: rgba(255, 107, 107, .45); }
/* В избранном сердечко становится красным, чтобы это было видно сразу. */
.fav-btn.is-on, .fav-btn.is-fav { color: var(--danger); border-color: rgba(255, 107, 107, .6); }
.btn-ghost.is-fav { border-color: rgba(255, 107, 107, .6); color: var(--danger); }

.product-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.product-link { display: flex; flex-direction: column; gap: 4px; }
.product-name { font-size: 16px; font-weight: 600; }
.product-spec { color: var(--muted); font-size: 13.5px; }

/* Состояние товара в списке: сразу видно, новый он или б/у. */
.product-cond {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  margin: 3px 0 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.product-cond::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.product-cond--new { color: #3ddc84; background: rgba(61, 220, 132, .12); }
.product-cond--used { color: #f3b544; background: rgba(243, 181, 68, .15); }

.price-row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.price { font-size: 19px; font-weight: 700; }
.price--big { font-size: 34px; }
.price-old { color: #6f737a; font-size: 14px; text-decoration: line-through; }
.price-off { padding: 3px 8px; border-radius: 8px; background: rgba(255, 107, 107, .14); color: #ff9b9b; font-size: 12px; font-weight: 600; }

.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.btn-buy { padding: 10px 22px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); border: 0; font: 600 15px/1 inherit; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.btn-buy:hover { background: var(--accent-hover); transform: translateY(-1px); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 20px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.empty-state h2 { font-size: 20px; margin: 6px 0 0; }
.empty-state p { color: var(--muted); margin: 0 0 10px; }

.app.is-entering > * { animation: rise .34s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.product-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

/* ---------- плитки категорий ---------- */

.section--tiles { padding-top: 10px; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.tile:hover { border-color: #3a3e46; transform: translateY(-3px); background: var(--surface-2); }
.tile-art { flex: none; width: 56px; }
.tile-art .art { width: 56px; height: 62px; }
.tile-body { display: flex; flex-direction: column; min-width: 0; }
.tile-title { font-size: 15.5px; font-weight: 600; }
.tile-sub { color: var(--muted); font-size: 12.5px; }
.tile-arrow { margin-left: auto; flex: none; color: var(--accent); }

/* ---------- фильтры ---------- */

.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filters-row--chips { gap: 10px; }
.filters-label { color: var(--muted); font-size: 13.5px; }

.filters-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.filters-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; outline: none; }

.filters-price, .filters-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13.5px;
}
.filters-price input {
  width: 94px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  outline: none;
}
.filters-sort select {
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  outline: none;
  cursor: pointer;
}
.filters-search:focus-within, .filters-price input:focus, .filters-sort select:focus { border-color: var(--accent); }

/* ---------- блок ремонта на главной ---------- */

.repair-banner {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 34px;
  margin: 12px 0 56px;
  padding: 34px;
  background: linear-gradient(120deg, var(--surface) 0%, #101319 60%, #12161c 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.repair-info { display: flex; flex-direction: column; }
.repair-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(24px, 2.6vw, 32px);
  margin-bottom: .4em;
}
.repair-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(61, 220, 132, .12);
  color: var(--accent);
  flex: none;
}
.repair-text { color: var(--muted); max-width: 52ch; margin: 0 0 24px; }
.repair-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.repair-item { display: flex; align-items: flex-start; gap: 12px; color: var(--muted); font-size: 14.5px; }
.repair-item svg { color: var(--accent); margin-top: 2px; }
.repair-item-text { display: flex; flex-direction: column; }
.repair-item-text b { color: var(--text); font-weight: 600; font-size: 14.5px; }
.repair-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: rgba(61, 220, 132, .1);
  border: 1px solid rgba(61, 220, 132, .28);
  color: var(--accent);
  flex: none;
}
.repair-art { display: grid; place-items: center; }
.repair-art .art { width: 100%; max-width: 320px; height: auto; }

/* ---------- страница товара ---------- */

.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; }
.pdp-media {
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px;
  min-height: 420px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .06), transparent 68%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.pdp-media .art { width: 260px; height: 286px; }
.pdp-media .product-photo { max-width: 100%; max-height: 420px; }

/* Когда у товара есть фото — рамка заполняется целиком, без пустых полей. */
.pdp-media--photo {
  padding: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-2);
}
.pdp-media--photo .gallery { width: 100%; }
/* Один снимок — рамка по его форме: горизонтальный показывается
   горизонтально, вертикальный — вертикально, без обрезки и растяжения. */
.pdp-media--photo .gallery__stage { min-height: 0; }
.pdp-media--photo .gallery--single .gallery__stage { aspect-ratio: auto; }
.pdp-media--photo .gallery--single .gallery__img { position: static; height: auto; }
/* Несколько снимков — рамка одна на всех, иначе карточка «прыгала» бы
   по высоте при листании. Фото всё равно видно целиком (contain). */
.pdp-media--photo .gallery:not(.gallery--single) .gallery__stage { aspect-ratio: 4 / 3; }
.pdp-media--photo .gallery__thumbs { padding: 0 14px 14px; margin-top: 12px; }

/* ---------- галерея фото в карточке товара ----------
   Без библиотек: стрелки, точки, миниатюры и свайп.
   Тени мягкие, углы скруглённые — в общем стиле сайта. */

.gallery { position: relative; width: 100%; }

.gallery__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 320px;
  border-radius: calc(var(--radius) - 4px);
  overflow: hidden;
  cursor: grab;
  /* Вертикальную прокрутку оставляем пальцу, горизонталь забирает галерея. */
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.gallery__stage:active { cursor: grabbing; }

/* Слайды лежат друг на друге: карточка не «прыгает» по высоте при листании.
   object-fit: contain — снимок виден целиком, в своих пропорциях:
   раньше стоял cover, и фото обрезалось по краям, а мелкие детали
   растягивались и выглядели крупнее, чем есть на самом деле. */
.gallery__img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: calc(var(--radius) - 4px);
  opacity: 0;
  transform: scale(.985);
  transition: opacity .26s ease, transform .26s ease;
  pointer-events: none;
  -webkit-user-drag: none;
}
.gallery__img.is-active { opacity: 1; transform: none; }

.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(14, 15, 17, .72);
  color: var(--text);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.gallery__nav:hover { color: var(--accent); border-color: rgba(61, 220, 132, .5); }
.gallery__nav:active { transform: translateY(-50%) scale(.94); }
.gallery__nav--prev { left: 8px; }
.gallery__nav--next { right: 8px; }
.gallery__nav--prev svg { transform: rotate(180deg); }

.gallery__counter {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 15, 17, .72);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.gallery__dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
}
.gallery__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  cursor: pointer;
  transition: background .18s ease, width .18s ease;
}
.gallery__dot:hover { background: rgba(255, 255, 255, .5); }
.gallery__dot.is-active { width: 20px; border-radius: 999px; background: var(--accent); }

/* Миниатюры под основным снимком */
.gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.gallery__thumb {
  width: 60px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.gallery__thumb:hover { transform: translateY(-2px); }
.gallery__thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 220, 132, .25), 0 4px 14px rgba(0, 0, 0, .25);
}
.gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* На телефоне кнопки и миниатюры чуть меньше, отступы компактнее. */
@media (max-width: 880px) {
  .pdp-media { padding: 22px; min-height: auto; }
  .pdp-media--photo { padding: 0; }
  .gallery__nav { width: 36px; height: 36px; }
  .gallery__thumb { width: 52px; height: 52px; border-radius: 10px; }
  .gallery__dots { bottom: 12px; }
}
.pdp-info { display: flex; flex-direction: column; gap: 14px; }
.pdp-brand { color: var(--muted); font-size: 13.5px; margin: 0; }
.pdp-title { font-size: clamp(26px, 3vw, 36px); margin: 0; }
.pdp-spec { color: var(--muted); margin: 0; }
.pdp-rating { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; }
.pdp-rating span { color: var(--muted); }
.pdp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 6px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pdp-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.pdp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pdp-usps { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.pdp-usps li { display: flex; align-items: center; gap: 10px; }
.pdp-usps svg { color: var(--accent); }

.qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.qty button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.qty button:hover { background: var(--surface-2); color: var(--accent); }
.qty span, .qty-input { min-width: 34px; text-align: center; font-size: 15px; }
.qty-input { width: 44px; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }

.pdp-condition { margin: 12px 0 0; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pdp-condition b { color: var(--text); }
.pdp-condition .cond-badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pdp-condition--new .cond-badge { color: #3ddc84; background: rgba(61, 220, 132, .12); }
.pdp-condition--used .cond-badge { color: #f3b544; background: rgba(243, 181, 68, .15); }

/* Телефон магазина на странице оформления. */
.checkout-seller { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.checkout-seller b { color: var(--text); }

/* Вход и регистрация: узкая форма по центру страницы. */
.auth-layout { max-width: 460px; margin: 0 auto; }
.auth-layout .form-card { width: 100%; }

/* ---------- правка товара прямо на странице (только владелец) ----------
   Скрыто от покупателей: блоки появляются лишь у админа. */

.pdp-admin { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.pdp-admin__hint { color: var(--muted); font-size: 12.5px; }

.site-edit { margin-top: 12px; }
.site-edit[hidden] { display: none; }
.site-edit__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.site-edit label { display: flex; flex-direction: column; gap: 5px; }
.site-edit label > span { color: var(--muted); font-size: 12.5px; }
.site-edit input {
  width: 100%; padding: 11px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; outline: none;
}
.site-edit input:focus { border-color: var(--accent); }
.site-edit select {
  width: 100%; padding: 11px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; outline: none;
}
.site-edit select:focus { border-color: var(--accent); }
/* Название и описание — на всю ширину: они длиннее остальных полей. */
.site-edit__wide { grid-column: 1 / -1; }
.site-edit__sub { margin: 16px 0 6px; color: var(--muted); font-size: 12.5px; }
.site-edit__note { color: var(--muted); font-size: 13px; }

/* Фото в режиме правки: миниатюры с крестиком и кнопка добавления. */
.site-edit__photos { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.site-photo { position: relative; width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.site-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.site-photo__del {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, .62); color: #fff; font: 600 14px/1 inherit; cursor: pointer;
}
.site-photo__del:hover { background: var(--danger); }

/* Опасные действия внизу блока правки */
.site-edit__danger { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.site-edit__danger [data-site-delete] { color: #ff9b9b; border-color: rgba(255, 107, 107, .4); }

/* ---------- окно «Добавить товар» ----------
   Одна разметка на две страницы: владелец добавляет товар и с сайта,
   и из панели. Разметку создаёт js/addproduct.js. */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 14px; }
.modal[hidden] { display: none; }
.modal__shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); }
.modal__card {
  position: relative; width: min(760px, 100%); max-height: 92vh; overflow: auto;
  padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.modal__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal__head h2 { font-size: 18px; margin: 0; }
.modal__x {
  margin-left: auto; display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--muted);
  font: 600 18px/1 inherit; cursor: pointer;
}
.modal__x:hover { color: var(--text); border-color: var(--accent); }
.modal__sub { margin: 18px 0 10px; font-size: 15px; }
.modal__sub small { font-weight: 400; }

/* Подсказки фирмы: чипы пересобираются на каждый ввод в поле бренда. */
.brand-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.brand-chip {
  padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 13.5px; cursor: pointer;
}
.brand-chip:hover { border-color: var(--accent); color: var(--accent); }
/* Единственное совпадение — подсвечиваем: ввели «sam», жми и готово. */
.brand-chip.is-guess { border-color: var(--accent); color: var(--accent); background: rgba(61, 220, 132, .12); }

.modal .field--wide { grid-column: 1 / -1; }
body.modal-open { overflow: hidden; }

/* Поля окна: те же, что у формы, но без внутренних отступов формы. */
.modal .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.modal .field { display: flex; flex-direction: column; gap: 6px; }
.modal .field > span { color: var(--muted); font-size: 12.5px; }
.modal .field input, .modal .field select {
  width: 100%; padding: 12px 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; outline: none;
}
.modal .field input:focus, .modal .field select:focus { border-color: var(--accent); }
.modal .admin-note { color: var(--muted); font-size: 12.5px; }
.modal .row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.modal .btn-mini { padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.modal .btn-mini:hover { border-color: var(--accent); color: var(--accent); }

/* Своя характеристика в окне: название, значение, удалить. */
.modal .spec-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; margin-top: 8px; }
.modal .spec-edit input {
  width: 100%; padding: 11px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; outline: none;
}
.modal .spec-edit input:focus { border-color: var(--accent); }
.modal .spec-edit__del {
  display: grid; place-items: center; width: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--muted);
  font: 600 16px/1 inherit; cursor: pointer;
}
.modal .spec-edit__del:hover { color: #ff9b9b; border-color: rgba(255, 107, 107, .5); }

/* Таблица характеристик: обычный вид и вид для правки. */
.specs-edit { display: none; }
.pdp.is-editing .specs[data-specs-view] { display: none; }
.pdp.is-editing .specs-edit { display: grid; gap: 10px; }

.spec-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px; }
.spec-line input {
  width: 100%; padding: 12px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; outline: none;
}
.spec-line input:focus { border-color: var(--accent); }
.spec-line__del {
  display: grid; place-items: center;
  width: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--muted);
  font: 600 16px/1 inherit; cursor: pointer;
}
.spec-line__del:hover { color: #ff9b9b; border-color: rgba(255, 107, 107, .5); }

.site-edit-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.site-edit-actions[hidden] { display: none; }
.site-edit-msg { font-size: 13.5px; }
.site-edit-msg.is-ok { color: var(--accent); }
.site-edit-msg.is-error { color: var(--danger); }

.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 18px; background: var(--surface); }
.spec-key { color: var(--muted); font-size: 14px; }
.spec-val { font-size: 14.5px; text-align: right; }

/* ---------- корзина ---------- */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.cart-lines { display: flex; flex-direction: column; gap: 14px; }
.cart-line {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.cart-line__art .art { width: 92px; height: 92px; }
.cart-line__body { display: flex; flex-direction: column; gap: 6px; }
.cart-line__name { font-weight: 600; }
.cart-line__name:hover { color: var(--accent); }
.cart-line__spec { color: var(--muted); font-size: 13.5px; margin: 0; }
.cart-line__controls { display: flex; align-items: center; gap: 16px; }
.cart-line__price { font-size: 18px; font-weight: 700; white-space: nowrap; }
.cart-remove { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.cart-remove:hover { color: var(--danger); }

.cart-summary {
  position: sticky;
  top: 150px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cart-summary__title { font-size: 20px; margin: 0; }
.cart-summary__note { color: var(--muted); font-size: 13px; margin: 0; }

.promo { display: flex; flex-direction: column; gap: 8px; }
.promo__label { color: var(--muted); font-size: 13.5px; }
.promo__row { display: flex; gap: 8px; }
.promo__row input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  outline: none;
}
.promo__row input:focus { border-color: var(--accent); }
.promo__note { color: var(--muted); font-size: 12.5px; margin: 0; }

.totals { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.totals dt { color: var(--muted); font-size: 14.5px; }
.totals dd { margin: 0; font-size: 15px; }
.totals__discount dd { color: var(--accent); }
.totals__total { padding-top: 12px; border-top: 1px solid var(--line); }
.totals__total dt { color: var(--text); font-size: 16px; }
.totals__total dd { font-size: 24px; font-weight: 700; }

.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 14px; }
.mini-list b { color: var(--text); white-space: nowrap; }

/* ---------- формы ---------- */

.form-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form-card__title { font-size: 19px; margin: 0; }
.form-card__note { color: var(--muted); font-size: 14px; margin: -8px 0 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { color: var(--muted); font-size: 13.5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .16s ease;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #6d7178; }

.check { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }

.form-msg { margin: 0; font-size: 14.5px; }
.form-msg.is-ok { color: var(--accent); }
.form-msg.is-error { color: var(--danger); }

.radio-list { display: grid; gap: 10px; }
.radio-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.radio-card:hover { border-color: #3a3e46; }
.radio-card input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.radio-card__body { display: flex; flex-direction: column; }
.radio-card__body small { color: var(--muted); font-size: 12.5px; }
.radio-card__price { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.radio-card:has(input:checked) { border-color: rgba(61, 220, 132, .55); background: rgba(61, 220, 132, .05); }

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 26px; align-items: start; }

/* ---------- ремонт: услуги и заявка ----------

   Услуги разделены на две колонки: компьютеры и телефоны.
   У каждой колонки свой цвет и своя картинка — так видно с первого
   взгляда, что где. Все рисунки векторные (SVG), без картинок-файлов. */

.repair-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }

.repair-col {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
/* Мягкое свечение в углу — задаёт цвет колонки. */
.repair-col::before {
  content: '';
  position: absolute;
  inset: -40% 40% 60% -20%;
  background: radial-gradient(closest-side, var(--col-glow), transparent 70%);
  opacity: .5;
  pointer-events: none;
}
.repair-col--pc { --col-accent: #a78bfa; --col-glow: rgba(124, 58, 237, .22); }
.repair-col--phone { --col-accent: #f0c452; --col-glow: rgba(201, 162, 39, .2); }

.repair-col__head { position: relative; display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.repair-col__art {
  flex: none;
  display: grid; place-items: center;
  width: 62px; height: 62px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.repair-col__art .art { width: 46px; height: auto; }
.repair-col__head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.repair-col__title { font-size: 19px; margin: 0; }
.repair-col__lead { margin: 0; color: var(--muted); font-size: 13px; }
/* Число услуг в кружке — видно объём раздела. */
.repair-col__count {
  margin-left: auto; flex: none;
  display: grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--col-accent);
  font-size: 13.5px; font-weight: 600;
}
.repair-col .services { grid-template-columns: 1fr; gap: 10px; }
.repair-col__empty { margin: 0; color: var(--muted); font-size: 14px; }

/* Строка услуги: слева название, справа цена и срок. При наведении
   подсвечиваем краем со стороны колонки — понятно, куда нажали. */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.service-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .18s ease, transform .18s ease;
}
.service-row::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--col-accent, var(--accent));
  opacity: .55;
}
.service-row:hover { border-color: var(--col-accent, var(--accent)); transform: translateX(2px); }
.service-row__main { display: flex; flex-direction: column; }
.service-row__main b { font-weight: 600; }
.service-row__main span { color: var(--muted); font-size: 13px; }
.service-row__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.service-row__time { color: var(--muted); font-size: 12.5px; }
.service-row__price { color: var(--col-accent, var(--accent)); font-weight: 600; white-space: nowrap; }

/* ---------- панель «Изменить» на странице «Ремонт» (только владельцу) ----------
   Обычный посетитель её не видит: в разметку она попадает лишь при isAdmin,
   плюс скрыта атрибутом hidden до нажатия «Изменить». */

.repair-edit {
  margin: 0 0 22px; padding: 20px;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: var(--radius);
}
.repair-edit[hidden] { display: none; }
.repair-edit__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.repair-edit__title { margin: 0; font-size: 17px; }
.repair-edit__sub { margin: 22px 0 10px; font-size: 15px; padding-top: 16px; border-top: 1px solid var(--line); }
.repair-edit__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.repair-edit__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.repair-edit__msg { margin: 12px 0 0; font-size: 13.5px; }
.repair-edit__msg.is-ok { color: var(--accent); }
.repair-edit__msg.is-error { color: var(--danger); }

/* Общие поля панели (они же используются внутри формы). */
.service-row__field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.service-row__field > span { color: var(--muted); font-size: 11.5px; }
.service-row__field input, .service-row__field select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px;
}
.service-row__field input:focus, .service-row__field select:focus {
  outline: none; border-color: var(--accent);
}
.service-row__field--price input { border-color: rgba(61, 220, 132, .55); font-weight: 600; color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-danger { background: rgba(255, 107, 107, .14); color: #ff9b9b; border-color: rgba(255, 107, 107, .35); }
.btn-danger:hover { background: rgba(255, 107, 107, .22); }

@media (max-width: 640px) {
  .repair-edit { padding: 16px; }
  .repair-edit__actions .btn { flex: 1 1 100%; }
}

.repair-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 26px; align-items: start; }
.repair-side { display: flex; flex-direction: column; gap: 16px; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.repair-side h3 { font-size: 18px; margin: 0; }
.repair-steps { display: flex; flex-direction: column; gap: 12px; counter-reset: rs; }
.repair-steps li { position: relative; padding-left: 36px; color: var(--muted); font-size: 14.5px; counter-increment: rs; }
.repair-steps li::before {
  content: counter(rs);
  position: absolute;
  left: 0;
  top: -1px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(61, 220, 132, .12);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}
.repair-side__contact { margin: 0; color: var(--muted); font-size: 14.5px; }
.repair-side__contact a { color: var(--accent); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.info-card { display: flex; flex-direction: column; gap: 4px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.info-card__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: 11px; background: var(--surface-2); color: var(--accent); }
.info-card__label { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
.info-card__value { font-size: 15.5px; }
.info-card__value small { color: var(--muted); font-size: 13px; }

.contact-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.contact-cta p { color: var(--muted); margin: 0; }
.contact-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.success { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; max-width: 620px; margin: 0 auto; padding: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.success__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(61, 220, 132, .14); color: var(--accent); }
.success__total { display: flex; align-items: baseline; justify-content: space-between; width: 100%; padding-top: 14px; border-top: 1px solid var(--line); }
.success__total b { font-size: 26px; }
.success__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- панель корзины ---------- */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 5, 6, .66);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  transform: translateX(102%);
  transition: transform .26s ease;
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 22px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font-size: 20px; }
.drawer__close { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.drawer__close:hover { color: var(--text); border-color: #3a3e46; }
.drawer__items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; }
.drawer__foot { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-top: 1px solid var(--line); }
.drawer__total { display: flex; align-items: baseline; justify-content: space-between; }
.drawer__total span { color: var(--muted); }
.drawer__total b { font-size: 22px; }
.drawer-empty { color: var(--muted); font-size: 15px; }

.drawer-item { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px; }
.drawer-item__art .art { width: 62px; height: 62px; }
.drawer-item__body { display: flex; flex-direction: column; min-width: 0; }
.drawer-item__body b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-item__body small { color: var(--muted); font-size: 13px; }
.drawer-item__remove { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.drawer-item__remove:hover { color: var(--danger); }

/* ---------- футер ---------- */

.site-footer { margin-top: 40px; border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, minmax(0, .8fr)) 1.2fr minmax(0, .8fr); gap: 30px; padding: 46px var(--gutter) 34px; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col h3 { font-size: 15px; color: var(--text); margin: 0 0 4px; }
.footer-col a, .footer-col span, .footer-col p { color: var(--muted); font-size: 14px; margin: 0; }
.footer-col a:hover { color: var(--accent); }
.footer-col--brand .brand--footer { margin-bottom: 6px; }
.footer-col--contacts a:first-of-type { color: var(--text); font-size: 16px; font-weight: 600; }
.footer-note { color: var(--muted); font-size: 12px; opacity: .8; }
.socials { display: flex; gap: 10px; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); }
.socials a:hover { color: var(--accent); border-color: rgba(61, 220, 132, .45); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--gutter) 26px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13.5px; }

/* ---------- адаптив ---------- */

/* На телефоне две колонки не помещаются — ставим их друг под друга. */
@media (max-width: 880px) {
  .repair-columns { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .repair-col { padding: 18px; }
  .repair-col__title { font-size: 17px; }
  .service-row { padding: 14px 16px; gap: 12px; }
}

@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  :root { --gutter: 20px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .header-top { flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; gap: 14px; }
  .hero-slide { grid-template-columns: 1fr; min-height: auto; padding-top: 20px; }
  .hero-art { order: -1; }
  .hero-art .hero-art__svg { max-width: 460px; }
  .pdp { grid-template-columns: 1fr; gap: 26px; }
  .cart-layout, .checkout-layout, .repair-grid { grid-template-columns: minmax(0, 1fr); }
  .cart-summary { position: static; }
  .repair-banner { grid-template-columns: 1fr; }
  .repair-art { order: -1; }
}

@media (max-width: 880px) {
  .burger { display: grid; margin-left: auto; }
  .header-actions { gap: 18px; }
  .action__label { display: none; }
  .site-nav { display: none; }
  .site-header.is-nav-open .site-nav { display: block; }
  .site-nav__inner { flex-direction: column; align-items: stretch; gap: 0; height: auto; padding: 6px 0 14px; }
  .site-nav a { height: auto; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .site-nav a.is-active { border-bottom-color: var(--line-soft); color: var(--accent); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-features { grid-template-columns: 1fr; gap: 14px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .product-media { height: 150px; }
  .product-media .art { width: 92px; height: 102px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 520px) {
  :root { --gutter: 16px; }
  /* Кнопки во всю ширину: на узком экране «Позвонить +7…» не умещается
     в одну строку и уезжала за край — растягиваем её по колонке. */
  .contact-cta__actions { width: 100%; }
  .contact-cta__actions .btn { flex: 1 1 100%; }
  /* Самый узкий экран (320 px): «Позвонить +7 940 726-25-11» в одну строку
     влезает только уменьшенным шрифтом — иначе кнопка вылезает за край. */
  .contact-cta__actions .btn-lg { padding: 15px 14px; font-size: 14px; }
  .brand__text b { font-size: 20px; }
  .brand__text small { display: none; }
  .hero { padding-top: 24px; }
  /* На телефоне фон чище: крупные устройства убираем, оставляем два мелких. */
  .hero-bg__item--1, .hero-bg__item--3, .hero-bg__item--5 { display: none; }
  .hero-bg__item--2 { left: -6%; top: 70%; width: 110px; }
  .hero-bg__item--4 { right: -4%; top: 72%; width: 96px; }
  .hero-bg__item--6 { right: 6%; top: 2%; width: 92px; }
  .hero-dots { justify-content: center; }
  .tiles { grid-template-columns: 1fr; }
  /* Два товара в ряд и по центру — как просил владелец. */
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-media { height: 132px; padding: 10px; }
  .product-media .art { width: 78px; height: 88px; }
  .product-body { padding: 12px 10px 14px; text-align: center; align-items: center; }
  .product-link { align-items: center; }
  .product-name { font-size: 14px; }
  .product-spec { font-size: 12px; }
  .price-row { justify-content: center; }
  .product-actions { justify-content: center; }
  .cart-line { grid-template-columns: 72px 1fr; }
  .cart-line__art .art { width: 72px; height: 72px; }
  .cart-line__price { grid-column: 2; text-align: right; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
  .hero-title { font-size: 38px; }
  .pdp-actions .btn-lg { flex: 1 1 100%; }
}

/* ---------- контейнер контента страниц ----------
   Шаблоны страниц (js/views.js) отдают секции прямо в #app, поэтому ограничение
   ширины и боковые отступы заданы здесь: разметка остаётся без лишних обёрток,
   а контент перестаёт упираться в края окна. */

.app > .section,
.app > .crumbs,
.hero-slide,
.hero-dots,
.hero-features {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

