<ul class="c-accordion__list c-accordion__list--level-{{level}}" id="{{id}}list-{{index}}"{{#ifCond level ">" 0}} hidden{{/ifCond}}>
  {{#each items}}
    <li class="c-accordion__item">
      <div class="c-accordion__item-container">
        {{#if ../fullWidthButtons}}

          {{!-- Full-width buttons --}}
          {{#if this.items}}
            {{> button
              buttonModifierClasses = "c-button--no-border c-button--no-border-radius c-button--full-width"
              buttonIconId = "#nav-arrow-down"
              buttonText = this.label
              buttonAttributes = (concat 'type="button" aria-expanded="false" aria-controls="' ../id 'list-' (concat ../index "-" @index) '"')
            }}
          {{else}}
            <a href="#" class="c-accordion__item-link">{{this.label}}</a>
          {{/if}}

        {{else}}

          {{!-- Standard buttons --}}
          <a href="#" class="c-accordion__item-link{{#if this.items}} c-accordion__item-link--beside-button{{/if}}">
            {{this.label}}
          </a>
          {{#if this.items}}
            {{> button
              buttonModifierClasses = "c-button--icon-only c-button--no-border c-button--no-border-radius"
              buttonIconId = "#nav-arrow-down"
              buttonAttributes = (concat 'type="button" aria-label="Open subcategories" aria-expanded="false" aria-controls="' ../id 'list-' (concat ../index "-" @index) '"')
            }}
          {{/if}}

        {{/if}}
      </div>
      {{#if this.items}}
        {{> accordion-list
          id = ../id
          items = this.items
          label = this.label
          level = (increment ../level)
          index = (concat ../index "-" @index)
          fullWidthButtons = ../fullWidthButtons
        }}
      {{/if}}
    </li>
  {{/each}}
</ul>

