@props([ 'products' => [], 'sliderId' => 'slider-' . uniqid(), 'viewAllUrl' => '/sarees', 'viewAllLabel' => 'View All Sarees', 'totalCount' => null, ]) @php // Enforce Data Rule: Maximum 12 in-stock products per slider (Sold-out products never appear in sliders) $sliderProducts = array_values(array_filter($products, fn($p) => !empty($p['inStock']) && ($p['stockQty'] ?? 0) > 0)); $sliderProducts = array_slice($sliderProducts, 0, 12); $productCount = count($sliderProducts); $desktopDotCount = (int) ceil($productCount / 4); $displayTotalCount = $totalCount ?? $productCount; @endphp @if($productCount > 0)
{{-- ==================================================================== 1. HORIZONTAL PRODUCT TRACK + DESKTOP CIRCULAR ARROWS Mobile (320–767px): 2 full cards + ~10% peek (gap: 12px) Tablet (768–1024px): 3 full cards + small peek (gap: 16px) Desktop (1025px+): 4 cards side-by-side (gap: 20px) ==================================================================== --}}
{{-- Desktop Left Circular Arrow Button (40x40px, vertically centered on images, hidden at start) --}} {{-- Scrollable Cards Row --}}
@foreach($sliderProducts as $saree)
@endforeach {{-- Mobile & Tablet "View All [Category] →" End Card (Hidden on Desktop) --}}
{{-- Desktop Right Circular Arrow Button (40x40px, vertically centered on images, hidden at end) --}}
{{-- ==================================================================== 2. BOTTOM SLIDER INDICATORS A. Mobile & Tablet (320–1024px): Slim Progress Bar (120px Mobile / 160px Tablet, 3px tall) B. Desktop (1025px+): 3-Dot Navigation Indicator (Active 24x8px --brand-primary pill, Inactive 8x8px --brand-accent dot) ==================================================================== --}} {{-- A. Touch Slim Progress Bar (Hidden if <= 2 products on mobile) --}} @if($productCount > 2) @endif {{-- B. Desktop 3-Dot Navigation Indicator (Hidden if <= 4 products) --}} @if($desktopDotCount > 1) @endif
@endif