            /* ============================================
           CHAT WIDGET MEJORADO - VERSIÓN 2.0
           ============================================ */
        
            .floating-chat-widget {
                position: fixed;
                bottom: 25px;
                right: 25px;
                z-index: 10000;
                font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Roboto', sans-serif;
                
            }
        
            /* Burbuja principal */
            .floating-chat-widget .chat-bubble {
                width: 60px;
                height: 60px;
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                border-radius: 50%;
                cursor: pointer;
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
                transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
                display: flex;
                align-items: center;
                justify-content: center;
                position: relative;
            }
        
            .floating-chat-widget .chat-bubble:hover {
                transform: scale(1.1);
                box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
            }
        
            .floating-chat-widget .chat-bubble i {
                font-size: 28px;
                color: white;
            }
        
            /* Notificación */
            .floating-chat-widget .notification-badge {
                position: absolute;
                top: -5px;
                right: -5px;
                background: #ff4757;
                color: white;
                border-radius: 50%;
                width: 22px;
                height: 22px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 11px;
                font-weight: bold;
                animation: pulse 1.5s infinite;
            }
        
            @keyframes pulse {
        
                0%,
                100% {
                    transform: scale(1);
                }
        
                50% {
                    transform: scale(1.2);
                }
            }
        
            /* Ventana del chat */
            .floating-chat-widget .chat-window {
                position: fixed;
                bottom: 100px;
                right: 25px;
                width: 400px;
                height: 600px;
                background: white;
                border-radius: 20px;
                box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
                display: none;
                flex-direction: column;
                overflow: hidden;
                animation: slideIn 0.3s ease-out;
            }
        
            @keyframes slideIn {
                from {
                    opacity: 0;
                    transform: translateY(20px);
                }
        
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
        
            /* Header */
            .floating-chat-widget .chat-header {
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                color: white;
                padding: 15px 20px;
                display: flex;
                justify-content: space-between;
                align-items: center;
            }
        
            .floating-chat-widget .chat-header-info {
                display: flex;
                align-items: center;
                gap: 12px;
            }
        
            .floating-chat-widget .chat-avatar {
                width: 40px;
                height: 40px;
                background: rgba(255, 255, 255, 0.2);
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        
            .floating-chat-widget .chat-avatar i {
                font-size: 24px;
            }
        
            .floating-chat-widget .chat-header-text h4 {
                margin: 0;
                font-size: 16px;
                font-weight: 600;
            }
        
            .floating-chat-widget .chat-header-text p {
                margin: 0;
                font-size: 11px;
                opacity: 0.9;
            }
        
            .floating-chat-widget .chat-close {
                cursor: pointer;
                font-size: 28px;
                font-weight: 300;
                transition: all 0.2s;
                width: 30px;
                height: 30px;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 50%;
            }
        
            .floating-chat-widget .chat-close:hover {
                background: rgba(255, 255, 255, 0.2);
                transform: rotate(90deg);
            }
        
            /* Status indicator */
            .floating-chat-widget .chat-status {
                padding: 8px 20px;
                background: #f8f9fa;
                border-bottom: 1px solid #e0e0e0;
                display: flex;
                justify-content: space-between;
                align-items: center;
                font-size: 12px;
            }
        
            .floating-chat-widget .status-dot {
                width: 8px;
                height: 8px;
                background: #4caf50;
                border-radius: 50%;
                animation: blink 1s infinite;
            }
        
            @keyframes blink {
        
                0%,
                100% {
                    opacity: 1;
                }
        
                50% {
                    opacity: 0.5;
                }
            }
        
            /* Mensajes */
            .floating-chat-widget .chat-messages {
                flex: 1;
                padding: 20px;
                overflow-y: auto;
                background: #f8f9fa;
                display: flex;
                flex-direction: column;
                gap: 15px;
            }
        
            .floating-chat-widget .chat-messages::-webkit-scrollbar {
                width: 6px;
            }
        
            .floating-chat-widget .chat-messages::-webkit-scrollbar-track {
                background: #f1f1f1;
            }
        
            .floating-chat-widget .chat-messages::-webkit-scrollbar-thumb {
                background: #888;
                border-radius: 3px;
            }
        
            .floating-chat-widget .message {
                display: flex;
                animation: fadeIn 0.3s ease;
            }
        
            @keyframes fadeIn {
                from {
                    opacity: 0;
                    transform: translateY(10px);
                }
        
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
        
            .floating-chat-widget .message-user {
                justify-content: flex-end;
            }
        
            .floating-chat-widget .message-ai {
                justify-content: flex-start;
            }
        
            .floating-chat-widget .message-bubble {
                font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Roboto', sans-serif;
                background: white;
                padding: 15px 20px;
                /* Más padding interno */
                border-radius: 20px;
                border: 1px solid #e0e0e0;
                line-height: 1.6;
                font-size: 14px;
                width: 100%;
                /* Ocupa todo el ancho disponible */
                max-width: 500px;
                /* Máximo más grande */
                min-width: 300px;
                /* Mínimo más amplio */
            }
        
            .floating-chat-widget .message-user .message-bubble {
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                color: white;
                border-bottom-right-radius: 4px;
            }
        
            .floating-chat-widget .message-ai .message-bubble {
                background: white;
                color: #333;
                border: 1px solid #e0e0e0;
                border-bottom-left-radius: 4px;
            }
        
            .floating-chat-widget .message-time {
                font-size: 10px;
                margin-top: 5px;
                opacity: 0.6;
            }
        
            .floating-chat-widget .message-user .message-time {
                text-align: right;
                color: #667eea;
            }
        
            .floating-chat-widget .message-ai .message-time {
                text-align: left;
                color: #999;
            }
        
            .floating-chat-widget .message-avatar {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                margin-right: 8px;
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            }
        
            .floating-chat-widget .message-avatar i {
                font-size: 18px;
                color: white;
            }
        
            /* Sugerencias */
            .floating-chat-widget .chat-suggestions {
                padding: 10px 15px;
                background: white;
                border-top: 1px solid #e0e0e0;
                display: flex;
                gap: 8px;
                overflow-x: auto;
                white-space: nowrap;
            }
        
            .floating-chat-widget .chat-suggestions::-webkit-scrollbar {
                height: 4px;
            }
        
            .floating-chat-widget .suggestion-chip {
                background: #f0f0f0;
                padding: 6px 12px;
                border-radius: 20px;
                font-size: 12px;
                cursor: pointer;
                transition: all 0.2s;
                display: inline-block;
            }
        
            .floating-chat-widget .suggestion-chip:hover {
                background: #667eea;
                color: white;
                transform: translateY(-2px);
            }
        
            /* Typing indicator */
            .floating-chat-widget .typing-indicator {
                display: flex;
                align-items: center;
                gap: 4px;
                padding: 10px 14px;
                background: white;
                border-radius: 18px;
                border: 1px solid #e0e0e0;
                width: fit-content;
            }
        
            .floating-chat-widget .typing-indicator span {
                width: 8px;
                height: 8px;
                background: #999;
                border-radius: 50%;
                animation: typing 1.4s infinite;
            }
        
            .floating-chat-widget .typing-indicator span:nth-child(2) {
                animation-delay: 0.2s;
            }
        
            .floating-chat-widget .typing-indicator span:nth-child(3) {
                animation-delay: 0.4s;
            }
        
            @keyframes typing {
        
                0%,
                60%,
                100% {
                    transform: translateY(0);
                    opacity: 0.4;
                }
        
                30% {
                    transform: translateY(-10px);
                    opacity: 1;
                }
            }
        
            /* Input area */
            .floating-chat-widget .chat-input-area {
                padding: 15px 20px;
                background: white;
                border-top: 1px solid #e0e0e0;
                display: flex;
                gap: 10px;
                align-items: center;
            }
        
            .floating-chat-widget .chat-input-area input {
                flex: 1;
                border: 1px solid #e0e0e0;
                border-radius: 25px;
                padding: 10px 15px;
                font-size: 13px;
                outline: none;
                transition: all 0.3s;
                font-family: inherit;
            }
        
            .floating-chat-widget .chat-input-area input:focus {
                border-color: #667eea;
                box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
            }
        
            .floating-chat-widget .chat-input-area button {
                width: 38px;
                height: 38px;
                border-radius: 50%;
                border: none;
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                color: white;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: all 0.2s;
            }
        
            .floating-chat-widget .chat-input-area button:hover:not(:disabled) {
                transform: scale(1.05);
            }
        
            .floating-chat-widget .chat-input-area button:disabled {
                opacity: 0.5;
                cursor: not-allowed;
            }
        
            .floating-chat-widget .chat-input-area button i {
                font-size: 18px;
            }
        
            /* Responsive */
            @media (max-width: 768px) {
                .floating-chat-widget .chat-window {
                    width: calc(100vw - 40px);
                    height: calc(100vh - 40px);
                    bottom: 20px;
                    right: 20px;
                }
            }
        
            /* Estilos para el mensaje de error en el footer */
            .chat-footer {
                padding: 8px 15px;
                background: #fff;
                border-top: 1px solid #e0e0e0;
            }
        
            .error-message {
                display: flex;
                align-items: center;
                gap: 10px;
                background: #ffebee;
                color: #c62828;
                padding: 8px 12px;
                border-radius: 8px;
                font-size: 12px;
                animation: slideIn 0.3s ease;
            }
        
            .error-message .error-icon {
                font-size: 16px;
            }
        
            .error-message .error-text {
                flex: 1;
            }
        
            .error-message .error-close {
                background: none;
                border: none;
                font-size: 18px;
                cursor: pointer;
                color: #c62828;
                opacity: 0.7;
            }
        
            .error-message .error-close:hover {
                opacity: 1;
            }
        
            @keyframes slideIn {
                from {
                    opacity: 0;
                    transform: translateY(-10px);
                }
        
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }