/* =======================================================
   1. БАЗОВЫЕ НАСТРОЙКИ И ЦВЕТА
   ======================================================= */
:root {
    --bg-main: #0f0f0f;      /* Фон сайта */
    --bg-black: #000000;     /* Черный для шапки/футера */
    --bg-card: #161616;      /* Фон блоков */
    --accent: #ff8c00;       /* Оранжевый ТЕХНОЮНГ */
    --accent-hover: #ffaa33; /* Светло-оранжевый */
    --text-main: #d1d1d1;    /* Светлый текст */
    --text-muted: #777777;   /* Серый текст */
    --border: #222222;       /* Линии */
}

* { box-sizing: border-box; outline: none; }

html { scroll-behavior: smooth; }

/* Прижатый футер */
body {
    margin: 0; padding: 0; width: 100%;
    min-height: 100vh;
    display: flex; flex-direction: column;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

main { flex-grow: 1; } /* Толкает футер вниз */

/* =======================================================
   2. ШАПКА (ВЕРХНЯЯ ПОЛОСА И HEADER)
   ======================================================= */
.top-bar {
    background-color: var(--bg-black);
    border-bottom: 1px solid #111;
    padding: 8px 0;
    width: 100%;
    z-index: 1002;
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.top-bar .container {
    display: flex; justify-content: space-between; align-items: center;
    color: var(--text-muted); font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px;
}

header {
    background-color: var(--bg-black);
    border-bottom: 1px solid var(--border);
    width: 100%;
    z-index: 1001;
    position: relative;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.main-header {
    display: flex; justify-content: space-between; align-items: center; padding: 20px 0;
}

.logo-block { display: flex; align-items: center; text-decoration: none; gap: 15px; }
.logo-img { height: 65px; width: auto; }
.logo-text { font-size: 28px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.logo-text span { color: var(--accent); }

.header-phone { font-size: 24px; font-weight: bold; color: var(--accent); text-decoration: none; transition: 0.3s; }
.header-phone:hover { color: #fff; }

.main-nav {
    background-color: #111;
    border-bottom: 2px solid var(--accent);
    position: sticky; top: 0; z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.main-nav a {
    display: block; color: #fff; padding: 15px 18px; /* Исправлено padding */
    text-decoration: none; font-weight: 600; font-size: 13px; text-transform: uppercase; transition: 0.3s;
}
.main-nav a:hover, .main-nav a.active { background-color: var(--accent); color: #000; }

/* Класс для скрытия шапки скриптом */
.header-hidden { transform: translateY(-100%); opacity: 0; }

/* =======================================================
   3. ГЛАВНЫЙ МАКЕТ, КАРТИНКИ И СЕТКА
   ======================================================= */
.valve-image { 
    width: 100%; max-width: 1000px; height: auto; 
    display: block; margin: 0 auto 30px; 
}

.layout { display: flex; gap: 40px; margin: 40px 0; align-items: flex-start; }
aside { width: 280px; flex-shrink: 0; }

.side-menu { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; }
.side-menu-head { background: var(--accent); color: #000; padding: 15px; font-weight: bold; text-transform: uppercase; }
.side-menu a { display: block; padding: 12px 20px; color: #aaa; text-decoration: none; border-bottom: 1px solid #222; transition: 0.3s; }
.side-menu a:hover { background: #222; color: #fff; padding-left: 25px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    padding: 30px 15px; text-align: center; border-radius: 4px;
    display: flex; flex-direction: column; justify-content: space-between; transition: 0.3s;
    scroll-margin-top: 100px;
}
.card:hover { border-color: var(--accent); }
.card-highlight { border-color: var(--accent) !important; box-shadow: 0 0 25px rgba(255, 140, 0, 0.4); transform: scale(1.02); }

.card img { max-width: 100%; height: 140px; object-fit: contain; margin-bottom: 15px; }
.card h3 { font-size: 16px; color: #fff; margin: 10px 0 20px 0; min-height: 40px; }

/* =======================================================
   4. СТИЛИ ДЛЯ ЛОГОТИПОВ БРЕНДОВ (1:1)
   ======================================================= */
.alphabet-letter { color: var(--accent); font-size: 32px; font-weight: bold; border-bottom: 1px solid #333; margin: 40px 0 20px; display: block; }
.brands-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.brand-item { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    padding: 12px 15px; 
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    -webkit-user-select: none;  /* Запрет выделения в Safari/Chrome */
    -moz-user-select: none;     /* Запрет в Firefox */
    -ms-user-select: none;      /* Запрет в IE */
    user-select: none;          /* Стандартный запрет */
    -webkit-touch-callout: none; /* Запрет вызова системного меню на iOS/Android */
    -webkit-tap-highlight-color: transparent; /* Убираем синюю заливку при нажатии в Chrome на Android */
}

.brand-logo-wrap {
    width: 44px; height: 44px; background: #1a1a1a; 
    border-radius: 4px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden; border: 1px solid #333; position: relative;
}

.brand-logo-wrap img {
    width: 30px; height: 30px; object-fit: contain; 
    filter: grayscale(1) brightness(1.2); transition: 0.3s ease;
    position: relative; z-index: 2; background: #222;
}

.brand-letter {
    position: absolute; z-index: 1;
    color: #444; font-weight: bold; font-size: 18px; text-transform: uppercase;
}

.brand-item:hover { border-color: var(--accent); background: #1a1a1a; transform: translateY(-2px); }
.brand-item:hover img { filter: grayscale(0) brightness(1); transform: scale(1.1); }
.brand-item:hover .brand-name { color: var(--accent); }
.brand-item:hover .brand-letter { color: var(--accent); opacity: 0.3; }

.brand-content { display: flex; flex-direction: column; overflow: hidden; }
.brand-name { color: #fff; font-weight: bold; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.brand-desc { color: #666; font-size: 11px; line-height: 1.2; }

.notice-box { background: #111; border-left: 4px solid var(--accent); padding: 25px; margin-top: 50px; color: #aaa; font-size: 14px; }


/* =======================================================
   5. ФОРМЫ И КОНТАКТЫ
   ======================================================= */
.contact-grid { display: flex; justify-content: space-between; gap: 50px; margin-top: 30px; }
.contact-info-block { flex: 0 0 45%; }
.contact-form-block { flex: 0 0 50%; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 13px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px; background: #111; border: 1px solid var(--border); color: #fff; border-radius: 4px; transition: 0.3s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }

.policy-agreement { display: flex; gap: 10px; font-size: 12px; margin-top: 15px; color: var(--text-muted); }
.policy-agreement a { color: var(--text-muted); text-decoration: underline; transition: 0.3s; }
.policy-agreement a:hover { color: var(--accent); }

.btn {
    background: var(--accent); color: #000 !important;
    padding: 12px 25px; text-decoration: none; font-weight: bold;
    border-radius: 4px; display: inline-block; text-transform: uppercase; font-size: 12px; border: none; cursor: pointer; transition: 0.3s;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* Защита контактов */
#js-phone-head, #js-phone-cont, #js-email-cont, #js-email-1, #js-email-2, #js-email-3, #js-email-foot { 
    min-width: 120px; display: inline-block; 
}

/* =======================================================
   6. ПОДВАЛ (FOOTER)
   ======================================================= */
footer {
    background-color: var(--bg-black);
    padding: 40px 0; border-top: 1px solid var(--border);
    color: var(--text-muted); width: 100%; margin-top: auto; text-align: center;
}
footer .container { display: flex; flex-direction: column; align-items: center; }
footer a { color: var(--text-muted) !important; text-decoration: none; font-size: 12px; transition: 0.3s ease; }
footer a:hover { color: var(--accent) !important; text-decoration: underline; }
.footer-links { margin-top: 10px; font-size: 12px; }

/* =======================================================
   7. АДАПТИВНОСТЬ (МОБИЛЬНАЯ ВЕРСИЯ)
   ======================================================= */
@media (max-width: 992px) {
    .grid { grid-template-columns: repeat(2, 1fr) !important; }
    .layout { flex-direction: column; }
    aside { width: 100%; }
    .side-menu { position: static; margin-bottom: 30px; }
}

@media (max-width: 768px) {
    .top-bar .container { flex-direction: column; text-align: center; gap: 5px; }
    .main-header { flex-direction: column !important; text-align: center; gap: 20px; }
    .header-phone { font-size: 20px; }
    .logo-text { font-size: 22px; }
    
    .main-nav ul { flex-direction: column; }
    .main-nav a { text-align: center; border-bottom: 1px solid #222; padding: 12px !important; }

    .contact-grid { flex-direction: column; }
    .contact-info-block, .contact-form-block { flex: 0 0 100%; width: 100%; }

    .grid { grid-template-columns: 1fr !important; }
    
    h1 { font-size: 26px !important; text-align: center; border: none !important; padding: 0 !important; }
    h2 { font-size: 22px !important; text-align: center; }

    /* ФИКС СТАТИСТИКИ НА ГЛАВНОЙ */
    .stats-wrap { flex-direction: column !important; gap: 30px !important; text-align: center; }
    .stats-wrap > div[style*="display: grid"] { grid-template-columns: 1fr !important; width: 100% !important; }

    .valve-image { width: 100%; padding: 0 10px; }
}