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

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


        <section class="checkout_pg section">
            <div class="container">
                <form class="row" action="{{$action}}" method="post" onsubmit="formAction(this)" id="calculate">
                    @CSRF
                    <div class="col-lg-12">
                        <div class="box mb-5">
                            <div class="row">
                                <div class="col-lg-3">
                                    <div class="data-group">
                                        <span class="label color-gray2">{{__('web.order_date')}}  </span>
                                        <p class="data mb-0">  {{$date}} </p>
                                    </div>
                                </div>
                                <div class="col-lg-3">
                                    <div class="data-group">
                                        <span class="label color-gray2">  {{__('web.address')}}  </span>
                                        <p class="data mb-0">     {{$address->address}}     </p>
                                    </div>
                                </div>
                                <div class="col-lg-3">
                                    <div class="data-group">
                                        <span class="label color-gray2">   {{__('web.way_pay')}}  </span>
                                        <p class="data mb-0"> {{$way->title}}     </p>
                                    </div>
                                </div>
                                <div class="col-lg-3">
                                    <div class="data-group">
                                        <span class="label color-gray2">   {{__('web.shipping_way')}}  </span>
                                        <p class="data mb-0"> {{$shipping->title}}     </p>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="box mb-5">
                            <h2 class="sec_title bb fw-bold mb-4"> {{__('web.note')}}    </h2>
                            <textarea name="note" class="form-control" placeholder="{{__('web.order_note')}}" rows="5"></textarea>
                        </div>
                        <div class="box mb-5">
                            <h2 class="sec_title bb fw-bold mb-4"> {{__('web.coupon')}}    </h2>
                            <div class="copoun_box">
                                <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>
                    <div class="col-lg-8">
                        <div class="box mb-5 pt-0" id="cart">
                        </div>
                    </div>

                    <div class="butns d-flex align-items-center justify-content-center">
                        <a href="{{route('web.checkout.way')}}" class="butn primary_border_butn me-2"> {{__('web.back')}}  </a>
                        <button type="submit" class="butn primary_butn">
                            {{__('web.ordering')}}
                        </button>
                    </div>
                </form>
            </div>
        </section>

    </main>

@endsection

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