@php($d = $d ?? [])
<section class="vs-section vs-pricing" id="pricing">
    <div class="vs-container">
        <div class="vs-head" data-aos="fade-up">
            <h2 class="vs-h2">{{ $d['heading'] ?? 'Pricing' }}</h2>
            @if(!empty($d['subheading']))<p class="vs-lead">{{ $d['subheading'] }}</p>@endif
        </div>
        <div class="vs-price-grid">
            @foreach(($d['items'] ?? []) as $i => $p)
                @php($feat = ($p['featured'] ?? '0') === '1')
                <div class="vs-price-card {{ $feat ? 'is-featured' : '' }}" data-aos="fade-up" data-aos-delay="{{ $i * 90 }}">
                    @if($feat)<span class="vs-price-tag">Most popular</span>@endif
                    <h3 class="vs-price-name">{{ $p['name'] ?? '' }}</h3>
                    <div class="vs-price-amount"><strong>{{ $p['price'] ?? '' }}</strong> <span>{{ $p['period'] ?? '' }}</span></div>
                    <ul class="vs-price-feats">
                        @foreach(preg_split('/\r\n|\r|\n/', (string)($p['features'] ?? '')) as $f)
                            @if(trim($f) !== '')<li><i class="fas fa-check"></i> {{ trim($f) }}</li>@endif
                        @endforeach
                    </ul>
                    <a href="#contact" class="vs-btn {{ $feat ? 'vs-btn-primary' : 'vs-btn-ghost' }}">Choose plan</a>
                </div>
            @endforeach
        </div>
    </div>
</section>
