@php 

   $category = App\Models\Category::where('name', $categoryName)->first();

           $categoryhaberler = App\Models\News::where('status', 1)
                    ->where('category_id', $category->id)
                    ->orderBy('created_at', 'desc')
                    ->limit(34)
                    ->get();
           $categorySlider = $categoryhaberler->slice(0, 15); // İlk 15 öğeyi slider olarak ayır
           $categoryNews = $categoryhaberler->slice(15, 6); // 16-19. öğeleri news olarak ayır
           $categoryTop = $categoryhaberler->slice(21,7); // 20-26. öğeleri top olarak ayır

@endphp


            <div class="container Category">
                <div class="container " style="margin-top:30px !important;padding-right: 0px; padding-left: 0px;">
                    <div class="section-header">
                        <h2>{{ $category->name }}</h2>
                        <div class="line" style="background-color:#ff8c04"></div>
                    </div>
                </div>
                <div class="row mt-3">
                    {{-- Slider Yapısı --}}
                    @include('sliders.slider', [
                        'sliderId' => 'newsCarousel_' . \Str::slug($category->name),
                        'slides' => $categorySlider,
                        'news' => $categoryNews
                    ])

                    {{-- Öne Çıkan Haberler Bölümü --}}
                    <div class="col-md-3 mobile-mt-50 ozel-md-3">
                        <div class="row">
                            <div class="col-md-12 ads">
                                {!! showAd('302',$category->id) !!}
                            </div>
                            <div class="col-md-12 one-cikan" style="padding-right:0px !important">
                                <div class="container mt-5" style="padding-left:0px !important;padding-right:0px !important">
                                    <div class="section-header" style="display: contents;">
                                        <h2>ÖNE ÇIKANLAR</h2>
                                        <div class="line" style="background-color:#FF0000; margin-top: 5px;"></div>
                                    </div>
                                    <div class="row">
                                        @php $i=0; @endphp
                                        @foreach($categoryTop as $news)
                                            @php $i++; @endphp
                                            <div class="col-md-12">
                                                <div class="one-cikan-card">
                                                    <div class="circle col-md-2">{{ $i }}</div>
                                                    <div class="text col-md-10">
                                                          {!! getNewsLink($news) !!}
                                                            <span>{{ $news->name }}</span>
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>        
                                        @endforeach
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                  <div class="row"> <a href="/{{$category->slug}}" class="btn btn-primary pull-right more-content commment-send" >Daha Fazla</a>
            </div></div>    

             
  
                          <div class="ads container fullWidthHeight mt-3">{!! showAd('301',$category->id) !!}</div>