/* =================================================
   CHATBOT WHATSAPP - WIDGET FLOTANTE
   ================================================= */

.chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-main);
}

/* Botón flotante principal */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

.chatbot-toggle.open {
    transform: rotate(45deg);
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
    }
}

/* Ventana del chatbot */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-height: 600px;
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.show {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del chatbot */
.chatbot-header {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-header-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #25D366;
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Body del chatbot */
.chatbot-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 450px;
    background: #F5F5F5;
}

.chatbot-intro {
    background: white;
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chatbot-intro h4 {
    margin: 0 0 0.5rem 0;
    color: var(--color-dark);
    font-size: 1rem;
}

.chatbot-intro p {
    margin: 0;
    color: var(--color-gray);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* FAQs */
.chatbot-faqs {
    margin-bottom: 1rem;
}

.chatbot-faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.chatbot-faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chatbot-faq-question {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--color-dark);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    user-select: none;
}

.chatbot-faq-question:hover {
    background: #F8F8F8;
}

.chatbot-faq-question i {
    color: var(--color-green);
    transition: transform 0.3s ease;
}

.chatbot-faq-item.active .chatbot-faq-question i {
    transform: rotate(180deg);
}

.chatbot-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.chatbot-faq-item.active .chatbot-faq-answer {
    max-height: 300px;
}

.chatbot-faq-answer-content {
    padding: 0 1rem 1rem 1rem;
    color: var(--color-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Footer con botón WhatsApp */
.chatbot-footer {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #E5E5E5;
}

.chatbot-whatsapp-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.chatbot-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.chatbot-whatsapp-btn i {
    font-size: 1.3rem;
}

/* Badge de notificación */
.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #E74C3C;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        right: -10px;
        bottom: 80px;
        max-height: 500px;
    }
    
    .chatbot-body {
        max-height: 350px;
    }
    
    .chatbot-widget {
        bottom: 20px;
        right: 20px;
    }
}
