/** Shopify CDN: Minification failed

Line 16:26 Unexpected "-->"
Line 25:3 Expected identifier but found "%"
Line 26:4 Unexpected "<"
Line 28:9 Expected identifier but found "%"
Line 29:10 Unexpected "<"
Line 30:66 Unexpected "{"
Line 30:72 Expected ":"
Line 30:81 Unexpected "<"
Line 31:13 Expected identifier but found "%"
Line 32:13 Unexpected "<"
... and 28 more hidden warnings

**/
<!-- custom-navbar.liquid -->
<!-- Include Bootstrap CSS and JS CDN -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>


<div class="custom-navbar section-{{ section.id }}-padding">
  {% if section.settings.menu != blank %}
    <nav class="custom-navbar__nav">
      <ul class="custom-navbar__menu">
        {% for link in linklists[section.settings.menu].links %}
          <li class="custom-navbar__item">
            <a href="{{ link.url }}" class="custom-navbar__link">{{ link.title }}</a>
            {% if link.links.size > 0 %}
             <svg aria-hidden="true" focusable="false" class="icon icon-caret" viewBox="0 0 10 6">
                <path fill-rule="evenodd" clip-rule="evenodd" d="M9.354.646a.5.5 0 00-.708 0L5 4.293 1.354.646a.5.5 0 00-.708.708l4 4a.5.5 0 00.708 0l4-4a.5.5 0 000-.708z" fill="currentColor">
              </path></svg>
              <span class="custom-navbar__arrow" onclick="toggleSubmenu(this)">&#9660;</span>
              <div class="custom-navbar__submenu">
                <div class="row">
                  {% for sublink in link.links %}
                    {% if forloop.index0 % 4 == 0 and forloop.index0 != 0 %}
                      </div><div class="row">
                    {% endif %}
                    <div class="col-3">
                      <a href="{{ sublink.url }}" class="custom-navbar__submenu-link">{{ sublink.title }}</a>
                    </div>
                  {% endfor %}
                </div>
              </div>
            {% endif %}
          </li>
        {% endfor %}
      </ul>
    </nav>
  {% else %}
    <p>Please select a menu for this custom navbar section.</p>
  {% endif %}
</div>

<style>
  .custom-navbar {
    padding: 10px;
  }
  .custom-navbar__nav {
    display: flex;
    justify-content: center;
  }
  .custom-navbar__menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
  }
  .custom-navbar__item {
    position: relative;
    margin: 0 15px;
  }
  .custom-navbar__link {
    text-decoration: none;
    color: #000; /* Black text for main items */
  }
  .custom-navbar__arrow {
    margin-left: 5px;
    cursor: pointer;
  }
  .custom-navbar__submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    width:100rem;
    transform: translateX(-50%);
    background-color: #000;
    padding: 10px;
    margin-top: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
    color: #fff; /* Ensuring text color is visible on black background */
  }
  .custom-navbar__submenu .row {
    display: flex;
    flex-wrap: wrap;
  }
  .custom-navbar__submenu .col-3 {
    width: 25%;
    padding: 5px;
  }
  .custom-navbar__submenu-link {
    width:134px;
    display: block;
    text-decoration: none;
    color: #fff; /* White text for submenu items */
    padding: 5px 5px 5px 5px;
    font-size:13px;
  }
  .custom-navbar__submenu-link:hover {
    background-color: #444; /* Slightly lighter background on hover */
    /* text-decoration:line-through; */
  }
   .custom-navbar__link::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: white; /* Underline color */
  transform-origin: bottom right;
  transition: transform 0.25s ease-out;
}
.custom-navbar__link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}
</style>

<script>
  function toggleSubmenu(arrow) {
    var submenu = arrow.nextElementSibling;
    submenu.style.display = submenu.style.display === "block" ? "none" : "block";
  }
</script>

{% schema %}
{
  "name": "Custom Navbar",
  "settings": [
    {
      "type": "link_list",
      "id": "menu",
      "label": "Menu"
    },
    {
      "type": "range",
      "id": "padding_top",
      "label": "Top Padding",
      "default": 36,
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px"
    },
    {
      "type": "range",
      "id": "padding_bottom",
      "label": "Bottom Padding",
      "default": 36,
      "min": 0,
      "max": 100,
      "step": 4,
      "unit": "px"
    }
  ],
  "presets": [
    {
      "name": "Custom Navbar"
    }
  ]
}
{% endschema %}
