@php
    $__ad = $product->getActiveDiscount();
@endphp
<a href="{{ $product->getUrl() }}" class="premium-product-card d-block text-reset text-decoration-none h-100">
    <div class="premium-product-card__media">
        @if ($product->getAvailability() < 1)
            <span class="premium-product-card__badge premium-product-card__badge--muted">{{ trans('update.out_of_stock') }}</span>
        @elseif ($__ad && ($__ad->percent ?? 0) > 0 && ($product->price ?? 0) > 0)
            <span class="premium-product-card__badge premium-product-card__badge--sale">{{ trans('public.offer', ['off' => $__ad->percent]) }}</span>
        @endif
        @if (! empty($product->thumbnail))
            <img src="{{ $product->thumbnail }}" alt="{{ clean($product->title, 'title') }}" class="premium-product-card__img img-cover" loading="lazy" decoding="async">
        @else
            <div class="premium-product-card__ph" aria-hidden="true"><i class="fa fa-shopping-bag"></i></div>
        @endif
    </div>
    <div class="premium-product-card__body">
        <h3 class="premium-product-card__title">{{ clean($product->title, 'title') }}</h3>
        @if (! empty($product->category))
            <p class="premium-product-card__cat mb-0">{{ $product->category->title }}</p>
        @endif
        <div class="premium-product-card__price">
            @if (($product->price ?? 0) > 0)
                @if ($product->getPriceWithActiveDiscountPrice() < $product->price)
                    <span class="premium-product-card__price-now">{{ handlePrice($product->getPriceWithActiveDiscountPrice()) }}</span>
                    <span class="premium-product-card__price-was">{{ handlePrice($product->price) }}</span>
                @else
                    <span class="premium-product-card__price-now">{{ handlePrice($product->price) }}</span>
                @endif
            @else
                <span class="premium-product-card__price-now">{{ trans('public.free') }}</span>
            @endif
        </div>
    </div>
</a>
