/* product info */ .product-info padding: 1.25rem 1rem 1.5rem 1rem; flex: 1; display: flex; flex-direction: column;
<!-- Product 5 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <img src="https://cdn-icons-png.flaticon.com/512/1046/1046784.png" alt="Ceramic Mug" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Home & Living</div> <div class="product-title">Zen Stone Mug</div> <div class="product-desc">Handcrafted ceramic, heat-retaining, 350ml</div> <div class="price-row"> <span class="current-price">$24</span> <span class="old-price">$32</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div>
<!-- Product 4 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <span class="badge">−15%</span> <img src="https://cdn-icons-png.flaticon.com/512/3584/3584575.png" alt="Wireless Charger" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Tech</div> <div class="product-title">MagFlow 3in1</div> <div class="product-desc">Fast charge for phone, watch, earbuds</div> <div class="price-row"> <span class="current-price">$59</span> <span class="old-price">$69</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div>
.old-price font-size: 0.85rem; color: #98aec5; text-decoration: line-through; Responsive Product Slider Html Css Codepen
.swiper-button-next:hover, .swiper-button-prev:hover background: #ffffff; box-shadow: 0 10px 20px rgba(0,0,0,0.12); transform: scale(1.02);
<!-- Swiper JS + initialization --> <script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script> <script> document.addEventListener('DOMContentLoaded', function () const swiper = new Swiper('.product-swiper', // responsive breakpoints + smooth sliding slidesPerView: 1, spaceBetween: 20, loop: true, // infinite loop for continuous feeling autoplay: delay: 3800, disableOnInteraction: false, pauseOnMouseEnter: true, , pagination: el: '.swiper-pagination', clickable: true, dynamicBullets: false, , navigation: nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', , breakpoints: // when window width is >= 540px 540: slidesPerView: 1.2, spaceBetween: 18, , // >= 680px 680: slidesPerView: 2, spaceBetween: 22, , // >= 900px 900: slidesPerView: 3, spaceBetween: 24, , // >= 1200px 1200: slidesPerView: 4, spaceBetween: 28, , 1500: slidesPerView: 4.2, spaceBetween: 30, , // optional: add smooth effect effect: 'slide', speed: 600, grabCursor: true, keyboard: enabled: true, onlyInViewport: true, , // free mode not enabled for stable grid, but touch is responsive touchRatio: 1, resistanceRatio: 0.85, );
.section-head p color: #5b6f82; font-weight: 500; margin-top: 0.5rem; font-size: 1rem; /* product info */
<!-- Product 3 --> <div class="swiper-slide"> <div class="product-card"> <div class="product-img"> <img src="https://cdn-icons-png.flaticon.com/512/2762/2762346.png" alt="Minimalist Backpack" loading="lazy"> </div> <div class="product-info"> <div class="product-category">Accessories</div> <div class="product-title">UrbanLuxe Backpack</div> <div class="product-desc">Water-resistant, laptop compartment, eco-friendly</div> <div class="price-row"> <span class="current-price">$89</span> <span class="old-price">$119</span> </div> <button class="btn-add" aria-label="Add to cart">+ Add to Cart</button> </div> </div> </div>
.section-head h2 font-size: 2.2rem; font-weight: 700; background: linear-gradient(135deg, #1A2A3F, #2C4C6E); background-clip: text; -webkit-background-clip: text; color: transparent; letter-spacing: -0.02em;
.product-card:hover transform: translateY(-6px); box-shadow: 0 22px 32px -12px rgba(0, 0, 0, 0.15); border-color: rgba(80, 140, 200, 0.3); !-- Product 5 -->
.product-title font-size: 1.1rem; font-weight: 700; color: #1f2e3c; line-height: 1.3; margin-bottom: 0.5rem;
/* extra small devices: hide navigation if needed but still touch swipe works */ @media (max-width: 480px) .swiper-button-next, .swiper-button-prev display: none; .product-card border-radius: 1.25rem;