@php
    $type = $section['type'] ?? 'text';
    $data = $section['data'] ?? [];
    $types = \App\Models\Page::getSectionTypes();
@endphp
<div class="section-item border border-slate-200 rounded-xl p-4 bg-slate-50/50 flex gap-4" data-index="{{ $index }}">
    <div class="drag-handle cursor-grab text-slate-400 hover:text-slate-600 pt-1" title="Glisser pour réorganiser">⋮⋮</div>
    <div class="flex-1">
        <div class="flex items-center justify-between mb-3">
            <span class="text-sm font-medium text-slate-600">{{ $types[$type]['label'] ?? $type }}</span>
            <button type="button" onclick="this.closest('.section-item').remove(); updateEmptyState();" class="text-slate-400 hover:text-red-600 text-sm">Supprimer</button>
        </div>
        <input type="hidden" name="sections[{{ $index }}][type]" value="{{ $type }}">
        @include('admin.pages.partials.section-fields', ['type' => $type, 'data' => $data, 'index' => $index])
    </div>
</div>
