/* Base Styles */
:root {
    /* Основные цвета */
    --primary-color: #2B50AA;
    --secondary-color: #004B8D;
    --accent-color: #00A1E0;
    --dark-color: #1E293B;
    --light-color: #F8FAFC;
    --gray-color: #64748B;
    --light-gray: #E2E8F0;

    /* Шрифт */
    --font-family: 'Roboto', sans-serif;

    /* Размеры шрифта */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    --font-5xl: 3rem;

    /* Другие переменные */
    --container-max-width: 1200px;
    --section-spacing: 5rem;
    /* ИЗМЕНЕНИЕ ЗДЕСЬ: Устанавливаем желаемое "слегка закругленное" значение */
    --border-radius: 12px;
    /* Например, 8px. Можете выбрать 10px или 12px */
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;

    /* НОВЫЕ ПЕРЕМЕННЫЕ ДЛЯ РЕДИЗАЙНА */
    --hero-text-color: #333333;
    --header-bg: #FFFFFF;
    --header-border-color: #E2E8F0;
    --hero-bg-shape-color: rgba(230, 235, 250, 0.6);
    --new-hero-h1-font-size: 3.25rem;
    --new-hero-h1-line-height: 1.35;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-md);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    padding: 0 1rem;
    margin: 0 auto;
}

/* Common Elements */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: var(--font-4xl);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-header p {
    font-size: var(--font-lg);
    color: var(--gray-color);
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-transform: uppercase;
    font-size: var(--font-sm);
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-contact {
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
}

.btn-contact:hover {
    background-color: var(--primary-color);
    color: white;
}

/* --- СТАРАЯ ШАПКА (если нет класса .new-header-style) --- */
header:not(.new-header-style) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    padding: 1rem 0;
}

header:not(.new-header-style).scrolled {
    padding: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.98);
}

/* --- НОВАЯ ШАПКА --- */
header.new-header-style {
    background-color: var(--header-bg);
    box-shadow: none;
    border-bottom: 1px solid var(--header-border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: none !important;
}

header.new-header-style.scrolled {
    padding: 0.75rem 0;
    background-color: var(--header-bg) !important;
    box-shadow: none !important;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    color: var(--dark-color);
    font-weight: 700;
    font-size: var(--font-xl);
}

.logo img {
    height: 40px;
    width: auto;
    margin-right: 0.5rem;
}

.new-header-style .main-nav {
    /* Стили для мобильного меню (display: none/block, position: fixed и т.д.) находятся в responsive.css */
}

.new-header-style .main-nav ul {
    display: flex;
    /* По умолчанию для десктопа */
    gap: 1.75rem;
    align-items: center;
}

.new-header-style .main-nav ul li a {
    color: var(--dark-color);
    font-weight: 500;
    position: relative;
}

.new-header-style .main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.new-header-style .main-nav ul li a:hover::after,
.new-header-style .main-nav ul li a.active::after {
    width: 100%;
}

.new-header-style .main-nav ul li.mobile-lang-switcher-item {
    display: none;
}

.new-header-style .header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.new-header-style .language-switcher.simple.desktop-lang-switcher {
    font-size: var(--font-sm);
}

.new-header-style .language-switcher.simple.desktop-lang-switcher a,
.new-header-style .language-switcher.simple.desktop-lang-switcher strong {
    color: var(--gray-color);
    text-decoration: none;
    padding: 0.1rem 0.2rem;
}

.new-header-style .language-switcher.simple.desktop-lang-switcher strong {
    font-weight: 700;
    color: var(--primary-color);
}

.new-header-style .language-switcher.simple.desktop-lang-switcher .lang-separator {
    color: var(--light-gray);
    margin: 0 0.3em;
}

.new-header-style .btn-leave-request {
    background-color: var(--primary-color);
    color: white;
    border-radius: 25px;
    /* Это специфичное сильное закругление остается */
    padding: 0.6rem 1.2rem;
    font-size: var(--font-sm);
    font-weight: 500;
    text-transform: none;
    border: none;
}

.new-header-style .btn-leave-request:hover {
    background-color: var(--secondary-color);
    color: white;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--dark-color);
    transition: var(--transition);
    border-radius: 2px;
}

/* --- СТАРАЯ СЕКЦИЯ HERO --- */
#hero:not(.new-hero-style) {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../img/hero-bg.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
    padding-top: 80px;
}

#hero:not(.new-hero-style) .hero-content {
    max-width: 800px;
    margin: 0 auto;
}

#hero:not(.new-hero-style) .hero-content h1 {
    font-size: var(--font-5xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: white;
}

#hero:not(.new-hero-style) .hero-content h1 span {
    color: var(--accent-color);
}

#hero:not(.new-hero-style) .hero-content p {
    font-size: var(--font-xl);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: white;
}

#hero:not(.new-hero-style) .hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* --- НОВАЯ СЕКЦИЯ HERO (стили для h1 и его содержимого остаются НЕИЗМЕННЫМИ) --- */
section#hero.new-hero-style {
    height: auto;
    min-height: 70vh;
    background: var(--header-bg);
    color: var(--hero-text-color);
    padding: 7rem 0 6rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

section#hero.new-hero-style::before {
    content: none !important;
}

/* .hero-background-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120vw;
    height: 450px;
    border-radius: 50%;
    transform: translate(-50%, -70%) scaleY(0.65);
    background: radial-gradient(ellipse at 50% 100%,
            var(--accent-color) 0%,
            rgba(255, 255, 255, 0) 60%);
    z-index: 1;
} */

.hero-background-shape {
    position: absolute;
    top: 50%;
    /* Это позиционирует центр эллипса по вертикали */
    left: 50%;
    width: 120vw;
    /* Ширина эллипса */
    height: 450px;
    /* Высота эллипса */
    border-radius: 50%;
    /* Делает его эллипсом (или кругом, если width=height) */

    /* ИЗМЕНЕНИЕ: Позиционирование эллипса и градиента */
    /* Чтобы "дуга" была сверху, а градиент шел вниз,
       нам нужно сместить сам эллипс так, чтобы его верхняя часть была видима,
       и изменить точку начала радиального градиента. */

    transform: translate(-50%, -55%) scaleY(0.65);
    /* 
        translateY(-30%) немного поднимает эллипс, чтобы его верхняя часть была выраженнее вверху.
        Раньше было -70%, что сильно смещало его вверх и показывало нижнюю дугу.
        scaleY(0.65) все еще сплющивает его.
        Подберите translateY, чтобы позиция дуги вам нравилась.
    */

    background: radial-gradient(ellipse at 50% 0%,
            /* <--- ИЗМЕНЕНО: Градиент начинается СВЕРХУ по центру эллипса */
            /* Цвет начала градиента (верхняя "дуга") */
            rgba(0, 161, 224, 0.15) 0%,
            /* <--- ИЗМЕНЕНО: var(--accent-color) с нужной прозрачностью (0.25 = 25%) */
            /* Подберите эту прозрачность (0.1 - 0.3 будет довольно мягко) */

            /* Цвет окончания градиента (переход в фон страницы) */
            rgba(248, 250, 252, 0) 65%
            /* <--- ИЗМЕНЕНО: var(--light-color) в RGB с opacity 0. 
                                         Процент 65% означает, что к 65% радиуса градиент станет полностью прозрачным.
                                         Увеличьте, если хотите, чтобы градиент был "длиннее". */
        );
    z-index: 1;
    /* Под текстом */
    /* opacity: 0.7; /* <--- Этот opacity можно убрать или уменьшить, так как прозрачность теперь в градиенте.
                        Если оставите, он будет применяться поверх прозрачности градиента.
                        Для большей прозрачности уберите его или поставьте, например, opacity: 0.5; */
}

.new-hero-style .hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    margin: 0 auto;
}

.new-hero-style .hero-content h1 {
    /* Стили для h1 остаются без изменений */
    font-size: var(--new-hero-h1-font-size);
    font-weight: 700;
    line-height: var(--new-hero-h1-line-height);
    color: var(--hero-text-color);
    margin: 0;
    text-align: center;
}

.hero-first-line-wrapper {
    /* Стили для обертки первой строки остаются без изменений */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: calc(var(--new-hero-h1-font-size) * var(--new-hero-h1-line-height));
}

.static-text-part {
    /* Стили для статического текста остаются без изменений */
    display: inline-block;
    padding-right: 0.2em;
}

.animated-word-container {
    /* Стили для контейнера анимации остаются без изменений */
    display: inline-block;
    position: relative;
    height: calc(var(--new-hero-h1-font-size) * var(--new-hero-h1-line-height));
    overflow: hidden;
    vertical-align: baseline;
    font-weight: inherit;
    width: 7em;
    text-align: left;
}

.animated-word {
    /* Стили для анимируемых слов остаются без изменений */
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    line-height: inherit;
    color: var(--primary-color);
    text-align: left;
    opacity: 0;
    transform: translateY(30%);
    transition-property: transform, opacity;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

.animated-word.is-visible {
    opacity: 1;
    transform: translateY(0);
    z-index: 2;
}

.animated-word.is-exiting {
    opacity: 0;
    transform: translateY(-30%);
    transition-timing-function: cubic-bezier(0.64, 0, 0.78, 0);
    z-index: 3;
}

.new-hero-style .hero-content p,
.new-hero-style .hero-buttons {
    display: none !important;
}

/* --- Конец секции НОВАЯ СЕКЦИЯ HERO --- */


/* About Section */
#about {
    padding: var(--section-spacing) 0;
    background-color: white;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--gray-color);
}

.about-stats {
    flex: 1;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    display: block;
    font-size: var(--font-4xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-text {
    font-size: var(--font-md);
    color: var(--gray-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Services Section */
#services {
    padding: var(--section-spacing) 0;
    background-color: var(--light-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: white;
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
    padding: 2rem;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--primary-color);
    opacity: 0.05;
    transition: var(--transition);
    z-index: -1;
    border-radius: inherit;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.service-card:hover::before {
    height: 100%;
}

.service-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(43, 80, 170, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon img {
    width: 40px;
    height: 40px;
}

.service-card h3 {
    font-size: var(--font-xl);
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.service-card p {
    color: var(--gray-color);
}

/* Portfolio Section */
#portfolio {
    padding: var(--section-spacing) 0;
    background-color: white;
}

.portfolio-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background-color: transparent;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: var(--font-md);
    font-weight: 500;
    color: var(--gray-color);
    transition: var(--transition);
    position: relative;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--primary-color);
}

.filter-btn:hover::after,
.filter-btn.active::after {
    width: 100%;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
    overflow: hidden;
    position: relative;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.portfolio-image {
    position: relative;
    height: 250px;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 41, 59, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition);
    border-radius: inherit;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-info {
    text-align: center;
    color: white;
}

.portfolio-info h3 {
    font-size: var(--font-lg);
    margin-bottom: 0.75rem;
}

.portfolio-info p {
    font-size: var(--font-sm);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.btn-more {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
    font-size: var(--font-sm);
    transition: var(--transition);
}

.btn-more:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Contact Section */
#contact {
    padding: var(--section-spacing) 0;
    background-color: var(--light-color);
}

.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(43, 80, 170, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
}

.contact-icon img {
    width: 24px;
    height: 24px;
}

.contact-text h3 {
    font-size: var(--font-lg);
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.contact-text p {
    color: var(--gray-color);
}

.contact-form {
    flex: 1;
    min-width: 300px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    /* Использует обновленную переменную */
    font-family: var(--font-family);
    font-size: var(--font-md);
    color: var(--dark-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(43, 80, 170, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.btn-submit {
    width: 100%;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding-top: 4rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    flex: 1;
    min-width: 250px;
}

.footer-logo img {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 300px;
}

.footer-links {
    flex: 2;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-column h3 {
    color: white;
    font-size: var(--font-lg);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-column ul li {
    margin-bottom: 0.75rem;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-social {
    flex: 1;
    min-width: 250px;
}

.footer-social h3 {
    color: white;
    font-size: var(--font-lg);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-social h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

.social-icon img {
    width: 18px;
    height: 18px;
}

.footer-bottom {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-policy {
    display: flex;
    gap: 1.5rem;
}

.footer-policy a {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-sm);
}

.footer-policy a:hover {
    color: var(--accent-color);
}

/* --- Floating Contact Widget --- */
#floating-contact-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#floating-contact-widget .contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#floating-contact-widget .contact-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#floating-contact-widget .whatsapp {
    background-color: #25D366;
}

#floating-contact-widget .telegram {
    background-color: #0088cc;
}

#floating-contact-widget .phone {
    background-color: var(--primary-color);
}

#floating-contact-widget .contact-icon svg {
    width: 24px;
    height: 24px;
}

/* --- Floating Chatbot Widget --- */
#floating-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    display: flex;
    align-items: center;
}

#floating-chatbot-widget #chatbot-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    order: 2;
}

#floating-chatbot-widget #chatbot-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#floating-chatbot-widget #chatbot-toggle-button svg {
    width: 24px;
    height: 24px;
}

.chatbot-bubble {
    position: relative;
    background-color: var(--accent-color);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    margin-right: 12px;
    font-size: var(--font-sm);
    /* white-space: nowrap; */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    order: 1;

    /* НОВЫЕ СВОЙСТВА ДЛЯ МНОГОСТРОЧНОСТИ */
    max-width: 150px;
    /* <--- ЗАДАЕМ МАКСИМАЛЬНУЮ ШИРИНУ. Подберите значение! */
    /* Это значение не должно быть слишком маленьким, чтобы текст не стал слишком "узким" */
    word-wrap: break-word;
    /* Позволяет переносить длинные слова, если они не помещаются */
    line-height: 1.4;
    /* <--- Можно немного увеличить межстрочный интервал для читаемости */
    text-align: left;
    /* <--- Выравнивание текста внутри пузыря (или center, если хотите) */

}

.chatbot-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid var(--accent-color);
}

/* --- Chatbot Popup Window --- */
#chatbot-popup {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    height: 450px;
    max-height: 70vh;
    background-color: white;
    border-radius: 8px;
    /* Использует свой радиус */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1070;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#chatbot-popup.chatbot-popup-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chatbot-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Для скругления верхних углов шапки чата, если #chatbot-popup скруглен */
    /* border-top-left-radius: inherit; */
    /* Не всегда работает как ожидается, если overflow:hidden на родителе */
    /* border-top-right-radius: inherit; */
}

#chatbot-title {
    font-weight: 500;
    font-size: var(--font-lg);
}

#chatbot-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
}

.chatbot-messages-container {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--light-color);
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background-color: var(--accent-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.bot-message {
    background-color: #E9E9EB;
    color: var(--dark-color);
    margin-right: auto;
    border-bottom-left-radius: 2px;
}

.chatbot-input-area {
    border-top: 1px solid var(--light-gray);
    padding: 10px;
    background-color: white;
    flex-shrink: 0;
    /* Для скругления нижних углов области ввода, если #chatbot-popup скруглен */
    /* border-bottom-left-radius: inherit; */
    /* border-bottom-right-radius: inherit; */
}

#chatbot-form {
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-md);
}

#chatbot-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(43, 80, 170, 0.2);
}

#chatbot-send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

#chatbot-send-button:hover {
    background-color: var(--secondary-color);
}

#chatbot-send-button svg {
    width: 20px;
    height: 20px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 10px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: var(--gray-color);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}