/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    /* Выстраиваем элементы шапки вертикально по центру */
    .header-wrap {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 10px;
    }

    /* Делаем логотип чуть меньше и центрируем его */
    .logo-link {
        flex-direction: column;
        gap: 8px;
    }

    .logo-img {
        height: 50px; /* Уменьшаем высоту для мобильных */
    }

    .logo-link h1 {
        font-size: 1.2rem; /* Уменьшаем шрифт заголовка */
        white-space: normal; /* Разрешаем перенос длинного названия */
    }

    /* Меню выстраиваем в ряд с переносом, если не помещается */
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav-menu li {
        font-size: 0.9rem;
    }

    /* Кнопки языков делаем в один ряд под меню */
    .lang-item {
        margin-left: 0;
        margin-top: 10px;
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

/* Переменные для легкого управления цветами */
:root {
    --primary-color: #2d3748;
    --accent-color: #d4af37;
    --text-color: #4a5568;
    --bg-light: #f7fafc;
    --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    line-height: 1.6; 
    background: var(--bg-light); 
    color: var(--text-color);
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* Хедер: идеально под белый фон логотипа */
header {
    background-color: var(--white);
    border-bottom: 3px solid var(--accent-color);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo-link:hover { transform: scale(1.02); }

.logo-img {
    height: 75px;
    width: auto;
}

.logo-link h1 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Меню навигации */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: 0.3s;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.nav-menu a:hover { color: var(--accent-color); }
.nav-menu a:hover::after { width: 100%; }

/* Блок языков */
.lang-item {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.lang-item button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.75rem;
    transition: all 0.3s;
}

.lang-item button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Сетка карточек */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    padding: 40px 0;
}

.card { 
    background: var(--white); 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: 0.3s;
    border-top: 4px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent-color);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.25rem;
}

/* Кнопка системы */
#test-btn {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
}

/* Контейнер чата */
#chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

#chat-open-btn {
    background: #d4af37;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    font-weight: bold;
}

#chat-window {
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

#chat-header {
    background: #2d3748;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-messages {
    height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #f7fafc;
}

#chat-options {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.opt-btn {
    background: #edf2f7;
    border: 1px solid #cbd5e0;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: 0.2s;
}

.opt-btn:hover { background: #d4af37; color: white; }

.user-msg { text-align: right; color: #2d3748; font-weight: bold; margin: 5px 0; }
.bot-msg { color: #4a5568; background: #e2e8f0; padding: 8px; border-radius: 8px; margin: 5px 0; }

/* Адаптивность */
@media (max-width: 850px) {
    .header-wrap { flex-direction: column; gap: 15px; }
    .nav-menu { gap: 15px; }
    .logo-img { height: 60px; }
}

.hidden { display: none !important; }

#chat-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; }
#chat-open-btn { background: #d4af37; color: white; border: none; padding: 12px 20px; border-radius: 25px; cursor: pointer; }
#chat-window { width: 300px; background: white; border: 1px solid #ccc; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
#chat-header { background: #2d3748; color: white; padding: 10px; display: flex; justify-content: space-between; border-radius: 10px 10px 0 0; }
#chat-messages { height: 200px; overflow-y: auto; padding: 10px; background: #f7fafc; }
#chat-options { padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.opt-btn { background: #edf2f7; border: 1px solid #cbd5e0; padding: 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.user-msg { text-align: right; color: #2d3748; font-weight: bold; margin: 5px 0; }
.bot-msg { background: #e2e8f0; padding: 8px; border-radius: 8px; margin: 5px 0; }

.hidden { display: none !important; }

#chat-container { position: fixed; bottom: 20px; right: 20px; z-index: 1000; }

#chat-open-btn { 
    background: #d4af37; color: white; border: none; 
    padding: 12px 25px; border-radius: 30px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-weight: bold;
}

#chat-window { 
    width: 320px; background: white; border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column; 
}

#chat-header { 
    background: #2d3748; color: white; padding: 12px; 
    display: flex; justify-content: space-between; border-radius: 15px 15px 0 0; 
}

#chat-messages { height: 200px; overflow-y: auto; padding: 15px; background: #f8f9fa; }

.opt-btn { 
    width: 100%; background: #fff; border: 1px solid #d4af37; 
    padding: 8px; margin-bottom: 5px; border-radius: 8px; 
    cursor: pointer; text-align: left; font-size: 0.85rem; transition: 0.3s;
}
.opt-btn:hover { background: #d4af37; color: white; }
#helper-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 1000; }

#helper-trigger { 
    background: #d4af37; color: white; border: none; 
    padding: 12px 25px; border-radius: 30px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); font-weight: bold;
}

#helper-ui { 
    width: 320px; background: white; border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); display: flex; flex-direction: column; 
}

#helper-top { 
    background: #2d3748; color: white; padding: 12px; 
    display: flex; justify-content: space-between; border-radius: 15px 15px 0 0; 
}

#helper-body { height: 200px; overflow-y: auto; padding: 15px; background: #f8f9fa; }

#helper-list { padding: 10px; }

/* Остальные стили (opt-btn, user-msg, bot-msg) можно оставить без изменений */