document.addEventListener("DOMContentLoaded", function() { // CSS kodu oluştur var css = ` @media (max-width: 768px) { .sticky-cart-bar { position: fixed !important; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid #ddd; box-shadow: 0 -2px 6px rgba(0,0,0,0.1); padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 9999; } body { padding-bottom: 70px; } } @media (min-width: 769px) { .sticky-cart-bar { position: static !important; box-shadow: none; border-top: none; padding: 0; display: block; } body { padding-bottom: 0; } } `; // Stil etiketi oluşturup CSS ekle var style = document.createElement('style'); style.type = 'text/css'; style.appendChild(document.createTextNode(css)); document.head.appendChild(style); // HTML elemanlarını seç var price = document.querySelector('.product-price'); var buyNow = document.querySelector('.buy-now-button'); var addToCart = document.querySelector('.add-to-cart'); if (price && buyNow && addToCart) { var stickyBar = document.createElement('div'); stickyBar.classList.add('sticky-cart-bar'); stickyBar.appendChild(price); stickyBar.appendChild(buyNow); stickyBar.appendChild(addToCart); addToCart.parentNode.insertBefore(stickyBar, addToCart); } });