@php
$primaryImage = $item->getPrimaryImage();
@endphp
{{-- Condition Badge - Top Right --}}
@if($item->conditionGrade)
{{ $item->conditionGrade->name }}
@endif
{{-- Hot Deal Badge --}}
@if($item->is_popular ?? false)
@endif
{{-- Discount Badge --}}
@if($item->has_discount ?? false)
-{{ $item->discount_percent }}%
@endif
@if($item->display_image_url || ($primaryImage && $primaryImage->image_url))
@else
@endif
{{-- Quick Actions - Hidden by default, shown on hover --}}
View Details
@php
$imageCount = method_exists($item, 'getGroupedVisibleImages') ? $item->getGroupedVisibleImages()->count() : 0;
@endphp
@if($imageCount > 1)
{{ $imageCount }}
@endif
{{-- Category --}}
@if($item->subcategory)
{{ $item->subcategory->name }}
@endif
{{-- Product Name with Brand --}}
@if($item->brand)
{{ $item->brand->name }}
@endif
{{ $item->product_name ?? 'Unknown Product' }}
{{-- Star Rating --}}
@php
$rating = $item->demo_rating ?? 4.5;
$fullStars = floor($rating);
$hasHalf = ($rating - $fullStars) >= 0.5;
@endphp
@for($i = 0; $i < 5; $i++)
@if($i < $fullStars)
@elseif($i == $fullStars && $hasHalf)
@else
@endif
@endfor
@if(($item->demo_reviews ?? 0) > 0)
({{ $item->demo_reviews }})
@endif
{{-- Trust Indicators --}}
@if(($item->demo_sold ?? 0) > 0)
{{ $item->demo_sold }}+ sold
@endif
@if($item->has_fast_shipping ?? false)
Fast
@endif
{{-- Price Section --}}
@if(($item->has_discount ?? false) && isset($item->original_price))
{{ $item->computed_price }}
${{ $item->original_price }}
@else
{{ $item->computed_price }}
@endif
{{-- Availability Status --}}
{{ $item->computed_status['status'] }}
{{-- Add to Cart Button --}}
@php
$availableCount = $item->available_count ?? 1;
$firstInventoryId = $item->first_inventory_id ?? $item->id ?? null;
@endphp
@if($availableCount == 1 && $firstInventoryId)
{{-- Single item - Add directly to cart --}}
@else
{{-- Multiple items - Link to detail page to choose --}}
View Options ({{ $availableCount }})
@endif