function initSwiperSlider() { const container = document.getElementById('slider-container'); if (!container) return console.log('Container not found'); container.innerHTML = ` `; const style = document.createElement('style'); style.innerHTML = ` .swiper { width: 100%; height: 600px; border-radius: 12px; } .swiper-slide { display: flex; align-items: center; justify-content: center; } .swiper-slide img { width: 100%; height: 100%; object-fit: cover; } .swiper-pagination { bottom: 20px !important; } .swiper-pagination-bullet { background: rgba(255,255,255,0.7); opacity: 1; } .swiper-pagination-bullet-active { background: #fff; } .swiper-button-next, .swiper-button-prev { color: #fff; background: rgba(0,0,0,0.5); border-radius: 4px; width: 45px; height: 45px; } `; document.head.appendChild(style); if (typeof Swiper !== 'undefined') { new Swiper('#mainSlider', { loop: true, autoplay: { delay: 5000, disableOnInteraction: false }, pagination: { el: '.swiper-pagination', clickable: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, slidesPerView: 1, speed: 800 }); console.log('Swiper initialized!'); }}if (typeof Swiper !== 'undefined') { initSwiperSlider();} else { document.addEventListener('DOMContentLoaded', initSwiperSlider);}