/* Botón flotante */
#ai-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    background: linear-gradient(90deg, #a78bfa 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.1rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 18px 0 rgba(80,0,180,0.13), 0 1.5px 4px 0 rgba(80,0,180,0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.18s cubic-bezier(.4,2,.6,1), box-shadow 0.2s, background 0.3s;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    width: auto;
    height: auto;
}
#ai-toggle:hover {
    transform: scale(1.07) translateY(-2px);
    box-shadow: 0 8px 28px 0 rgba(80,0,180,0.18), 0 2px 8px 0 rgba(80,0,180,0.10);
    background: linear-gradient(90deg, #7c3aed 0%, #6366f1 100%);
}
#ai-toggle i {
    font-size: 1.25rem;
}
#ai-toggle-text {
    font-size: 0.98rem;
    font-weight: 500;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(124,58,237,0.18); }
    70% { box-shadow: 0 0 0 12px rgba(124,58,237,0.04); }
    100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.18); }
}
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg);}
    15% { transform: rotate(-12deg);}
    25% { transform: rotate(10deg);}
    35% { transform: rotate(-8deg);}
    45% { transform: rotate(6deg);}
    55% { transform: rotate(-4deg);}
    65% { transform: rotate(2deg);}
    75%, 95% { transform: rotate(0deg);}
}

/* Widget */
#chat-widget {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 370px;
    max-width: 98vw;
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px rgba(139,92,246,0.18), 0 1.5px 6px rgba(0,0,0,0.07);
    z-index: 101;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 2px solid #a78bfa;
    min-height: 440px;
    font-family: 'Poppins', sans-serif;
}
#chat-widget.hidden {
    display: none !important;
}

/* Header */
#chat-widget .bg-gradient-to-r {
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 2px 8px rgba(139,92,246,0.07);
    font-size: 1.08rem;
    letter-spacing: 0.01em;
}
#chat-header .fas.fa-times {
    font-size: 1.3rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}
#chat-header .fas.fa-times:hover {
    opacity: 1;
}

/* Mensajes */
#chat-messages {
    flex: 1 1 auto;
    padding: 1.1rem 1.2rem 0.5rem 1.2rem;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 60%, #ede9fe 100%);
    min-height: 180px;
    max-height: 320px;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}
#chat-messages::-webkit-scrollbar {
    width: 7px;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 8px;
}

/* Mensajes de usuario y bot */
.chat-message {
    margin-bottom: 0.7rem;
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
    max-width: 90%;
    opacity: 1;
    transform: none;
    transition: background 0.2s, color 0.2s;
}
.user-message {
    background: linear-gradient(90deg, #a78bfa 0%, #8b5cf6 100%);
    color: #fff;
    border-radius: 18px 18px 0 18px;
    padding: 10px 16px;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(139,92,246,0.07);
    font-weight: 500;
}
.bot-message {
    background: #f3f0ff;
    color: #5b21b6;
    border-radius: 18px 18px 18px 0;
    padding: 10px 16px;
    align-self: flex-start;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(139,92,246,0.07);
    font-weight: 500;
}
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #ede9fe;
    border-radius: 12px 12px 12px 0;
    padding: 7px 12px;
    width: 48px;
    margin: 4px 0;
}
.typing-indicator span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #a78bfa;
    border-radius: 50%;
    opacity: 0.5;
    animation: typingWidget 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingWidget {
    0%, 100% { opacity: 0.5; transform: translateY(0);}
    50% { opacity: 1; transform: translateY(-3px);}
}

/* Botones rápidos */
#chat-widget .quick-question {
    background: #ede9fe;
    color: #7c3aed;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.93rem;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px rgba(139,92,246,0.06);
}
#chat-widget .quick-question:hover {
    background: #c7d2fe;
    color: #4c1d95;
    box-shadow: 0 2px 8px rgba(139,92,246,0.12);
}

/* Input y botón enviar */
#chat-widget .border-t {
    border-top: 1.5px solid #ede9fe !important;
}
#chat-widget input[type="text"] {
    flex: 1 1 auto;
    border: 1.5px solid #ede9fe;
    border-radius: 10px 0 0 10px;
    padding: 10px 14px;
    font-size: 1rem;
    outline: none;
    background: #f3f4f6;
    color: #4b5563;
    transition: border 0.2s, background 0.2s;
}
#chat-widget input[type="text"]:focus {
    border-color: #a78bfa;
    background: #fff;
}
#chat-widget button#send-message {
    background: linear-gradient(90deg, #a78bfa 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0;
    padding: 10px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(139,92,246,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
}
#chat-widget button#send-message:hover {
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}

/* Responsive */
@media (max-width: 600px) {
    #ai-toggle {
        right: 12px;
        bottom: 12px;
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    #chat-widget {
        right: 2vw;
        bottom: 70px;
        width: 98vw;
        min-width: 0;
        max-width: 99vw;
        border-radius: 1rem;
    }
    #chat-widget .bg-gradient-to-r {
        border-radius: 1rem 1rem 0 0;
    }
    #chat-messages {
        max-height: 220px;
        padding: 0.8rem 0.7rem 0.3rem 0.7rem;
    }
}

/* Sección destacada */
/* styles.widget.css o styles.global.css */
.section-highlight {
    box-shadow: 0 0 0 4px #a78bfa, 0 0 16px 4px #c4b5fd;
    border-radius: 1rem;
    transition: box-shadow 0.4s;
    z-index: 10;
    position: relative;
}