/** Shopify CDN: Minification failed

Line 16:0 Unexpected "<"
Line 18:9 Unexpected "{"
Line 18:18 Expected ":"
Line 18:46 Unexpected "<"
Line 23:9 Expected identifier but found "%"
Line 24:8 Unexpected "{"
Line 24:9 Expected identifier but found "%"
Line 25:8 Unexpected "<"
Line 27:13 Expected identifier but found "%"
Line 28:12 Unexpected "<"
... and 54 more hidden warnings

**/
<section class="testimonial-slider-section">
  <div class="container">
    <h2>{{ section.settings.section_heading }}</h2>
    <div class="testimonial-slider-wrapper">
      <button class="slider-prev">‹</button>
      <div class="testimonial-slider">
        <!-- Clone the last 3 slides at the beginning for seamless loop -->
        {% assign last_blocks = section.blocks | slice: -3, 3 %}
        {% for block in last_blocks %}
        <div class="testimonial-slide clone">
          <div class="testimonial-content">
            {% if block.settings.testimonial_image %}
            <img src="{{ block.settings.testimonial_image | image_url: width: 100, height: 100, crop: 'center' }}" alt="{{ block.settings.customer_name }}" width="100" height="100">
            {% endif %}
            <p>"{{ block.settings.testimonial_text }}"</p>
            <strong>- {{ block.settings.customer_name }}</strong>
          </div>
        </div>
        {% endfor %}

        <!-- Original slides -->
        {% for block in section.blocks %}
        <div class="testimonial-slide">
          <div class="testimonial-content">
            {% if block.settings.testimonial_image %}
            <img src="{{ block.settings.testimonial_image | image_url: width: 100, height: 100, crop: 'center' }}" alt="{{ block.settings.customer_name }}" width="100" height="100">
            {% endif %}
            <p>"{{ block.settings.testimonial_text }}"</p>
            <strong>- {{ block.settings.customer_name }}</strong>
          </div>
        </div>
        {% endfor %}

        <!-- Clone the first 3 slides at the end for seamless loop -->
        {% assign first_blocks = section.blocks | slice: 0, 3 %}
        {% for block in first_blocks %}
        <div class="testimonial-slide clone">
          <div class="testimonial-content">
            {% if block.settings.testimonial_image %}
            <img src="{{ block.settings.testimonial_image | image_url: width: 100, height: 100, crop: 'center' }}" alt="{{ block.settings.customer_name }}" width="100" height="100">
            {% endif %}
            <p>"{{ block.settings.testimonial_text }}"</p>
            <strong>- {{ block.settings.customer_name }}</strong>
          </div>
        </div>
        {% endfor %}
      </div>
      <button class="slider-next">›</button>
    </div>
  </div>
</section>

<style>
  .testimonial-slider-section {
    padding: 40px 0;
    background-color: #f9f9f9;
    overflow: hidden;
  }

#HeaderMenu-nutrogpt{
  background: #3e6d59;
    padding: 6px 20px;
    color: #fff;
    border-radius: 4px;
    margin-top: 7px;
    border-top-left-radius: 25px !important;
    border-bottom-right-radius: 25px !important;
}

  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
  }
.accordion-header,.faq-question,.cart-item__name{
      font-family: Montserrat, sans-serif;
}
  .testimonial-slider-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    width: 100%;
  }

  .testimonial-slider {
    display: flex;
    transition: transform 0.5s ease;
    will-change: transform;
  }

  .testimonial-slide {
    box-sizing: border-box;
    padding: 0 15px;
    text-align: center;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    min-width: 33.33%;
  }

 /* .testimonial-content {
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
  }*/
h2.inline-richtext::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: #f6d7c3;
    margin: 10px auto 0;
    border-radius: 4px;
}
  .testimonial-content img {
    border-radius: 50%;
    margin-bottom: 15px;
    display: block;
    max-width: 100px;
  }

  .testimonial-content p {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 10px;
  }

  .testimonial-content strong {
    display: block;
    font-weight: bold;
    margin-top: auto;
  }

  .slider-prev,
  .slider-next {
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 24px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
  }

  .slider-prev {
    left: 10px;
  }

  .slider-next {
    right: 10px;
  }

  /* Add cursor pointer for better UX */
  .slider-prev:hover,
  .slider-next:hover {
    background-color: #555;
  }
#shopify-section-template--22382971650329__image_banner_mbAkeA{
  margin:20px 0px;
}

  @media (max-width: 992px) {
    .testimonial-slide {
      min-width: 50%;
    }
  }


  @media (max-width: 768px) {
    
    .testimonial-slide {
      min-width: 100%;
    }
    .slider-mobile-gutter li{
      width:100% !important;
    }
    #shopify-section-template--22382971650329__multicolumn_dw4HGb .multicolumn-card__image-wrapper{
       width:100px !important;
      margin-left:30px !important;
    }
    #shopify-section-template--22382971650329__multicolumn_fX6FJc .multicolumn-card__image-wrapper{
      width:310px !important;
      margin-left:5% !important;
    }
    .promo-section{
      margin:1% !important;
      padding-top: 6px;
    }
    .quick-add__submit{
      font-size: 1.1rem;
    padding-top: 2px;
    padding-bottom: 2px;
    min-height: calc(3rem + var(--buttons-border-width)* 2) !important;
    }
#Slider-template--22382971650329__multicolumn_nWapeP .multicolumn-card__image-wrapper{
  width:120px;
}
   #Slider-template--22382971650329__multicolumn_nWapeP  .grid__item{
     max-width:40% !important;
   }
    .banner-section{
      padding-top:0px !important;
      padding-bottom:0px !important;
    }
    .testimonial-content {
      font-size: 14px;
    }
    .prev,.next{
      display:none;
    }
   .slideshow__text-wrapper{
     display:none !important;
   }
  }


/* Display on mobile screens only */
@media screen and (max-width: 767px) {
  /* Fixed wrapper for the buttons */
.product-buttons-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff; /* White background for contrast */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow for separation */
  z-index: 999; /* Ensure it's above other elements */
  padding: 10px 0;
  //display: none; /* Hidden by default */
}
  .product-buttons-wrapper {
    display: block;
  }
  .showM{
    display:none !important;
  }
}

@media screen and (min-width: 768px) {
.product-buttons-wrapper {
    display: none !important;
  }
}

/* Inner button container */
.product-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  max-width: 768px;
  
  margin: 0 auto;
  padding: 0 15px;
}

/* Add to Cart button */
.btn-add-to-cart {
  background-color: #00154F; /* Navy blue */
  color: #fff;
  padding: 12px 20px;
  //flex: 1; /* Flex to share space evenly */
  text-align: center;
  border: none;
  font-family:var(--font-body-family);
  border-radius: 5px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}
.btn-buy-now, .btn-add-to-cart {
    width: 100%;
    margin: 5px 0;
}
/* Buy Now button */
.btn-buy-now {
  background-color: #FF7F50; /* Coral color */
  color: #fff;
  padding: 12px 20px;
  flex: 1; /* Flex to share space evenly */
  text-align: center;
  border: none;
  border-radius: 5px;
  font-size: 15px;
  font-family:var(--font-body-family);
  font-weight: bold;
  cursor: pointer;
}

/* Hover effects */
.btn-add-to-cart:hover {
  background-color: #000A38; /* Darker navy */
}

.btn-buy-now:hover {
  background-color: #FF6F3A; /* Darker coral */
}

</style>



<script>
  document.addEventListener('DOMContentLoaded', function () {
    var slider = document.querySelector('.testimonial-slider');
    var slides = document.querySelectorAll('.testimonial-slide');
    var nextButton = document.querySelector('.slider-next');
    var prevButton = document.querySelector('.slider-prev');
    var totalSlides = slides.length;
    var currentIndex = 3; // Start at the first real slide (after cloned slides)
    var slideInterval;
    var slideWidth;

    // Function to update the slide position
    function updateSlidePosition() {
      var offset = currentIndex * -slideWidth;
      slider.style.transition = 'transform 0.5s ease';
      slider.style.transform = 'translateX(' + offset + 'px)';
    }

    // Function to set the slide width dynamically based on the container size
    function setSlideWidth() {
      var containerWidth = document.querySelector('.testimonial-slider-wrapper').offsetWidth;
      var slidesPerView = 3;

      if (containerWidth <= 768) {
        slidesPerView = 1;
      } else if (containerWidth <= 992) {
        slidesPerView = 2;
      }

      slideWidth = containerWidth / slidesPerView;
      slides.forEach(function (slide) {
        slide.style.minWidth = slideWidth + 'px';
      });
    }

    // Function to move to the next slide
    function moveToNextSlide() {
      currentIndex++;
      updateSlidePosition();
      // If reaching the last set of original slides, jump back to the start set of original slides
      if (currentIndex >= totalSlides - 3) {
        setTimeout(function () {
          slider.style.transition = 'none';
          currentIndex = 3; // Skip to the first set of original slides
          updateSlidePosition();
          setTimeout(function () {
            slider.style.transition = 'transform 0.5s ease';
          }, 50);
        }, 500);
      }
    }

    // Function to move to the previous slide
    function moveToPrevSlide() {
      currentIndex--;
      updateSlidePosition();
      // If reaching the first set of original slides, jump back to the last set of original slides
      if (currentIndex <= 2) {
        setTimeout(function () {
          slider.style.transition = 'none';
          currentIndex = totalSlides - 6; // Skip to the last set of original slides
          updateSlidePosition();
          setTimeout(function () {
            slider.style.transition = 'transform 0.5s ease';
          }, 50);
        }, 500);
      }
    }

    // Function to start the auto-slide
    function startAutoSlide() {
      slideInterval = setInterval(moveToNextSlide, 3000);
    }

    // Function to stop the auto-slide
    function stopAutoSlide() {
      clearInterval(slideInterval);
    }

    // Event listeners for the Next and Previous buttons
    nextButton.addEventListener('click', function () {
      moveToNextSlide();
      stopAutoSlide();
      startAutoSlide();
    });

    prevButton.addEventListener('click', function () {
      moveToPrevSlide();
      stopAutoSlide();
      startAutoSlide();
    });

    // Adjust slide width on window resize
    window.addEventListener('resize', function () {
      setSlideWidth();
      updateSlidePosition();
    });

    // Initialize slide width and start auto-slide
    setSlideWidth();
    updateSlidePosition();
    startAutoSlide();

    // Pause auto-slide on mouse enter and resume on mouse leave
    slider.addEventListener('mouseenter', stopAutoSlide);
    slider.addEventListener('mouseleave', startAutoSlide);
  });
</script>

{% schema %}
{
  "name": "Testimonials Slider",
  "settings": [
    {
      "type": "text",
      "id": "section_heading",
      "label": "Section Heading",
      "default": "Customer Testimonials"
    }
  ],
  "blocks": [
    {
      "type": "testimonial",
      "name": "Testimonial",
      "settings": [
        {
          "type": "image_picker",
          "id": "testimonial_image",
          "label": "Customer Image"
        },
        {
          "type": "text",
          "id": "testimonial_text",
          "label": "Testimonial Text",
          "default": "Amazing service and great quality! Highly recommend."
        },
        {
          "type": "text",
          "id": "customer_name",
          "label": "Customer Name",
          "default": "John Doe"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Default",
      "category": "Testimonials"
    }
  ]
}
{% endschema %}
