<?php $__env->startSection('content'); ?>


    <main>

        <!-- Start pg_header -->
        <section class="pg_header section">
            <div class="container">
                <h2 class="title fw-bold color-secondary text-center ">  <?php echo e($product->title); ?>     </h2>
                <div class="bread d-flex justify-content-center">
                    <a href="<?php echo e(route('web.home')); ?>" class="item"> <?php echo e(__('web.home')); ?> </a>
                    <a href="<?php echo e(route('web.product')); ?>" class="item"> <?php echo e(__('web.products')); ?> </a>
                    <span class="item active">    <?php echo e(__('web.product_details')); ?>       </span>
                </div>
            </div>
            <img src="<?php echo e(url('')); ?>/assets/web/images/vector-1.svg" class="vector1" alt="" />
            <img src="<?php echo e(url('')); ?>/assets/web/images/vector-2.svg" class="vector2" alt="" />

        </section>

        <!-- Start section -->
        <section class="products_det  section">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6">
                        <div class="product_imgs">
                            <div class="row">
                                <div class="col-2">
                                    <div class="swiper-container gallery-thumbs">
                                        <div class="swiper-wrapper">
                                            <div class="swiper-slide">
                                                <img src="<?php echo e(asset($product->image)); ?>" class="secImg" alt="" />
                                            </div>
                                            <?php $__currentLoopData = $product->photos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div class="swiper-slide">
                                                    <img src="<?php echo e(asset($row->image)); ?>" class="secImg" alt="" />
                                                </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-10">
                                    <!-- Swiper -->
                                    <div class="swiper-container gallery-top">
                                        <div class="swiper-wrapper">
                                            <div class="swiper-slide ">
                                                <img src="<?php echo e(asset($product->image)); ?>" class="secImg" alt="">
                                            </div>
                                            <?php $__currentLoopData = $product->photos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <div class="swiper-slide">
                                                    <img src="<?php echo e(asset($row->image)); ?>" class="secImg" alt="">
                                                </div>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>
                                    </div>
                                    <div class="share_links d-flex justify-content-center mt-5">
                                        <span class="title"> <?php echo e(__('web.share_product')); ?> </span>
                                        <div class="links">
                                            <a href="#">
                                                <i class="fa-brands fa-facebook-f"></i>
                                            </a>
                                            <a href="#">
                                                <i class="fa-brands fa-x-twitter"></i>
                                            </a>
                                            <a href="#">
                                                <i class="fa-solid fa-paper-plane"></i>
                                            </a>
                                            <a href="#">
                                                <i class="fa-brands fa-whatsapp"></i>
                                            </a>
                                            <a href="#">
                                                <i class="fa-solid fa-link"></i>
                                            </a>
                                        </div>
                                    </div>

                                </div>
                            </div>


                        </div>

                    </div>
                    <div class="col-lg-6">
                        <div class="txt_box my-4">
                            <div class=" py-2">
                                <div class="d-flex justify-content-between align-items-center">
                                    <div class="rating mb-2">
                                        <?php echo $__env->make('web.pages.components.products.rate',['product'=>$product], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                        <span class="rate_num ms-2"> <b class="me-2">(<?php echo e($product->rate); ?>)</b> <small>   <?php echo e($product->rate_count); ?> <?php echo e(__('web.rate')); ?> </small> </span>
                                    </div>
                                    <h6 class="prodCode color-gray2 fw-bold"><small>#<?php echo e($product->code); ?></small></h6>
                                </div>
                                <h3 class="prod_name fw-bold mb-3">
                                    <?php echo $product->title; ?>

                                </h3>
                                <h6 class="color-gray2 fs-3 fw-bold ">
                                    <?php echo e($product->category->currentDescription->title); ?> - <?php echo e($product->subCategory->currentDescription->title); ?>

                                </h6>
                            </div>
                            <div class="py-3 d-flex align-items-center justify-content-between">
                                <div class="price_box d-flex align-items-end">
                                   <?php echo $__env->make('web.pages.components.products.cost',['product'=>$product], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                </div>
                                <span class="badge secondary_badge"><?php echo $__env->make('web.pages.components.products.offer',['product'=>$product], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?></span>
                            </div>
                            <div class="d-flex align-items-center my-3">
                                <h6 class="sm_title color-dark mb-0 me-4"><b><?php echo e(__('web.quantity')); ?></b></h6>
                                <div class="qty-container">
                                    <button class="qty-btn-minus btn-light" type="button"><i class="fa fa-minus"></i></button>
                                    <input type="text" id="count_product" name="count" value="1" class="input-qty"/>
                                    <button class="qty-btn-plus btn-light" type="button"><i class="fa fa-plus"></i></button>
                                </div>
                            </div>
                            <?php if(count($product->sizes)): ?>
                                <div class="py-3">
                                    <div class="row">
                                        <div class="col-lg-6">
                                            <div class="form-group size-group">
                                                <h6 class="sm_title color-dark mb-3"><b><?php echo e(__('web.size')); ?></b></h6>
                                                <div class="size-flex ps-2 d-flex">
                                                    <?php $__currentLoopData = $product->sizes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php echo $__env->make('web.pages.components.products.size',['size'=>$row,'product'=>$product,'size_id'=>$request->size_id,'details'=>true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-lg-6">
                                            <div class="form-group color-group">
                                                <h6 class="sm_title color-dark mb-3"><b><?php echo e(__('web.color')); ?></b></h6>
                                                <div class="colors-flex ps-2 d-flex" id="colors">

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>


                            <div class="butns d-flex border-top align-items-center mt-4 pt-4">
                                <button type="button" onclick="addToCart(this)" data-id="<?php echo e($product->id); ?>" class="butn primary_butn cart_butn">
                                    <img src="<?php echo e(url('')); ?>/assets/web/images/icons/cart-2.svg" class="icon me-2" alt="" /> <?php echo e(__('web.add_to_cart')); ?>

                                </button>
                                <button type="button" onclick="favorite(this)" data-id="<?php echo e($product->id); ?>" class="butn secondary_butn fav_butn sm_butn ms-4 <?php echo e(auth()->user()?->favorited($product->id) ? 'active': ''); ?>">
                                    <img src="<?php echo e(url('')); ?>/assets/web/images/icons/heart.svg" class="icon" alt="" />
                                </button>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="desc_wrapper mt-5 pt-4">
                    <ul class="nav nav-pills mb-0" id="pills-tab" role="tablist">
                        <li class="nav-item" role="presentation">
                            <button class="nav-link active" id="pills-tab1-tab" data-bs-toggle="pill" data-bs-target="#pills-tab1" type="button" role="tab" aria-controls="pills-tab1" aria-selected="true">
                                <?php echo e(__('web.product_description')); ?>

                            </button>
                        </li>
                        <li class="nav-item" role="presentation">
                            <button class="nav-link" id="pills-tab2-tab" data-bs-toggle="pill" data-bs-target="#pills-tab2" type="button" role="tab" aria-controls="pills-tab2" aria-selected="false">
                                <?php echo e(__('web.descriptions')); ?>

                            </button>
                        </li>
                        <li class="nav-item" role="presentation">
                            <button class="nav-link" id="pills-tab3-tab" data-bs-toggle="pill" data-bs-target="#pills-tab3" type="button" role="tab" aria-controls="pills-tab3" aria-selected="false">
                                <?php echo e(__('web.rates')); ?>

                            </button>
                        </li>

                    </ul>
                    <div class="tab-content" id="pills-tabContent">
                        <div class="tab-pane fade show active" id="pills-tab1" role="tabpanel" aria-labelledby="pills-tab1-tab">
                            <div class="tab_wrapper">
                                <div class="data mb-4">
                                    <h4 class="fw-bold fs-5 mb-4"> <?php echo e(__('web.product_description')); ?> </h4>
                                    <div class="p mb-4">
                                        <?php echo $product->description; ?>

                                    </div>


                                </div>

                            </div>
                        </div>
                        <div class="tab-pane fade " id="pills-tab2" role="tabpanel" aria-labelledby="pills-tab2-tab">
                            <div class="tab_wrapper">
                                <?php $__currentLoopData = $product->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product_item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="data ">
                                        <h4 class="fw-bold fs-5 mb-4"> <?php echo $product_item->currentDescription->title; ?>  </h4>
                                        <table class="table  table-bordered">
                                            <?php $__currentLoopData = $product_item->items->chunk(2); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $items): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <th> <?php echo e($row->currentDescription->title); ?> </th>
                                                        <td > <?php echo e($row->currentDescription->description); ?> </td>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                                        </table>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                        <div class="tab-pane fade " id="pills-tab3" role="tabpanel" aria-labelledby="pills-tab3-tab">
                            <div class="tab_wrapper">
                                <?php $__currentLoopData = $product->rates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="review_item">
                                        <div class="prof_data d-flex align-items-center mb-3">
                                            <img src="<?php echo e(asset($row->user->photo)); ?>" class="avatar" alt=""/>
                                            <div class="txt">
                                                <h6 class="name fw-bold mb-1"> <?php echo e($row->user->name); ?> </h6>
                                                <div class="rating">
                                                    <?php echo $__env->make('web.pages.components.products.rate',['product'=>$row], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                    <span class="date ms-2"><?php echo e($row->date); ?></span>
                                                </div>
                                            </div>
                                        </div>
                                        <p class="review_det">
                                            <?php echo $row->comment; ?>

                                        </p>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>

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

        <?php if(count($products)): ?>
            <!-- Start section -->
            <section class="products_sec section">
                <div class="container">
                    <div class="sec_head has_border text-center mb-5">
                        <h1 class="title_head fw-bold mb-0"> <?php echo e(__('web.related_products')); ?>    </h1>
                    </div>
                    <div class="swiper-container prod_swiper">
                        <div class="swiper-wrapper">
                            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="swiper-slide">
                                <?php echo $__env->make('web.pages.components.products.card',['product'=>$row,'type'=>'related'], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
                <!-- Arrows -->
                <div class="swiper-button-next"></div>
                <div class="swiper-button-prev"></div>
            </section>
        <?php endif; ?>
    </main>


<?php $__env->stopSection(); ?>

<?php $__env->startSection('inject_js'); ?>
    <script>
        let url_colors = "<?php echo e(route('web.fetch.colors')); ?>"
    </script>
    <script src="<?php echo e(url('')); ?>/assets/web/js/custom/product.js"></script>
    <?php if($request->size_id): ?>
        <script>
            let product_id = "<?php echo e($product->id); ?>"
            let size_id = "<?php echo e($request->size_id); ?>"
            let target = '#sizeRadio'+product_id+'attr'+size_id
            $(target).click()
        </script>
    <?php endif; ?>
    <script>
        // ---------- single product slider -----------
        var galleryThumbs = new Swiper('.gallery-thumbs', {
            spaceBetween: 20,
            slidesPerView: 5,
            freeMode: true,
            watchSlidesVisibility: true,
            watchSlidesProgress: true,
            direction: "vertical",
        });
        var galleryTop = new Swiper('.gallery-top', {
            spaceBetween: 10,
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
            thumbs: {
                swiper: galleryThumbs
            }
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/rose/resources/views/web/pages/products/details.blade.php ENDPATH**/ ?>