document.addEventListener('DOMContentLoaded',function(){document.querySelectorAll('.aplicar-4x3-btn').forEach(function(btn){btn.addEventListener('click',function(e){e.preventDefault();var product_id=btn.getAttribute('data-product-id');if(!product_id){alert('No se pudo obtener el producto. Actualiza la página o contacta soporte.');return} var form=document.createElement('form');form.method='POST';form.action='/?add-to-cart='+product_id;var input=document.createElement('input');input.type='hidden';input.name='quantity';input.value=3;form.appendChild(input);document.body.appendChild(form);form.submit();setTimeout(function(){window.location.href="/carrito-2/"},900)})})})