/* ==========================================================================
   Грузовой центр «Барсук-КАМАЗ» (Новосибирск)
   Базовые стили: палитра, сброс, типографика, 12-колоночная сетка, фокус
   ========================================================================== */

/* Межстраничные переходы View Transitions */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: ease;
}

::view-transition-old(root) {
  animation-name: vt-fade-out;
}

::view-transition-new(root) {
  animation-name: vt-fade-in;
}

@keyframes vt-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes vt-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Шрифты IBM Plex Sans и IBM Plex Mono из локальной папки assets/fonts/ */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Цветовая палитра: тёплый каталог, технический справочник */
  --bg-body: #EFEDE8;
  --bg-surface: #FFFFFF;
  --bg-subtle: #E6E3DC;
  --bg-muted: #F4F2ED;
  --bg-dark: #191918;

  --text-main: #1B1B1A;
  --text-muted: #595855;
  --text-faint: #787672;
  --text-inverse: #FFFFFF;

  --border-color: #D8D4CC;
  --border-light: #E8E5DD;
  --border-dark: #AFAAA0;

  /* Единственный акцентный цвет: сигнальный оранжевый */
  --accent: #E4570F;
  --accent-hover: #CC4C09;
  --accent-active: #B54005;
  --accent-soft: #FDEEE6;

  /* Строгие прямые углы (0-2px), никаких скруглений больше 4px */
  --radius: 2px;
  --radius-sm: 1px;
  --radius-none: 0;

  /* Шрифты с локальным IBM Plex и запасным системным стеком */
  --font-sans: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, "Courier New", monospace;

  /* Типографическая шкала */
  --font-xs: 0.75rem;    /* 12px */
  --font-sm: 0.875rem;   /* 14px */
  --font-base: 1rem;     /* 16px */
  --font-md: 1.125rem;   /* 18px */
  --font-lg: 1.25rem;    /* 20px */
  --font-xl: 1.5rem;     /* 24px */
  --font-2xl: 2rem;      /* 32px */
  --font-3xl: 2.5rem;    /* 40px */

  --lh-tight: 1.2;
  --lh-heading: 1.3;
  --lh-base: 1.55;
  --lh-prose: 1.6;

  /* Сетка и контейнер */
  --container-max: 1320px;
  --container-pad: 24px;
  --grid-gap: 24px;
}

/* Сброс стилей */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: var(--font-base);
  line-height: var(--lh-base);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Изображения и медиа */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Формы и элементы управления */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Таблицы */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* Списки */
ul,
ol {
  list-style: none;
}

/* Типографика */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: var(--font-3xl);
  line-height: var(--lh-tight);
  font-weight: 800;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: var(--font-2xl);
  margin-bottom: 1rem;
}

h3 {
  font-size: var(--font-xl);
  margin-bottom: 0.75rem;
}

h4 {
  font-size: var(--font-lg);
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  max-width: 72ch;
}

p:last-child {
  margin-bottom: 0;
}

strong,
b {
  font-weight: 700;
}

small {
  font-size: var(--font-sm);
}

/* Моноширинные цифры для таблиц, цен и характеристик */
.tabular-nums,
table,
.price-value,
.spec-value,
.code-inline,
.badge-num,
.section-index {
  font-variant-numeric: tabular-nums;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Номера разделов в стиле каталожной спецификации */
.section-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Ссылки */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

/* Видимый фокус для клавиатурной навигации */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Минимальный размер тач-цели 44px */
button,
.btn,
.nav-link,
select,
input[type="checkbox"],
input[type="radio"] {
  min-height: 44px;
}

/* Контейнер */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.page-main {
  flex: 1 0 auto;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* 12-колоночная сетка */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
}

.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Асимметричные колонки для каталога и карточки модели */
.col-main {
  grid-column: span 8;
}

.col-aside {
  grid-column: span 4;
}

.col-half {
  grid-column: span 6;
}

.col-third {
  grid-column: span 4;
}

.col-quarter {
  grid-column: span 3;
}

/* Утилитарные классы */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--text-muted);
}

.text-faint {
  color: var(--text-faint);
}

.text-accent {
  color: var(--accent);
}

.surface-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Адаптивные медиазапросы */
@media (max-width: 1200px) {
  :root {
    --font-3xl: 2.125rem;
    --font-2xl: 1.75rem;
  }
}

@media (max-width: 992px) {
  .col-main {
    grid-column: span 12;
  }

  .col-aside {
    grid-column: span 12;
  }

  .col-half {
    grid-column: span 12;
  }

  .col-third {
    grid-column: span 6;
  }

  .col-quarter {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  :root {
    --container-pad: 16px;
    --grid-gap: 16px;
    --font-3xl: 1.75rem;
    --font-2xl: 1.5rem;
    --font-xl: 1.25rem;
  }

  .grid-12 {
    gap: var(--grid-gap);
  }

  .col-1, .col-2, .col-3, .col-4,
  .col-5, .col-6, .col-7, .col-8,
  .col-9, .col-10, .col-11, .col-12,
  .col-third, .col-quarter {
    grid-column: span 12;
  }

  .surface-box {
    padding: 1.25rem;
  }
}

@media (max-width: 360px) {
  :root {
    --container-pad: 12px;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Отключение анимаций при предпочтении уменьшенного движения */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
