{% if nav_item.children and nav_item.children | length > 0 %}
  {% set title = title | default(nav_item.title) %}
  {% if (nav_item.children | first).children %}
    {% set nav_item = nav_item.children | first %}
    {% include "partials/tabs-item.html" %}
  {% else %}
    <li class="md-tabs__item">
      {% set class = "md-tabs__link" %}
      {% if nav_item.active %}
        {% set class = "md-tabs__link md-tabs__link--active" %}
      {% endif %}
      <a href="{{ (nav_item.children | first).url | url }}" class="{{ class }}">
        {{ title }}
      </a>
    </li>
  {% endif %}
{% else %}
  <li class="md-tabs__item">
    {% set class = "md-tabs__link" %}
    {% if nav_item.active %}
      {% set class = "md-tabs__link md-tabs__link--active" %}
    {% endif %}
	<a href="{{ nav_item.url | url }}" class="{{ class }}">
      {{ nav_item.title }}
    </a>
  </li>
{% endif %}
