(function() { const sizeData = [ ["UK", "XS", "S", "M", "L", "XL", "2XL", "3XL"], ["الصدر ", "30", "32", "34", "36", "38", "40", "42"], ["الخصر ", "24", "26", "28", "30", "32", "34", "36"], ["الورك ", "34", "36", "38", "40", "42", "44", "46"], ["EN", "24", "26", "28", "30", "32", "34", "36"], ["US", "34", "36", "38", "40", "42", "44", "46"], ["AR", "0", "1", "2", "3", "4", "5", "6"] ]; function createTable() { const oldTable = document.querySelector('.js-custom-size-chart'); if (oldTable) oldTable.remove(); const target = document.querySelector('.s-product-options-option-container'); if (!target) return; const wrapper = document.createElement('div'); wrapper.className = 'js-custom-size-chart'; wrapper.style.cssText = "width:100%; overflow-x:auto; margin:20px 0; direction:rtl; border-radius:8px; border:1px solid #ddd;"; let tableHtml = ``; sizeData.forEach((row, i) => { let rowBackground = i === 0 ? "#f8f8f8" : "#fff"; tableHtml += ``; row.forEach((cell, j) => { let cellStyle = "border:1px solid #eee; width: 12.5%; min-width: 50px; vertical-align: middle;"; if (j === 0) { cellStyle += "font-weight:bold; background:#fafafa; color:#333; font-size:12px;"; } else { cellStyle += "color:#666;"; } const tag = i === 0 ? 'th' : 'td'; tableHtml += `<${tag} style="${cellStyle}">${cell}`; }); tableHtml += ``; }); tableHtml += `
`; wrapper.innerHTML = tableHtml; target.after(wrapper); } createTable(); window.addEventListener('load', createTable); let attempts = 0; const interval = setInterval(() => { attempts++; createTable(); if (attempts > 5) clearInterval(interval); }, 1000); })();