@extends('web.layouts.layout')
@section('content')

    <main>
        <!-- Start pg_header -->
        @include('web.pages.components.header.header')

        <section class="checkout_pg cart_pg section">
            <div class="container">
                <div class="">
                    <form class="row" id="calculate_form" action="{{$action}}" method="post" onsubmit="formAction(this)" >
                        @CSRF
                        <div class="sec_head mb-5 ">
                            <h2 class="fs-1 fw-bold color-primary">   {{__('web.order_details')}}         </h2>
                        </div>
                        <div class="row">
                            <div class="col-lg-8">
                                <div class="box bg_transparent">
                                    <div class="table-responsive" id="products">
                                    </div>
                                </div>

                                <div class="butns mt-5 d-flex justify-content-center align-items-center">
                                    <a href="{{route('web.checkout.way')}}" class="butn gray_butn color-primary">
                                        <i class="fa-solid fa-angle-right ms-0 me-2"></i> {{__('web.back')}}
                                    </a>
                                    <button type="submit" class="butn primary_butn ms-4">
                                        {{__('web.ordering')}} <i class="fa-solid fa-angle-left"></i>
                                    </button>
                                </div>
                            </div>
                            <div class="col-lg-4 order_md_1">
                                <div class="box sm_box p-0 border-none">
                                    <div class="couboun_box mb-4">
                                        <h4 class="fw-bold fs-4 mb-4"> {{__('web.coupon')}}      </h4>
                                        <div class="form-group">
                                            <input type="text" class="form-control" name="coupon" onchange="calculate()" placeholder="{{__('web.enter_code')}}" />
                                            <button type="button" class="apply_butn butn primary_butn">{{__('web.apply')}}</button>
                                        </div>
                                    </div>

                                    <div class="couboun_box">
                                        <h4 class="fw-bold fs-4 mb-4"> {{__('web.note')}}     </h4>
                                        <div class="form-group">
                                            <textarea class="form-control" name="note" placeholder="{{__('web.order_note')}} " rows="3"></textarea>

                                        </div>
                                    </div>
                                </div>
                                <div id="calculate"></div>
                            </div>
                        </div>



                    </form>
                </div>
            </div>
        </section>

    </main>

    <div class="modal  delModal fade" id="delModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg">
            <div class="modal-content">
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                <div class="modal-body">
                    <div class="content text-center mt-4" >
                        <h4 class="title fs-2 text-dark mb-4"><b>  {{__('web.delete_product')}}  </b></h4>
                        <h5 class="mb-4">{{__('web.sure_delete')}}</h5>
                        <div class="d-flex justify-content-center align-items-center justify-content-center mt-5 ">
                            <button type="button" class="butn btn-secondary  mx-1" data-bs-dismiss="modal">{{__('web.no')}}</button>
                            <button type="button" id="deleteRaw" onclick="deleteCart(this)" action-id="" class="butn primary_butn mx-1">{{__('web.yes')}}</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection

@section('inject_js')
    <script>
        let url_calculate = "{{route('web.cart.calculate')}}"
    </script>
    <script src="{{url('')}}/assets/web/js/custom/cart.js"></script>
@endsection
