@php
$columns = (int) ($options['columns'] ?? 3);
$color = $options['color'] ?? 'transparent';
$padding = $options['padding'] ?? 'lg';
$colSize = (int) (12 / max(1, $columns));
$locale = app()->getLocale();
@endphp
<section class="page-block-featured-products py-{{ $padding }} @if($color !== 'transparent') {{ pb_bg_class($color) }} @endif">
    <div class="container">
        @if(! empty($data['title']))<h2 class="text-center mb-5">{{ $data['title'] }}</h2>@endif
        <div class="row g-4">
            @foreach($products as $product)
                <div class="col-md-{{ $colSize }}">
                    <div class="card h-100">
                        <div class="card-body">
                            <h4>{{ $product->getTranslation('name', $locale) ?: $product->name }}</h4>
                            <p class="text-muted">{!! e(Str::limit($product->getTranslation('description', $locale) ?: $product->description ?? '', 150)) !!}</p>
                            <a href="{{ route('store.products.show', $product->slug) }}" class="btn btn-outline-primary">İncele</a>
                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
</section>
