How to make this slick slider responsive for tablet and mobile in Shopify?

The slider looks fine on desktop view but it does not resize properly. I just want it to resize on tablet and mobile for responsiveness. Keep it still 3 pictures in main view. I tried a few media queries but they did not work for me as the slider images/slider itself keeps to the same size. Thank you for your help in advance!

{% comment %} -------CSS------- {% endcomment %}
<link rel="stylesheet" type="text/css" href="{{ 'slick.css' | asset_url }}"/>

{% comment %} -------HTML------- {% endcomment %}
<div class="spacer" style="height: 80px; width: 100%;"> </div>
<div class="custom-text-area">
    <h1 style="font-family: eurostile-extended, sans-serif; font-weight: 500; text-transform: uppercase;">Legacy Edition</h1>
</div>
<div class="carousel-wrap" style="margin-top: 30px; margin-bottom: 30px;">
  <div class="band-accessory-routing_band-accessory-routing__slider--opacity__80oPN" style="display: block !important;"></div>
  <div class="slider center blue">
    <div class="image-x"> 
    <a href="#"><img class="" src="https://cdn.shopify.com/s/files/1/0663/8865/6306/files/purple-1.png?v=1725491685" style="opacity: 1;"></a>
    </div>
    <div class="image-x"> 
    <a href="#"><img class="" src="https://cdn.shopify.com/s/files/1/0663/8865/6306/files/orange-1.png?v=1725491685" style="opacity: 1;"></a>
    </div>
    <div class="image-x">
    <a href="#"><img class="" src="https://cdn.shopify.com/s/files/1/0663/8865/6306/files/pink-1.png?v=1725491685" style="opacity: 1;"></a>
    </div>
    <div class="image-x"> 
    <a href="#"><img class="" src="https://cdn.shopify.com/s/files/1/0663/8865/6306/files/purple-1.png?v=1725491685" style="opacity: 1;"></a>
    </div>
    <div class="image-x">
    <a href="#"><img class="" src="https://cdn.shopify.com/s/files/1/0663/8865/6306/files/orange-1.png?v=1725491685" style="opacity: 1;"></a>
    </div>
    <div class="image-x"> 
    <a href="#"><img class="" src="https://cdn.shopify.com/s/files/1/0663/8865/6306/files/pink-1.png?v=1725491685" style="opacity: 1;"></a>
    </div>
  </div>
</div>


<div class="custom-button-area" style="padding: 30px 0 20px;">
  <a href="/collections/all" class="btn-link">Shop All</a>
</div>
<div class="spacer" style="height: 100px; width: 100%;"> </div>

{% comment %} -------JS------- {% endcomment %}
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="{{ 'slick.min.js' | asset_url }}"></script>


<script>
$(document).ready(function(){
  $('.slider').slick({
    centerMode: true,
    centerPadding: '60px',
    slidesToShow: 3,
    arrows: true, // Ensure arrows are enabled
    responsive: [
      {
        breakpoint: 768,
        settings: {
          arrows: true, // Ensure arrows are enabled
          centerMode: true,
          centerPadding: '40px',
          slidesToShow: 3,
        }
      },
      {
        breakpoint: 480,
        settings: {
          arrows: true, // Ensure arrows are enabled
          centerMode: true,
          centerPadding: '40px',
          slidesToShow: 1,
        }
      }
    ]
  });

  $('a[data-slide]').click(function(e) {
     e.preventDefault();
     var slideno = $(this).data('slide');
     $('.slider').slick('slickGoTo', slideno - 1);
   });
});
</script>

{% comment %} -------CSS------- {% endcomment %}
{% stylesheet %}
.custom-button-area {
  padding: 30px 0 20px;
  text-align: center; 
}

.btn-link {
  display: inline-block;
  padding: 12px 24px;
  background-color: #ffffff; 
  color: #000000; 
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
  font-family: "eurostile-extended", sans-serif; 
  font-weight: 500; 
  text-transform: uppercase;
  border: 1px solid #000000;
}

.btn-link:hover {
  background-color: #11322c; 
  transform: scale(1.05); 
  color: #ffffff; 
}

.btn-link:active {
  background-color: #11322c;
  transform: scale(1); 
}


.slider .image-x img {
  width: 100% !important; 
  height: auto;
}

{% endstylesheet %}



{% comment %} /*  -------SECTION CREATE-------  */ {% endcomment %}
{% schema %}  
    {
        "name": "Custom JS Slider Home",
        "settings": [],
        "presets": [{"name": "Custom JS Slider Home"}]
    }
{% endschema %}

The media queries adjust the slider for screens smaller than 768px (tablet) and 480px (mobile). On tablets, it keeps the 3 images visible by setting each image’s width to calc(33.33% – 20px) to provide some spacing between them. On mobile, it changes to 1 image per slide (width: 100%).

.slider .image-x img {
  width: 100% !important; 
  height: auto;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .slider .image-x img {
    width: calc(33.33% - 20px) !important; /* Keeps 3 images visible with some spacing */
  }
  .slick-slider {
    max-width: 100%;
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .slider .image-x img {
    width: 100% !important; /* One image on mobile */
  }
  .slick-slider {
    max-width: 100%;
    padding: 0 10px;
  }
}

In the slick settings, we specify different slidesToShow for different breakpoints. The default is 3 slides, and on mobile (480px and below), it shows 1 slide at a time.

$(document).ready(function(){
  $('.slider').slick({
    centerMode: true,
    centerPadding: '60px',
    slidesToShow: 3,
    arrows: true, 
    responsive: [
      {
        breakpoint: 768,
        settings: {
          arrows: true,
          centerMode: true,
          centerPadding: '40px',
          slidesToShow: 3, /* Ensures 3 images on tablet */
        }
      },
      {
        breakpoint: 480,
        settings: {
          arrows: true,
          centerMode: true,
          centerPadding: '40px',
          slidesToShow: 1, /* Ensures 1 image on mobile */
        }
      }
    ]
  });
});

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật