/* ============================================
   ДИЗАЙН-СИСТЕМА
   Версия 2.2 | Максимальная ширина 1480px
   ============================================ */

:root {
    /* ========== ЦВЕТОВАЯ ПАЛИТРА ========== */
    --color-text-primary: #313131;
    --color-text-secondary: #5A5A5A;
    --color-text-light: #FFFFFF;
    
    --color-accent-start: #7CCC0E;
    --color-accent-end: #00B31B;
    --color-accent: #00B31B;
    --color-link: #131313;
    --color-link-hover: #030303;
    
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F5F5F5;
    --color-bg-tertiary: #E7E7E7;
    
    --color-success: #00B31B;
    --color-error: #FF3B30;
    --color-warning: #FF9500;
    --color-info: #007AFF;
    
    --gradient-primary: linear-gradient(90deg, var(--color-accent-start), var(--color-accent-end));
    --gradient-primary-hover: linear-gradient(90deg, #6BB80C, #009E18);
    
    /* ========== ТИПОГРАФИЯ ========== */
    --font-family: 'Manrope', sans-serif;
    
    --fs-h1: 32px;
    --fs-h2: 24px;
    --fs-h3: 20px;
    --fs-h4: 18px;
    --fs-body: 16px;
    --fs-small: 14px;
    --fs-tiny: 12px;
    
    --fs-h1-rem: 2rem;
    --fs-h2-rem: 1.5rem;
    --fs-h3-rem: 1.25rem;
    --fs-h4-rem: 1.125rem;
    --fs-body-rem: 1rem;
    --fs-small-rem: 0.875rem;
    --fs-tiny-rem: 0.75rem;
    
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    
    --lh-heading: 1.3;
    --lh-body: 1.5;
    --lh-tight: 1.2;
    --lh-relaxed: 1.6;
    
    /* ========== ОТСТУПЫ И РАЗМЕРЫ ========== */
    --container-max-width: 1480px;      /* новая максимальная ширина */
    --container-padding: 20px;           /* базовый паддинг */
    
    /* Дополнительные переменные для разных разрешений */
    --container-padding-desktop: 20px;   /* паддинг для десктопа */
    --container-padding-tablet: 20px;    /* паддинг для планшета */
    --container-padding-mobile: 16px;    /* паддинг для мобильных */
    --container-padding-xs: 12px;        /* паддинг для сверхмалых экранов */
    
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 20px;
    --space-xl: 40px;
    --space-xxl: 60px;
    
    --height-input: 48px;
    --height-button: 48px;
    
    /* ========== СКРУГЛЕНИЯ ========== */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* ========== ТЕНИ ========== */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-focus: 0 0 0 3px rgba(0, 179, 27, 0.1);
    
    /* ========== АНИМАЦИИ ========== */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* ========== Z-INDEX ========== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;
    --z-toast: 700;
    
    /* ========== БРЕЙКПОИНТЫ (для документации) ========== */
    --bp-xs: 360px;
    --bp-sm: 640px;
    --bp-md: 1024px;
    --bp-lg: 1480px;       /* новая граница, где контейнер достигает максимума */
    --bp-xl: 1600px;        /* для очень широких экранов */
}

/* ========== БАЗОВЫЕ СТИЛИ ========== */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== ТИПОГРАФИЯ ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    margin-bottom: var(--space-lg);
    color: var(--color-text-primary);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p {
    margin-bottom: var(--space-lg);
    line-height: var(--lh-body);
}

.text-small {
    font-size: var(--fs-small);
    line-height: var(--lh-body);
}

.text-tiny {
    font-size: var(--fs-tiny);
    line-height: var(--lh-tight);
}

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-light { color: var(--color-text-light); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }

/* ========== ССЫЛКИ ========== */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--color-link-hover);
}

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ========== КНОПКИ ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    height: var(--height-button);
    border: 0;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--fs-body);
    font-weight: var(--fw-medium);
    line-height: var(--lh-tight);
    cursor: pointer;
    transition: background-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
    text-align: center;
    text-decoration: none;
    background: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Акцентная кнопка (зелёный градиент) */
.btn-catalog {
    background: var(--gradient-primary);
    color: var(--color-text-light);
    font-weight: var(--fw-semibold);
}

.btn-catalog:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-catalog:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
    filter: brightness(0.95);
}

/* Основная кнопка (серая) */
.btn-primary {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.btn-primary:hover {
    background-color: #E0E0E0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: translateY(0);
    background-color: #D0D0D0;
}

/* Второстепенная кнопка (серый фон, тёмный текст) – алиас для .btn-primary */
.btn-secondary {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.btn-secondary:hover {
    background-color: #E0E0E0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
    background-color: #D0D0D0;
}

/* Состояние disabled для всех кнопок */
.btn:disabled,
.btn.disabled {
    background-color: var(--color-bg-secondary);
    color: #AAAAAA;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
    pointer-events: none;
}

/* Отключаем hover на тач-устройствах */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none !important;
        box-shadow: none !important;
        background-color: inherit;
        background: inherit;
        filter: none;
    }
    .btn-catalog:hover {
        background: var(--gradient-primary);
    }
    .btn-primary:hover,
    .btn-secondary:hover {
        background-color: var(--color-bg-tertiary);
    }
}

/* ========== ФОРМЫ И ИНПУТЫ ========== */
.form-group {
    margin-bottom: var(--space-xl);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-primary);
}

.form-control {
    width: 100%;
    height: var(--height-input);
    padding: 0 16px;
    border: 1px solid #DDDDDD;
    border-radius: var(--radius-md);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.form-control::placeholder {
    color: #AAAAAA;
    opacity: 1;
}

.form-control:hover {
    border-color: #BBBBBB;
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-focus);
    outline: none;
}

.form-control:disabled {
    background-color: var(--color-bg-secondary);
    color: #AAAAAA;
    cursor: not-allowed;
    border-color: #EEEEEE;
}

textarea.form-control {
    min-height: 120px;
    padding: 12px 16px;
    resize: vertical;
}

/* Чекбоксы и радиокнопки */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check-input {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.form-check-input:checked {
    accent-color: var(--color-accent);
}

.form-check-label {
    font-size: var(--fs-body);
    color: var(--color-text-primary);
}

/* ========== КОНТЕЙНЕР И СЕТКА ========== */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ========== УТИЛИТНЫЕ КЛАССЫ ========== */
/* Отступы */
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: var(--space-xs) !important; }
.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-lg { margin-top: var(--space-lg) !important; }
.mt-xl { margin-top: var(--space-xl) !important; }
.mt-xxl { margin-top: var(--space-xxl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: var(--space-xs) !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.mb-xl { margin-bottom: var(--space-xl) !important; }
.mb-xxl { margin-bottom: var(--space-xxl) !important; }

.p-xs { padding: var(--space-xs) !important; }
.p-sm { padding: var(--space-sm) !important; }
.p-md { padding: var(--space-md) !important; }
.p-lg { padding: var(--space-lg) !important; }
.p-xl { padding: var(--space-xl) !important; }
.p-xxl { padding: var(--space-xxl) !important; }

/* Выравнивание текста */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* Flex утилиты */
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }

.flex-column { flex-direction: column !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.align-start { align-items: flex-start !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }
.gap-xs { gap: var(--space-xs) !important; }
.gap-sm { gap: var(--space-sm) !important; }
.gap-md { gap: var(--space-md) !important; }
.gap-lg { gap: var(--space-lg) !important; }
.gap-xl { gap: var(--space-xl) !important; }

/* ========== АДАПТИВНОСТЬ ========== */

/* Очень большие экраны (1600px и выше) – увеличиваем боковые отступы и чуть поднимаем шрифты */
@media (min-width: 1600px) {
    :root {
        --container-padding: 40px;
        --container-padding-desktop: 40px;
        --fs-h1: 36px;
        --fs-h2: 28px;
        --space-xxl: 80px;
    }
    .hide-xl { display: none !important; }
    .show-xl { display: block !important; }
}

/* Большие экраны (1480px - 1599px) – стандартные отступы, контейнер уже максимальный */
@media (min-width: 1480px) and (max-width: 1599px) {
    :root {
        --container-padding: 20px;
        --container-padding-desktop: 20px;
        --fs-h1: 32px;
        --fs-h2: 24px;
        --space-xxl: 60px;
    }
    .hide-lg { display: none !important; }
    .show-lg { display: block !important; }
}

/* Десктопы (1024px - 1479px) */
@media (min-width: 1024px) and (max-width: 1479px) {
    :root {
        --container-padding: 20px;
        --container-padding-desktop: 20px;
    }
    .hide-desktop { display: none !important; }
    .show-desktop { display: block !important; }
}

/* Планшеты (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
    :root {
        --container-padding: 20px;
        --container-padding-tablet: 20px;
        --fs-h1: 28px;
        --fs-h2: 22px;
        --fs-h3: 18px;
        --space-xxl: 50px;
        --space-xl: 35px;
    }
    .hide-md { display: none !important; }
    .show-md { display: block !important; }

    .col-md-1 { width: 8.333%; }
    .col-md-2 { width: 16.666%; }
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333%; }
    .col-md-5 { width: 41.666%; }
    .col-md-6 { width: 50%; }
    .col-md-7 { width: 58.333%; }
    .col-md-8 { width: 66.666%; }
    .col-md-9 { width: 75%; }
    .col-md-10 { width: 83.333%; }
    .col-md-11 { width: 91.666%; }
    .col-md-12 { width: 100%; }
}

/* Мобильные (360px - 639px) */
@media (min-width: 360px) and (max-width: 639px) {
    :root {
        --container-padding: 16px;
        --container-padding-mobile: 16px;
        --fs-h1: 26px;
        --fs-h2: 22px;
        --fs-h3: 18px;
        --fs-body: 15px;
        --space-xxl: 40px;
        --space-xl: 32px;
    }
    .btn {
        padding: 10px 20px;
        height: 44px;
    }
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: var(--space-md);
    }
    p {
        margin-bottom: var(--space-md);
    }
    .form-check-input {
        width: 24px;
        height: 24px;
    }
    .hide-sm { display: none !important; }
    .show-sm { display: block !important; }

    .col-sm-1 { width: 8.333%; }
    .col-sm-2 { width: 16.666%; }
    .col-sm-3 { width: 25%; }
    .col-sm-4 { width: 33.333%; }
    .col-sm-5 { width: 41.666%; }
    .col-sm-6 { width: 50%; }
    .col-sm-7 { width: 58.333%; }
    .col-sm-8 { width: 66.666%; }
    .col-sm-9 { width: 75%; }
    .col-sm-10 { width: 83.333%; }
    .col-sm-11 { width: 91.666%; }
    .col-sm-12 { width: 100%; }
}

/* Сверхмалые экраны (до 359px) */
@media (max-width: 359px) {
    :root {
        --container-padding: 12px;
        --container-padding-xs: 12px;
        --fs-h1: 22px;
        --fs-h2: 18px;
        --fs-h3: 16px;
        --fs-body: 14px;
        --space-xxl: 35px;
        --space-xl: 28px;
    }
    .btn {
        padding: 8px 16px;
        height: 40px;
        font-size: 14px;
    }
    .form-control {
        padding: 0 12px;
        height: 44px;
    }
    textarea.form-control {
        padding: 10px 12px;
    }
    .form-check-input {
        width: 24px;
        height: 24px;
    }
    .hide-xs { display: none !important; }
    .show-xs { display: block !important; }
}

/* Показать/скрыть для десктопов (по умолчанию) */
@media (min-width: 1024px) {
    .hide-desktop { display: none !important; }
    .show-desktop { display: block !important; }
}

/* ========== ДОСТУПНОСТЬ ========== */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}