<?php $__env->startSection('content'); ?>
    <div class="py-60">
        <div class="container">
            <div class="row g-4 g-xl-5">
                <div class="col-xl-9">
                    <?php echo $__env->make($activeTemplate . 'partials.quick_view', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <?php
                        $description = preg_replace('/<\/?br>/', '', $product->description, 1);
                    ?>

                    <?php if($product->specification || $description || $product->video_link || gs('product_review')): ?>
                        <div class="products-details-wrapper pt-60">
                            <div class="products-description pt-0">
                                <ul class="nav nav-tabs" id="productTabs">
                                    <?php if($product->specification): ?>
                                        <li><a href="#specification" data-bs-toggle="tab"><?php echo app('translator')->get('Specification'); ?></a></li>
                                    <?php endif; ?>

                                    <?php if($description): ?>
                                        <li><a href="#description" data-bs-toggle="tab"><?php echo app('translator')->get('Description'); ?></a></li>
                                    <?php endif; ?>

                                    <?php if($product->video_link): ?>
                                        <li><a href="#video" data-bs-toggle="tab"><?php echo app('translator')->get('Video'); ?></a></li>
                                    <?php endif; ?>

                                    <?php if(gs('product_review')): ?>
                                        <li><a href="#reviews" data-bs-toggle="tab"><?php echo app('translator')->get('Reviews'); ?>(<?php echo e(__($product->reviews_count)); ?>)</a></li>
                                    <?php endif; ?>
                                </ul>

                                <div class="tab-content">
                                    <?php if($product->specification && $product->productType): ?>
                                        <div class="tab-pane fade" id="specification">
                                            <div class="specification-wrapper">
                                                <div class="specification-table d-flex flex-column">
                                                    <?php $__currentLoopData = $product->productType->specifications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $specificationGroup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if(collect($product->specification)->whereIn('key', $specificationGroup['attributes'])->whereNotNull('value')->count()): ?>
                                                            <div>
                                                                <h6 class="mb-2"><?php echo e(__($specificationGroup['group_name'])); ?></h6>
                                                                <ul>
                                                                    <?php $__currentLoopData = $specificationGroup['attributes'] ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attribute): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                        <?php
                                                                            $specification = collect($product->specification)->firstWhere('key', $attribute);
                                                                        ?>

                                                                        <?php if(@$specification->value): ?>
                                                                            <li>
                                                                                <span><?php echo e(__($attribute)); ?></span>
                                                                                <span><?php echo e(@$specification->value); ?></span>
                                                                            </li>
                                                                        <?php endif; ?>
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                </ul>
                                                            </div>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </div>
                                            </div>
                                        </div>
                                    <?php endif; ?>

                                    <?php if($description || $product->extra_descriptions): ?>
                                        <div class="tab-pane fade" id="description">

                                            <?php if($description): ?>
                                                <div class="description-item">
                                                    <?php echo $product->description ?>
                                                </div>
                                            <?php endif; ?>

                                            <?php if($product->extra_descriptions): ?>
                                                <div class="description-item mt-5">
                                                    <?php $__currentLoopData = $product->extra_descriptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $description): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <h4><?php echo e(__(@$description['key'])); ?></h4>
                                                        <p>
                                                            <?php
                                                                echo @$description['value'];
                                                            ?>
                                                        </p>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                    <?php endif; ?>

                                    <?php if($product->video_link): ?>
                                        <div class="tab-pane fade" id="video">
                                            <iframe class="product-details-video" src="<?php echo e($product->video_link); ?>" allow="autoplay; encrypted-media" allowfullscreen></iframe>
                                        </div>
                                    <?php endif; ?>

                                    <?php if(gs('product_review')): ?>
                                        <div class="tab-pane fade" id="reviews">
                                            <div class="review-area"></div>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>

                <?php if($otherProducts->count() > 0): ?>
                    <div class="col-md-12 col-xl-3">
                        <div class="sticky-sidebar">
                            <h5 class="product-details-title fw-500 mb-3"><?php echo e(__($otherProductsTitle)); ?></h5>
                            <div class="row gy-3">
                                <?php $__currentLoopData = $otherProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $relatedProduct): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-sm-6 col-md-6 col-lg-4 col-xl-12">
                                        <div class="best-sell-item">
                                            <div class="best-sell-inner d-flex flex-wrap">
                                                <div class="thumb">
                                                    <a href="<?php echo e($relatedProduct->link()); ?>">
                                                        <img src="<?php echo e(getImage(null)); ?>" data-src="<?php echo e($relatedProduct->mainImage()); ?>" class="lazyload" alt="products">
                                                    </a>
                                                </div>
                                                <div class="content">
                                                    <h6 class="title">
                                                        <a href="<?php echo e($relatedProduct->link()); ?>"><?php echo e(__($relatedProduct->name)); ?></a>
                                                    </h6>

                                                    <?php if(gs('product_review')): ?>
                                                        <div class="ratings-area">
                                                            <span class="ratings">
                                                                <?php echo __(displayRating($relatedProduct->reviews_avg_rating)) ?>
                                                            </span>
                                                            <?php if($relatedProduct->reviews_count): ?>
                                                                <span>(<?php echo e($relatedProduct->reviews_count); ?>)</span>
                                                            <?php endif; ?>
                                                        </div>
                                                    <?php endif; ?>

                                                    <div class="price fw-500">
                                                        <?php
                                                            echo $relatedProduct->formattedPrice();
                                                        ?>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>



<?php $__env->startPush('script'); ?>
    <script>
        'use strict';
        (function($) {
            <?php if(gs('product_review')): ?>
                loadReviews(`<?php echo e(route('product.reviews', $product->id)); ?>`);
            <?php endif; ?>

            const firstTabLink = document.querySelector('#productTabs a');

            if (firstTabLink) {
                const firstTab = new bootstrap.Tab(firstTabLink);
                firstTab.show();
            }
        })(jQuery)
    </script>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('style-lib'); ?>
    <link href="<?php echo e(asset($activeTemplateTrue . 'css/owl.carousel.min.css')); ?>" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo e(asset($activeTemplateTrue . 'css/xzoom/xzoom.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset($activeTemplateTrue . 'css/xzoom/magnific-popup.css')); ?>">
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script-lib'); ?>
    <script src="<?php echo e(asset($activeTemplateTrue . 'js/owl.carousel.min.js')); ?>"></script>
    <script src="<?php echo e(asset($activeTemplateTrue . 'js/owl-carousel.js')); ?>"></script>
    <script src="<?php echo e(asset($activeTemplateTrue . 'js/xzoom/xzoom.min.js')); ?>"></script>
    <script src="<?php echo e(asset($activeTemplateTrue . 'js/xzoom/magnific-popup.js')); ?>"></script>
    <script src="<?php echo e(asset($activeTemplateTrue . 'js/xzoom/setup.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make($activeTemplate . 'layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/creativedesignbd/ecommerce8.creativedesign.com.bd/core/resources/views/templates/basic/product_details.blade.php ENDPATH**/ ?>