@php
$items = $data['items'] ?? [];
$color = $options['color'] ?? 'transparent';
$padding = $options['padding'] ?? 'lg';
@endphp
<section class="page-block-faq 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="accordion" id="{{ $accordionId }}">
            @foreach($items as $idx => $faq)
                <div class="accordion-item">
                    <h3 class="accordion-header">
                        <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#{{ $accordionId }}-{{ $idx }}">
                            {{ $faq['question'] ?? '' }}
                        </button>
                    </h3>
                    <div id="{{ $accordionId }}-{{ $idx }}" class="accordion-collapse collapse" data-bs-parent="#{{ $accordionId }}">
                        <div class="accordion-body">{!! e($faq['answer'] ?? '') !!}</div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>
</section>
