/* Blocksy header account modal — reset reCAPTCHA when opening account panel */
document.addEventListener('DOMContentLoaded', function () {
	document.querySelectorAll('.ct-header-account').forEach(function (element) {
		element.addEventListener('click', function () {
			setTimeout(function () {
				if (typeof window.grecaptcha === 'undefined' || typeof window.grecaptcha.reset !== 'function') {
					return;
				}
				try {
					window.grecaptcha.reset();
				} catch (e) {}
			}, 500);
		});
	});
});
