/*
 * BIK-AVTO · Оболочка изолированной встройки
 * -------------------------------------------
 * Подключается ПЕРЕД uslugi-isolated.css.
 * Здесь только правила, действующие внутри .bk-root, и ни одного глобального
 * селектора: ни body, ни html, ни :root, ни голых тегов.
 *
 * Задача этого файла — не оформление, а граница:
 *   1. .bk-root обрывает наследование стилей сайта (all: initial);
 *   2. :where(.bk-root) с нулевой специфичностью сбрасывает то, что сайт
 *      прибивает к тегам (margin у h1/p/ul, border у button, max-width у img и т.п.);
 *   3. собственные токены проекта живут на .bk-root, а не в :root.
 */

/* ============================================================
   Граница: контекст наложения + обрыв наследования
   ============================================================ */

.bk-root {
  /* Собственный stacking context: ни сайт не перекрывает проект,
     ни проект не поднимает элементы над сайтом. */
  isolation: isolate;

  /* Обрываем наследование от body сайта (шрифт, цвет, line-height,
     text-transform, letter-spacing, visibility, direction и т.д.).
     Специфичность 0-1-0 — все правила проекта ниже побеждают. */
  all: initial;

  display: block;
  position: relative;
  z-index: 0;
  width: 100%;
  min-width: 0;
  background: #fff;
  color: var(--c-text);
  font: 400 var(--fs-body) / 1.6 var(--font-main);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* Если страница сайта лежит в RTL-контейнере — вёрстка проекта остаётся LTR */
.bk-root[dir] {
  direction: ltr;
}

/* ============================================================
   Сброс тегов сайта внутри .bk-root
   :where() даёт специфичность 0-0-1, поэтому любое правило
   проекта (0-1-0 и выше) перекрывает этот сброс.
   ============================================================ */

:where(.bk-root, .bk-root *) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: inherit;
  text-decoration: none;
  list-style: none;
  box-shadow: none;
  float: none;
  min-width: 0;
  max-width: none;
  max-height: none;
  transform: none;
  animation: none;
}

:where(.bk-root img, .bk-root svg, .bk-root video, .bk-root canvas, .bk-root iframe) {
  display: block;
  max-width: 100%;
  height: auto;
}

:where(.bk-root button, .bk-root input, .bk-root select, .bk-root textarea) {
  font: inherit;
  color: inherit;
  appearance: none;
}

:where(.bk-root button) {
  background: none;
  border: 0;
  cursor: pointer;
}

:where(.bk-root a) {
  color: inherit;
  text-decoration: none;
}

:where(.bk-root ul, .bk-root ol) {
  list-style: none;
}

/* Доступность: свечение фокуса только внутри проекта */
:where(.bk-root :focus) {
  outline: none;
}

:where(.bk-root :focus-visible) {
  outline: 2px solid var(--c-primary, #00579c);
  outline-offset: 3px;
}

/* ============================================================
   Токены проекта — на .bk-root, а не в :root,
   чтобы не перезаписать переменные сайта.
   ============================================================ */

.bk-root {
  /* Цвета */
  --c-primary: #00579c;
  --c-primary-dark: #00457c;
  --c-primary-soft: #e6eff6;
  --c-surface: #ebeef0;
  --c-surface-soft: #f2f6fa;
  --c-heading: #333;
  --c-text: #333;
  --c-muted: #8a9096;
  --c-chip-text: #5c8099;
  --c-white: #fff;
  --c-border: #e3e8ec;
  --c-border-blue: #cfdfec;
  --c-line: #333;

  /* Сетка */
  --container: 1120px;
  --gutter: 20px;
  --gutter-sm: 10px;

  /* Отступы */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  /* Радиусы */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;

  /* Типографика */
  --font-main: "Open Sans", "Segoe UI", Arial, Helvetica, sans-serif;
  --fs-h1: 2.5rem;
  --fs-h2: 2rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Анимации */
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur: 0.18s;
  --transition: var(--dur) var(--ease);
  --scale-hover: 1.02;
  --scale-chip: 1.04;
  --shadow-hover: 0 10px 24px rgb(20 40 60 / 12%);
}
