@extends('frontend.layout.app')

@section('content')
<section class="pt-4 mb-4">
    <div class="container">
        <div class="row">
            <div class="col-lg-3 text-center ">
                <h1 class="fw-600 h4">Products/New Arivel</h1>
            </div>
            <div class="col-lg-9">
                <ul class="breadcrumb bg-transparent p-0 justify-content-center justify-content-lg-end">
                    <li class="breadcrumb-item opacity-50">
                        <a class="text-reset" href="{{ route('home') }}">Home</a>
                    </li>
                    <li class="text-dark fw-600 breadcrumb-item">
                        <a class="text-reset" href="">New Arivel</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</section>
<section class="mb-4">
    <div class="container">
            <div class="row">
            @foreach($products as $product)
            <div class="col-6 col-md-3 product-display">
                            <div class="product-all-card-img">
                                <img src={{ asset('/storage/'.$product->thumbnail_img) }} class="img_center" alt="Laptop">
                            </div>    
                            
                            <div class="p-3 text-left">
                                    <p class="product-all-brand"> {{ $product->category->name }} </p>
                                        <h4 class="product-name">
                                            <a href="{{ route('categoryproducts',[$product->id]) }}"  tabindex="0">{{$product->name }}</a>
                                        </h4>
                                     <div class="rating rating-sm mb-2"></div>
                                            @php
                                              $prignalprice=$product->unit_price;
                                              $descount=$product->discount;
                                              $price=$prignalprice-$descount;
                                             @endphp
                                         <span class="selling-price">Rs:{{ $price }}</span>
                                         <span class="original-price">{{ $product->unit_price }}</span>
                                        
                                        <div class="mt-2">
                                               <a href="{{ route('addtocart',[$product->id]) }}" class="btn btn2">Add To Cart</a>
                                               <a href="" class="btn btn2"> <i class="bi bi-heart"></i> </a>
                                              <a href={{ route('viewproduct',[$product->id]) }} class="btn btn2"> View </a>
                                       </div>
                                        <div class="mt-2">
                                             
                                        </div>
                            </div>
            </div>
                                    
            @endforeach
            </div>
     </div>
</section>            

@endsection
