@props(['data'])
@php
    $parent = reset($data);
    $child = array_values(array_slice($data, 1));

@endphp

<!-- Why Chose us -->
<section class="container mx-auto flex items-center px-2 md:px-[20px] lg:px-[100px] xl:px-[169px]">
    <!-- left -->
    <section class="container mx-auto w-full space-y-7 md:w-1/2">
        <!-- Header -->
        @if (!empty($parent))
            <div class="text-[#424242]">
                <h2 class="text-[22px] font-medium">{{ $parent['title'] }}</h2>
                <h1 class="text-[26px] font-bold">{{ $parent['sub title'] }}</h1>
                <p class="text-[14px]">
                    {{ $parent['description'] }}
                </p>
            </div>
        @endif

        <!-- Body -->
        <div class="grid-cols-12 gap-2 space-y-3 sm:grid sm:space-y-0">

            @foreach ($child as $value)
                <div class="col-span-12 flex items-center gap-2 sm:col-span-6">
                    <span
                        class="rounded-[10px] border-[0.7px] border-[#424242] px-2 py-1.5 text-[18px] text-[#F06728]"><i
                            class="{{ $value['icone'] }} flex h-8 w-8 items-center justify-center"></i></span>
                    <div class="space-y-0.5">
                        <h1
                            class="text-[12px] font-semibold text-[#424242] sm:text-[14px] md:text-[12px] lg:text-[14px]">
                            {{ $value['title'] }}
                        </h1>
                        <h2 class="text-[11px] text-[#424242] sm:text-[13px] md:text-[11px] lg:text-[13px]">
                            {{ $value['description'] }}
                        </h2>
                    </div>
                </div>
            @endforeach



        </div>
    </section>
    <!-- right -->
    @if (!empty($parent))
        <section class="hidden w-1/2 md:block">
            <img src="{{ asset('images/' . $parent['image']) }}" alt="choose-us"
                class="h-[400px] w-full object-contain" />
        </section>
    @endif
</section>
