/* tshop_3 — ядро дизайн-системы.
 *
 * Слои (порядок объявлен inline в <head>): panel, reset, tokens, base, ui, layout, parts, modules, utilities.
 * panel — стили панели конструктора (bootstrap и др.), подключаются через @import … layer(panel) и уступают всему.
 * Стили дизайнера стилей (<style id="iww__theme">) — вне слоёв и потому перекрывают всё это.
 *
 * Стиль = пресет токенов (html[data-style]): bento (по умолчанию), quiet, editorial.
 * Схема — html[data-scheme]: light | dark. Бренд --brand/--brand-ink приходят из Templater::getThemeTokens.
 * Дизайнер стилей «для всего сайта» правит токены на body: --radius-*, --font-*, --section-gap, --bg и т. д.
 */

/* ───────────────────────── reset ───────────────────────── */
/* Интерфейс панели конструктора (левая панель и верхняя полоса iww_panel_____*, плашки кнопок над элементами
   .iww_____element-buttons-container, окна tingle, CKEditor) живёт в слое panel и не должен получать сброс сайта.
   Исключение — :not(:where(<корни панели>, <корни панели> *)) с нулевой специфичностью.
   ВАЖНО: панель вешает класс iww_____element-container на сами редактируемые блоки/шапку/меню — это контент сайта,
   его исключать нельзя; body.iww_panel_____visible корнем панели тоже не считается. */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  *:not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; hanging-punctuation: first last; }
  body { min-height: 100dvh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  :is(img, picture, svg, video, canvas):not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { display: block; max-width: 100%; }
  :is(img, video):not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { height: auto; }
  :is(input, button, select, textarea):not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { font: inherit; color: inherit; }
  button:not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { background: none; border: 0; padding: 0; cursor: pointer; }
  a:not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { color: inherit; text-decoration: none; }
  :is(ul[class], ol[class]):not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { list-style: none; padding: 0; }
  h1, h2, h3, h4, h5, h6 { text-wrap: balance; overflow-wrap: break-word; }
  p, li { text-wrap: pretty; }
  dialog { padding: 0; border: 0; max-width: none; max-height: none; color: inherit; background: none; }
  dialog:not([open]) { display: none !important; }
  [hidden] { display: none !important; }
  address { font-style: normal; }
  summary { cursor: pointer; }
  summary::-webkit-details-marker { display: none; }
}

/* ───────────────────────── tokens ───────────────────────── */
@layer tokens {
  :root {
    --brand: #2f5bea;
    --brand-ink: #fff;
    --brand-hover: color-mix(in oklch, var(--brand) 84%, black);
    --brand-soft: color-mix(in oklch, var(--brand) 10%, var(--surface));
    --brand-soft-2: color-mix(in oklch, var(--brand) 18%, var(--surface));
    --brand-text: color-mix(in oklch, var(--brand) 82%, var(--text));

    --container: 1344px;
    --gutter: clamp(16px, 3.2vw, 40px);
    --section-gap: clamp(48px, 7vw, 112px);

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 112px;

    --fs-xs: .75rem; --fs-s: .875rem; --fs-m: 1rem; --fs-l: 1.125rem;
    --fs-xl: clamp(1.25rem, 1.05rem + .8vw, 1.625rem);
    --fs-2xl: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
    --fs-3xl: clamp(2.375rem, 1.3rem + 4.6vw, 5.25rem);

    --ease: cubic-bezier(.2, .7, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur: .22s;
    --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand);

    --header-h: 72px;
    --tabbar-h: 0px;

    --success: #12a150; --danger: #d92d20; --warning: #c77a00;

    color-scheme: light;
  }

  /* ── «Бенто»: мягкий объём, острова, крупные скругления (по умолчанию) ── */
  :root, [data-style="bento"] {
    --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
    --display-weight: 650; --display-tracking: -.04em; --display-leading: 1.02;
    --label-transform: none; --label-tracking: 0; --label-weight: 600;
    --radius-s: 10px; --radius-m: 18px; --radius-l: 28px; --radius-btn: 999px; --radius-pill: 999px;
    --line-w: 1px;
    --shadow-1: 0 1px 2px rgb(16 24 40 / .04), 0 6px 20px -6px rgb(16 24 40 / .10);
    --shadow-pop: 0 2px 4px rgb(16 24 40 / .05), 0 28px 60px -20px rgb(16 24 40 / .28);
    --bg: #eef1f6; --surface: #ffffff; --surface-2: #e5e9f1; --line: #dde2eb; --line-strong: #c9d0dc;
    --text: #0e1626; --text-2: #5a6478; --text-3: #8c95a8;
    --header-bg: color-mix(in srgb, var(--surface) 72%, transparent);
  }
  [data-style="bento"][data-scheme="dark"] {
    --bg: #0b0f17; --surface: #131a26; --surface-2: #1a2231; --line: #222b3b; --line-strong: #2f3a4e;
    --text: #eef2f8; --text-2: #9aa5b8; --text-3: #6c778b;
    --header-bg: color-mix(in srgb, var(--surface) 70%, transparent);
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -8px rgb(0 0 0 / .5);
  }

  /* ── «Тишина»: нео-швейцарский минимализм, тёплый нейтральный ── */
  [data-style="quiet"] {
    --font-body: "Golos Text", system-ui, sans-serif;
    --font-display: "Golos Text", system-ui, sans-serif;
    --display-weight: 500; --display-tracking: -.035em; --display-leading: 1.04;
    --label-transform: none; --label-tracking: 0; --label-weight: 500;
    --radius-s: 4px; --radius-m: 8px; --radius-l: 14px; --radius-btn: 8px; --radius-pill: 8px;
    --line-w: 1px;
    --shadow-1: none;
    --shadow-pop: 0 1px 0 var(--line), 0 24px 48px -24px rgb(30 25 15 / .22);
    --bg: #f6f4ef; --surface: #fffefb; --surface-2: #eeebe4; --line: #e2ddd2; --line-strong: #cfc8ba;
    --text: #1c1a16; --text-2: #6e695f; --text-3: #9b9588;
    --header-bg: color-mix(in srgb, var(--bg) 86%, transparent);
  }
  [data-style="quiet"][data-scheme="dark"] {
    --bg: #141310; --surface: #1b1a16; --surface-2: #24221d; --line: #2f2c26; --line-strong: #3f3b33;
    --text: #f1ede4; --text-2: #a8a193; --text-3: #7b7568;
  }

  /* ── «Манифест»: редакционный, крупная типографика, жёсткая сетка ── */
  [data-style="editorial"] {
    --font-body: "Onest", system-ui, sans-serif;
    --font-display: "Unbounded", "Onest", system-ui, sans-serif;
    --display-weight: 600; --display-tracking: -.03em; --display-leading: 1.06;
    --label-transform: uppercase; --label-tracking: .08em; --label-weight: 600;
    --radius-s: 0px; --radius-m: 0px; --radius-l: 0px; --radius-btn: 0px; --radius-pill: 0px;
    --line-w: 1.5px;
    --shadow-1: none;
    --shadow-pop: 6px 6px 0 var(--text);
    --bg: #fbfaf7; --surface: #ffffff; --surface-2: #f0eee8; --line: #111111; --line-strong: #111111;
    --text: #0d0d0d; --text-2: #4d4d4d; --text-3: #7a7a7a;
    --header-bg: var(--bg);
  }
  [data-style="editorial"][data-scheme="dark"] {
    --bg: #0c0c0c; --surface: #121212; --surface-2: #1b1b1b; --line: #f2f2f2; --line-strong: #f2f2f2;
    --text: #f4f4f1; --text-2: #b4b4ae; --text-3: #85857f;
  }

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

/* ───────────────────────── base ───────────────────────── */
@layer base {
  html { scroll-padding-top: calc(var(--header-h) + 16px); }
  body {
    font-family: var(--font-body);
    font-size: var(--fs-m);
    color: var(--text);
    background: var(--bg);
    padding-bottom: var(--tabbar-h);
    overflow-x: clip;
  }
  :focus-visible:not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-s); }
  ::selection { background: var(--brand); color: var(--brand-ink); }

  h1, h2, h3, h4, h5, h6 { line-height: 1.15; font-weight: 700; }
  .display {
    font-family: var(--font-display); font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking); line-height: var(--display-leading);
  }
  .label {
    display: inline-block;
    font-size: var(--fs-xs); font-weight: var(--label-weight);
    text-transform: var(--label-transform); letter-spacing: var(--label-tracking);
    color: var(--text-2);
  }

  /* типографика пользовательского текста (WYSIWYG-поля модулей) */
  .prose { max-width: 72ch; color: var(--text); }
  .prose > * + * { margin-top: 1em; }
  .prose h2 { font-size: var(--fs-xl); margin-top: 1.6em; }
  .prose h3 { font-size: var(--fs-l); margin-top: 1.4em; }
  .prose a { color: var(--brand-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
  .prose a:hover { text-decoration-thickness: 2px; }
  .prose ul, .prose ol { padding-left: 1.3em; }
  .prose li + li { margin-top: .4em; }
  .prose img { border-radius: var(--radius-m); }
  .prose blockquote { padding-left: var(--s-5); border-left: 3px solid var(--brand); color: var(--text-2); }
  .prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
  .prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  }
}

/* ───────────────────────── ui ───────────────────────── */
@layer ui {
  .i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
  .i--s { width: 16px; height: 16px; }
  .i--l { width: 24px; height: 24px; }

  .btn:not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) {
    --_bg: var(--brand); --_fg: var(--brand-ink); --_bd: var(--brand);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: 44px; padding: 0 var(--s-5);
    font-weight: 600; font-size: var(--fs-s); line-height: 1.2; white-space: nowrap; text-align: center; text-decoration: none;
    color: var(--_fg); background: var(--_bg); border: var(--line-w) solid var(--_bd);
    border-radius: var(--radius-btn);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  }
  .btn:hover { --_bg: var(--brand-hover); --_bd: var(--brand-hover); }
  .btn:active { transform: translateY(1px); }
  .btn--ghost { --_bg: transparent; --_fg: var(--text); --_bd: var(--line-strong); }
  .btn--ghost:hover { --_bg: var(--surface-2); --_bd: var(--line-strong); }
  .btn--soft { --_bg: var(--brand-soft); --_fg: var(--brand-text); --_bd: transparent; }
  .btn--soft:hover { --_bg: var(--brand-soft-2); --_bd: transparent; }
  .btn--invert { --_bg: var(--bg); --_fg: var(--text); --_bd: var(--bg); }
  .btn--invert:hover { --_bg: color-mix(in srgb, var(--bg) 88%, var(--text)); --_bd: transparent; }
  .btn--lg { min-height: 56px; padding: 0 var(--s-6); font-size: var(--fs-m); }
  .btn--sm { min-height: 36px; padding: 0 var(--s-4); }
  .btn--block { width: 100%; }

  /* совместимость с контентом tshop_2 (визуальный редактор, старые блоки): */
  /* btn-transparent — контурная в цвет бренда, --active и наведение — залитая */
  .btn-transparent { --_bg: transparent; --_fg: var(--brand-text); --_bd: var(--brand); }
  .btn-transparent:hover, .btn-transparent--active { --_bg: var(--brand); --_fg: var(--brand-ink); --_bd: var(--brand); }
  .btn-white { --_bg: var(--surface); --_fg: var(--text); --_bd: var(--surface); }
  .btn-white:hover { --_bg: var(--surface-2); --_bd: var(--surface-2); }
  .btn-fill { --_bg: var(--brand); --_fg: var(--brand-ink); --_bd: var(--brand); }
  .btn-sm { min-height: 36px; padding: 0 var(--s-4); }
  [data-style="editorial"] .btn { text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-xs); }
  [data-style="editorial"] .btn:hover { box-shadow: 4px 4px 0 var(--text); transform: translate(-2px, -2px); }

  .icon-btn {
    position: relative; display: inline-grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: var(--radius-pill); color: var(--text);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .icon-btn:hover { background: var(--surface-2); }

  /* плитка иконки элемента (Tshop3::itemMedia): SVG из библиотеки иконок / свой SVG — в цвет темы,
     явные fill/stroke внутри иконки перекрашиваются (CSS сильнее атрибутов SVG); картинка — как есть.
     Ручки: --ico-size (плитка), --ico-bg, --ico-color, --ico-radius */
  .t3-ico {
    --_s: var(--ico-size, 56px);
    display: grid; place-items: center; flex: none; width: var(--_s); height: var(--_s);
    border-radius: var(--ico-radius, var(--radius-m));
    background: var(--ico-bg, var(--brand-soft)); color: var(--ico-color, var(--brand-text));
    overflow: hidden;
  }
  .t3-ico svg { width: calc(var(--_s) * .5); height: calc(var(--_s) * .5); display: block; overflow: visible; }
  /* иконки спрайта (.i) — контурные, их не заливаем */
  .t3-ico svg:not(.i):not([fill]) { fill: currentColor; }
  .t3-ico svg:not(.i) [fill]:not([fill="none"]) { fill: currentColor; }
  .t3-ico svg:not(.i) [stroke]:not([stroke="none"]) { stroke: currentColor; }
  .t3-ico--img { background: none; border-radius: 0; overflow: visible; }
  .t3-ico--img img { width: 100%; height: 100%; object-fit: contain; }
  [data-style="editorial"] .t3-ico:not(.t3-ico--img) { background: none; border: var(--line-w) solid currentColor; color: var(--ico-color, var(--text)); }

  /* ссылка на всю карточку: последний ребёнок элемента с position: relative; текст ссылки — для чтения с экрана */
  .t3-cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
  .t3-cover:focus-visible { outline-offset: -2px; }
  /* просмотр фото на весь экран (T3.zoom в core.js: галерея товара, фото статьи) */
  .t3-zoom { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; background: var(--bg); color: var(--text); }
  .t3-zoom::backdrop { background: var(--bg); }
  .t3-zoom__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .t3-zoom__track::-webkit-scrollbar { display: none; }
  .t3-zoom__slide { flex: 0 0 100%; display: grid; place-items: center; padding: 56px var(--gutter); scroll-snap-align: start; }
  .t3-zoom__slide img { max-width: 100%; max-height: 100%; object-fit: contain; }
  .t3-zoom__close, .t3-zoom__nav { position: absolute; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-1); color: var(--text); }
  .t3-zoom__close { top: var(--s-4); right: var(--s-4); }
  .t3-zoom__nav { top: 50%; translate: 0 -50%; }
  .t3-zoom__nav--prev { left: var(--s-4); }
  .t3-zoom__nav--next { right: var(--s-4); }
  .t3-zoom__count { position: absolute; top: var(--s-4); left: 50%; translate: -50% 0; font-size: var(--fs-s); color: var(--text-2); font-variant-numeric: tabular-nums; }
  @media (hover: none) { .t3-zoom__nav { display: none; } }
  .badge:not(:where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container) *, :where(:not(body):is([class*="iww_panel_____"], .iww_____element-buttons-container), .tingle-modal, .widget-settings-overlay, .cke, .cke_dialog_container)) {
    position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 999px;
    font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
    background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 2px var(--bg);
  }
  [data-style="editorial"] .badge { border-radius: 0; }
  .badge.is-bump { animation: badge-bump .4s var(--ease-out); }
  @keyframes badge-bump { 40% { transform: scale(1.35); } }

  .link-u { background: linear-gradient(currentColor 0 0) 0 100% / 0 1px no-repeat; transition: background-size var(--dur) var(--ease); }
  .link-u:hover { background-size: 100% 1px; }

  kbd {
    font: 600 11px/1 var(--font-body); padding: 4px 6px; border-radius: 6px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-3);
  }
  [data-style="editorial"] kbd { border-radius: 0; }

  .chip {
    display: inline-flex; align-items: center; gap: var(--s-2); min-height: 36px; padding: 0 var(--s-4);
    border-radius: var(--radius-pill); border: var(--line-w) solid var(--line); background: var(--surface);
    font-size: var(--fs-s); font-weight: 500; white-space: nowrap;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .chip:hover { border-color: var(--text); }
  .chip--accent, .chip[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

  /* лента чипов с горизонтальной прокруткой (подкатегории, теги) */
  .t3-chips { margin-bottom: var(--s-4); }
  .t3-chips ul { list-style: none; padding: 2px 0; margin: 0; display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .t3-chips ul::-webkit-scrollbar { display: none; }
  .t3-chips li { flex: none; }

  /* селект: родной <select> (на телефоне — системный выбор), стрелка своя */
  .t3-select { position: relative; display: inline-grid; align-items: center; }
  .t3-select select {
    appearance: none; min-height: 40px; padding: 0 36px 0 var(--s-4); border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-s); font-weight: 500; cursor: pointer;
  }
  [data-style="editorial"] .t3-select select { border-radius: 0; }
  .t3-select select:hover { border-color: var(--text); }
  .t3-select .i { position: absolute; right: 12px; pointer-events: none; color: var(--text-2); }

  /* переключатель: <input type=checkbox role=switch> + дорожка */
  .t3-switch { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-s); cursor: pointer; user-select: none; }
  .t3-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .t3-switch__track { position: relative; width: 36px; height: 22px; flex: none; border-radius: 999px; background: var(--line-strong); transition: background-color var(--dur) var(--ease); }
  .t3-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform var(--dur) var(--ease); }
  .t3-switch input:checked + .t3-switch__track { background: var(--brand); }
  .t3-switch input:checked + .t3-switch__track::after { transform: translateX(14px); }
  .t3-switch input:focus-visible + .t3-switch__track { box-shadow: var(--focus-ring); }

  /* сегментный переключатель (вид списка) */
  .t3-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-pill); background: var(--surface-2); }
  .t3-seg__btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-pill); color: var(--text-3); }
  .t3-seg__btn:hover { color: var(--text); }
  .t3-seg__btn[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
  [data-style="editorial"] :is(.t3-seg, .t3-seg__btn) { border-radius: 0; }

  /* всплывающее окно (Popover API): по центру экрана, на телефоне — снизу */
  .t3-popover:popover-open {
    margin: auto; max-width: min(360px, calc(100vw - 32px)); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-l);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), 0 24px 48px rgb(0 0 0 / .16); font-size: var(--fs-s);
  }
  .t3-popover::backdrop { background: rgb(0 0 0 / .2); }

  /* пустое состояние списка */
  .t3-empty { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-8) var(--s-4); text-align: center; border-radius: var(--radius-l); background: var(--surface-2); color: var(--text-2); }
  .t3-empty .i { width: 40px; height: 40px; color: var(--text-3); }

  /* ── карусель (core.js, [data-t3-car]): нативная прокрутка со snap, слайдов на экране — --car-per ──
     Ручки на корне блока: --car-per (слайдов на широком экране), --car-gap. На телефоне виден край
     следующего слайда — понятно, что ленту можно листать. */
  /* --car-per / --car-gap не задаются на самой .t3-car — иначе перекрыли бы значения с корня блока (дизайнер стилей) */
  .t3-car { container: car / inline-size; position: relative; }
  .t3-car__track {
    display: flex; gap: var(--car-gap, var(--s-4)); margin: 0; padding: 4px 0 var(--s-2); list-style: none;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    scroll-padding-inline: 0;
  }
  .t3-car__track::-webkit-scrollbar { display: none; }
  .t3-car__track > * { flex: 0 0 86%; min-width: 0; scroll-snap-align: start; }
  @container car (min-width: 560px) { .t3-car__track > * { flex-basis: calc((100% - var(--car-gap, var(--s-4))) / 2); } }
  @container car (min-width: 900px) {
    .t3-car__track > * { flex-basis: calc((100% - (var(--car-per, 3) - 1) * var(--car-gap, var(--s-4))) / var(--car-per, 3)); }
  }
  .t3-car__nav { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-3); }
  [data-t3-car-static] .t3-car__nav { display: none; }
  .t3-car__btn {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-pill);
    border: var(--line-w) solid var(--line-strong); background: var(--surface); color: var(--text);
    transition: background-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
  }
  .t3-car__btn:hover:not(:disabled) { background: var(--surface-2); }
  .t3-car__btn:disabled { opacity: .35; cursor: default; }
  .t3-car__dots { display: flex; gap: 6px; margin-right: auto; }
  /* точка 8px, область нажатия 24px (WCAG 2.5.8) */
  .t3-car__dot { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0; background: none; }
  .t3-car__dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--line-strong); transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease); }
  .t3-car__dot[aria-current]::before { width: 22px; background: var(--brand); }
  [data-style="editorial"] .t3-car__btn, [data-style="editorial"] .t3-car__dot::before { border-radius: 0; }

  /* кнопка/ссылка открытия фото на весь экран (core.js, [data-t3-zoom]) */
  [data-t3-zoom] { cursor: zoom-in; }
  .t3-empty__title { font-size: var(--fs-l); font-weight: 600; color: var(--text); }

  .social { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; }
  .social a {
    display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: var(--radius-pill);
    background: var(--surface-2); font-size: 11px; font-weight: 700; letter-spacing: .02em;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .social a:hover { background: var(--brand); color: var(--brand-ink); }
  [data-style="editorial"] .social a { border: var(--line-w) solid var(--line); background: transparent; }

  .logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
  .logo__img { height: var(--logo-h, 40px); width: auto; max-width: 220px; object-fit: contain; }
  .logo__mark {
    width: 38px; height: 38px; flex: none; display: grid; place-items: center;
    border-radius: var(--radius-m); background: var(--brand); color: var(--brand-ink);
    font: 700 16px/1 var(--font-display);
  }
  .logo__name { font-family: var(--font-display); font-size: 17px; overflow: hidden; text-overflow: ellipsis; }
  .logo__name small, .logo__slogan { display: block; font: 500 11px/1.3 var(--font-body); letter-spacing: 0; color: var(--text-2); }
  .logo__slogan { max-width: 22ch; }

  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .skip-link {
    position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 16px;
    background: var(--text); color: var(--bg); border-radius: var(--radius-m);
    transform: translateY(-160%); transition: transform var(--dur) var(--ease);
  }
  .skip-link:focus-visible { transform: none; }

  /* ── диалоги: модальные окна, выдвижное меню, палитра поиска ── */
  dialog::backdrop { background: rgb(10 12 18 / .44); backdrop-filter: blur(4px); }
  dialog[open] { animation: dlg-in .32s var(--ease-out); }
  @keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

  /* .t3-modal — окно по ссылке (core.js создаёт и удаляет), .t3-dialog — окно, встроенное в разметку модуля */
  .t3-modal, .t3-dialog {
    margin: auto; width: min(var(--_w, 720px), calc(100vw - 24px)); max-height: calc(100dvh - 32px);
    background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-pop);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .t3-dialog:not([open]) { display: none; } /* display:flex выше перебил бы скрытие закрытого <dialog> */
  :is(.t3-modal, .t3-dialog)[data-size="s"] { --_w: 460px; }
  :is(.t3-modal, .t3-dialog)[data-size="m"] { --_w: 720px; }
  :is(.t3-modal, .t3-dialog)[data-size="l"] { --_w: 1040px; }
  [data-style="editorial"] :is(.t3-modal, .t3-dialog) { border: var(--line-w) solid var(--line); }
  .t3-modal__close { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--surface); }
  .t3-modal__body { overflow: auto; padding: var(--s-6); overscroll-behavior: contain; }
  .t3-modal__body.is-loading { min-height: 200px; display: grid; place-items: center; }
  .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(1turn); } }

  .drawer {
    position: fixed; inset: 0 auto 0 0; height: 100dvh; width: min(420px, 92vw);
    background: var(--surface); border-radius: 0 var(--radius-l) var(--radius-l) 0;
    display: flex; flex-direction: column; overscroll-behavior: contain;
  }
  .drawer[open] { animation: drawer-in .38s var(--ease-out); }
  @keyframes drawer-in { from { transform: translateX(-100%); } }
  .drawer__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
  .drawer__body { flex: 1; overflow: auto; padding: var(--s-2) var(--s-5) var(--s-6); }
  .drawer__meta { display: flex; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
  .drawer__foot { padding: var(--s-4) var(--s-5) max(var(--s-4), env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: var(--s-3); }
  .drawer__phone { font-weight: 700; font-size: var(--fs-l); font-variant-numeric: tabular-nums; }

  .acc { border-bottom: 1px solid var(--line); }
  .acc > summary, .acc > a { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 52px; font-weight: 600; list-style: none; }
  .acc > summary .i { transition: transform var(--dur) var(--ease); }
  .acc[open] > summary .i { transform: rotate(180deg); }
  .acc ul { list-style: none; padding: 0 0 var(--s-4); display: grid; gap: 2px; }
  .acc ul a { display: block; padding: 8px 0; color: var(--text-2); }
  .acc ul a:hover, .acc ul a[aria-current] { color: var(--text); }
  .acc__all { color: var(--brand-text) !important; font-weight: 600; }
  .acc--nested { border: 0; }
  .acc--nested > summary { min-height: 40px; font-weight: 500; color: var(--text-2); }
  .acc--nested[open] > summary { color: var(--text); }
  .acc--nested ul { padding: 0 0 var(--s-2) var(--s-4); border-left: 1px solid var(--line); }

  /* ── меню личного кабинета (parts/_account_menu): общее для шапки, мобильного меню и колонки кабинета ── */
  .t3-avatar {
    display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
    background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: var(--fs-s); letter-spacing: .02em;
  }
  .t3-avatar--s { width: 32px; height: 32px; font-size: 12px; }
  [data-style="editorial"] .t3-avatar { border-radius: 0; }
  .t3-accmenu { display: grid; gap: var(--s-2); }
  .t3-accmenu__user { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
  .t3-accmenu__who { display: grid; min-width: 0; line-height: 1.3; }
  .t3-accmenu__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t3-accmenu__email { font-size: var(--fs-xs); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t3-accmenu__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .t3-accmenu__link {
    display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-3);
    border-radius: var(--radius-s); color: var(--text); font: inherit; font-weight: 500; text-align: left; background: none;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .t3-accmenu__link .i { color: var(--text-3); transition: color var(--dur) var(--ease); }
  .t3-accmenu__link:hover { background: var(--surface-2); }
  .t3-accmenu__link:hover .i { color: var(--text); }
  .t3-accmenu__link[aria-current] { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
  .t3-accmenu__link[aria-current] .i { color: currentColor; }
  .t3-accmenu__label { flex: 1; min-width: 0; }
  .t3-accmenu__count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
    background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .t3-accmenu__count[hidden] { display: none; }
  .t3-accmenu__link[aria-current] .t3-accmenu__count { background: var(--surface); color: var(--brand-text); }
  .t3-accmenu__foot { display: grid; gap: 2px; padding-top: var(--s-2); border-top: 1px solid var(--line); }
  .t3-accmenu__link--minor { color: var(--text-2); font-size: var(--fs-s); min-height: 40px; }
  .t3-accmenu__logout:hover { color: var(--danger); }
  .t3-accmenu__logout:hover .i { color: var(--danger); }
  .t3-accmenu__logout[aria-busy="true"] { opacity: .6; pointer-events: none; }

  /* в мобильном меню — раздел между навигацией и подвалом меню */
  .t3-accmenu--drawer { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
  .t3-accmenu--drawer .t3-accmenu__user { padding: 0 var(--s-1) var(--s-2); }
  .t3-accmenu--drawer .t3-accmenu__link { padding-inline: var(--s-1); }
  .t3-accmenu--drawer .t3-accmenu__link[aria-current] { padding-inline: var(--s-3); }

  .palette {
    margin: min(12vh, 120px) auto auto; width: min(680px, calc(100vw - 24px));
    background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-pop); overflow: hidden;
  }
  [data-style="editorial"] .palette { border: var(--line-w) solid var(--line); }
  .palette__field { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); }
  .palette__field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--fs-l); min-height: 44px; }
  .palette__field input::-webkit-search-cancel-button { display: none; }
  .palette__body { padding: var(--s-4) var(--s-5) var(--s-5); display: grid; gap: var(--s-5); max-height: 60vh; overflow: auto; }
  .palette__hint { color: var(--text-2); font-size: var(--fs-s); }
  .palette__hint kbd, .t3-ls__all kbd { padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-strong); font: 600 11px/1.6 var(--font-body); color: var(--text-2); }
  .palette__spinner { display: none; width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; }
  .palette__field.is-loading .palette__spinner { display: block; }

  /* выдача живого поиска (палитра в шапке и блок модуля search) */
  .t3-ls { display: grid; gap: var(--s-4); }
  .t3-ls__group { display: grid; gap: var(--s-1); }
  .t3-ls__title { margin: 0 0 var(--s-1); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
  .t3-ls__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .t3-ls__item {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3);
    padding: 6px var(--s-2); margin-inline: calc(-1 * var(--s-2)); border-radius: var(--radius-m); color: var(--text);
  }
  .t3-ls__item--page { grid-template-columns: 24px minmax(0, 1fr); }
  .t3-ls__item:hover, .t3-ls__item:focus-visible { background: var(--surface-2); outline: none; }
  .t3-ls__item:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
  .t3-ls__thumb { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-s); background: var(--surface-2); overflow: hidden; color: var(--text-3); }
  .t3-ls__thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
  [data-scheme="dark"] .t3-ls__thumb img { mix-blend-mode: normal; }
  .t3-ls__icon { display: grid; place-items: center; color: var(--text-3); }
  .t3-ls__body { display: grid; gap: 2px; min-width: 0; }
  .t3-ls__name { font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .t3-ls__name mark, .t3-ls__text mark, .t3-ls__meta mark { background: var(--brand-soft-2); color: inherit; border-radius: 3px; }
  .t3-ls__meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--fs-xs); color: var(--text-3); }
  .t3-ls__stock.is-in { color: color-mix(in srgb, var(--success) 70%, var(--text)); }
  .t3-ls__text { font-size: var(--fs-xs); color: var(--text-2); }
  .t3-ls__price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .t3-ls__more { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; font-size: var(--fs-s); font-weight: 600; color: var(--brand-text); }
  .t3-ls__more:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
  .t3-ls__all {
    display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); padding: var(--s-3) var(--s-4);
    border-radius: var(--radius-m); background: var(--surface-2); font-weight: 600; color: var(--text);
  }
  .t3-ls__all span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .t3-ls__all:hover, .t3-ls__all:focus-visible { background: var(--brand-soft); outline: none; }
  .t3-ls__empty { display: grid; gap: var(--s-1); color: var(--text-2); font-size: var(--fs-s); }
  .t3-ls__empty p { margin: 0; }
  .t3-ls__empty-title { font-weight: 600; color: var(--text); font-size: var(--fs-m); }
  .t3-ls__recent { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
  .t3-ls__recent ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
  @media (max-width: 479px) { .t3-ls__item { grid-template-columns: 40px minmax(0, 1fr); } .t3-ls__thumb { width: 40px; height: 40px; } .t3-ls__price { grid-column: 2; } }

  /* ── прочее ── */
  .global-error {
    display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--gutter);
    background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  }
  .global-error p { flex: 1; }

  .cookie-note {
    position: fixed; z-index: 70; left: var(--gutter); bottom: calc(var(--tabbar-h) + 16px);
    width: min(460px, calc(100vw - 2 * var(--gutter)));
    display: grid; grid-template-columns: auto 1fr; gap: var(--s-3) var(--s-4); align-items: start;
    padding: var(--s-4) var(--s-5); background: var(--surface); color: var(--text);
    border-radius: var(--radius-l); box-shadow: var(--shadow-pop); font-size: var(--fs-s);
    animation: dlg-in .4s var(--ease-out);
  }
  [data-style="editorial"] .cookie-note { border: var(--line-w) solid var(--line); }
  .cookie-note__text p { color: var(--text-2); margin-top: 4px; }
  .cookie-note .btn { grid-column: 2; justify-self: start; }

  .module-missing {
    display: flex; align-items: center; gap: var(--s-4);
    padding: var(--s-5) var(--s-6); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-l);
    background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--text-2);
  }
  .module-missing strong { display: block; color: var(--text); }

  /* заглушка компонента — строчная плашка, не ломает поток */
  .component-missing {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    padding: 4px 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-pill);
    font-size: var(--fs-xs); line-height: 1.4; color: var(--text-2); background: color-mix(in srgb, var(--surface) 70%, transparent);
    vertical-align: middle;
  }
  .component-missing code { font-size: .95em; color: var(--text); }
  .pagination-missing { display: flex; justify-content: center; margin-top: var(--s-6); }
  /* пустое меню в режиме конструктора (components/menu/_empty) */
  .menu-empty { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 0; }
  .panel-empty-menus { padding-block: var(--s-2); }
  .module-missing code { font-size: .9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }

  /* ── кнопки мессенджеров (Tshop3::messengers, parts/_messengers) ── */
  .t3-msgr { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .t3-msgr__link {
    --_c: var(--brand);
    display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4) 0 6px;
    border-radius: var(--radius-btn); font-size: var(--fs-s); font-weight: 600; color: inherit; text-decoration: none;
    background: color-mix(in srgb, var(--_c) 12%, transparent); border: var(--line-w) solid color-mix(in srgb, var(--_c) 22%, transparent);
    transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .t3-msgr__link:hover { background: color-mix(in srgb, var(--_c) 22%, transparent); }
  .t3-msgr__link:active { transform: scale(.98); }
  .t3-msgr__ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--_c); color: #fff; }
  .t3-msgr__ico .i { width: 17px; height: 17px; }
  .t3-msgr__link[data-key="tg"] { --_c: #2aabee; }
  .t3-msgr__link[data-key="wa"] { --_c: #25d366; }
  .t3-msgr__link[data-key="max"] { --_c: #7b3cf5; }
  .t3-msgr__link[data-key="vk"] { --_c: #0077ff; }
  .t3-msgr--lg .t3-msgr__link { min-height: 56px; padding-right: var(--s-5); font-size: var(--fs-m); }
  .t3-msgr--lg .t3-msgr__ico { width: 42px; height: 42px; }
  .t3-msgr--lg .t3-msgr__ico .i { width: 21px; height: 21px; }
}

/* ───────────────────────── layout ───────────────────────── */
@layer layout {
  .wrap { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

  /* общий корень блока модуля (Tshop3::blockOpen). Ручки дизайнера стилей, общие для всех модулей:
     --block-pt / --block-pb (внутренние отступы), --block-bg (фон), --block-text (цвет текста) */
  .t3-block {
    position: relative; isolation: isolate;
    padding-block: var(--block-pt, 0px) var(--block-pb, 0px);
    background: var(--block-bg, transparent);
    color: var(--block-text, inherit);
  }
  .t3-block__bg { position: absolute; inset: 0; z-index: -1; background: center / cover no-repeat; pointer-events: none; }
  .t3-block:has(> .t3-block__bg) { --block-pt: var(--section-gap); --block-pb: var(--section-gap); }

  /* шапка блока (Tshop3::blockHead): заголовок, вводный текст, действие справа («Все услуги →»).
     Ручки блока: --title-size, --title-color */
  .t3-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4) var(--s-6); margin-bottom: clamp(24px, 3.5vw, 48px); }
  .t3-head__main { display: grid; gap: var(--s-4); max-width: 760px; }
  .t3-head__title { font-size: var(--title-size, var(--fs-2xl)); color: var(--title-color, inherit); text-wrap: balance; }
  .t3-head__text { color: var(--text-2); font-size: var(--fs-l); }
  .t3-head__action { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; color: var(--brand-text); white-space: nowrap; }
  .t3-head__action .i { transition: transform var(--dur) var(--ease); }
  .t3-head__action:hover .i { transform: translateX(3px); }
  [data-style="editorial"] .t3-head { padding-bottom: var(--s-5); border-bottom: var(--line-w) solid var(--line); }
  [data-style="editorial"] .t3-head__action { text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-xs); color: var(--text); }

  .t3-main { display: block; min-height: 40vh; }

  /* режим конструктора: страница под фиксированной верхней полосой панели (.iww_panel_____main, 40px).
     Плашку кнопок панель вешает на top: -44px над элементом — у шапки и первого блока она ушла бы под полосу,
     поэтому для них плашка опускается внутрь элемента (видна при наведении), вёрстка не сдвигается */
  body.t3.iww_panel_____visible { padding-top: 40px; }
  /* прелоадер панели вешается на body с position: absolute на всю высоту — на длинной странице его не видно */
  body > .iww_panel_____loader { position: fixed; z-index: 3000; }
  .t3-header > .iww_____element-buttons-container--wrapper,
  .t3-content > .t3-block:first-child > .iww_____element-buttons-container--wrapper { top: 0; z-index: 60; }
  .t3-main:focus { outline: none; }
  .t3-content > .t3-block + .t3-block { margin-top: var(--section-gap); }
  .t3-content > .t3-block:first-child { margin-top: var(--s-6); }
  .is-main-page .t3-content > .t3-block:first-child { margin-top: 0; }

  .page-head { padding-top: var(--s-4); }
  .page-title { font-size: var(--fs-2xl); margin-block: var(--s-3) var(--s-2); }

  .crumbs { padding-top: var(--s-5); font-size: var(--fs-s); color: var(--text-2); }
  .crumbs__list { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; white-space: nowrap; list-style: none; padding: 0; }
  .crumbs__list::-webkit-scrollbar { display: none; }
  .crumbs__list li { display: inline-flex; align-items: center; gap: var(--s-2); }
  .crumbs__list li + li::before { content: ""; width: 5px; height: 5px; border-top: 1.5px solid var(--text-3); border-right: 1.5px solid var(--text-3); transform: rotate(45deg); }
  .crumbs__list a:hover { color: var(--text); }
  .crumbs__list [aria-current] { color: var(--text); }

  .with-aside { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: var(--s-7); padding-top: var(--s-5); align-items: start; }
  .with-aside__side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: var(--s-5); }
  .with-aside__main .t3-content > .t3-block .wrap { width: 100%; }

  .side-nav__list { list-style: none; padding: 0; display: grid; gap: 2px; }
  .side-nav__list--2, .side-nav__list--3 { padding-left: var(--s-4); margin-block: 2px var(--s-2); border-left: 1px solid var(--line); }
  .side-nav a { display: block; padding: 8px var(--s-3); border-radius: var(--radius-s); color: var(--text-2); }
  .side-nav a:hover { background: var(--surface-2); color: var(--text); }
  .side-nav .is-current > a { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }

  /* пагинация (components/pagination): «Показать ещё» + номера страниц */
  .pager { display: grid; justify-items: center; gap: var(--s-4); margin-top: var(--s-7); }
  .pager__more { min-width: min(320px, 100%); }
  .pager__more[aria-busy="true"] { pointer-events: none; opacity: .7; }
  .pager__more[aria-busy="true"] .i { animation: t3-spin .8s linear infinite; }
  .pager__pages { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .pager__page, .pager__step, .pager__gap { display: grid; place-items: center; min-width: 40px; height: 40px; padding-inline: 10px; border-radius: var(--radius-pill); font-variant-numeric: tabular-nums; color: var(--text-2); }
  a.pager__page:hover, a.pager__step:hover { background: var(--surface-2); color: var(--text); }
  .pager__page.is-current { background: var(--text); color: var(--bg); font-weight: 600; }
  .pager__step[aria-disabled="true"] { opacity: .35; }
  [data-t3-infinite] .pager__pages { display: none; }
  @keyframes t3-spin { to { transform: rotate(360deg); } }

  /* дерево каталога (catalog_menu/default): ссылка + кнопка раскрытия ветки справа от неё */
  .cat-nav { display: grid; gap: var(--s-2); padding: var(--s-3); border-radius: var(--radius-l); background: var(--surface); border: var(--line-w) solid var(--line); }
  [data-style="quiet"] .cat-nav, [data-style="editorial"] .cat-nav { padding: 0; background: none; border: 0; border-radius: 0; }
  .cat-nav__head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); font-weight: 700; font-size: var(--fs-l); }
  [data-style="editorial"] .cat-nav__head { padding-inline: 0; padding-bottom: var(--s-3); border-bottom: var(--line-w) solid var(--text); text-transform: uppercase; letter-spacing: .06em; font-size: var(--fs-s); }
  .cat-nav__head:hover { color: var(--brand-text); }
  .cat-nav__list { list-style: none; padding: 0; display: grid; gap: 2px; }
  .cat-nav__list--2, .cat-nav__list--3 { margin: 2px 0 var(--s-2) calc(var(--s-3) + 13px); padding-left: var(--s-2); border-left: 1px solid var(--line); }
  .cat-nav__item { position: relative; }
  .cat-nav__link { display: flex; align-items: center; gap: var(--s-3); min-height: 40px; padding: 6px var(--s-3); border-radius: var(--radius-s); color: var(--text-2); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
  .cat-nav__list--1 > .cat-nav__item > .cat-nav__link { color: var(--text); font-weight: 500; }
  .has-children > .cat-nav__link { padding-right: 44px; }
  .cat-nav__link:hover { background: var(--surface-2); color: var(--text); }
  .cat-nav__item.is-current > .cat-nav__link { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
  .cat-nav__thumb { flex: none; width: 28px; height: 28px; object-fit: contain; border-radius: var(--radius-s); }
  .cat-nav__thumb--letter { display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); font-size: var(--fs-xs); font-weight: 700; }
  .cat-nav__toggle { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-s); color: var(--text-3); list-style: none; }
  .cat-nav__toggle:hover { background: var(--surface-2); color: var(--text); }
  .cat-nav__toggle .i { transition: transform var(--dur) var(--ease); }
  .cat-nav__branch[open] > .cat-nav__toggle .i { transform: rotate(180deg); }
  .cat-nav__toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

  @media (max-width: 1023px) {
    :root { --header-h: 60px; }
    .with-aside { grid-template-columns: 1fr; gap: var(--s-5); }
    .with-aside__side { position: static; }
  }
}

/* ───────────────────────── utilities ───────────────────────── */
@layer utilities {
  /* блоки, открытые в модальном окне, теряют внешние отступы страницы: поля контейнера, отступы и фон блока
     (в последнем слое — иначе .wrap из слоя layout вернул бы поля) */
  .t3-modal__body .t3-block { padding: 0; margin: 0 !important; background: none; }
  .t3-modal__body .t3-block > .t3-block__bg { display: none; }
  .t3-modal__body .t3-block .wrap { width: 100%; }
  .t3-modal__body .t3-block + .t3-block { margin-top: var(--s-6) !important; }

  .only-mobile { display: none !important; }
  @media (max-width: 1023px) {
    .only-desk { display: none !important; }
    .only-mobile { display: inline-grid !important; }
  }
  @media (max-width: 1279px) { .only-wide { display: none !important; } }
  @media (max-width: 767px) {
    [data-tabbar="1"] { --tabbar-h: calc(60px + env(safe-area-inset-bottom)); }
    [data-tabbar="1"] .tab-dup { display: none !important; }
  }
  /* блок, чьи стили ещё грузятся (вставлен по AJAX) */
  [data-t3-pending] { visibility: hidden; }
}
