/**
 * Stablezact order-confirmation page behaviour.
 * (Moved out of an inline script block in the order-confirmation template to comply
 * with the wp_enqueue policy.)
 */
jQuery(document).ready(function ($) {
    // Initialize ClipboardJS for copy buttons
    if (typeof ClipboardJS !== 'undefined') {
        new ClipboardJS('.stablezact-btn-copy');
    }

    // Trigger payment modal if payment is pending
    $('.stablezact-order-pay-button').on('click', function (e) {
        e.preventDefault();
        $('#stablezact-payment-modal').show();
        $('body').addClass('stablezact-modal-open');
        return false;
    });
});
