/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-light: #ffffff;
    --primary-blue: #0066cc;    
    --dark-blue: #003380;       
    --text-dark: #333333;       
    --text-gray: #666666;       
    --font-main: 'Montserrat', sans-serif;
    --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

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

/* =========================================
   2. CLASSIC HERO SECTION
   ========================================= */
.classic-hero {
    /* Красивый, глубокий синий градиент */
    background: linear-gradient(135deg, #005ce6 0%, #003380 100%);
    color: #ffffff;
    position: relative;
    padding: 50px 0 60px;
    min-height: 400px;
}

.hero-container {
    display: flex; flex-direction: column;
    height: 100%; position: relative; z-index: 2;
}

/* Логотип с бликом */
.hero-logo-wrapper { 
    margin-bottom: 50px; 
    display: inline-block;
    position: relative;
    overflow: hidden; 
}

.hero-logo-img {
    height: 50px; 
    width: auto;
    display: block;
}



/* Заголовок */
.hero-content h1 { 
    font-size: 3.2rem; 
    font-weight: 500; 
    line-height: 1.1; 
    margin-bottom: 25px; 
    max-width: 800px;
}
.hero-content p { 
    font-size: 1.05rem; 
    font-weight: 500; 
    opacity: 0.9; 
    max-width: 600px;
    letter-spacing: 0.5px;
}

/* =========================
   ИСПРАВЛЕННЫЙ БЛОК СЕРТИФИКАТОВ
   ========================= */
.hero-certs {
    display: flex;
    align-items: center; /* Вертикальное выравнивание по центру */
    gap: 30px; /* Расстояние между картинками */
    align-self: flex-end;
    margin-top: 35px;
    height: 60px; /* Фиксируем высоту контейнера, чтобы выравнивание сработало идеально */
}

/* Общий стиль для ВСЕХ сертификатов */
.cert-img {
    /* Вместо фиксированной height, используем max-height.
       Картинка ужмется, если она больше, но не растянется, если меньше. */
    max-height: 50px; 
    width: auto; /* Сохраняем пропорции */
    display: block;
    object-fit: contain; /* Гарантирует, что картинка не обрежется */
    
    /* Если твои картинки черные, раскомментируй строку ниже, чтобы сделать их белыми: */
    /* filter: brightness(0) invert(1); */
}

/* ВАЖНО: Я убрал специальный класс .wqa-img, который делал средний логотип больше. 
   Теперь все равны. */

/* Адаптивность для мобильных */
@media (max-width: 900px) {
    .hero-certs { 
        align-self: flex-start; 
        flex-wrap: wrap; 
        gap: 20px; 
        height: auto; /* На мобильном высоту контейнера отпускаем */
    }
    /* На телефоне делаем их чуть меньше, но тоже одинаковыми */
    .cert-img { 
        max-height: 40px; 
    } 
}

/* =========================================
   3. ABOUT SECTION (2014 / 5 ЗАВОДОВ)
   ========================================= */
.about-section { padding: 70px 0; background-color: var(--bg-light); }
.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 60px; }
.about-item { display: flex; flex-direction: column; }
.about-number { font-size: 2.5rem; font-weight: 800; color: var(--primary-blue); line-height: 1; margin-bottom: 10px; }
.about-title { font-size: 1.1rem; font-weight: 700; color: var(--primary-blue); text-transform: uppercase; margin-bottom: 15px; letter-spacing: 0.5px; }
.about-text { font-size: 0.95rem; color: var(--primary-blue); line-height: 1.6; font-weight: 500; }

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-number { font-size: 2rem; }
    .about-section { padding: 40px 0; }
}

/* =========================================
   4. CATALOG SECTION (3 CARDS)
   ========================================= */
.catalog-section { padding-bottom: 80px; background-color: var(--bg-light); }
.catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.cat-card {
    display: block; border: 1px solid var(--primary-blue); background: #fff;
    height: 300px; padding: 25px; position: relative; text-decoration: none;
    transition: 0.3s ease; overflow: hidden;
}
.cat-card:hover { box-shadow: 0 10px 30px rgba(0, 102, 204, 0.15); transform: translateY(-5px); }
.cat-title { font-size: 1.25rem; font-weight: 500; color: var(--primary-blue); line-height: 1.3; position: relative; z-index: 2; }
.cat-img-wrapper { position: absolute; bottom: 20px; right: 20px; width: 180px; height: 160px; display: flex; align-items: flex-end; justify-content: flex-end; }
.cat-img { max-width: 100%; max-height: 100%; object-fit: contain; }

@media (max-width: 900px) {
    .catalog-grid { grid-template-columns: 1fr; }
    .cat-card { height: auto; min-height: 250px; }
    .cat-img-wrapper { position: relative; width: 100%; height: 180px; bottom: 0; right: 0; margin-top: 20px; justify-content: center; }
}

/* =========================================
   5. SERVICES SECTION (3 COLUMNS)
   ========================================= */
.services-section { 
    padding: 60px 0; 
    background-color: var(--bg-light); 
}

.services-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 40px; 
}

.service-item { 
    display: flex; 
    align-items: flex-start; /* Иконка и текст по верхнему краю */
    gap: 20px; 
}

/* Настраиваем большие, детализированные иконки */
.service-icon { 
    flex-shrink: 0; 
    width: 80px; /* Увеличили размер иконок как в оригинале */
    height: 80px; 
    display: flex; 
    justify-content: center; 
    align-items: flex-start; /* Прижимаем иконку к верхней части */
}

/* Цвет и толщина линий иконок */
.service-icon svg { 
    width: 100%; 
    height: auto; 
    color: #555555; /* Строгий серый цвет линий */
}

.service-content { 
    display: flex; 
    flex-direction: column; 
    padding-top: 5px; /* Слегка опускаем текст, чтобы сбалансировать с иконкой */
}

/* Заголовок теперь серый и не такой жирный */
.service-title { 
    font-size: 1.05rem; 
    font-weight: 500; /* Убрали лишнюю жирность */
    color: #666666; /* Серый цвет как на макете */
    text-transform: uppercase; 
    margin-bottom: 12px; 
    line-height: 1.3; 
    letter-spacing: 0.5px;
}

/* Текст описания */
.service-text { 
    font-size: 0.85rem; 
    color: #888888; /* Светло-серый, воздушный текст */
    line-height: 1.6; 
    font-weight: 400; 
}

/* АДАПТАЦИЯ ДЛЯ ТЕЛЕФОНОВ */
@media (max-width: 900px) {
    .services-grid { 
        grid-template-columns: 1fr; 
        gap: 35px; 
    }
    .service-icon {
        width: 60px; /* На телефоне иконки чуть меньше */
        height: 60px;
    }
}

/* =========================================
   6. CLIENTS SECTION (LOGOS)
   ========================================= */
.clients-section { padding: 60px 0; background-color: var(--bg-light); border-top: 1px solid #eeeeee; }
.text-center { text-align: center; color: #999999; font-size: 1.2rem; font-weight: 500; letter-spacing: 2px; margin-bottom: 40px; }
.clients-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: center; justify-items: center; }
/* Рамка для каждого логотипа */
.client-item {
    width: 100%; height: 100px; display: flex; justify-content: center; align-items: center;
    padding: 15px; border: 1px solid #f0f0f0; border-radius: 6px; transition: all 0.3s ease; background: #ffffff;
}

/* Логотипы теперь всегда в оригинальном цвете */
.client-item img { 
    max-width: 120px; 
    max-height: 70px; 
    object-fit: contain; 
    transition: all 0.3s ease; 
}

/* Эффект при наведении: карточка всплывает, логотип чуть увеличивается */
.client-item:hover { 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); 
    transform: translateY(-3px); 
    border-color: #dcdcdc; 
}
.client-item:hover img { 
    transform: scale(1.05); 
}

@media (max-width: 900px) { .clients-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .clients-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; } .client-item { height: 80px; } .client-item img { max-width: 100px; } }

/* =========================================
   7. FOOTER SECTION (CONTACTS & FORM)
   ========================================= */
.classic-footer { padding: 60px 0 80px; background-color: #eef5fc; color: var(--text-dark); }
.footer-header h2 { color: var(--primary-blue); font-size: 1.4rem; font-weight: 600; margin-bottom: 40px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 20px; align-items: flex-start; }
.solid-panel { background: #ffffff; border: 1px solid #dce8f5; padding: 30px 25px; height: 100%; }

/* QR Блок */
.qr-title { font-size: 0.95rem; font-weight: 700; color: #1a73e8; text-align: center; margin-bottom: 20px; line-height: 1.3; }
.qr-img-wrapper img { width: 130px; height: 130px; margin: 0 auto; display: block; border: 3px solid #333; padding: 2px; }

/* Форма */
.form-title { font-size: 1.1rem; font-weight: 600; color: var(--primary-blue); margin-bottom: 25px; }
.contact-form { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: flex; align-items: center; gap: 15px; }
.form-row label { width: 90px; font-weight: 600; font-size: 0.85rem; color: var(--primary-blue); text-align: right; }
.form-row input { flex-grow: 1; padding: 10px 15px; border: 1px solid var(--primary-blue); outline: none; font-family: var(--font-main); transition: 0.3s; }
.form-row input:focus { box-shadow: 0 0 5px rgba(0, 102, 204, 0.3); }
.form-action { display: flex; align-items: center; gap: 20px; margin-top: 10px; padding-left: 105px; }
.btn-submit { padding: 8px 30px; border: 1px solid var(--primary-blue); background: transparent; color: var(--primary-blue); font-weight: 700; cursor: pointer; transition: 0.3s; }
.btn-submit:hover { background: var(--primary-blue); color: white; }
.form-disclaimer { font-size: 0.75rem; color: var(--text-gray); line-height: 1.3; }

/* Контакты */
.info-item { margin-bottom: 20px; display: flex; flex-direction: column; }
.info-label { font-size: 0.85rem; color: var(--primary-blue); font-weight: 700; margin-bottom: 5px; }
.info-val { font-size: 0.95rem; font-weight: 600; color: var(--text-dark); text-decoration: none; line-height: 1.4; }
.link-hover:hover { color: var(--primary-blue); }

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .solid-panel { height: auto; padding: 20px; }
    .form-row { flex-direction: column; align-items: flex-start; gap: 5px; }
    .form-row label { text-align: left; width: 100%; }
    .form-action { padding-left: 0; flex-direction: column; align-items: flex-start; }
}

/* --- ИСПРАВЛЕНИЕ ШАТАНИЯ НА МОБИЛЬНЫХ --- */

/* 1. Глобальная блокировка горизонтального скролла */
html, body {
    overflow-x: hidden;
}

/* 2. Уменьшаем текст главного экрана для телефонов */
@media (max-width: 768px) {
    .hero-content h1 { 
        font-size: 2rem; /* Существенно уменьшаем размер для мобилок */
        line-height: 1.2; 
    }
    
    .hero-content p { 
        font-size: 0.95rem; 
    }
    
    /* Дополнительно страхуем сертификаты, чтобы они не растягивали экран */
    .hero-certs {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* 3. Страховка для формы в футере (иногда инпуты тоже раздвигают экран) */
@media (max-width: 600px) {
    .form-row input {
        width: 100%;
    }
}