/* ==========================================================================
   Трикотажная Республика — дизайн-система
   Тёплая «шерстяная» палитра, редакционная типографика, светлая и тёмная темы
   ========================================================================== */

:root {
  color-scheme: light;

  /* Палитра — светлая тема */
  --paper: #FBF9F6;
  --paper-2: #F4F0E9;
  --surface: #FFFFFF;
  --surface-2: #F7F4EF;
  --ink: #14110E;
  --ink-2: #4C443B;
  --ink-3: #8A8076;
  --line: #E7E1D8;
  --line-2: #D6CDC1;
  --accent: #A8442A;
  --accent-ink: #8E3721;
  --accent-soft: #FAEDE7;
  --gold: #B98A2E;
  --success: #2C6A4E;
  --success-soft: #E6F0EA;
  --danger: #A6281F;
  --danger-soft: #FBEAE8;

  /* Кнопка-действие: инверсия чернил, работает в обеих темах */
  --btn-bg: var(--ink);
  --btn-fg: #FBF9F6;

  --shadow-xs: 0 1px 2px rgba(20, 17, 14, 0.05);
  --shadow-sm: 0 2px 8px -2px rgba(20, 17, 14, 0.08);
  --shadow-md: 0 12px 32px -12px rgba(20, 17, 14, 0.16);
  --shadow-lg: 0 32px 64px -24px rgba(20, 17, 14, 0.24);
  --img-bg: #EFEAE2;

  /* Типографика */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;

  /* Ритм */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 0.14s;
  --dur-2: 0.24s;
  --dur-3: 0.42s;

  --page-max: 1360px;
  --gutter: 20px;
  --header-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --z-header: 100;
  --z-sticky: 90;
  --z-scrim: 200;
  --z-panel: 210;
  --z-toast: 300;
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper: #100E0C;
  --paper-2: #17140F;
  --surface: #1A1713;
  --surface-2: #221E18;
  --ink: #F6F2EC;
  --ink-2: #BAB1A5;
  --ink-3: #8A8177;
  --line: #2C2822;
  --line-2: #3B352C;
  --accent: #E58057;
  --accent-ink: #F09B77;
  --accent-soft: #2B1B12;
  --gold: #DCB25C;
  --success: #6FC498;
  --success-soft: #16261D;
  --danger: #F0847A;
  --danger-soft: #2C1613;

  --btn-bg: var(--ink);
  --btn-fg: #14110E;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, 0.8);
  --img-bg: #221E18;
}

/* ── Сброс ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  /* Без pinch и double-tap zoom: скролл и тапы остаются */
  touch-action: pan-x pan-y;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
svg { display: block; flex-shrink: 0; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
}

button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

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

/* ── Утилиты ── */
.shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--sp-4);
  z-index: 400;
  padding: 12px 20px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--dur-2) var(--ease);
}

.skip-link:focus { top: var(--sp-4); }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ==========================================================================
   Шапка
   ========================================================================== */

.hdr {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.hdr.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-xs);
}

@supports not (backdrop-filter: blur(4px)) {
  .hdr { background: var(--paper); }
}

.hdr__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--header-h);
}

/* Бренд + переключатель цехов */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  margin-left: -6px;
  border-radius: var(--r-md);
  text-align: left;
  min-width: 0;
  transition: background var(--dur-1) var(--ease);
}

.brand:hover { background: var(--surface-2); }
.brand:active { transform: scale(0.985); }

.brand__mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand__text { min-width: 0; display: flex; flex-direction: column; }

.brand__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__net {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__chev { color: var(--ink-3); transition: transform var(--dur-2) var(--ease); }
.brand:hover .brand__chev { transform: translateY(1px); }

/* Поиск */
.search {
  position: relative;
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  display: none;
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}

.search__input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid transparent;
  font-size: 14px;
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.search__input::placeholder { color: var(--ink-3); }

.search__input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}

.search__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: none;
  place-items: center;
  color: var(--ink-3);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.search__clear:hover { background: var(--line); color: var(--ink); }
.search.has-value .search__clear { display: grid; }

/* Кнопки-иконки */
.hdr__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-left: auto;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.92); }

.icon-btn__badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--paper);
  transform: scale(0);
  transition: transform var(--dur-2) var(--ease-out);
}

.icon-btn__badge.is-visible { transform: scale(1); }

.icon-btn__badge.is-bumped { animation: badge-bump 0.4s var(--ease-out); }

@keyframes badge-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.theme-toggle__sun, .theme-toggle__moon { transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-out); }
.theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: block; }

.search-toggle { display: grid; }

/* Мобильный поиск — выдвижная строка */
.hdr__search-m {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-3) var(--ease-out);
}

.hdr__search-m.is-open { grid-template-rows: 1fr; }
.hdr__search-m > div { overflow: hidden; }

.hdr__search-m .search {
  display: block;
  max-width: none;
  margin: 0 0 12px;
}

/* ==========================================================================
   Хиро
   ========================================================================== */

/* Первый экран отдан товарам: хиро держим низким, а рассказ о компании
   переехал в модальное окно за кнопками. */
.hero {
  padding: clamp(20px, 3vw, 34px) 0 clamp(18px, 2.5vw, 26px);
  border-bottom: 1px solid var(--line);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 4.4vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 8px 0 0;
  max-width: 20ch;
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__lead {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 56ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  padding-top: var(--sp-4);
  margin-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat__val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.stat__lbl {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.35;
}

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), background var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
}

.btn:active { transform: scale(0.975); }

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn--primary:hover { background: color-mix(in srgb, var(--btn-bg) 86%, var(--accent)); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-2);
}

.btn--ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }

.btn--block { width: 100%; }
.btn--sm { height: 40px; padding: 0 18px; font-size: 13px; }

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Каталог
   ========================================================================== */

.catalog { padding: clamp(28px, 4vw, 48px) 0 var(--sp-8); }

.catalog__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.catalog__count {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

.catalog__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.select-wrap { position: relative; }

.select-wrap svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-3);
}

.select {
  height: 40px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease);
}

.select:hover { border-color: var(--ink-3); }

.filters-btn { display: inline-flex; }

.filters-btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Полосы категорий */
.chips-scroll {
  position: relative;
  margin-bottom: var(--sp-4);
}

.chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip:active { transform: scale(0.96); }

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip__n { font-size: 11px; opacity: 0.6; }

/* Layout: сайдбар фильтров + сетка */
.catalog__layout {
  display: grid;
  gap: var(--sp-6);
}

.catalog__main { min-width: 0; }

/* Активные фильтры */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.active-filters:empty { display: none; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

.tag button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: inherit;
  opacity: 0.7;
  transition: opacity var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}

.tag button:hover { opacity: 1; background: rgba(0, 0, 0, 0.08); }

/* ── Сетка товаров ── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4) var(--sp-3);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  animation: card-in var(--dur-3) var(--ease-out) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.card__media {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--img-bg);
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease-out);
}

.card__img.is-loaded { opacity: 1; }
.card:hover .card__img { transform: scale(1.04); }

.card__img--alt {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.card:hover .card__img--alt.is-loaded { opacity: 1; }

.card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

.badge {
  padding: 4px 8px;
  border-radius: var(--r-xs);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}

.badge--sale { background: var(--accent); color: #fff; }
.badge--last { background: rgba(20, 17, 14, 0.78); color: #fff; }

.card__quick {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  opacity: 0;
  transform: translateY(8px);
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out),
              background var(--dur-1) var(--ease);
  box-shadow: var(--shadow-sm);
}

.card:hover .card__quick,
.card:focus-within .card__quick { opacity: 1; transform: none; }

.card__quick:hover { background: var(--surface); }
.card__quick:active { transform: scale(0.98); }

/* На тач-устройствах ховера нет — кнопку показываем сразу */
@media (hover: none) {
  .card__quick { opacity: 1; transform: none; }
}

.card__body { padding: 12px 2px 0; }

.card__price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.card__price {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card__price--sale { color: var(--accent); }

.card__old {
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: line-through;
}

.card__name {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

.card__rating { display: inline-flex; align-items: center; gap: 3px; }
.star { color: var(--gold); }
.card__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

/* Метка цеха в общем каталоге сети */
.card__shop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.card__shop svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.75; }

/* Скелетоны */
.skeleton {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--r-xs);
}

@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}

.sk-card__media { aspect-ratio: 3 / 4; border-radius: var(--r-md); }
.sk-card__line { height: 12px; margin-top: 10px; }
.sk-card__line--price { height: 16px; width: 42%; }
.sk-card__line--name { width: 90%; }
.sk-card__line--name2 { width: 62%; }

/* Пустое состояние и ошибка */
.state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.state svg { margin: 0 auto var(--sp-4); color: var(--ink-3); }
.state h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.state p { font-size: 14px; color: var(--ink-3); max-width: 44ch; margin: 0 auto var(--sp-4); }

.state--error { border-style: solid; border-color: var(--danger); background: var(--danger-soft); }
.state--error h3 { color: var(--danger); }
.state--error p { color: var(--ink-2); }

.state__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ==========================================================================
   Панель фильтров
   ========================================================================== */

.filters {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-panel);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(101%);
  transition: transform var(--dur-3) var(--ease-out);
  visibility: hidden;
}

.filters.is-open { transform: none; visibility: visible; }

.filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.filters__title { font-size: 17px; font-weight: 600; }

.filters__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
}

.filters__foot {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.fgroup { padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.fgroup:last-child { border-bottom: none; }

.fgroup__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--sp-3);
}

.fgroup__wrap { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Цена */
.price-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-2);
}

.price-inputs span { color: var(--ink-3); }

.field {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}

.field::placeholder { color: var(--ink-3); }

.field:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent);
}

.field.is-invalid { border-color: var(--danger); }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.field-label span { color: var(--accent); }

.field-hint { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.field-error { margin-top: 6px; font-size: 12px; color: var(--danger); }

/* Переключатель */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  cursor: pointer;
  padding: 4px 0;
}

.switch-row__label { font-size: 14px; }

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--line-2);
  transition: background var(--dur-2) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-2) var(--ease-out);
}

.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row input:checked + .switch { background: var(--success); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   Скрим
   ========================================================================== */

.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: rgba(12, 10, 8, 0.48);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-2) var(--ease), visibility var(--dur-2) var(--ease);
}

.scrim.is-open { opacity: 1; visibility: visible; }

/* ==========================================================================
   Страница товара (оверлей с deep-link)
   ========================================================================== */

.pdp {
  position: fixed;
  inset: 0;
  z-index: var(--z-panel);
  background: var(--paper);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform var(--dur-3) var(--ease-out);
  visibility: hidden;
}

.pdp.is-open { transform: none; visibility: visible; }

.pdp__bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 56px;
  padding: 0 var(--sp-3);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.pdp__bar-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdp__layout {
  display: grid;
  gap: var(--sp-4);
  max-width: var(--page-max);
  margin: 0 auto;
  /* Место под закреплённые кнопки покупки */
  padding: 0 0 96px;
}

/* Галерея */
.gal { position: relative; }

/* Фото не занимает больше половины экрана, иначе название и цена уходят
   за пределы первого экрана */
.gal__stage {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 46dvh;
  margin-inline: auto;
  background: var(--img-bg);
  overflow: hidden;
}

.gal__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}

.gal__img.is-current { opacity: 1; }

.gal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.gal__nav:hover { background: var(--surface); }
.gal__nav:active { transform: translateY(-50%) scale(0.92); }
.gal__nav--prev { left: 12px; }
.gal__nav--next { right: 12px; }
.gal__nav:disabled { opacity: 0.35; pointer-events: none; }

.gal__dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gal__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}

.gal__dot.is-active { background: #fff; transform: scale(1.5); }

.gal__thumbs { display: none; }

.gal__thumb {
  width: 68px;
  height: 90px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--img-bg);
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color var(--dur-2) var(--ease), opacity var(--dur-2) var(--ease);
  opacity: 0.65;
}

.gal__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal__thumb:hover { opacity: 1; }
.gal__thumb.is-active { border-color: var(--ink); opacity: 1; }

/* Инфо-панель */
.pdp__info { padding: var(--sp-4) var(--gutter) 0; }

.pdp__cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pdp__title {
  font-family: var(--font-display);
  font-size: clamp(19px, 4.6vw, 34px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 6px 0 var(--sp-2);
}

.pdp__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
}

.pdp__price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-3) 0 var(--sp-2);
}

.pdp__price {
  font-size: clamp(23px, 6vw, 38px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1;
}

.pdp__price.is-sale { color: var(--accent); }

.pdp__old {
  font-size: 16px;
  color: var(--ink-3);
  text-decoration: line-through;
}

.pdp__save {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.pdp__block { padding: var(--sp-5) 0; border-top: 1px solid var(--line); margin-top: var(--sp-5); }

.pdp__block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.pdp__block-title { font-size: 14px; font-weight: 600; }
.pdp__block-note { font-size: 12px; color: var(--ink-3); }

/* Размеры */
.sizes { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.size {
  min-width: 62px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}

.size:hover { border-color: var(--ink-3); }
.size:active { transform: scale(0.97); }

.size.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.size.is-selected .size__stock { color: color-mix(in srgb, var(--paper) 70%, transparent); }

.size__label { font-size: 14px; font-weight: 600; line-height: 1.1; }
.size__stock { font-size: 10px; color: var(--ink-3); line-height: 1.1; }

.size:disabled { opacity: 0.4; pointer-events: none; text-decoration: line-through; }

/* Количество */
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.qty button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background var(--dur-1) var(--ease);
}

.qty button:hover { background: var(--surface-2); }
.qty button:disabled { opacity: 0.3; pointer-events: none; }

.qty__val {
  min-width: 44px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Липкая панель покупки */
/* На мобильных кнопки прижаты к низу экрана: клиент видит цену и действие
   сразу, без прокрутки до конца карточки */
.pdp__buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--gutter) calc(10px + var(--safe-bottom));
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

/* «Заказать сейчас» ведёт мимо корзины, поэтому занимает всю ширину;
   на узких экранах «в корзину» сжимается до иконки */
.pdp__buy .pdp__buy-now { flex: 1; min-width: 0; }

.pdp__buy-cart { flex: 0 0 auto; padding-inline: 14px; }
.pdp__buy-cart .pdp__buy-label { display: none; }

/* Характеристики / аккордеон */
.spec { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }

.spec__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  padding: 12px 14px;
  background: var(--surface);
  font-size: 13px;
}

.spec__k { color: var(--ink-3); }
.spec__v { font-weight: 500; text-align: right; }

.acc { border-top: 1px solid var(--line); }

.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.acc__btn svg { color: var(--ink-3); transition: transform var(--dur-2) var(--ease); }
.acc.is-open .acc__btn svg { transform: rotate(180deg); }

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-3) var(--ease-out);
}

.acc.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__panel > div { overflow: hidden; }

.acc__inner {
  padding-bottom: var(--sp-4);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}

.acc__inner p + p { margin-top: 10px; }

/* ==========================================================================
   Корзина и оформление (боковая панель)
   ========================================================================== */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-panel);
  width: min(440px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(101%);
  transition: transform var(--dur-3) var(--ease-out);
  visibility: hidden;
}

.drawer.is-open { transform: none; visibility: visible; }

.drawer__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.drawer__title { font-size: 17px; font-weight: 600; flex: 1; }
.drawer__title span { color: var(--ink-3); font-weight: 400; }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-4);
}

.drawer__foot {
  border-top: 1px solid var(--line);
  padding: var(--sp-4) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  background: var(--surface);
}

/* Переключение шагов корзина → оформление */
.drawer__views { position: relative; flex: 1; display: flex; min-height: 0; }

.drawer__view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease);
}

.drawer__view[hidden] { display: none; }

.drawer[data-step="pickup"] .drawer__view--cart,
.drawer[data-step="checkout"] .drawer__view--cart,
.drawer[data-step="checkout"] .drawer__view--pickup { transform: translateX(-24px); opacity: 0; }

/* Строка корзины */
.line {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
  animation: line-in var(--dur-2) var(--ease-out) both;
}

@keyframes line-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

.line.is-removing {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}

.line:first-child { padding-top: 0; }

.line__media {
  width: 68px;
  height: 88px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--img-bg);
  cursor: pointer;
}

.line__media img { width: 100%; height: 100%; object-fit: cover; }

.line__info { min-width: 0; }

.line__name {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.line__name:hover { color: var(--accent); }

.line__attrs { margin-top: 4px; font-size: 12px; color: var(--ink-3); }

.line__qty {
  display: inline-flex;
  align-items: center;
  margin-top: var(--sp-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
}

.line__qty button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background var(--dur-1) var(--ease);
}

.line__qty button:hover { background: var(--surface-2); }
.line__qty button:disabled { opacity: 0.3; pointer-events: none; }

.line__qty span {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.line__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2);
}

.line__sum { font-size: 14px; font-weight: 600; white-space: nowrap; }
.line__sum small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); text-align: right; }

.line__del {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}

.line__del:hover { color: var(--danger); background: var(--danger-soft); }

.line__warn {
  margin-top: 6px;
  font-size: 11px;
  color: var(--danger);
}

/* Итоги */
.totals { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); }

.totals__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 13px;
  color: var(--ink-2);
}

.totals__row--save { color: var(--accent); font-weight: 500; }

.totals__row--grand {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink);
}

.totals__row--grand b { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }

.drawer__note {
  margin-top: var(--sp-3);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: center;
}

/* Форма оформления */
.form { display: grid; gap: var(--sp-4); }
.form__row { display: grid; gap: 0; }

.summary-mini {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--r-md);
  font-size: 13px;
}

.summary-mini b { margin-left: auto; font-size: 15px; }

/* Заказ мимо корзины — предупреждаем, что оформляется одна позиция */
.checkout__express {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: var(--sp-3);
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}

.checkout__express svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.checkout__express b { font-weight: 600; }

textarea.field { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

/* ==========================================================================
   Пункты выдачи
   ========================================================================== */

.pvz-lead {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  margin-bottom: var(--sp-3);
}

.pvz-geo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}

.pvz-geo--ok { color: var(--success); }
.pvz-geo--ok svg { flex-shrink: 0; }
.pvz-geo--wait { color: var(--ink-3); }

.pvz-geo__btn {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.pvz-map-btn { margin-bottom: var(--sp-4); }

.pvz-list { display: grid; gap: var(--sp-2); }

.pvz {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: transparent;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}

.pvz:hover { border-color: var(--ink-3); }

.pvz.is-selected {
  border-color: var(--ink);
  background: var(--surface-2);
}

.pvz__mark {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  position: relative;
  transition: border-color var(--dur-2) var(--ease);
}

.pvz__mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform var(--dur-2) var(--ease-out);
}

.pvz.is-selected .pvz__mark { border-color: var(--ink); }
.pvz.is-selected .pvz__mark::after { transform: scale(1); }

.pvz__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }

.pvz__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: 14px;
}

.pvz__price { font-size: 13px; font-weight: 600; white-space: nowrap; }
.pvz__addr { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.pvz__meta { font-size: 11px; color: var(--ink-3); }

.pvz-chosen {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin-bottom: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.pvz-chosen__label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.pvz-chosen__value { font-size: 13px; font-weight: 600; }
.pvz-chosen__price { font-size: 12px; color: var(--ink-2); }
.pvz-chosen__empty { margin-top: 0; margin-bottom: var(--sp-3); }

/* Строка доставки в итогах, пока пункт не выбран */
.totals__row--pending { color: var(--ink-3); }

.totals__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.totals--compact { margin-bottom: var(--sp-3); }

/* Выбранный пункт в форме оформления */
.co-pvz {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: var(--sp-3);
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.co-pvz__icon { color: var(--ink-2); flex-shrink: 0; margin-top: 1px; }
.co-pvz__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 12px; }
.co-pvz__body b { font-size: 14px; }
.co-pvz__body span { color: var(--ink-2); line-height: 1.4; }
.co-pvz__body .co-pvz__price { color: var(--ink-3); }

.co-pvz__edit {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   Карта пунктов выдачи
   ========================================================================== */

.mapview {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-panel) + 5);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform var(--dur-3) var(--ease-out);
}

.mapview.is-open { transform: none; visibility: visible; }

.mapview__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 56px;
  flex-shrink: 0;
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.mapview__title { flex: 1; font-size: 15px; font-weight: 600; }

.mapview__canvas {
  flex: 1;
  min-height: 0;
  background: var(--surface-2);
}

.mapview__loading {
  display: grid;
  place-items: center;
  height: 100%;
  padding: var(--sp-5);
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.mapview__card {
  flex-shrink: 0;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.mapview__hint { font-size: 12px; color: var(--ink-3); text-align: center; }

.mapcard { display: flex; align-items: center; gap: var(--sp-3); }
.mapcard__info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mapcard__info b { font-size: 14px; }
.mapcard__info span { font-size: 12px; color: var(--ink-2); }
.mapcard__info .mapcard__price { color: var(--ink-3); }

/* Метка пункта выдачи на карте */
.pvz-pin span {
  display: block;
  width: 18px;
  height: 18px;
  margin: 4px;
  border-radius: 50%;
  border: 3px solid var(--paper);
  background: var(--ink-3);
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.35);
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out);
}

.pvz-pin--active span { background: var(--accent, #d94f30); transform: scale(1.35); }

/* Успешное оформление */
.done { text-align: center; padding: var(--sp-7) var(--sp-4); }

.done__mark {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  animation: pop var(--dur-3) var(--ease-out) both;
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.done h3 { font-family: var(--font-display); font-size: 24px; font-weight: 500; margin-bottom: var(--sp-2); }
.done p { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: var(--sp-5); }
.done__id { font-weight: 600; color: var(--ink); }

/* ==========================================================================
   Тосты
   ========================================================================== */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: var(--z-toast);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in var(--dur-3) var(--ease-out) both;
}

.toast.is-out { animation: toast-out var(--dur-2) var(--ease) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

.toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast__text { flex: 1; line-height: 1.4; }

.toast__action {
  font-size: 13px;
  font-weight: 600;
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

[data-theme="dark"] .toast__action { color: var(--btn-fg); }

/* ==========================================================================
   О продавце — модальное окно, открывается кнопками с главной
   ========================================================================== */

.info__lead {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.info__text { margin-top: var(--sp-3); font-size: 14px; line-height: 1.65; color: var(--ink-2); }

.info__lead + .fact,
.info__text + .fact { margin-top: var(--sp-4); }

.fact + .fact { margin-top: var(--sp-2); }

.fact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-2);
}

.fact svg { color: var(--success); }

.contacts { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; }

.contact {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 16px;
  background: var(--surface);
  transition: background var(--dur-1) var(--ease);
}

a.contact:hover { background: var(--surface-2); }

.contact__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.contact__body { display: flex; flex-direction: column; min-width: 0; }
.contact__k { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.contact__v { font-size: 14px; font-weight: 500; line-height: 1.4; margin-top: 1px; }

/* ==========================================================================
   Подвал
   ========================================================================== */

.foot {
  padding: var(--sp-6) 0 calc(var(--sp-6) + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}

.foot__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.foot__brand { display: flex; align-items: center; gap: 10px; }
.foot__note { font-size: 12px; color: var(--ink-3); line-height: 1.6; max-width: 52ch; }

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}

.foot__links button {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
  transition: color var(--dur-1) var(--ease), text-decoration-color var(--dur-1) var(--ease);
}

.foot__links button:hover { color: var(--ink); text-decoration-color: var(--ink-3); }

/* ==========================================================================
   Лист выбора цеха
   ========================================================================== */

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-panel);
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(101%);
  transition: transform var(--dur-3) var(--ease-out);
  visibility: hidden;
}

.sheet.is-open { transform: none; visibility: visible; }

.sheet__grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  margin: 10px auto 0;
}

.sheet__head { padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.sheet__title { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.sheet__desc { margin-top: 6px; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.sheet__desc strong { color: var(--ink-2); font-weight: 600; }

.sheet__filters {
  display: flex;
  gap: var(--sp-2);
  padding: 0 var(--sp-4) var(--sp-3);
  overflow-x: auto;
  scrollbar-width: none;
}

.sheet__filters::-webkit-scrollbar { display: none; }

.sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--sp-4) var(--sp-4);
}

.sheet__foot {
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.5;
}

.shop {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
  background: var(--surface);
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}

.shop:hover { border-color: var(--ink-3); }
.shop:active { transform: scale(0.99); }

.shop.is-current { border-color: var(--ink); background: var(--surface-2); }
.shop.is-soon { opacity: 0.6; pointer-events: none; }

/* Общий каталог сети — не магазин, а способ смотреть все цеха сразу */
button.shop { width: 100%; text-align: left; font: inherit; }

.shop--market {
  border-style: dashed;
  border-color: var(--line-2);
  margin-bottom: var(--sp-3);
}

.shop--market .shop__mark { background: var(--accent); color: #fff; }
.shop--market.is-current { border-style: solid; }

.shop__mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
}

.shop.is-current .shop__mark { background: var(--ink); color: var(--paper); }

.shop__info { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; }
.shop__name { font-size: 14px; font-weight: 600; }
.shop__tag { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.shop__cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.shop__cat {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 3px 7px;
  border-radius: var(--r-pill);
}

.shop.is-current .shop__cat { background: var(--surface); }

.shop__state {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shop.is-current .shop__state { color: var(--success); }

/* ==========================================================================
   Адаптив
   ========================================================================== */

@media (min-width: 560px) {
  :root { --gutter: 28px; }

  .grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5) var(--sp-4); }
  .hero__stats { gap: var(--sp-3) var(--sp-6); }
  .gal__stage { aspect-ratio: 4 / 5; max-height: 52dvh; }
}

@media (min-width: 900px) {
  :root { --header-h: 72px; --gutter: 32px; }

  .search { display: block; }
  .search-toggle { display: none; }
  .hdr__search-m { display: none; }

  /* Листы на широком экране — окно по центру, а не шторка снизу */
  .sheet {
    inset: auto auto 24px 50%;
    width: min(560px, calc(100vw - 48px));
    max-height: min(78dvh, 760px);
    border-radius: var(--r-xl);
    transform: translate(-50%, calc(100% + 24px));
  }

  .sheet.is-open { transform: translate(-50%, 0); }
  .sheet__grip { display: none; }
  .sheet__head { padding-top: var(--sp-5); }

  /* Карта — окно по центру, а не на весь экран */
  .mapview {
    inset: 50% auto auto 50%;
    width: min(880px, calc(100vw - 48px));
    height: min(80dvh, 720px);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg, 0 24px 64px rgb(0 0 0 / 0.28));
    transform: translate(-50%, calc(-50% + 24px));
  }

  .mapview.is-open { transform: translate(-50%, -50%); }

  /* Фильтры — постоянный сайдбар */
  .catalog__layout { grid-template-columns: 252px minmax(0, 1fr); }

  .filters {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    inset: auto;
    max-height: calc(100dvh - var(--header-h) - 48px);
    transform: none;
    visibility: visible;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .filters__head {
    padding: 0 0 var(--sp-3);
    border-bottom-color: var(--line);
  }

  .filters__body { padding: 0; }
  .filters__close { display: none; }

  .filters__foot {
    padding: var(--sp-3) 0 0;
    background: transparent;
  }

  .filters-btn { display: none; }

  /* Карточка товара — две колонки */
  .pdp__bar { height: 64px; padding: 0 var(--gutter); }

  .pdp__layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: clamp(32px, 4vw, 64px);
    padding: var(--sp-6) var(--gutter) var(--sp-8);
    align-items: start;
  }

  .gal {
    position: sticky;
    top: calc(64px + var(--sp-6));
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: var(--sp-3);
    align-items: start;
  }

  .gal__stage { border-radius: var(--r-lg); aspect-ratio: 3 / 4; max-height: none; }
  .gal__nav { display: grid; }
  .gal__dots { display: none; }

  .gal__thumbs {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .gal__thumbs::-webkit-scrollbar { display: none; }
  .gal__thumbs:empty { display: none; }

  .pdp__info { padding: 0; }

  .pdp__buy {
    position: static;
    gap: var(--sp-3);
    padding: 0;
    margin-top: var(--sp-5);
    background: none;
    backdrop-filter: none;
    border: none;
  }

  .pdp__buy-cart { flex: 0 0 auto; padding-inline: 22px; }
  .pdp__buy-cart .pdp__buy-label { display: inline; }

  .toasts { left: auto; right: 24px; transform: none; }
}

@media (min-width: 1180px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: var(--sp-6) var(--sp-4); }
  .catalog__layout { grid-template-columns: 268px minmax(0, 1fr); gap: var(--sp-7); }
}

@media (max-width: 899px) {
  .gal__thumbs { display: none; }

  /* Карточку товара на телефоне держим плотнее: меньше воздуха между блоками */
  .pdp__block { padding: var(--sp-4) 0; margin-top: var(--sp-4); }
  .pdp__bar { height: 52px; }
}

/* ==========================================================================
   Уважение к настройкам пользователя
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover .card__img { transform: none; }
}

@media print {
  .hdr, .filters, .drawer, .sheet, .scrim, .toasts, .pdp, .foot { display: none !important; }
}



