<div {{ attributes.defaults({'data-id-label': this.id_label}) }}>
   <div>
      {% set visibleCount = 0 %}
      {% set inStoreAboveLimitCount = this.inStoreCount - this.limit %}

      {% for value in this.fetchValues %}
         {% if not value.soldout %}
            {% if visibleCount < this.limit or (visibleCount == this.limit and inStoreAboveLimitCount == 1) %}
               <a href="{{ this.getUrl(value.idVariation) }}" class="delivery-{{ value.delivery_time_index }} {{ value.soldout }}" title="{{ value.title }}">
                  <span class="variation-title">{{ value.title }}</span>
                  {% set icon = this.icon(value) %}
                  {% if icon %}
                     <twig:ux:icon name="{{ icon }}" class="c-icon"/>
                  {% endif %}
               </a>
            {% endif %}

            {% set visibleCount = visibleCount + 1 %}
         {% endif %}
      {% endfor %}

      {% if inStoreAboveLimitCount > 1 %}
         <a href="{{ this.productUrl }}">
            <span class="variation-title">+ {{ inStoreAboveLimitCount }} další</span>
         </a>
      {% endif %}
   </div>
</div>
