<script>
// WhatsApp redirect function
function redirectToWhatsApp(phoneNumber, message = '') {
    // Format the phone number (remove any non-digit characters except +)
    const formattedPhone = phoneNumber.replace(/[^\d+]/g, '');
    
    // Format the message for URL
    const encodedMessage = encodeURIComponent(message);
    
    // Redirect to WhatsApp
    window.open(`https://wa.me/${formattedPhone}?text=${encodedMessage}`, '_blank');
}

// Example usage with your information (replace with your actual details)
document.addEventListener('DOMContentLoaded', function() {
    // Your WhatsApp number (please provide this)
    const whatsappNumber = '+1234567890'; // REPLACE WITH YOUR NUMBER
    
    // Optional default message (please provide if desired)
    const defaultMessage = 'Hello, I would like to inquire about your visa services.'; // REPLACE WITH YOUR MESSAGE
    
    // Add click event to all contact buttons
    const contactButtons = document.querySelectorAll('.cta-button, .whatsapp-button, .contact-button');
    
    contactButtons.forEach(button => {
        button.addEventListener('click', function(e) {
            e.preventDefault();
            redirectToWhatsApp(whatsappNumber, defaultMessage);
        });
    });
});
</script>