{{-- Recursive mobile offcanvas category items (any depth) --}}
@foreach($items as $cat)
    @php
        $depth = (int) ($depth ?? 0);
        $hasChildren = $cat->allChildren->isNotEmpty();
    @endphp
    <li class="nav-item rm-cat-item rm-cat-depth-{{ min($depth, 3) }}">
        <a href="{{ route('shop.category', $cat->slug) }}" class="nav-link">
            @if($depth === 0 && $cat->icon)
                <i class="bi bi-{{ $cat->icon }}"></i>
            @endif
            {{ $cat->name }}
        </a>
        @if($hasChildren)
            <span class="showSubMenu"><i class="bi bi-chevron-left"></i></span>
            <ul class="navbar-nav h-0 rm-submenu">
                @include('site.partials._mobile-menu-cat', [
                    'items' => $cat->allChildren,
                    'depth' => $depth + 1,
                ])
            </ul>
        @endif
    </li>
@endforeach
