/*
 * Общий production-слой для внутренних страниц.
 * Имена с префиксом ds- намеренно не применяются к утверждённой главной:
 * она продолжает использовать свои существующие BEM-классы из styles.css.
 */

:root {
  /* Color */
  --ds-color-canvas: var(--color-bg);
  --ds-color-surface: #ffffff;
  --ds-color-surface-muted: var(--color-badge-bg);
  --ds-color-text: var(--color-text);
  --ds-color-text-muted: rgba(35, 30, 19, 0.72);
  /* Reference token for reusable inverse text on dark/new patterns, not a 1:1 copy of the homepage block. */
  --ds-color-text-inverse: #f7efde;
  --ds-color-brand: var(--color-brown);
  --ds-color-accent: var(--primary);
  /* Reference token for reusable inverse backgrounds on dark/new patterns, not a 1:1 copy of the homepage block. */
  --ds-color-inverse: var(--color-dark);
  --ds-color-border: rgba(35, 30, 19, 0.2);
  --ds-color-border-strong: var(--color-text);
  /* Reference focus token for reusable UI patterns, not a 1:1 copy of the homepage block.
     Оранжевый (не красный): активное поле ввода не должно выглядеть как ошибка (2026-08-24). */
  --ds-color-focus: rgba(255, 84, 0, 0.5);

  /* Typography — единая система (единственный источник типографики).
   * Правила:
   * 1. Гарнитура во всём /design одна — Cormorant Infant (brand-legacy-tokens.md, п. 4).
   *    В компонентах она задаётся ТОЛЬКО токенами --ds-font-display/--ds-font-body;
   *    литеральные 'Cormorant Infant' и новые гарнитуры запрещены.
   * 2. Кегли и веса — только через токены ниже. Новое числовое значение не заводить:
   *    нет подходящего шага — сначала обсуждаем расширение шкалы (или свёртку), правим здесь.
   * 3. Текстовая шкала — 5 ролей на 4 кегля (12/15/18/21; title=md=18), заголовочная — адаптивные h3/h2/h1.
 *    (Синхронизировано с токенами ниже и brand-legacy-tokens.md п.4, аудит 2026-08-25.)
   *    Промежуточные кегли 13/15/17/19/20/22px свернуты к шкале по ролям 2026-08-22,
   *    роли перераспределены в тот же день (читаемость): xs→sm для тегов/бейджей/плашек/
   *    хинтов, sm→md для подписей/кнопок/крошек/мета/дат/кикеров/линков. Возврат
   *    промежуточных значений запрещён.
   * 4. Дисплейные заголовки (23–96px) и clamp()-масштабирование остались литералами —
    *    это утверждённые исключения (решение 2026-08-22: clamp сохраняем, токены не заводим).
    *    Новые дисплейные литералы не добавлять без обсуждения.
    * 5. Веса — только 500/600/700 (решение 2026-08-23: веса ниже 500 запрещены везде,
    *    включая font-shorthand и загрузку гарнитуры; токен regular 400 удалён, базовый
    *    вес body — 500). Новые веса ниже 500 не заводить. */
  --ds-font-display: var(--font-heading);   /* заголовки, декоративные цифры, цитаты */
  --ds-font-body: var(--font-body);         /* весь наборный текст и UI */
  --ds-font-size-xs: 12px;    /* только числовые счётчики-точки (бейдж корзины/фильтра в круге 16px) */
  --ds-font-size-sm: 15px;    /* теги, бейджи, возрастные плашки, хинты, микро-подписи */
  --ds-font-size-md: 18px;    /* базовый текст, подписи, кнопки, крошки, мета, даты, кикеры/эйброу, линки, фильтры, сортировка, инпуты */
  --ds-font-size-title: 18px; /* названия и описания компактных карточек, FAQ, подписи к изображениям, мелкие заголовки, «итого» */
  --ds-font-size-lead: 21px;  /* описания у заголовков и в крупных карточках, отзывы, читальные колонки, цены карточек, крупные CTA и ссылки футера */
  --ds-font-size-h3: 32px;    /* подзаголовки секций, панельные и карточные заголовки — фильтры, корзина, opt/mc/payment-cards, contacts (адаптивный) */
  --ds-font-size-h2: 42px;    /* заголовки секций (адаптивный) */
  --ds-font-size-h1: clamp(38px, 1.1rem + 2.7vw, 54px);    /* единые заголовки страниц: 38@768 → 54@1350, ниже 768 плавно к 38 (на ≤480 — свой тир 34px) */
  --ds-font-weight-medium: 500;    /* минимальный вес: базовый текст и дисплейные заголовки (пол весов 500+) */
  --ds-font-weight-semibold: 600;  /* UI-текст: кнопки, навигация, лейблы, даты-метки, заголовки контент-карточек, описания у заголовков */
  --ds-font-weight-bold: 700;      /* названия товарных карточек, цены, сильные акценты */
  --ds-line-height-tight: 1.05;
  --ds-line-height-heading: 1.1;
  --ds-line-height-body: 1.65;

  /* Layout and spacing */
  --ds-container-max: 1440px;
  --ds-container-reading: 760px;
  --ds-page-gutter: 60px;
  --ds-card-gap: 24px;
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 28px;
  --ds-space-8: 32px;
  --ds-space-9: 40px;
  --ds-space-10: 48px;
  --ds-space-12: 56px;
  --ds-space-14: 64px;
  --ds-section-space: clamp(48px, 3.5vw + 12px, 56px);
  --ds-section-space-top: var(--ds-section-space);
  --ds-section-space-bottom: var(--ds-section-space);
  /* Shape, elevation and interaction */
  --ds-radius-sm: 4px;
  --ds-radius-md: 8px;
  --ds-radius-image: 12px;
  --ds-radius-lg: 14px;
  --ds-radius-pill: 999px;
  --ds-shadow-card: 0 12px 28px rgba(20, 20, 20, 0.08);
  --ds-shadow-card-hover: 0 22px 44px rgba(20, 20, 20, 0.16);
  /* Reference shadow for reusable floating surfaces and new patterns, not a 1:1 copy of the homepage block. */
  --ds-shadow-floating: 0 20px 40px rgba(0, 0, 0, 0.25);
  --ds-transition-fast: 0.2s ease;
  --ds-transition-base: 0.25s ease;
}

/* Layout primitives */
/* Единый стандарт подчёркивания ссылок по дизайн-системе (топ-1% стандарт):
   дефолтное браузерное подчёркивание убрано, кастомная линия располагается
   строго ниже свисающих элементов букв (д, ц, щ, р, у, ф, з, g, j, p, q, y). */
a,
.text-button,
button.text-button {
  text-decoration-skip-ink: auto;
  text-underline-offset: max(3px, 0.14em);
}

.text-button,
button.text-button {
  text-decoration: underline;
  text-decoration-skip-ink: auto;
  text-underline-offset: max(2.5px, 0.14em);
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(114, 64, 30, 0.4);
  border: 0;
  background: none;
  cursor: pointer;
  display: inline-block;
  padding: 0;
  transition: color var(--ds-transition-fast), text-decoration-color var(--ds-transition-fast);
}

.text-button:hover,
button.text-button:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

.ds-container {
  width: 100%;
  max-width: var(--ds-container-max);
  margin-inline: auto;
}

.ds-container--reading {
  max-width: var(--ds-container-reading);
}

.ds-section {
  padding: var(--ds-section-space) var(--ds-page-gutter);
  /* Same opaque canvas as body and header prevents seams between light sections. */
  background-color: var(--ds-color-canvas);
  color: var(--ds-color-text);
}

.ds-section--dark {
  background-color: var(--ds-color-inverse);
  color: var(--ds-color-text-inverse);
}

.ds-page-hero {
  padding: 56px var(--ds-page-gutter) var(--ds-section-space);
  /* Page heroes continue the shared light canvas; decorative backgrounds stay local. */
  background-color: var(--ds-color-canvas);
  color: var(--ds-color-text);
}

.ds-page-hero__eyebrow {
  margin-bottom: var(--ds-space-5);
  color: var(--primary);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ds-page-hero__title,
.ds-section__title {
  margin: 0;
  font-family: var(--ds-font-display);
  font-size: var(--ds-font-size-h1);
  font-weight: var(--ds-font-weight-medium);
  line-height: var(--ds-line-height-heading);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  /* Длинные слова (напр. «Новокуйбышевска») переносятся, а не обрезаются краем экрана */
  overflow-wrap: break-word;
}

/* Описание рядом с заголовком страницы: роль «лид у заголовка» = lead/600
   (единая с-hero-лидами внутренних страниц, 2026-08-23). */
.ds-page-hero__lead {
  max-width: 620px;
  margin: var(--ds-space-6) 0 0;
  color: var(--ds-color-text-muted);
  font-size: var(--ds-font-size-lead);
  font-weight: var(--ds-font-weight-semibold);
  line-height: var(--ds-line-height-body);
}

/* Navigation: Хлебные крошки */
.ds-breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: -12px;
  margin-bottom: var(--ds-space-7);
  color: var(--ds-color-text-muted);
  font-size: var(--ds-font-size-md);
  line-height: 1.4;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ds-breadcrumbs > * {
  flex-shrink: 0;
}

.ds-breadcrumbs::-webkit-scrollbar {
  display: none;
}

/* Кликабельные ссылки в крошках: кастомное подчёркивание ниже букв */
.ds-breadcrumbs a {
  color: var(--color-brown);
  font-weight: var(--ds-font-weight-medium);
  text-decoration: none;
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(114, 64, 30, 0.3);
  cursor: pointer;
  transition: color var(--ds-transition-fast), border-color var(--ds-transition-fast);
}

.ds-breadcrumbs a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ds-breadcrumbs a:focus-visible {
  outline: 2px solid var(--ds-color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Разделители: приглушённый цвет стрелочки, не отвлекает от текста */
.ds-breadcrumbs span[aria-hidden="true"] {
  display: inline-block;
  color: rgba(114, 64, 30, 0.38);
  font-size: 0.9em;
  user-select: none;
  pointer-events: none;
  padding-inline: 2px;
}

/* Активный пункт (текущая страница): тёмный контрастный цвет, жирный шрифт, акцентная точка */
.ds-breadcrumbs [aria-current='page'],
.ds-breadcrumbs [aria-current="page"] {
  display: inline;
  color: var(--ds-color-text);
  font-weight: var(--ds-font-weight-bold);
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

.ds-breadcrumbs [aria-current='page']::before,
.ds-breadcrumbs [aria-current="page"]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  vertical-align: 2px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(198, 1, 0, 0.16);
  flex-shrink: 0;
}

.ds-breadcrumbs a[aria-current='page'],
.ds-breadcrumbs a[aria-current="page"] {
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}

/* Buttons */
.ds-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: var(--primary);
  color: var(--ds-color-text-inverse);
  cursor: pointer;
  font-family: var(--ds-font-body);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--ds-transition-base), color var(--ds-transition-base), border-color var(--ds-transition-base), transform 0.15s ease;
}

.ds-button:hover {
  background-color: var(--ds-color-brand);
  color: var(--ds-color-text-inverse);
  text-decoration: none;
}

.ds-button:active {
  transform: scale(0.97);
  text-decoration: none;
}

/* Кнопки и интерактивные кнопки-ссылки: запрет подчёркивания текста */
.ds-button,
.ds-button:hover,
.ds-button:focus,
.ds-button:active,
.ds-button:visited,
.bestsellers__button,
.bestsellers__button:hover,
.bestsellers__button:focus,
.bestsellers__button:active,
.bestsellers__button:visited,
.add-cart,
.add-cart:hover,
.add-cart:focus,
.add-cart:active,
.add-cart:visited,
.add_to_cart_button,
.add_to_cart_button:hover,
.add_to_cart_button:focus,
.add_to_cart_button:active,
.add_to_cart_button:visited,
.single_add_to_cart_button,
.single_add_to_cart_button:hover,
.single_add_to_cart_button:focus,
.single_add_to_cart_button:active,
.single_add_to_cart_button:visited,
.woocommerce a.button,
.woocommerce a.button:hover,
.woocommerce a.button:focus,
.woocommerce a.button:active,
.woocommerce a.button:visited,
.woocommerce button.button,
.woocommerce button.button:hover,
.woocommerce button.button:focus,
.woocommerce button.button:active,
.woocommerce button.button:visited,
.quick-filters a,
.quick-filters a:hover,
.quick-filters a:focus,
.quick-filters a:active,
.quick-filters a:visited,
.quick-filters button,
.mobile-filter-button,
.mobile-filter-button:hover,
.mobile-filter-button:focus,
.mobile-filter-button:active {
  text-decoration: none !important;
}

/* Вторичная кнопка — фирменная оранжевая градиентная обводка на прозрачном фоне.
   Обводка сделана псевдоэлементом-кольцом с маской, чтобы фон оставался прозрачным
   и сохранялись скруглённые углы. При наведении — заливка фирменным оранжевым градиентом. */
.ds-button--secondary {
  position: relative;
  padding-inline: 18px;
  border-color: transparent;
  background-color: transparent;
  color: var(--ds-color-text);
}

.ds-button--secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-cta);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}

.ds-button--secondary:hover {
  background-image: var(--gradient-cta);
  color: #fff;
}

.ds-button:disabled,
.ds-button[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* Forms */
.ds-field {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
}

.ds-label {
  color: var(--ds-color-text);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-medium);
  line-height: 1.4;
}

.ds-input,
.ds-textarea,
.ds-select {
  width: 100%;
  min-height: 52px;
  padding: 14px var(--ds-space-5);
  border: 1px solid var(--ds-color-border);
  border-radius: 12px;
  outline: none;
  background-color: rgba(255, 255, 255, 0.55);
  color: var(--ds-color-text);
  font-family: var(--ds-font-body);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-medium);
  line-height: 1.4;
  transition: border-color var(--ds-transition-base), background-color var(--ds-transition-base), box-shadow var(--ds-transition-base);
}

.ds-textarea {
  min-height: 128px;
  resize: vertical;
}

.ds-input::placeholder,
.ds-textarea::placeholder {
  color: rgba(35, 30, 19, 0.5);
}

.ds-input:hover,
.ds-textarea:hover,
.ds-select:hover {
  border-color: rgba(35, 30, 19, 0.45);
}

.ds-input:focus,
.ds-textarea:focus,
.ds-select:focus {
  border-color: var(--color-orange);
  background-color: var(--ds-color-surface);
  box-shadow: 0 0 0 3px var(--ds-color-focus);
}

/* Shared compact control for result toolbars. Kept separate from .ds-select so
 * filters and long forms retain their more spacious treatment. */
.ds-sort-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ds-space-2);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-color-text-muted);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-medium);
  white-space: nowrap;
}

.ds-sort-control .ds-select {
  width: auto;
  min-height: 32px;
  padding: 0 24px 0 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23231E13' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 4px center;
  background-repeat: no-repeat;
  box-shadow: none;
  color: var(--ds-color-text);
  font-size: var(--ds-font-size-md);
  font-weight: var(--ds-font-weight-semibold);
  text-align: right;
}
.ds-sort-control .ds-select:focus { border: 0; background-color: transparent; box-shadow: none; }

.ds-field--error .ds-input,
.ds-field--error .ds-textarea,
.ds-field--error .ds-select,
.ds-input.is-invalid,
.ds-textarea.is-invalid,
.ds-select.is-invalid,
input.is-invalid,
textarea.is-invalid {
  border-color: var(--ds-color-brand) !important;
  box-shadow: 0 0 0 3px rgba(198, 1, 0, 0.14) !important;
}

.ds-input.is-valid,
.ds-textarea.is-valid,
input.is-valid,
textarea.is-valid {
  border-color: rgba(46, 125, 50, 0.5);
}

.ds-input.is-valid:focus,
.ds-textarea.is-valid:focus,
input.is-valid:focus,
textarea.is-valid:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.16);
}

.wholesale__input.is-invalid {
  border-bottom-color: #ff6b6b !important;
  box-shadow: 0 1px 0 0 #ff6b6b !important;
}

input[type="checkbox"].is-invalid {
  outline: 2px solid var(--ds-color-brand, #c60100);
  outline-offset: 2px;
}

.ds-field__error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ds-color-brand, #c60100);
  margin-top: 6px;
  animation: ds-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-field__error svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.wholesale .ds-field__error {
  color: #ff9e9e;
}

.gift__form .ds-field__error {
  margin-top: -8px;
  margin-bottom: 12px;
}

.ds-field__message {
  color: var(--ds-color-brand);
  font-size: var(--ds-font-size-sm);
  font-weight: var(--ds-font-weight-semibold);
  line-height: 1.4;
}

@keyframes ds-field-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.ds-shake {
  animation: ds-field-shake 0.35s ease-in-out;
}

@keyframes ds-fade-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Keyboard accessibility for all new primitives. */
.ds-button:focus-visible,
.ds-breadcrumbs a:focus-visible {
  outline: 3px solid var(--ds-color-focus);
  outline-offset: 3px;
}

/* ── Страховки раскладки и доступности (базовый слой) ─────────────────
   Медиа не ломает контейнеры; фокус видим с клавиатуры везде,
   даже у элементов вне дизайн-системы (специфичные правила перекрывают). */
img, video { max-width: 100%; }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--ds-color-focus);
  outline-offset: 3px;
}

/* ── Адаптивная шкала — контракт v2, единый для CSS и JS сайта ──────
   НАПРАВЛЕНИЕ: desktop-first (@media max-width). Осознанный выбор;
   смена направления на mobile-first — отдельная миграция, не попутная правка.
   Шкала привязана к реальным устройствам, а не к круглым числам (2026-08-26).

   КАНОНИЧЕСКИЕ ГРАНИЦЫ (пары без дыр):
      ≥1200          полный десктоп          ←→  max-width: 1199px
      769–1199       компактный десктоп      ←→  max-width: 768px
                      (сетки сжимаются, 3 колонки → 2, сайдбары уже)
      481–768        планшет / большой телефон (компактный хедер, 2 колонки)
      ≤480           мобайл (одноколоночные layout'ы и донастройки).
                      480, а не 375: реальные телефоны — 360–430px
                      (iPhone 390/430, Android 360–412); нижняя граница
                      поддержки по ТЗ договора — 320px.

   ИМЕНОВАННЫЕ ИСКЛЮЧЕНИЯ (новые не заводить; каждое — со ссылкой на причину):
      max-width: 1440px — донастройки при сужении от ширины контейнера
                          (--ds-container-max): hero title, site-content-shell
      max-width: 1279px — переход сеток ниже 1280px: преимущества (.features__grid)
                          в 2 строки по 2 карточки (feedback 2026-09-03);
                          секция «Об авторе» (.about__grid) — карточка автора
                          на всю ширину, вертикальный слайдер отзывов под ней (feedback 2026-09-04);
                          страница «Об авторе»: .author-biography__intro в 1 колонку,
                          .author-biography__grid — 3 карточки в 1 колонку (feedback 2026-09-05)
      max-width: 1220px — шаг page-gutter 48→40px между полным и компактным десктопом
      max-width: 1080px — переключение sticky-сцены «Подборок» на карусель (index)
      max-width: 1024px — герой главной + tablet gutter/card gap для shell/header/footer;
                          лейбл автора главной (.hero__label): центрирование, звёздочка сверху по центру,
                          под ней центрированные строки имени и роли («Елена Велена» крупнее и жирнее, «Детский писатель» чуть крупнее),
                          тире скрыто (на десктопе от 1025px — звёздочка сверху по левой границе, feedback 2026-09-11);
                          футер (.footer__cols) — перестроение 4 → 1 колонку:
                          вся навигация одноколоночная, колонки друг под другом
                          по центру (feedback 2026-09-06);
                          секция художников (.artists__grid) и аудиосказки (.audio-grid) — 1 колонка (одна на строку) (feedback 2026-09-04, 2026-09-05);
                          герой страниц художников (.nenov-hero__grid, .pustovit-hero__grid, .duo-hero__grid) — 1 колонка (feedback 2026-09-05);
                           карточки (.book-reviews__grid, .book-grid, .blog-grid, .news__grid) — перестроение в 2 колонки (feedback 2026-09-04, 2026-09-05);
                           страница доставки: .payment-cards и итог калькулятора — 1 колонка (Issue #57, feedback 2026-09-06);
                           страница контактов: .contacts-pickup (карта самовывоза +
                           инфо-блок) — 1 центрированная колонка (feedback 2026-09-06);
                           страница опта и учреждений: полная перестройка всех секций
                           в 1 колонку с центрированием контента, включая форму
                           (.opt-hero__grid, .opt-conditions, .opt-cases, .opt-steps,
                           .wholesale__container) (Issue #59, feedback 2026-09-06);
                           страница дошкольных учреждений: аналогично опту — все секции
                           в 1 колонку с центрированием (.mc-hero__grid, .mc-conditions,
                           .mc-cards, .mc-steps, .wholesale__container) (Issue #60, feedback 2026-09-06);
                           страница входа: центрирование контента .login-layout (Issue #62, feedback 2026-09-06);
                           единый стандарт: с 1024px на ВСЕХ страницах центрируются
                           герои, заголовки секций, лиды и табы (ds-page-hero,
                           ds-section__title, bestsellers__tabs и стр.) (feedback 2026-09-06);
                           главная: с ≤1024 фото (hero, about-карточка, карточки
                           художников) — на всю ширину КОНТЕЙНЕРА (в пределах
                           паддингов подложки), декор графики «Подборок» скрыт,
                           предзаголовки с символами по центру (feedback 2026-09-06);
                           личный кабинет: .account-layout в 1 колонку, вкладки —
                           горизонтальная лента, контент по центру (.account-hero,
                           .account-panel, заказы, форма) (Issue #63, feedback 2026-09-06)
      max-width: 900px  — плотные страницы book (+ book.js share)
      max-width: 640px  — мобильная композиция шапки (header-menu.js),
                          уплотнение карточек и сервисной строки топбара

   САНКЦИОНИРОВАННЫЙ RANGE-СИНТАКСИС (исключение из правила 1):
      (min-width: 768.02px) and (max-width: 1024px) — точечные tablet-патчи
      отдельных сеток (news/blog…), чтобы не трогать ≤768. Не плодить:
      новая сетка сначала пытается жить на базовых токенах и clamp().

    ПРАВИЛА:
   1. Один синтаксис: @media (max-width: NNNpx) — пробел после двоеточия.
      Range-синтаксис (width<=Npx) запрещён до отдельного решения.
   2. JS (window.matchMedia) использует ТОЛЬКО значения этого реестра.
      Новое значение в JS без записи здесь = баг.
   3. Новый брейкпоинт заводится только с причиной в этом комментарии.
   4. Между тирами вёрстка должна доживать сама: clamp()/min()/max()/fr,
      фиксированные высоты запрещены.
   5. Проверка: npm run check:responsive (ширины покрывают ТЗ п. 2.6:
      320…1920), после любых правок вёрстки.                                */
/* Between full desktop and compact desktop reduce gutter to 40px */
@media (max-width: 1220px) {
  :root {
    --ds-page-gutter: 40px;
  }
}

@media (max-width: 1024px) {
  :root {
    --ds-page-gutter: 24px;
    --ds-card-gap: 16px;
    --ds-section-space: 44px;
    --ds-section-space-top: var(--ds-section-space);
    --ds-section-space-bottom: var(--ds-section-space);
  }

  /* Карточки с 1024px перестраиваются в 2 колонки (2 строчки для 4-карточных сеток) */
  .book-reviews__grid,
  .landing-detail .book-grid,
  .author-books__grid,
  .blog-grid,
  .news__grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  :root {
    --ds-section-space: 36px;
    --ds-section-space-top: var(--ds-section-space);
    --ds-section-space-bottom: var(--ds-section-space);
  }

  /* Кнопки в адаптиве компактнее: боковые паддинги как у вторичного варианта
     (18px), шрифт на шаг ниже окружающего текста (sm 15px при тексте 18px).
     Высота не меняется — её держит min-height: 48px, тач-таргет сохраняется. */
  .ds-button {
    padding-inline: 18px;
    font-size: var(--ds-font-size-sm);
  }

  .ds-page-hero {
    padding-top: var(--ds-space-9);
    padding-bottom: var(--ds-section-space);
  }

  /* Card grids: tablet = 2 columns (481–768px) across all card/grid families.
     Uses !important to reliably override local grid-template-columns set in page files.
     ИСКЛЮЧЕНИЯ:
     - .about__grid/.about__review-page не в списке — у секции «Об авторе»
       собственный адаптив (вертикальная карусель отзывов), центральное правило
       ломало её: отзывы сжимались до ~160px на 481–768.
     - .artists__grid не в списке — карточки художников перестраиваются
       друг под друга (1 колонка) с 1024px и вниз (Issue #26).
     - .audio-grid не в списке — карточки аудиосказок перестраиваются
       в 1 колонку с 1024px и вниз (feedback пользователя).
     - .blog-grid, .news__grid не в списке — карточки статей и новостей
       перестраиваются в 1 колонку с 768px и вниз (feedback 2026-09-05).
     - .contacts-grid не в списке — карточки контактов перестраиваются в 1
       колонку с 768px и вниз, блок карты: карта сверху, инфо-колонка под
       картой (feedback 2026-09-06).
     - .opt-cases, .opt-steps не в списке — страница опта перестраивается
       в 1 колонку с 1024px и вниз (Issue #59, feedback 2026-09-06).
     - .mc-cards, .mc-steps не в списке — страница дошкольных учреждений
       перестраивается в 1 колонку с 1024px и вниз (Issue #60, feedback 2026-09-06).
     - .news__track не в списке — у секции «Новости» на главной собственный
       адаптивный горизонтальный слайдер .js-carousel (Issue #27). */
  .book-grid, .landing-grid, .contacts-link-grid,
  .payment-cards, .delivery-contacts-grid,
  .author-facts__grid, .author-honours__grid,
  .author-biography__grid, .author-books__grid,
  .related-grid, .article-gallery__grid,
  .work-gallery, .profile-books,
  .book-reviews__grid, .book-related__grid, .duo-roles-split, .duo-stats,
  .features__grid,
  .stories-mobile__track, .new-books__carousel,
  .bestsellers__carousel, .author-gallery__track, .author-timeline__track,
  .filmstrip__track, .account-order__products {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Карточки статей, новостей и контактов с 768px перестраиваются в 1 колонку (одна под одной) */
  .blog-grid,
  .news__grid,
  .contacts-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  :root {
    --ds-page-gutter: 12px;
    --ds-card-gap: 12px;
    --ds-section-space: 24px;
    --ds-section-space-top: var(--ds-section-space);
    --ds-section-space-bottom: var(--ds-section-space);
  }

  .ds-page-hero {
    padding-top: var(--ds-space-7);
    padding-bottom: var(--ds-section-space);
  }

  .ds-page-hero__lead {
    font-size: var(--ds-font-size-title);
  }
}

@media (max-width: 480px) {
  :root {
    --ds-font-size-h1: 34px;
    --ds-font-size-h2: 34px;
    --ds-font-size-h3: 28px;
  }

  .ds-button {
    width: 100%;
  }

  
/* Единый стандарт центрирования (feedback 2026-09-06): с 1024px и ниже
   герои и заголовки секций, их лиды и подписи центрируются на всех страницах */
@media (max-width: 1024px) {
  .ds-page-hero { text-align: center; }
  .ds-page-hero__lead, .content-hero__lead { margin-inline: auto; }
  .ds-section__title { text-align: center; margin-inline: auto; }
}

/* Card grids: mobile = 1 column (≤480px) */
  .book-grid, .audio-grid, .landing-grid, .contacts-grid, .contacts-link-grid,
  .payment-cards, .delivery-contacts-grid, .mc-cards, .mc-steps, .opt-cases,
  .opt-steps, .author-facts__grid, .author-honours__grid,
  .author-biography__grid, .author-books__grid,
  .blog-grid, .news__grid, .related-grid, .article-gallery__grid,
  .work-gallery, .profile-books,
  .book-reviews__grid, .book-related__grid, .duo-roles-split, .duo-stats,
  .artists__grid, .features__grid,
  .stories-mobile__track, .new-books__carousel,
  .bestsellers__carousel, .author-gallery__track, .author-timeline__track,
  .filmstrip__track, .account-order__products {
    /* Исключения .about__* — см. комментарий в правиле 481–768px выше. */
    grid-template-columns: 1fr !important;
  }

  /* Глобальный мобильный стандарт (≤480px): центрирование шапок страниц и секций */
  .ds-page-hero,
  .content-hero,
  .audio-hero,
  .delivery-hero,
  .opt-hero,
  .mc-hero,
  .commerce-hero,
  .account-hero,
  .search-page-hero,
  .catalog-hero,
  .content-section-head,
  .opt-section-head,
  .mc-section-head,
  .delivery-heading,
  .delivery-payment-intro {
    text-align: center;
  }

  .ds-page-hero__title,
  .ds-page-hero__eyebrow,
  .ds-page-hero__lead,
  .ds-section__title,
  .ds-section-label,
  .author-section-label,
  .content-label,
  .content-hero h1,
  .content-hero__eyebrow,
  .content-hero__lead,
  .audio-hero h1,
  .audio-hero__eyebrow,
  .audio-hero__lead,
  .catalog-hero h1,
  .catalog-hero__eyebrow,
  .catalog-hero__lead,
  .opt-kicker,
  .mc-kicker,
  .delivery-heading__eyebrow,
  .contacts-card__eyebrow,
  .payment-intro__note {
    text-align: center;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-button,
  .ds-input,
  .ds-textarea,
  .ds-select {
    transition: none;
  }
}

/* Адаптивные боковые поля для всех общих оболочек страниц. Оставляем
   внутренние паддинги самих карточек и контролов без изменений. */
@media (max-width: 1024px) {
  .content-hero,
  .catalog-hero,
  .audio-hero,
  .landing-hero,
  .commerce-hero,
  .account-hero,
  .login-section,
  .book-product,
  .site-content-shell,
  .stories-mobile,
  .topbar,
  .footer,
  .hero,
  .author,
  .new-books,
  .bestsellers,
  .gift,
  .features,
  .artists,
  .news,
  .book-type {
    /* .wholesale и .header в списке нет: плавающие карточки с фоном и скруглением
       держат собственный симметричный padding, а не gutter — см. styles.css. */
    padding-left: var(--ds-page-gutter) !important;
    padding-right: var(--ds-page-gutter) !important;
  }
}

/* Единый ритм карточных сеток и карточных лент. */
@media (max-width: 1024px) {
  .book-grid, .audio-grid, .landing-grid, .contacts-grid, .contacts-link-grid,
  .payment-cards, .delivery-contacts-grid, .mc-cards, .mc-steps, .opt-cases,
  .opt-steps, .author-facts__grid, .author-honours__grid,
  .author-biography__grid, .author-books__grid,
  .blog-grid, .news__grid, .related-grid, .article-gallery__grid,
  .work-gallery, .profile-books,
  .book-reviews__grid, .book-related__grid, .duo-roles-split, .duo-stats,
  .features__grid,
  .stories-mobile__track, .new-books__carousel, .news__track,
  .bestsellers__carousel, .author-gallery__track, .author-timeline__track,
  .filmstrip__track, .account-order__products {
    gap: var(--ds-card-gap) !important;
  }
}

/* Балансировка заголовков и аккуратные переносы текста по дизайн-системе (см. AGENTS.md) */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p, li, blockquote {
  text-wrap: pretty;
}

/* Глобальная страховка скрытия технических скроллбаров (см. AGENTS.md) */
.js-carousel__track,
.bestsellers__carousel,
.new-books__carousel,
.news__track,
.stories-mobile__track,
.author-gallery__track,
.author-timeline__track,
.filmstrip__track,
.account-order__products,
.delivery-table-wrap,
.header__dropdown,
.header__dropdown--catalog,
.filter-drawer__panel,
.account-nav {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}

.js-carousel__track::-webkit-scrollbar,
.bestsellers__carousel::-webkit-scrollbar,
.new-books__carousel::-webkit-scrollbar,
.news__track::-webkit-scrollbar,
.stories-mobile__track::-webkit-scrollbar,
.author-gallery__track::-webkit-scrollbar,
.author-timeline__track::-webkit-scrollbar,
.filmstrip__track::-webkit-scrollbar,
.account-order__products::-webkit-scrollbar,
.delivery-table-wrap::-webkit-scrollbar,
.header__dropdown::-webkit-scrollbar,
.header__dropdown--catalog::-webkit-scrollbar,
.filter-drawer__panel::-webkit-scrollbar,
.account-nav::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* WordPress Screen Reader Text Accessibility Utility */
.screen-reader-text {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: #ffffff;
  border-radius: 4px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.4);
  clip: auto !important;
  clip-path: none !important;
  color: var(--ds-color-text, #231e13);
  display: block !important;
  font-size: 0.875rem;
  font-weight: 600;
  height: auto !important;
  left: 8px !important;
  line-height: normal;
  padding: 12px 18px !important;
  text-decoration: none;
  top: 8px !important;
  width: auto !important;
  z-index: 100000 !important;
}

/* ==========================================================================
   Пагинация в стиле сайта (WordPress & WooCommerce)
   ========================================================================== */
.pagination,
.navigation.pagination,
.woocommerce-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: clamp(40px, 5vw, 64px);
  margin-bottom: 24px;
  clear: both;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.pagination .nav-links,
.woocommerce-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.woocommerce-pagination ul.page-numbers li {
  margin: 0;
  padding: 0;
  list-style: none;
  background: transparent;
}

.page-numbers,
.pagination .page-numbers,
.woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--color-text, #231e13);
  font-family: var(--font-body, inherit);
  font-size: var(--ds-font-size-title, 20px);
  font-weight: var(--ds-font-weight-semibold, 600);
  text-decoration: none;
  line-height: 1;
  box-sizing: border-box;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.page-numbers:hover,
a.page-numbers:hover,
.pagination a.page-numbers:hover,
.woocommerce-pagination a.page-numbers:hover {
  background: transparent;
  border-color: rgba(114, 64, 30, 0.25);
  color: var(--color-brown, #72401e);
  transform: none;
  box-shadow: none;
  text-decoration: none;
}

.page-numbers.current,
span.page-numbers.current,
.pagination span.page-numbers.current,
.woocommerce-pagination .page-numbers.current {
  background: transparent;
  border-color: var(--color-brown, #72401e);
  color: var(--color-brown, #72401e);
  font-weight: var(--ds-font-weight-bold, 700);
  cursor: default;
  transform: none;
  box-shadow: none;
}

.page-numbers.dots,
span.page-numbers.dots {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  cursor: default;
  color: var(--ds-color-text-muted, #72401e);
  min-width: 28px;
  padding: 0 4px;
}

.page-numbers.prev,
.page-numbers.next,
.pagination .prev,
.pagination .next {
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  font-size: 22px;
  font-weight: var(--ds-font-weight-semibold, 600);
  border-radius: 50%;
}

.page-numbers.prev:hover,
.page-numbers.next:hover,
.pagination .prev:hover,
.pagination .next:hover {
  background: transparent;
  border-color: rgba(114, 64, 30, 0.25);
  color: var(--primary, #c60100);
  transform: none;
  box-shadow: none;
}

/* Единая гарнитура для всех кнопок, селектов, инпутов и текстовых полей */
button,
input,
optgroup,
select,
textarea {
  font-family: var(--font-body, 'Cormorant Infant', serif);
}


