document.addEventListener("DOMContentLoaded",function(){const n=document.querySelectorAll(".upgrade-product-card"),r=document.getElementById("selected-product-id"),e=document.getElementById("period-select"),s=document.getElementById("preview-btn");n.forEach(c=>{c.addEventListener("click",function(){if(n.forEach(t=>t.classList.remove("border-primary","shadow")),this.classList.add("border-primary","shadow"),r&&(r.value=this.dataset.productId),e&&this.dataset.periods){const t=JSON.parse(this.dataset.periods);e.innerHTML="",t.forEach(d=>{const o=document.createElement("option");o.value=d.period,o.textContent=d.label+" - "+d.price,e.appendChild(o)}),e.disabled=!1}s&&(s.disabled=!1)})})});
