// Add custom JS for variation image scroll and select add_action('wp_footer',function(){?><script type="text/javascript">jQuery(document).ready(function($){$('.variations_form').on('woocommerce_variation_has_changed',function(event){// Scroll to product gallery var gallery=$('.woocommerce-product-gallery__wrapper').first();if(gallery.length){$('html, body').animate({scrollTop:gallery.offset().top - 50},500)}// Get selected variation image URL var selectedOption=$(this).find('select').first();var variationImage=selectedOption.find('option:selected').data('image');if(variationImage){$('.woocommerce-product-gallery__wrapper a').each(function(){var imgSrc=$(this).find('img').attr('src');if(imgSrc==variationImage){$(this).trigger('click')}})}})});</script><?php});add_action('wp_footer',function (){?><script>document.addEventListener("DOMContentLoaded",function (){// selectors – TemplateMela safe const serviceBar=document.querySelector('.tm-product-service, .product-services, .tm-product-feature');const gallery=document.querySelector('.woocommerce-product-gallery');if (serviceBar && gallery){// Move bar AFTER gallery (outside slider) gallery.parentNode.insertBefore(serviceBar,gallery.nextSibling);// Reset any slider styles serviceBar.style.transform='none';serviceBar.style.position='relative';serviceBar.style.left='auto';serviceBar.style.right='auto'}});</script><?php});