<div class="horticulture-item p-4 border border-gray-200 rounded-lg relative">
    <button type="button" class="remove-horticulture absolute top-2 right-2 text-gray-400 hover:text-red-500">
        <i class="fas fa-times-circle"></i>
    </button>
    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
        <div class="space-y-2">
            <label for="horticultures_{{ $index }}_type" class="text-sm font-semibold text-gray-700">Tipe Budidaya</label>
            <input type="text" name="horticultures[{{ $index }}][type]" id="horticultures_{{ $index }}_type" value="{{ old('horticultures.' . $index . '.type', $horticulture['type'] ?? '') }}"
                class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary outline-none transition"
                placeholder="Contoh: Sayuran, Buah">
        </div>
        <div class="space-y-2">
            <label for="horticultures_{{ $index }}_commodity" class="text-sm font-semibold text-gray-700">Komoditas</label>
            <input type="text" name="horticultures[{{ $index }}][commodity]" id="horticultures_{{ $index }}_commodity" value="{{ old('horticultures.' . $index . '.commodity', $horticulture['commodity'] ?? '') }}"
                class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary outline-none transition"
                placeholder="Contoh: Cabe, Tomat">
        </div>
        <div class="space-y-2">
            <label for="horticultures_{{ $index }}_quantity" class="text-sm font-semibold text-gray-700">Jumlah/Luas (Are)</label>
            <input type="number" step="any" name="horticultures[{{ $index }}][quantity]" id="horticultures_{{ $index }}_quantity" value="{{ old('horticultures.' . $index . '.quantity', $horticulture['quantity'] ?? '') }}"
                class="w-full px-4 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-primary/20 focus:border-primary outline-none transition"
                placeholder="Contoh: 50 (polybag), 0.5 (are)">
        </div>
    </div>
    @if(isset($horticulture->id))
        <input type="hidden" name="horticultures[{{ $index }}][id]" value="{{ $horticulture->id }}">
    @endif
</div>