<div class="container" style="margin-top: 30px;margin-bottom: 30px;">  
     <div class="title-link-wrapper title-deals appear-animate mb-0.5">
        <h2 class="title title-link">New Arrivals</h2>
        <div  class="font-size-sm text-white bg-secondary align-items-center mr-auto">
        </div>
        <a href="#" class="ml-0">More Products<i class="w-icon-long-arrow-right"></i></a>
    </div>

    <div class="owl-carousel owl-theme appear-animate cols-xl-6 cols-lg-5 cols-md-4 cols-sm-3 cols-2"
        data-owl-options="{'nav': false, 'dots': true, 'margin': 20, 'responsive': {'0': {'items': 2},
            '576': {'items': 3},'768': {'items': 4}, '992': {'items': 6}}}">
            
        @foreach($npros as $np)
        <div class="product-wrap">
            <div class="product product-image product-simple">
                <figure class="product-media  text-center"  style="border:1px solid #e4e7ec;">
                    <center style="background-color:#e4e7ec;"><img class="lazy" src="{{URL::to($np->image)}}" style="height:188px;width:auto;"></center>
                        @if(!is_null($np->regu_price))
                        <div class="product-label-group">
                            <label class="product-label label-discount"><?php echo number_format((($np->regu_price-$np->price)/$np->regu_price)*100); ?>% Off</label>
                        </div>
                        @endif
                    
                        <div class="product-action-vertical">
                            <a href="#" class="btn-product-icon"><i class="fa fa-eye"></i>
                            </a>
                        </div>
                </figure>
                <div class="product-details">
                    <h3 class="product-name">
                        <a href="{{url('prodetails/'.$np->id)}}">{{$np->title}}</a>
                    </h3>

                     
                    <div class="product-pa-wrapper" style="margin-top:3px;">
                        <div class="product-price">
                            <ins class="new-price">Tk. {{$np->price}}</ins>@if(!is_null($np->regu_price)) <del class="old-price">Tk. {{$np->regu_price}}</del> @endif
                        </div>                      
                        <div class="product-action">
                            <form action="{{url('addtocart')}}" method="post">@csrf
                                <input type="hidden" name="pro_id" value="{{$np->id}}">
                                <input type="hidden" name="qty" value="1">
                                <button type="submit" style="color: #fff; background: #009688; padding: 2px 8px;" class="btn-product btn btn-link">Add To Cart</button>
                            </form>
                        </div>                      
                    </div>
                </div>
            </div>
        </div>
        @endforeach  
    </div> 
</div>

<div class="container">   
    @foreach($pro_cats as $pcat)
    <div class="banner banner-fashion appear-animate br-sm mb-9 hidem" style="background-image: url(web/images/banner/4.jpg);
        background-color: #383839;">
        <div class="banner-content align-items-center">
            <div class="content-left d-flex align-items-center mb-3">
                <div class="banner-price-info font-weight-bolder text-secondary text-uppercase lh-1 ls-25">
                    0-25
                    <sup class="font-weight-bold">%</sup><sub class="font-weight-bold ls-25">Off</sub>
                </div>
                <hr class="banner-divider bg-white mt-0 mb-0 mr-8">
            </div>
            <div class="content-right d-flex align-items-center flex-1 flex-wrap">
                <div class="banner-info mb-0 mr-auto pr-4 mb-3">
                    <h3 class="banner-title text-white font-weight-bolder text-uppercase ls-25">{{$pcat->cat_name}} </h3>
                    <p class="text-white mb-0">Choose best product & get best offer.</p>
                </div>
                <a href="{{url('cat-'.$pcat->id)}}" class="btn btn-white btn-outline btn-rounded btn-icon-right mb-3">More Products<i class="w-icon-long-arrow-right"></i></a>
            </div>
        </div>
    </div>

    <?php $cpros = DB::table('products')->where('cat_id', $pcat->id)->where('status', 1)->inRandomOrder()->take(6)->get(); ?>
  
    <div class="product-wrapper-1 appear-animate mb-5">
        <div class="title-link-wrapper pb-1 mb-4 d-sm-none d-md-none d-xl-none">
            <h2 class="title ls-normal mb-0">{{$pcat->cat_name}} </h2>
            <a href="#" class="font-size-normal font-weight-bold ls-25 mb-0">More
                Products<i class="w-icon-long-arrow-right"></i></a>
        </div>
        <div class="row">
            <div class="col-lg-12 col-sm-12">
                <div class="owl-carousel owl-theme appear-animate cols-xl-6 cols-lg-5 cols-md-4 cols-sm-3 cols-2" data-owl-options="{'nav': false, 'dots': true, 'margin': 20, 'responsive': {'0': {'items': 2}, '576': { 'items': 3}, '768': {'items': 4}, '992': {'items': 6}}}">                          
                     @foreach($cpros as $cps)
                    <div class="product-wrap">
                        <div class="product product-image product-simple">
                            <figure class="product-media text-center"  style="border:1px solid #e4e7ec;">
                                <center style="background-color:#e4e7ec;"><img class="lazy" src="{{URL::to($cps->image)}}" style="height:188px;width:auto;"></center>
                                    @if(!is_null($cps->regu_price))
                                    <div class="product-label-group">
                                        <label class="product-label label-discount"><?php echo number_format((($cps->regu_price-$cps->price)/$cps->regu_price)*100); ?>% Off</label>
                                    </div>
                                    @endif
                                
                                    <div class="product-action-vertical">
                                        <a href="#" class="btn-product-icon"><i class="fa fa-eye"></i>
                                        </a>
                                    </div>
                            </figure>
                            <div class="product-details">
                                <h3 class="product-name">
                                    <a href="{{url('prodetails/'.$cps->id)}}">{{$cps->title}}</a>
                                </h3>

                                 
                                <div class="product-pa-wrapper" style="margin-top:3px;">
                                    <div class="product-price">
                                        <ins class="new-price">Tk. {{$cps->price}}</ins>@if(!is_null($cps->regu_price)) <del class="old-price">Tk. {{$cps->regu_price}}</del> @endif
                                    </div>                      
                                    <div class="product-action">
                                        <form action="{{url('addtocart')}}" method="post">@csrf
                                            <input type="hidden" name="pro_id" value="{{$cps->id}}">
                                            <input type="hidden" name="qty" value="1">
                                            <button type="submit" style="color: #fff; background: #009688; padding: 2px 8px;" class="btn-product btn btn-link">Add To Cart</button>
                                        </form>
                                    </div>                      
                                </div>
                            </div>
                        </div>
                    </div>
                    @endforeach  
                </div>
            </div>
        </div>
    </div>
    @endforeach

    <div class="post-wrapper appear-animate mb-4">
        <div class="title-link-wrapper pb-1 mb-4">
            <h2 class="title ls-normal mb-0">From Our News</h2>
            <a href="{{url('news')}}" class="font-weight-bold font-size-normal">View More</a>
        </div>
        
        <div class="owl-carousel owl-theme row cols-lg-4 cols-md-3 cols-sm-2 cols-1" data-owl-options="{'items': 4, 'nav': false, 'dots': true, 'loop': false, 'margin': 20, 'responsive': {'0': {'items': 2}, '576': {'items': 2}, '768': {'items': 3}, '992': {'items': 4, 'dots': false}}}">
            @foreach($posts as $cont)      
            <div class="post text-center overlay-zoom">
                <figure class="post-media br-sm">
                    <a href="{{url('postdetails/'.$cont->id)}}">
                        <center><img class="lazy" src="{{URL::to($cont->image)}}" style="height:120px;width:auto;background-color:#4b6e91;" /></center>                                
                    </a>
                </figure>
                <div class="post-details">
                    <h4 class="post-title"><a href="{{url('postdetails/'.$cont->id)}}">{{$cont->title}}</a>
                    </h4>
                    <a href="{{url('postdetails/'.$cont->id)}}" class="btn btn-link btn-dark btn-underline">Read More<i
                            class="w-icon-long-arrow-right"></i></a>
                </div>
            </div>
            @endforeach
        </div>
    </div>
 
    <h2 class="title title-underline mb-4 ls-normal appear-animate">Top Selling Products</h2>
    <div class="owl-carousel owl-theme owl-shadow-carousel appear-animate row cols-xl-8 cols-lg-6 cols-md-4 cols-2 pb-2 mb-10" data-owl-options="{'nav': false, 'dots': true, 'margin': 20, 'responsive': {'0': {'items': 2}, '576': {'items': 3}, '768': {'items': 5}, '992': {'items': 6}, '1200': {'items': 8, 'dots': false}}}">
        @foreach($tpros as $tp)
        <div class="product-wrap mb-0">         
            <div class="product text-center product-absolute" style="border: 1px solid #80808029;">
                <figure class="product-media">
                    <a href="{{url('prodetails/'.$tp->id)}}">
                        <center style="background-color:#e4e7ec;"><img class="lazy" src="{{URL::to($tp->image)}}" alt="Product" style="height:146px;width:auto;"></center>                              
                    </a>
                </figure>
                <h4 class="product-name">
                    <a href="{{url('prodetails/'.$tp->id)}}">{{$tp->title}}</a>
                </h4>
        
            </div>
        </div> 
        @endforeach             
      
    </div>
</div>