@php
    $faqItems = [];
    if (!empty($items)) {
        $decoded = json_decode($items, true);
        if (is_array($decoded)) {
            $faqItems = $decoded;
        }
    }
@endphp
@php $fw = $full_width ?? false; @endphp
@if(count($faqItems))
<section class="{{ $fw ? 'px-0' : 'max-w-5xl mx-auto px-4 sm:px-6' }} py-12">
    <div class="space-y-3">
        @foreach($faqItems as $item)
        @if(!empty($item['q']))
        <details class="group border border-gray-200 rounded-xl overflow-hidden">
            <summary class="flex items-center justify-between px-5 py-4 cursor-pointer font-semibold text-gray-900 hover:bg-gray-50 transition-colors list-none">
                <span>{{ $item['q'] }}</span>
                <svg class="w-5 h-5 text-gray-400 transition-transform group-open:rotate-180 flex-shrink-0 ml-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/>
                </svg>
            </summary>
            @if(!empty($item['a']))
            <div class="px-5 py-4 text-gray-600 border-t border-gray-100 bg-gray-50">
                {{ $item['a'] }}
            </div>
            @endif
        </details>
        @endif
        @endforeach
    </div>
</section>
@endif
