<meta property="og:url" content="{{ Request::url() }}" />
<meta property="og:type" content="Article">
<meta property="og:title" content="{{ $viewproduct->product_name }}">
<meta property="og:description" content="{{ $viewproduct->product_name }}">
<meta property="og:image" content="{{ url('/public/productImage') }}/{{ $viewproduct->image }}" />

@extends('User.layouts.master')
@section('body')






<div class="col-md-12">
    <div class="container">
        <div class="row">

            <div class="col-xl-3 col-lg-3 col-md-3 col-sm-3 col-3 d-none d-lg-block">
                @include('User.layouts.sidmenu')
            </div>
            <!----------End Sidebar-------->

            <div class="col-xl-9 col-lg-9 col-md-12 col-sm-12 col-12 pb-5">
                <div class="col-md-12 mt-3 p-3 bg-white breadcumbs">
                    <li><a href="{{ url('/') }}"><i class="bi bi-house-fill"></i>&nbsp;&nbsp;Home</a></li>
                    <li><i class="bi bi-chevron-right"></i></li>
                    <li>{{ $viewproduct->product_name }}</li>
                </div>


                <div class="col-md-12 mt-4 single bg-white rounded pb-4 p-3 p-lg-0">
                    <div class="row">
                        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 p-4">

                            <div class="simpleLens-gallery-container" id="demo-1">
                                <div class="simpleLens-container border" style="width: 100%;">
                                    <div class="simpleLens-big-image-container p-2">
                                        @foreach($product_image as $img)
                                        <a href="{{ asset('/public/productImage') }}/{{ $img->image }}" class="simpleLens-lens-image popup-image" data-lens-image="{{asset('/public/productImage')}}/{{$img->image}}">
                                            <img src="{{asset('/public/productImage')}}/{{$img->image}}" class="simpleLens-big-image product-image-zoom">
                                        </a>
                                        @endforeach
                                    </div>
                                </div>

                                <div class="product-thumb-gallery">
                                    @foreach($product_image as $img)
                                    <div class="product-thumb-gallery-item">
                                        <!-- <img src="{{ asset('public/productImage') }}/{{ $viewproduct->image }}" alt=""> -->
                                        <img src="{{asset('/public/productImage')}}/{{$img->image}}" alt="">
                                    </div>
                                    @endforeach
                                </div>
                            </div>
                        </div>



                        <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12">
                            <br>
                            <h3 class="mt-0 mb-3 fw-bold">{{ $viewproduct->product_name }}</h3>
                            <div><b>SKU:</b> {{ $viewproduct->product_id }}</div>
                            <div class="my-2">
                                @if($viewproduct->stock_status == 1)
                                <span class="bg-success text-light rounded" style="padding: 2px 10px; font-size: 13px;">Stock Available</span>
                                @else
                                <span class="bg-danger text-light rounded" style="padding: 2px 10px; font-size: 13px;">Stock Out</span>
                                @endif
                            </div>
                            
                            <div class="product-price">৳ {{ number_format($viewproduct->current_price, 2, '.', ',') }}</div>

                            @if ($viewproduct->discount_price > 0)
                            <del>৳ {{ number_format($viewproduct->sale_price, 2, '.', ',') }}</del>
                            @endif

                            <div class="row" style="padding-right: 40px;">
                                <div class="col-lg-6 col-6">
                                    <select name="size" id="size" class="border bg-transparent py-1 px-2 w-100">
                                        <option value="">Select</option>
                                        @foreach($product_size as $size)
                                        <option value="{{$size->size}}">{{$size->size}}</option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="col-lg-6 col-6">
                                    <select name="color" id="color" class="border bg-transparent py-1 px-2 w-100">
                                        <option value="">Select</option>
                                        @foreach($product_color as $color)
                                        <option value="{{$color->color}}">{{$color->color}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>

                            <div class="quentity mt-3">
                                <label>Quentity</label><br>
                                <input type="number" min="{{ $viewproduct->min_qunt }}" name="Quantity-{{ $viewproduct->id }}" id="Quantity-{{ $viewproduct->id }}" value="{{ $viewproduct->min_qunt }}">
                            </div>

                            <div class="mt-4">
                                <div class="col-md-12">
                                    @if($viewproduct->stock_status == 1)
                                    <button class="cart w-50" onclick="AddCart('{{ $viewproduct->id }}')"><i class="fa fa-shopping-basket" aria-hidden="true"></i>&nbsp;&nbsp;Add To Cart</button>
                                    @else
                                    <button class="cart w-50" style="cursor: not-allowed;"><i class="fa fa-shopping-basket" aria-hidden="true"></i>&nbsp;&nbsp;Add To Cart</button>
                                    @endif
                                </div>
                            </div>


                            <div class="mt-4">
                                <span>Share With :</span><br>
                                <div class="addthis_inline_share_toolbox_0v9d"></div>

                            </div>


                        </div>



                    </div>
                </div>
                <!--------------End Product's--------------------->





                <div class="col-md-12 bg-white p-0 p-4 details mt-4">

                    <ul class="nav nav-tabs" id="myTab" role="tablist">

                        <li class="nav-item">

                            <a class="nav-link active" id="home-tab" data-toggle="tab" href="#Description" role="tab" aria-controls="home" aria-selected="true">Description</a>

                        </li>

                    </ul>



                    <div class="tab-content" id="myTabContent">

                        <div class="tab-pane fade show active mt-3" id="Description" role="tabpanel" aria-labelledby="home-tab">

                            <h4 class="font-weight-bold text-uppercase">{{ $viewproduct->product_name }}</h4>

                            <span>
                                {!! $viewproduct->product_details !!}
                            </span>

                        </div>


                    </div>
                </div>



                <div class="col-md-12 mt-5 cathead">
                    <strong>Related Products</strong>
                    <div class="row">

                        @if (isset($related_product))
                        @foreach ($related_product as $r)
                        @php
                        $productname = str_replace(['%', '/', ' '], '-', $r->product_name);
                        @endphp



                        <div class="col-xl-3 col-lg-3 col-md-3 col-sm-4 col-6 mt-4">
                            <div class="bg-white product p-3">
                                <center>
                                    <a href="{{ url('product') }}/{{ $productname }}/{{ $r->product_id }}"><img src="{{ asset('public/productImage') }}/{{ $r->image }}" alt="">
                                    <div class="text-dark fw-bold productname mt-3">{{ substr($r->product_name, 0, 20) }}<br><span>৳ {{ $r->current_price }}</span></div>
                                    </a>
                                    <div class="mt-2"><button class="btn btn-success btn-sm" onclick="AddCart('{{ $r->id }}')">Add To Cart</button></div>
                                </center>
                            </div>
                        </div>


                        @endforeach
                        @endif






                    </div>
                </div>





            </div>


        </div>
    </div>
</div>









@endsection