/* Botón flotante de WhatsApp */
.whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 9999;
    animation: moveUpDown 1.5s infinite ease-in-out;
    transition: transform 0.3s ease-in-out;
}

.whatsapp-button img {
    width: 35px;
    height: 35px;
}

/* Efecto al pasar el mouse */
.whatsapp-button:hover {
    transform: scale(1.1);
}
/* Animación de entrada de mensajes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message, .user-message {
    animation: fadeIn 0.3s ease-in-out;
}


/* Animación de movimiento arriba y abajo */
@keyframes moveUpDown {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
    100% { transform: translateY(0px); }
}

/* Caja de chat */
.chat-box {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    max-width: 90vw; /* Ajuste para pantallas pequeñas */
    background: white;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    display: none;
    z-index: 9999;
}

/* Encabezado del chat */
.chat-header {
    background: #25d366;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}

/* Cuerpo del chat */
.chat-body {
    padding: 10px;
    height: 250px;
    max-height: 60vh; /* Evita que el chat sea demasiado grande en móviles */
    overflow-y: auto;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    color: black;
}

/* Mensajes */
.bot-message, .user-message {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 10px;
    margin: 5px 0;
    font-size: 14px;
    word-wrap: break-word;
}

.bot-message {
    background: #e5e5ea;
    align-self: flex-start;
}

.user-message {
    background: #25d366;
    color: white;
    align-self: flex-end;
}

/* Pie del chat */
.chat-footer {
    padding: 10px;
    display: flex;
    border-top: 1px solid #ddd;
    background: #fff;
}

.chat-footer input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    font-size: 14px;
}

.send-button, .whatsapp-send {
    background: #25d366;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    margin-left: 5px;
    border-radius: 5px;
    font-size: 14px;
}

/* 📌 RESPONSIVIDAD */
@media (max-width: 600px) {
    .whatsapp-button {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-button img {
        width: 30px;
        height: 30px;
    }

    .chat-box {
        width: 90vw;
        right: 5%;
        bottom: 70px;
    }

    .chat-header {
        font-size: 14px;
    }

    .chat-body {
        font-size: 12px;
        height: 200px;
    }

    .chat-footer input {
        font-size: 12px;
    }

    .send-button, .whatsapp-send {
        font-size: 12px;
        padding: 5px 8px;
    }
}
