@php
    // Panggil data dari helper floating()
    $floatingsMobile = floating();
@endphp

@forelse($floatingsMobile as $index => $float)
    @php
        // STACKING OTOMATIS UNTUK MOBILE
        // Icon pertama di bottom 120px, icon kedua naik 55px (ukuran 45px + gap 10px)
        $bottomPosition = 65 + ($index * 55); 
        
        // Sesuaikan nama kolom dengan database bosku
        $floatUrl = $float->url ?? $float->link ?? '#';
        $floatImg = $float->image ?? $float->icon ?? $float->banner ?? '';
        
        $imgSrc = asset('uploads/' . $floatImg);
    @endphp

    <a href="{{ $floatUrl }}" class="apk-icon" target="_blank" style="position: fixed; left: 20px; bottom: {{ $bottomPosition }}px; width: 45px; z-index: 99; transition: 0.3s;">
        <img src="{{ $imgSrc }}" alt="Floating Banner" width="45" height="auto" onerror="this.src='/assets/custom/img/TelegramMantra88.png'">
    </a>

@empty
    <a href="https://t.me/Gameonline_mantra88" class="apk-icon" target="_blank" style="position: fixed; left: 20px; bottom: 120px; width: 45px; z-index: 99; transition: 0.3s;">
        <img src="/assets/custom/img/TelegramMantra88.png" alt="Telegram" width="45" height="auto">
    </a>
@endforelse