/* ============================================
   ПЛАВАЮЩИЙ ЧАТ
   ============================================ */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.chat-button {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--transition);
    animation: pulse 2s infinite;
}

.chat-button:hover {
    transform: scale(1.1);
}

.chat-button .chat-icon-open {
    display: block;
}

.chat-button .chat-icon-close {
    display: none;
}

.chat-button.active .chat-icon-open {
    display: none;
}

.chat-button.active .chat-icon-close {
    display: block;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    background: var(--color-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.chat-window.active {
    display: flex;
}

.chat-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-header-info h5 {
    font-size: 1rem;
    font-weight: 600;
}

.chat-header-info p {
    font-size: 0.8rem;
    opacity: 0.9;
}

.chat-status {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.chat-body {
    padding: 20px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--color-gray-100);
}

.chat-message {
    margin-bottom: 16px;
}

.chat-message.manager {
    text-align: left;
}

.chat-message.manager .message-bubble {
    background: var(--color-white);
    border-radius: 16px 16px 16px 4px;
}

.chat-message.user {
    text-align: right;
}

.chat-message.user .message-bubble {
    background: var(--color-primary);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.message-bubble {
    display: inline-block;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 80%;
}

.message-time {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.chat-footer {
    padding: 16px;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-300);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-gray-300);
    border-radius: 60px;
    font-family: inherit;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--color-primary-dark);
}