(async () => { window.shiprocketSmartCartLoaded = false; const container = document.querySelector('[data-app="shiprocket-smart-cart"]'); const shadowRoot = container.shadowRoot || container.attachShadow({ mode: 'open' }); document.addEventListener('DOMContentLoaded', () => { if (!container) return; // Inject external CSS into shadow const cssUrl = window.shiprocketSmartCart?.cssUrl; if (cssUrl) { fetch(cssUrl) .then(res => res.text()) .then(css => { const style = document.createElement('style'); style.textContent = css; shadowRoot.appendChild(style); window.shiprocketSmartCartLoaded = true; }) .catch((err) => { console.warn('Failed to load Smart Cart CSS', err) }); } // Inject HTML from