/** Shopify CDN: Minification failed

Line 26:0 Unexpected "{"
Line 26:1 Expected identifier but found "%"
Line 26:32 Expected identifier but found "%"
Line 27:0 Unexpected "<"
Line 46:1 Expected identifier but found "%"
Line 46:26 Expected identifier but found "%"
Line 47:0 Unexpected "<"
Line 48:3 Unexpected "{"
Line 48:5 Expected identifier but found "'theme.css'"
Line 49:0 Unexpected "<"
... and 15 more hidden warnings

**/
.product-title a, 
.product-vendor a {
    text-decoration: none !important;
}

.product-title a:hover, 
.product-vendor a:hover {
    text-decoration: none !important;
}

{% comment %} Lazy Load Images {% endcomment %}
<script>
  document.addEventListener("DOMContentLoaded", function() {
    let lazyImages = document.querySelectorAll("img.lazyload");
    let observer = new IntersectionObserver(function(entries, observer) {
      entries.forEach(function(entry) {
        if (entry.isIntersecting) {
          let img = entry.target;
          img.src = img.dataset.src;
          img.classList.remove("lazyload");
          observer.unobserve(img);
        }
      });
    }, { rootMargin: "100px 0px" });
    lazyImages.forEach(function(img) {
      observer.observe(img);
    });
  });
</script>

{% comment %} Minify CSS {% endcomment %}
<style>
  {{ 'theme.css' | asset_url | stylesheet_tag | replace: '\n', '' | replace: '  ', '' }}
</style>

{% comment %} Defer Non-Critical JavaScript {% endcomment %}
<script>
  function loadScripts() {
    let scripts = ["script1.js", "script2.js"]; // Add your script names here
    scripts.forEach(script => {
      let s = document.createElement("script");
      s.src = script;
      s.defer = true;
      document.body.appendChild(s);
    });
  }
  window.addEventListener("load", loadScripts);
</script>

{% comment %} Preload Important Assets {% endcomment %}
<link rel="preload" href="{{ 'theme.css' | asset_url }}" as="style">
<link rel="preconnect" href="https://cdn.shopify.com">

{% comment %} Optimize Liquid Loops {% endcomment %}
{% assign collections = collections | where: "all_products_count", "<", 1000 %}

<style>
    body {
        font-family: Arial, sans-serif;
        text-align: center;
        margin: 50px;
        background-color: #f8f9fa;
    }

    h2 {
        color: #4f4567;
    }

    #tracking-form {
        background: white;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        display: inline-block;
        max-width: 400px;
        width: 100%;
    }

    input {
        width: 80%;
        padding: 10px;
        margin-top: 10px;
        border: 1px solid #ddd;
        border-radius: 5px;
        font-size: 16px;
    }

    button {
        background-color: #4f4567;
        color: white;
        border: none;
        padding: 10px 15px;
        border-radius: 5px;
        font-size: 16px;
        cursor: pointer;
        margin-top: 10px;
    }

    button:hover {
        background-color: #ff92c9;
    }
</style>

<h2>Suivez votre commande</h2>
<form id="tracking-form">
    <input type="text" id="tracking-number" placeholder="Entrez votre numéro de suivi" required>
    <button type="submit">Suivre</button>
</form>

<script>
    document.getElementById("tracking-form").addEventListener("submit", function(event) {
        event.preventDefault();
        var trackingNumber = document.getElementById("tracking-number").value.trim();
        if (trackingNumber) {
            var trackingUrl = "https://app.sendit.ma/deliveries/" + trackingNumber;
            window.open(trackingUrl, "SuiviColis", "width=800,height=600");
        }
    });
</script>

