@if(count($carts))
    <table class="table">
        <thead>
        <tr>
            <th>{{__('web.product_image')}}</th>
            <th>{{__('web.product_name')}}</th>
            <th>{{__('web.quantity')}}</th>
            <th>{{__('web.total')}}</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        @foreach($carts as $row)
            <tr class="cart_card_row">

                <td>
                    <img src="{{asset($row['product_image'])}}" class="prodImg" alt=""/>
                </td>
                <td>
                    <h4 class="name fs-6 mb-1">   {{$row['product_name']}}   </h4>
                    <span class="codeProd fs-6">{{$row['product_code']}}</span>
                </td>
                <td>
                    <div class="qty-container">
                        <button style="background-color: transparent;
                                        padding: 10px 13px;
                                        font-size: 12px;
                                        height: 38px;
                                        width: 45px;
                                        transition: 0.3s;
                                        color: #777;
                                        margin-right: -1px;
                                        box-shadow: none !important;" class="btn-light" onclick="qtyDecrease(this)" action-id="{{route('cart.update',$row['id'])}}" data-id="{{$row['id']}}" type="button"><i class="fa fa-minus"></i></button>
                        <input type="text" id="qty{{$row['id']}}" name="qty" value="{{$row['count']}}" class="input-qty quantity-digit"/>
                        <button style="background-color: transparent;
                                        padding: 10px 13px;
                                        font-size: 12px;
                                        height: 38px;
                                        width: 45px;
                                        transition: 0.3s;
                                        color: #777;
                                        margin-left: -1px;
                                        box-shadow: none !important;" class="btn-light" onclick="qtyIncrease(this)" action-id="{{route('cart.update',$row['id'])}}" data-id="{{$row['id']}}" type="button"><i class="fa fa-plus"></i></button>
                    </div>
                </td>
                <td><b>{{$row['product_cost']}} {{__('web.sar')}}</b></td>
                <td>
                    <button type="button" class="delete_butn butn sm_butn rounded-circle gray_butn mx-auto"  onclick="deleteCartItem(this)" action-id="{{route('cart.destroy',$row['id'])}}">
                        <i class="fa-regular fa-x mx-0"></i>
                    </button>
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>

    <script src="{{url('')}}/assets/web/js/custom/product.js"></script>
    <script>
        $('.quantity-digit').keypress(function(e) {
            e.preventDefault();
        });
    </script>
@else
    @include('web.pages.components.not_found',['message'=>__('web.not_found_product_cart')])
@endif
