/**
 * Глобальные стили сайта
 *
 * ПРИМЕНЯЕТСЯ:
 * - На обычных страницах (через bitrix/templates/empty/header.php)
 * - В Vue приложении (через frontend/src/main.js)
 * - В отладке и на хостинге
 *
 * ПОРЯДОК ЗАГРУЗКИ В VUE:
 * 1. global.css (этот файл) - загружается первым, устанавливает базовые стили
 * 2. main.css (Tailwind) - загружается вторым, добавляет утилиты (.text-center, .mt-2)
 *
 * СОДЕРЖИМОЕ:
 * - CSS-переменные дизайн-системы (--radius-sm, --radius-md, --radius-lg)
 * - Базовые стили (html, body, h1-h6, p, a, ul, ol и т.д.)
 * - Кнопки (.btn-primary, .btn-secondary)
 * - Контейнеры (.container, .container-narrow, .container-wide)
 * - Формы (input, textarea, select, button)
 * - Таблицы (table, th, td)
 *
 * ЭТО ТО, ЧТО МЕНЯЕТСЯ РЕДКО (базовые страницы Битрикса)
 */

/* ========================================
   СБРОС И БАЗОВЫЕ НАСТРОЙКИ
   ======================================== */

/* Box-sizing для всех элементов */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Предотвращение горизонтального скролла */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   ДИЗАЙН-СИСТЕМА: CSS ПЕРЕМЕННЫЕ
   ======================================== */

:root {
    /* ====================================
       СИСТЕМА СКРУГЛЕНИЙ (Border Radius)
       ====================================

       Иерархический подход (Material Design):
       - Мелкие элементы (4px): inputs, buttons, select, checkboxes
       - Средние контейнеры (8px): cards, panels
       - Крупные контейнеры (12px): modals, drawers

       ПРИМЕНЕНИЕ В CSS:
       border-radius: var(--radius-sm);

       СООТВЕТСТВИЕ С TAILWIND:
       --radius-sm = 4px  = rounded      (inputs, buttons)
       --radius-md = 8px  = rounded-lg   (cards)
       --radius-lg = 12px = rounded-xl   (modals)

       ПРИМЕРЫ:
       .my-button { border-radius: var(--radius-sm); }
       <div class="rounded-lg"> = 8px (средний контейнер)
       ==================================== */

    --radius-sm: 4px;   /* Мелкие элементы: inputs, buttons, select */
    --radius-md: 8px;   /* Средние контейнеры: cards, panels */
    --radius-lg: 12px;  /* Крупные контейнеры: modals, drawers */
}

/* ========================================
   БАЗОВЫЕ СТИЛИ HTML ЭЛЕМЕНТОВ
   ======================================== */

/* HTML и body */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: Open_Sans, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    color: #111827;
    background-color: #f9fafb;
}

/* Заголовки */
h1 {
    font-size: 48px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 16px;
}

h2 {
    font-size: 30px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin-top: 32px;
    margin-bottom: 16px;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Параграфы */
p {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.7;
}

/* Ссылки */
a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Списки */
ul {
    list-style-type: disc;
    list-style-position: inside;
    margin-bottom: 20px;
}

ul > li {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.6;
}

ol {
    list-style-type: decimal;
    list-style-position: inside;
    margin-bottom: 20px;
}

ol > li {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Цитаты */
blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 16px;
    font-style: italic;
    color: #374151;
    margin: 16px 0;
}

/* Горизонтальная линия */
hr {
    border: 0;
    border-top: 1px solid #d1d5db;
    margin: 32px 0;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

th {
    background-color: #f3f4f6;
    font-weight: 600;
    text-align: left;
    padding: 8px;
    border: 1px solid #d1d5db;
}

td {
    padding: 8px;
    border: 1px solid #d1d5db;
}

/* Формы (базовая стилизация) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
textarea,
select {
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
    border-color: #9ca3af;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb inset;
}

button {
    cursor: pointer;
}


/* ========================================
   КОНТЕЙНЕРЫ (кастомные для проекта)
   ======================================== */

.page-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-container-narrow {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-container-wide {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   КНОПКИ
   ======================================== */

/* Красная */
.btn-primary {
    background-color: #cc0000;
    color: #efefef;
    padding: 8px 24px;
    border: 1px solid #cc0000;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #bb0000;
    border-color: #bb0000;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
    box-shadow: none;
}

/* Серая */
.btn-secondary {
    background-color: #e5e7eb;
    color: #1f2937;
    padding: 8px 24px;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #d1d5db;
    border-color: #d1d5db;
    color: #000000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    background-color: #c5c9cf;
    border-color: #c5c9cf;
    color: #000000;
}

/* ========================================
   МОДАЛЬНЫЕ ОКНА
   ========================================

   Блокировка прокрутки body при открытом модальном диалоге.
   Класс добавляется/снимается из компонента RcDialog.vue
   через document.body.classList.add/remove('dialog-open').
   ======================================== */

body.dialog-open {
    overflow: hidden;
}