@props([
    'originalPrice',
    'promotion' => null,
    'showBadge' => true
])

@php
    $hasPromotion = $promotion && $promotion['discount'] > 0;
    $finalPrice = $hasPromotion ? $promotion['final_price'] : $originalPrice;
    $discountPercentage = $promotion['discount_percentage'] ?? 0;
@endphp

<div class="inline-flex items-center gap-2">
    @if($hasPromotion)
        {{-- Prix barré --}}
        <span class="text-gray-400 line-through text-sm">
            {{ number_format($originalPrice, 0, ',', ' ') }} FCFA
        </span>
        
        {{-- Prix promo --}}
        <span class="text-red-600 font-bold text-lg">
            {{ number_format($finalPrice, 0, ',', ' ') }} FCFA
        </span>
        
        @if($showBadge && $discountPercentage > 0)
            <span class="bg-red-500 text-white text-xs font-semibold px-2 py-0.5 rounded">
                -{{ $discountPercentage }}%
            </span>
        @endif
    @else
        {{-- Prix normal --}}
        <span class="text-gray-900 dark:text-white font-bold text-lg">
            {{ number_format($originalPrice, 0, ',', ' ') }} FCFA
        </span>
    @endif
</div>
