/* ================================================================
   MAIN.CSS — Глобальная база: шрифты, переменные, reset, типографика,
              .container, кнопки. Подключается первым на всех страницах.
   ================================================================ */

/* ----------------------------------------------------------------
   Шрифты
   ---------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter/Inter24pt-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter/Inter24pt-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter/Inter24pt-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------
   CSS-переменные
   ---------------------------------------------------------------- */
:root {
  --clr-primary:      #1a7fd4; /* FIX TC-D2: был #3fa2f7 (контраст ~3.0), теперь #1a7fd4 (≥4.5, WCAG AA) */
  --clr-primary-10:   rgba(26, 127, 212, 0.10);
  --clr-primary-15:   rgba(26, 127, 212, 0.15);
  --clr-primary-22:   rgba(26, 127, 212, 0.22);
  --clr-primary-30:   rgba(26, 127, 212, 0.30);
  --clr-dark:         #0b1736;
  --clr-text:         #333333;
  --clr-muted:        #666666;

  --radius:           15px;
  --radius-sm:        10px;
  --radius-xs:        6px;

  --shadow-card:      0 4px 18px rgba(0, 0, 0, 0.07);
  --shadow-hover:     0 8px 28px rgba(0, 0, 0, 0.13);

  /* Высота фиксированного хедера — используется для body padding-top */
  --header-height: 150px;

  /* Горизонтальный отступ контейнера */
  --px: 60px;
}

/* ----------------------------------------------------------------
   Глобальный сброс
   ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------------------------------
   Базовые стили документа
   ---------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--clr-text);
  background: #fff;
  /* Отступ под фиксированный хедер (переопределяется в media) */
  padding-top: var(--header-height);
}

/* ----------------------------------------------------------------
   Типографика
   ---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--clr-dark);
  line-height: 1.25;
}
h1 { font-size: 32px; font-weight: 600; }
h2 { font-size: 26px; font-weight: 600; }
h3 { font-size: 20px; font-weight: 500; }
h4 { font-size: 18px; font-weight: 500; }

p  { font-size: 16px; line-height: 1.65; }
ul, ol { padding-left: 1.4em; }
li { font-size: 16px; line-height: 1.6; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----------------------------------------------------------------
   Контейнер — единый на весь сайт
   ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--px);
  padding-right: var(--px);
}

/* Вертикальные отступы для секций-контейнеров внутренних страниц */
section.container {
  padding-top: 48px;
  padding-bottom: 80px;
}

/* ----------------------------------------------------------------
   Декоративная линия под заголовками
   ---------------------------------------------------------------- */
.page-h1 {
  margin-bottom: 40px;
  position: relative;
}
.page-h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--clr-primary);
  border-radius: 2px;
  margin-top: 12px;
}

/* Переиспользуем через h1 внутри section.container на внутренних страницах */
section.container > h1:first-child {
  margin-bottom: 40px;
  position: relative;
}
section.container > h1:first-child::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--clr-primary);
  border-radius: 2px;
  margin-top: 12px;
}

/* ----------------------------------------------------------------
   Кнопки
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
  white-space: nowrap;
}

.btn-outline {
  background: var(--clr-primary-10);
  border: 1px solid var(--clr-primary-30);
  color: var(--clr-dark);
}
.btn-outline:hover {
  background: var(--clr-primary-22);
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--clr-primary);
  color: #fff;
}
.btn-primary:hover {
  background: #2a8fe0;
  transform: translateY(-2px);
}

/* ----------------------------------------------------------------
   Адаптив переменных — меняем px и header-height одним местом
   ---------------------------------------------------------------- */
@media (max-width: 1400px) {
  :root { --px: 48px; }
}
@media (max-width: 1200px) {
  :root { --px: 36px; }
  h1 { font-size: 28px; }
}
@media (max-width: 991px) {
  :root { --px: 24px; --header-height: 120px; }
  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
}
@media (max-width: 899px) {
  /* Переключение на мобильный хедер */
  :root { --header-height: 68px; }
}
@media (max-width: 767px) {
  :root { --px: 16px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  section.container { padding-top: 32px; padding-bottom: 56px; }
}
@media (max-width: 575px) {
  :root { --px: 12px; }
  h1 { font-size: 22px; }
}

/* ----------------------------------------------------------------
   Доступность: визуально скрытые элементы для скринридеров
   ---------------------------------------------------------------- */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content: видна только при фокусе с клавиатуры */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 10px 20px;
  background: var(--clr-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 16px;
}

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

/* Убираем outline при навигации мышью */
:focus:not(:focus-visible) {
  outline: none;
}

/* Запрет анимаций для пользователей с вестибулярными нарушениями */
@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;
  }
}

/* ----------------------------------------------------------------
   FIX M-10: @media print — корректная печать страниц цен и контактов
   ---------------------------------------------------------------- */
@media print {
  /* Скрываем навигацию, шапку, кнопки */
  .site-header,
  .mobile-header,
  .site-footer,
  .btn,
  .slider-prev,
  .slider-next,
  .pagination,
  .news-more,
  .department-signup,
  #searchInput {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #555;
  }

  /* Таблица цен — не разрывается посередине строки */
  .prices-table-inner tr {
    page-break-inside: avoid;
  }

  .prices-table-inner thead {
    display: table-header-group; /* повторяет заголовок на каждой странице */
  }
}
