/**
 * WhatsApp Widget CSS
 * Estilos para el botón flotante y pop-up de chat
 */

/* Contenedor principal */
.whatsapp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    z-index: 9999;
}

/* Botón flotante de WhatsApp */
.whatsapp-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #20ba5c 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    padding: 0;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn:active {
    transform: scale(0.95);
}

.whatsapp-btn svg {
    width: 32px;
    height: 32px;
}

/* Pop-up de chat */
.whatsapp-popup {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    max-height: 500px;
    animation: popupSlideIn 0.3s ease-out forwards;
}

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

.whatsapp-popup.is-open {
    display: flex;
}

/* Header del pop-up */
.whatsapp-popup__header {
    background: linear-gradient(135deg, #25d366 0%, #20ba5c 100%);
    color: white;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.whatsapp-popup__title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.whatsapp-popup__status {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.whatsapp-popup__close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.whatsapp-popup__close:hover {
    opacity: 0.8;
}

/* Cuerpo del pop-up */
.whatsapp-popup__body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f5f5f5;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Mensajes */
.whatsapp-message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.whatsapp-message--received {
    justify-content: flex-start;
}

.whatsapp-message p {
    margin: 0;
    padding: 8px 12px;
    background: white;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 80%;
    word-wrap: break-word;
    color: #333;
}

.whatsapp-message--received p {
    background: white;
    border-bottom-left-radius: 4px;
}

.whatsapp-message__time {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Footer del pop-up */
.whatsapp-popup__footer {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
}

.whatsapp-popup__cta {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #25d366 0%, #20ba5c 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.whatsapp-popup__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .whatsapp-widget {
        bottom: 10px;
        right: 10px;
    }

    .whatsapp-popup {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .whatsapp-btn {
        width: 56px;
        height: 56px;
    }
}

/* Animación de pulseo del botón al aparecer */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.whatsapp-btn.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}
