/* Централизованная система шрифтов */

/* ===== ОПРЕДЕЛЕНИЯ ШРИФТОВ ===== */

/* OpenSans Regular */
@font-face {
    font-family: 'OpenSans';
    src: url('../fonts/OpenSans/OpenSans-Regular.woff2') format('woff2'),
         url('../fonts/OpenSans/OpenSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* OpenSans Medium */
@font-face {
    font-family: 'OpenSans';
    src: url('../fonts/OpenSans/OpenSans-Medium.woff2') format('woff2'),
         url('../fonts/OpenSans/OpenSans-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* OpenSans Semibold */
@font-face {
    font-family: 'OpenSans';
    src: url('../fonts/OpenSans/OpenSans-Semibold.woff2') format('woff2'),
         url('../fonts/OpenSans/OpenSans-Semibold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* OpenSans Bold */
@font-face {
    font-family: 'OpenSans';
    src: url('../fonts/OpenSans/OpenSans-Bold.woff2') format('woff2'),
         url('../fonts/OpenSans/OpenSans-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===== ПЕРЕМЕННЫЕ ШРИФТОВ ===== */
:root {
    /* Семейства шрифтов */
    --font-primary: 'OpenSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-secondary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-monospace: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', 'Source Code Pro', monospace;
    
    /* Веса шрифтов */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* ===== РАЗМЕРЫ ШРИФТОВ ===== */
    --font-size-14: 0.875rem;     /* 14px */
    --font-size-16: 1rem;         /* 16px */
    --font-size-18: 1.125rem;     /* 18px */
    --font-size-20: 1.25rem;      /* 20px */
    --font-size-22: 1.375rem;     /* 22px */
    --font-size-24: 1.5rem;       /* 24px */
    --font-size-32: 2rem;         /* 32px */
    --font-size-38: 2.375rem;     /* 38px */
    --font-size-42: 2.625rem;     /* 42px */
    --font-size-44: 2.75rem;      /* 44px */
    --font-size-48: 3rem;         /* 48px */
    
    /* ===== МЕЖСТРОЧНЫЕ РАССТОЯНИЯ ===== */
    --line-height-auto: normal;   /* auto */
    --line-height-110: 1.1;       /* 110% */
    --line-height-120: 1.2;       /* 120% */
    
    /* ===== МЕЖБУКВЕННЫЕ РАССТОЯНИЯ ===== */
    --letter-spacing-0: 0;        /* 0% */
    --letter-spacing-minus1: -0.01em; /* -1% */
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */

/* Основной шрифт для body - используем p2 как базовый (Regular 20px auto 0%) */
body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-16);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* ===== УТИЛИТЫ ===== */

/* Сглаживание шрифтов */
.font-smooth {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Отключение сглаживания */
.font-crisp {
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
}

/* Принудительное использование системного шрифта */
.font-system {
    font-family: var(--font-secondary);
}

/* Запрет переноса слов */
.text-nowrap {
    white-space: nowrap;
}

/* Обрезка текста с многоточием */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Многострочное обрезание (поддержка webkit) */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== ЗАГОЛОВКИ ===== */

/* Базовые стили заголовков */
h1, h2, h3, h4, h5 {
    font-family: var(--font-primary);
}

/* h1 SemiBold 48px межстрочное 120% межбуквенное -1% */
h1 {
    font-size: var(--font-size-48);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* Визуальный «h1» для НЕ-заголовочных элементов (числа статистики, цена и т.п.),
   которым нужен вид h1, но семантически они не должны быть <h1> (один H1 на страницу). */
.dk-h1-visual {
    font-family: var(--font-primary);
    font-size: var(--font-size-48);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* Доступное визуальное скрытие: элемент не виден глазами, но доступен поисковику
   и скринридеру. Для SEO-H1, который не должен менять внешний вид страницы. */
.dk-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* h2 SemiBold 38px межстрочное 110% межбуквенное -1% */
h2 {
    font-size: var(--font-size-38);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-110);
    letter-spacing: var(--letter-spacing-minus1);
}

/* h3 SemiBold 32px межстрочное 120% межбуквенное -1% */
h3 {
    font-size: var(--font-size-32);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* h4 SemiBold 24px межстрочное 110% межбуквенное 0% */
h4 {
    font-size: var(--font-size-24);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* h5 SemiBold 22px межстрочное auto межбуквенное 0% */
h5 {
    font-size: var(--font-size-22);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* ===== ТЕКСТОВЫЕ ЭЛЕМЕНТЫ ===== */

/* Основной текст - p по умолчанию используем p2 (Regular 20px auto 0%) */
p {
    font-family: var(--font-primary);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* Классы для разных типов текста */
/* p1 Regular 24px межстрочное 120% межбуквенное -1% */
.text-p1 {
    font-size: var(--font-size-24);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* p2 Regular 18px межстрочное auto межбуквенное 0% */
.text-p2 {
    font-size: var(--font-size-18);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* p3 Regular 16px межстрочное 120% межбуквенное -1% */
.text-p3, select  {
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* ===== КНОПКИ И ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ ===== */

/* Текст кнопок SemiBold 22px межстрочное 120% межбуквенное -1% */
button, .btn {
    font-family: var(--font-primary);
    font-size: var(--font-size-18);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

.btn-sm {
    font-family: var(--font-primary);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* Ссылки используют color-plashka стиль */
a, .link {
    font-family: var(--font-primary);
    font-size: var(--font-size-14);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* ===== ПЛАШКИ ===== */
/* Плашки Regular 22px межстрочное 120% межбуквенное -1% */
.plashka, .badge {
    font-family: var(--font-primary);
    font-size: var(--font-size-22);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* Цветные плашки Regular 14px межстрочное auto межбуквенное 0% */
.color-plashka, .events-tag{
    font-family: var(--font-primary);
    font-size: var(--font-size-14);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* ===== ФОРМЫ ===== */

/* Поля ввода используют p2 стиль */
input, textarea{
    font-family: var(--font-primary);
    font-size: var(--font-size-18);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* Лейблы используют p3 стиль */
label {
    font-family: var(--font-primary);
    font-size: var(--font-size-18);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* ===== СПИСКИ ===== */

/* Элементы списков используют p3 стиль */
li {
    font-family: var(--font-primary);
    font-size: var(--font-size-18);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-0);
}

li::before {
    font-weight: var(--font-weight-semibold);
}

/* ===== СПЕЦИАЛЬНЫЕ СЕЛЕКТОРЫ ДЛЯ КОМПОНЕНТОВ ===== */

/* H_5 - специальный стиль заголовка (SemiBold 20px auto 0%) */
.H_5, .banner-content .H_5 {
    font-family: var(--font-primary);
    font-size: var(--font-size-20);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* H_5 в слайдере баннеров - добавляем отступ снизу */
.slide-text .H_5 {
    margin-bottom: 0.5rem;
}

.phone-contact .phone-number {
    font-size: var(--font-size-20);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

.desktop-nav ul li a {
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* Пагинация использует стиль кнопок */
.pagination-btn {
    font-size: var(--font-size-24);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-minus1);
}

/* Информация пагинации использует цветные плашки + semibold */
.pagination-info {
    font-family: var(--font-primary);
    font-size: var(--font-size-16);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* Селект фильтра использует p2 стиль */
.filter-select {
    font-size: var(--font-size-18);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-auto);
    letter-spacing: var(--letter-spacing-0);
}

/* Стрелки выпадающих меню используют p3 размер */
.dropdown-toggle::after, .mobile-dropdown-toggle::after {
    font-size: var(--font-size-18);
}

.step-number {
    font-size: 100px;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-120);
    letter-spacing: var(--letter-spacing-0);
}

.how-to-start-section .step-number{
    font-size: 180px;
    line-height: 0.5;
}

/* ===== АДАПТИВНАЯ ТИПОГРАФИКА ===== */

/* Критическая точка для размеров шрифтов */
@media screen and (max-width: 1280px) {
    :root {
        --font-size-48: 2.75rem;      /* 44px вместо 48px */
        --font-size-44: 2.5rem;        /* 40px вместо 44px */
        --font-size-42: 2.375rem;      /* 38px вместо 42px */
        --font-size-38: 2.125rem;     /* 34px вместо 38px */
        --font-size-32: 1.875rem;     /* 30px вместо 32px */
        --font-size-24: 1.375rem;     /* 22px вместо 24px */
    }
}

/* Средние экраны - промежуточная адаптация */
@media screen and (max-width: 1200px) {
    :root {
        --font-size-48: 2.5rem;       /* 40px вместо 48px */
        --font-size-44: 2.25rem;      /* 36px вместо 44px */
        --font-size-42: 2.125rem;     /* 34px вместо 42px */
        --font-size-38: 2rem;         /* 32px вместо 38px */
        --font-size-32: 1.875rem;     /* 30px вместо 32px */
        --font-size-24: 1.375rem;     /* 22px вместо 24px */
        --font-size-22: 1.25rem;      /* 20px вместо 22px */
        --font-size-20: 1.125rem;     /* 18px вместо 20px */
    }
}

/* Планшеты */
@media screen and (max-width: 1024px) {
    :root {
        --font-size-48: 2.25rem;      /* 36px вместо 48px */
        --font-size-44: 2rem;          /* 32px вместо 44px */
        --font-size-42: 1.875rem;     /* 30px вместо 42px */
        --font-size-38: 1.875rem;     /* 30px вместо 38px */
        --font-size-32: 1.75rem;      /* 28px вместо 32px */
        --font-size-22: 1.25rem;      /* 20px вместо 22px */
    }
}

/* Мобильные устройства */
@media screen and (max-width: 768px) {
    :root {
        --font-size-48: 2rem;         /* 32px */
        --font-size-44: 1.875rem;     /* 30px */
        --font-size-42: 1.75rem;      /* 28px */
        --font-size-38: 1.75rem;      /* 28px */
        --font-size-32: 1.625rem;     /* 26px */
        --font-size-24: 1.25rem;      /* 20px */
        --font-size-22: 1.125rem;     /* 18px */
        --font-size-20: 1.125rem;     /* 18px */
        --font-size-18: 1rem;         /* 16px */
    }
}

/* Очень маленькие экраны */
@media screen and (max-width: 480px) {
    :root {
        --font-size-48: 1.75rem;      /* 28px */
        --font-size-44: 1.625rem;      /* 26px */
        --font-size-42: 1.5rem;        /* 24px */
        --font-size-38: 1.5rem;       /* 24px */
        --font-size-32: 1.375rem;     /* 22px */
        --font-size-24: 1.125rem;     /* 18px */
        --font-size-22: 1rem;         /* 16px */
        --font-size-20: 1rem;         /* 16px */
        --font-size-18: 0.875rem;     /* 14px */
        --font-size-16: 0.875rem;     /* 14px */
        --font-size-14: 0.75rem;      /* 12px */
    }
}