@php
    $statsRows = $statsRows ?? [];
    $counterPrefix = $counterPrefix ?? '+';
@endphp
@if(!empty($statsRows))
    <div class="imt-catalog-hero__stats-slot w-100 {{ $slotExtraClass ?? '' }}">
        <div class="imt-catalog-stats-bar imt-catalog-stats-bar--hero mx-auto">
            <div class="imt-catalog-stats-bar__track imt-catalog-stats-bar__track--4">
                @foreach($statsRows as $row)
                    @continue(empty($row['label_trans']))
                    <div class="imt-catalog-stats-bar__cell">
                        <span class="imt-catalog-stats-bar__icon" aria-hidden="true">
                            @php $ic = $row['icon'] ?? ''; @endphp
                            @if($ic === 'globe')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><circle cx="12" cy="12" r="9"/><path d="M3 12h18"/><path d="M12 3c2.76 6.5 3.5 17 3.5 17S16.24 17.5 12 21c-4.24-3.5-3.74-13.5-3.74-13.5S9.24 9.5 12 3z"/></svg>
                            @elseif($ic === 'layer' || $ic === 'grid')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/></svg>
                            @elseif($ic === 'users')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M16 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="3"/><path d="M23 21v-2a4 4 0 0 0-3-3.87M17 11a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/></svg>
                            @elseif($ic === 'star')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"><path d="m12 2 2 7h7l-5.5 4 2 7-5.5-4L6.5 20l2-7L3 9h7z"/></svg>
                            @elseif($ic === 'book')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M4 5a2 2 0 0 1 2-2h12v17H6a2 2 0 0 0-2 2Zm0 0v15"/></svg>
                            @elseif($ic === 'download')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 5v10m4-6-4 4-4-4"/><path d="M5 17h14a2 2 0 0 1 2 2v1H3v-1a2 2 0 0 1 2-2z"/></svg>
                            @elseif($ic === 'award')
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M9 12l2 2 4-5"/></svg>
                            @else
                                <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 22s8-5 8-11a8 8 0 1 0-16 0c0 6 8 11 8 11z"/><circle cx="12" cy="10" r="3"/></svg>
                            @endif
                        </span>
                        <div class="imt-catalog-stats-bar__text">
                            <span class="imt-catalog-stats-bar__value">
                                @if(($row['show_prefix'] ?? true) !== false)
                                    <span class="imt-catalog-stats-bar__prefix">{{ $row['prefix'] ?? $counterPrefix }}</span>
                                @endif
                                <span class="js-imt-counter"
                                      data-imt-counter="{{ (int) ($row['value'] ?? 0) }}"
                                      aria-hidden="true">0</span>
                                @if(!empty($row['suffix']))
                                    <span>{{ $row['suffix'] }}</span>
                                @endif
                            </span>
                            <span class="imt-catalog-stats-bar__label">{{ trans($row['label_trans']) }}</span>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </div>
@endif
