(function () { const NOTE_TEXT = 'Hinweis: Nach Klick auf „Weiter“ kannst du Kreditkarte, Apple Pay, Google Pay & weitere Zahlungsmethoden auswählen.'; function findWeiterButton() { // Wir suchen alle Buttons/Links und nehmen den, der genau "Weiter" heißt const els = Array.from(document.querySelectorAll('button, a')); return els.find(el => (el.textContent || '').trim().toLowerCase() === 'weiter'); } function injectNote() { const btn = findWeiterButton(); if (!btn) return false; if (document.getElementById('lg-checkout-note')) return true; const note = document.createElement('div'); note.id = 'lg-checkout-note'; note.textContent = NOTE_TEXT; note.style.marginTop = '10px'; note.style.fontSize = '14px'; note.style.lineHeight = '1.35'; note.style.opacity = '0.95'; note.style.padding = '10px 12px'; note.style.borderRadius = '10px'; note.style.background = 'rgba(0,0,0,0.04)'; btn.insertAdjacentElement('afterend', note); return true; } function runWithObserver() { if (injectNote()) return; const obs = new MutationObserver(() => { if (injectNote()) obs.disconnect(); }); obs.observe(document.body, { childList: true, subtree: true }); setTimeout(injectNote, 1500); setTimeout(injectNote, 3000); } // Wenn Ecwid vorhanden ist, nutzen wir deren Page-Events (zuverlässiger) if (window.Ecwid && typeof window.Ecwid.OnPageLoaded === 'function') { window.Ecwid.OnPageLoaded(function () { // nur relevant, wenn man wirklich im Warenkorb/Checkout ist runWithObserver(); }); } else { // Fallback runWithObserver(); } })();