.maxic2__fix {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    z-index: 5;
    cursor: pointer;
}

.maxic2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, 
        #405DE6, #5851DB, #833AB4, #C13584, 
        #E1306C, #FD1D1D, #F56040, #F77737, 
        #FCAF45, #FFDC80, #405DE6);
    background-size: 400% 100%;
    animation: snake 3s linear infinite;
    mask: linear-gradient(#fff 0 0) content-box, 
          linear-gradient(#fff 0 0);
    mask-composite: exclude;
    padding: 2px;
}

@keyframes snake {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 400% 0%;
    }
}

.maxic2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

#bot-window {
    display: none; /* Скрыто по умолчанию, открывается функцией */
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    z-index: 10;
    background: white;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    border-radius: 15px 15px 0 0;
    font-family: Arial, sans-serif;
    font-weight: 400;
}

#bot-header {
    background: #f4f7f9;
    display: flex;
    justify-content: end;
    padding: 5px 15px;
    border-radius: 15px 15px 0 0;
    align-items: center;
    gap: 20px;
}

#bot-header > span {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    color: #333;
}

#bot-header > span::after {
    content: '×';
    color: #000;
    font-size: 21px;
}

.bot-header__msg {
    display: flex;
    gap: 10px;
    position: relative;
    top: 5px;
}

.bot-header__msg a {
    position: unset;
    width: 24px;
    height: 24px;
}

.bot-header__msg a::after,
.bot-header__msg a::before {
    display: none;
}

#chat-input-area button {
    background: linear-gradient(180deg, #0099F7 0%, #0077c1 100%);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

/* Стили для диалога и иконок */
#bot-chat-container { height: 400px; display: flex; flex-direction: column; background: #f4f7f9; }
#chat-content { flex-grow: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }

.msg-wrapper { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; }
.msg-wrapper.bot { align-self: flex-start; }
.msg-wrapper.user { align-self: flex-end; flex-direction: row-reverse; }

.manager-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: #ccc; /* Сюда вставите фото: background-image: url(...) */
    background-size: cover; flex-shrink: 0;
}

.msg { padding: 10px 15px; border-radius: 15px; font-size: 14px; line-height: 1.4; position: relative; }
.bot .msg { background: white; color: #333; border-bottom-left-radius: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.user .msg { background: #007bff; color: white; border-bottom-right-radius: 2px; }

.chat-btn { 
    display: block; width: 100%; border: 1px solid #007bff; background: white; color: #007bff; 
    padding: 8px; border-radius: 8px; margin-top: 5px; cursor: pointer; text-align: left;
}
.chat-btn:hover { background: #eef7ff; }

#chat-input-area { display: flex; padding: 5px 10px; border-top: 1px solid #eee; background: white; }
#chat-input { flex-grow: 1; border: none; outline: none; padding: 10px 0;}

.msg a { color: inherit; text-decoration: underline; }
.msg img { display: block; max-width: 100%; height: auto; }

/* Улучшение прокрутки для мобильных */
#chat-content {
    -webkit-overflow-scrolling: touch;
}

.chat-btn.selected {
    background: #007bff !important;
    color: #fff !important;
    border-color: #0056b3 !important;
}

.manager-avatar {
    background-image: url('../images/alexandr.webp');
}

.typing-indicator .msg::after {
    content: '';
    animation: typing-dots 1.5s infinite;
}

@keyframes typing-dots {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Сглаживание прокрутки */
#chat-content {
    scroll-behavior: smooth;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }