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

    
    <div class="hero-section">
        <div class="container-fluid">
            <div class="row gy-3 align-items-stretch">

                
                <div class="col-lg-3 order-lg-1 order-2">
                    <div class="hero-suggest">
                        <div class="swiper" id="suggetMoment">
                            <div class="swiper-wrapper position-relative">
                                <?php $__empty_1 = true; $__currentLoopData = $amazingProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ap): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <?php
                                        $apVariant      = $ap->defaultVariant() ?: $ap->variants->first();
                                        $apPrice        = $apVariant ? (float)$apVariant->price : 0;
                                        $apFinalPrice   = ($apVariant && $apVariant->discount_price) ? (float)$apVariant->discount_price : $apPrice;
                                        $apHasDiscount  = $apVariant && $apVariant->discount_price && $apVariant->discount_price < $apVariant->price;
                                        $apDiscountPct  = ($apHasDiscount && $apPrice > 0) ? round((($apPrice - $apFinalPrice) / $apPrice) * 100) : 0;
                                        $apImage        = $ap->featured_image ? asset('uploads/products/' . $ap->featured_image) : asset('theme/assets/image/product/wach1.jpg');
                                        $apEndsAt       = $ap->special_offer_ends_at;
                                        $apInStock      = $ap->isInStock();
                                    ?>
                                    <div class="swiper-slide">
                                        <div class="product-box <?php echo e($apInStock ? '' : 'out-of-stock'); ?>">
                                            <div class="product-timer">
                                                <div class="timer-label">
                                                    <?php if($apDiscountPct > 0): ?>
                                                        <span><?php echo e($apDiscountPct); ?>% تخفیف</span>
                                                    <?php endif; ?>
                                                </div>
                                                <div class="timer">
                                                    <?php if($apEndsAt): ?>
                                                        <div class="countdown"
                                                             data-date="<?php echo e($apEndsAt->format('Y-m-d')); ?>"
                                                             data-time="<?php echo e($apEndsAt->format('H:i')); ?>"></div>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                            <a href="<?php echo e(route('product.show', $ap->slug)); ?>" class="product-image d-block">
                                                <img src="<?php echo e($apImage); ?>" loading="lazy" alt="<?php echo e($ap->title); ?>" class="img-fluid">
                                            </a>
                                            <div class="product-title">
                                                <div class="title">
                                                    <a href="<?php echo e(route('product.show', $ap->slug)); ?>" class="text-body text-decoration-none">
                                                        <p class="text-overflow-1 mb-0"><?php echo e($ap->title); ?></p>
                                                        <?php if($ap->title_en): ?>
                                                            <span class="text-muted text-overflow-1"><?php echo e($ap->title_en); ?></span>
                                                        <?php endif; ?>
                                                    </a>
                                                </div>
                                                <?php if($ap->rating): ?>
                                                    <div class="rating">
                                                        <div class="number"><span class="text-muted font-12"><?php echo e($ap->rating); ?></span></div>
                                                        <div class="icon"><i class="bi bi-star-fill"></i></div>
                                                    </div>
                                                <?php endif; ?>
                                            </div>
                                            <div class="product-action">
                                                <div class="price">
                                                    <?php if($apFinalPrice > 0): ?>
                                                        <p class="new-price"><?php echo e(number_format($apFinalPrice)); ?> تومان</p>
                                                    <?php endif; ?>
                                                    <?php if($apHasDiscount): ?>
                                                        <p class="old-price"><?php echo e(number_format($apPrice)); ?> تومان</p>
                                                    <?php endif; ?>
                                                </div>
                                                <div class="link">
                                                    <?php if($apInStock): ?>
                                                    <a href="<?php echo e(route('product.show', $ap->slug)); ?>" class="btn border-0 rounded-3 main-color-one-bg">
                                                        <i class="bi bi-basket text-white"></i>
                                                        <span class="text-white">خرید محصول</span>
                                                    </a>
                                                    <?php else: ?>
                                                    <span class="btn border-0 rounded-3 btn-out-of-stock disabled" aria-disabled="true">
                                                        <i class="bi bi-x-circle"></i>
                                                        <span>ناموجود</span>
                                                    </span>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    
                                <?php endif; ?>
                            </div>
                            <div class="swiper-progress-bar">
                                <span class="slide_progress-bar"></span>
                            </div>
                        </div>
                    </div>
                </div>

                
                <div class="col-lg-9 order-lg-2 order-1">
                    <div class="hero-main-slider">
                        <div class="swiper" id="homeSlider">
                            <div class="swiper-wrapper">
                                <?php $__empty_1 = true; $__currentLoopData = $sliderSlides; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slide): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <div class="swiper-slide">
                                    <?php if($slide['link']): ?>
                                    <a href="<?php echo e($slide['link']); ?>"><img src="<?php echo e($slide['image']); ?>" loading="lazy" class="img-fluid" alt=""></a>
                                    <?php else: ?>
                                    <img src="<?php echo e($slide['image']); ?>" loading="lazy" class="img-fluid" alt="">
                                    <?php endif; ?>
                                </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <div class="swiper-slide">
                                    <a href=""><img src="<?php echo e(asset('theme/assets/image/slide2-2.jpg')); ?>" loading="lazy" class="img-fluid" alt=""></a>
                                </div>
                                <div class="swiper-slide">
                                    <a href=""><img src="<?php echo e(asset('theme/assets/image/slide3-1.jpg')); ?>" loading="lazy" class="img-fluid" alt=""></a>
                                </div>
                                <div class="swiper-slide">
                                    <a href=""><img src="<?php echo e(asset('theme/assets/image/slide4.jpg')); ?>" loading="lazy" class="img-fluid" alt=""></a>
                                </div>
                                <?php endif; ?>
                            </div>
                            <div class="swiper-button-next d-lg-flex d-none"></div>
                            <div class="swiper-button-prev d-lg-flex d-none"></div>
                            <div class="swiper-pagination"></div>
                        </div>
                    </div>
                </div>

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

    
    <?php if($features): ?>
        <div class="feature-strip">
            <div class="container-fluid">
                <div class="row gy-3 row-cols-1 row-cols-sm-2 row-cols-lg-4">
                    <?php $__currentLoopData = $features; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col">
                            <div class="f-card">
                                <div class="f-icon"><i class="ti ti-<?php echo e($f['icon']); ?> fs-3"></i></div>
                                <div class="f-text">
                                    <h6><?php echo e($f['title']); ?></h6>
                                    <p><?php echo e($f['subtitle']); ?></p>
                                </div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        </div>
    <?php endif; ?>

    
    <div class="brand-bar">
        <div class="container-fluid bb-inner">
            <div class="row gy-4 align-items-center">
                <div class="col-lg-3 col-md-12 bb-left">
                    <h6 class="mb-1">بیش از ۵۰۰۰ محصول</h6>
                    <p class="mb-0">برترین برندهای اصیل داخلی و خارجی</p>
                </div>
                <div class="col-lg-9 col-md-12 brand-logos">
                    <div class="row gy-2 gx-2 justify-content-lg-end justify-content-center align-items-center">
                        <?php $__currentLoopData = $homeBrands; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $brand): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-md-2 col-4">
                                <a href="<?php echo e(route('shop.brand', $brand->slug)); ?>" class="brand-logo-item" title="<?php echo e($brand->name); ?>">
                                    <?php if($brand->image): ?>
                                        <img src="<?php echo e(asset('uploads/brands/' . $brand->image)); ?>" alt="<?php echo e($brand->name); ?>">
                                    <?php else: ?>
                                        <span class="brand-logo-fallback"><?php echo e(mb_substr($brand->name, 0, 1)); ?></span>
                                    <?php endif; ?>
                                </a>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-md-2 col-4">
                            <a href="<?php echo e(route('brands.index')); ?>" class="brand-logo-item brand-all-btn">
                                <span>مشاهده همه</span>
                                <i class="bi bi-chevron-double-left"></i>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    
    <?php if($homeCategories->isNotEmpty()): ?>
    <div class="cat-section">
        <div class="container-fluid">
            <div class="hp-head">
                <h5 class="hp-head-title">دسته‌بندی <span class="hp-accent">محصولات</span></h5>
                <a href="<?php echo e(route('categories.index')); ?>" class="hp-head-more">مشاهده همه <i class="bi bi-chevron-double-left"></i></a>
            </div>
            <div class="row gy-3 row-cols-2 row-cols-sm-3 row-cols-md-4 row-cols-lg-<?php echo e(min($homeCategories->count(), 4)); ?> row-cols-xl-<?php echo e($homeCategories->count()); ?>">
                <?php $__currentLoopData = $homeCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $hc): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col">
                        <a href="<?php echo e(route('shop.category', $hc->slug)); ?>" class="cat-card">
                            <div class="cat-icon-wrap">
                                <?php if($hc->image): ?>
                                    <img src="<?php echo e(asset('uploads/categories/' . $hc->image)); ?>" alt="<?php echo e($hc->name); ?>">
                                <?php else: ?>
                                    <i class="ti ti-<?php echo e($hc->icon ?: 'folder'); ?>"></i>
                                <?php endif; ?>
                            </div>
                            <p class="cat-name"><?php echo e($hc->name); ?></p>
                        </a>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>
    <?php endif; ?>

    
    <?php if($amazingOffers->isNotEmpty()): ?>
    <div class="hp-amazing amazing py-20">
        <div class="container-fluid mt-4">
            <div class="hp-head">
                <h5 class="hp-head-title">پیشنهادات <span class="hp-accent">شگفت‌انگیز</span></h5>
                <a href="<?php echo e(route('amazing')); ?>" class="hp-head-more">مشاهده همه <i class="bi bi-chevron-double-left"></i></a>
            </div>
            <div class="amazing-slider">
                <div class="row">
                    <div class="col-lg-8">
                        <div class="amazing-pro-parent">
                            <div class="swiper amazing-slider-slider">
                                <div class="swiper-wrapper">
                                    <?php $__currentLoopData = $amazingOffers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ao): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        $aoVariant    = $ao->defaultVariant() ?: $ao->variants->first();
                                        $aoPrice      = $aoVariant ? (float)$aoVariant->price : 0;
                                        $aoFinal      = ($aoVariant && $aoVariant->discount_price) ? (float)$aoVariant->discount_price : $aoPrice;
                                        $aoHasDisc    = $aoVariant && $aoVariant->discount_price && $aoVariant->discount_price < $aoVariant->price;
                                        $aoDiscPct    = ($aoHasDisc && $aoPrice > 0) ? round((1 - $aoFinal / $aoPrice) * 100) : 0;
                                        $aoImg        = $ao->featured_image ? asset('uploads/products/' . $ao->featured_image) : asset('theme/assets/image/product/laptop-1.jpg');
                                        $aoInStock    = $ao->isInStock();
                                    ?>
                                        <div class="swiper-slide">
                                            <div class="slider-item rounded-3 shadow-box bg-white <?php echo e($aoInStock ? '' : 'out-of-stock'); ?>">
                                                <div class="row">
                                                    <div class="col-lg-4">
                                                        <div class="image">
                                                            <img src="<?php echo e($aoImg); ?>" loading="lazy" class="img-fluid" alt="<?php echo e($ao->title); ?>">
                                                        </div>
                                                    </div>
                                                    <div class="col-lg-8">
                                                        <div class="desc mt-3">
                                                            <div class="title">
                                                                <h3 class="text-overflow-1 font-18">
                                                                    <a href="<?php echo e(route('product.show', $ao->slug)); ?>" class="text-dark"><?php echo e($ao->title); ?></a>
                                                                    <?php if($aoDiscPct > 0): ?>
                                                                    <span class="hp-discount-badge text-white"><?php echo e($aoDiscPct); ?>% تخفیف</span>
                                                                    <?php endif; ?>
                                                                </h3>
                                                            </div>
                                                            <?php if($ao->description): ?>
                                                            <div class="short-desc mt-3">
                                                                <p class="mb-2 text-overflow-3 text-muted"><?php echo e(strip_tags($ao->description)); ?></p>
                                                            </div>
                                                            <?php endif; ?>
                                                        </div>
                                                        <div class="foot mt-3 d-flex justify-content-between align-items-center flex-wrap">
                                                            <div class="price d-flex align-items-center gap-2">
                                                                <?php if($aoFinal > 0): ?>
                                                                <h6 class="font-20 main-color-one-color mb-0"><?php echo e(number_format($aoFinal)); ?></h6>
                                                                <h6 class="font-12 ms-1 mb-0">تومان</h6>
                                                                <?php if($aoHasDisc): ?>
                                                                <h6 class="font-13 old-price ms-2 mb-0"><?php echo e(number_format($aoPrice)); ?></h6>
                                                                <?php endif; ?>
                                                                <?php endif; ?>
                                                            </div>
                                                            <div class="link">
                                                                <?php if($aoInStock): ?>
                                                                    <a href="<?php echo e(route('product.show', $ao->slug)); ?>" class="btn border-0 rounded-3 main-color-one-bg">
                                                                        <i class="bi bi-basket text-white"></i>
                                                                        <span class="text-white">خرید محصول</span>
                                                                    </a>
                                                                <?php else: ?>
                                                                    <span class="btn border-0 rounded-3 btn-out-of-stock disabled" aria-disabled="true">
                                                                        <i class="bi bi-x-circle"></i>
                                                                        <span>ناموجود</span>
                                                                    </span>
                                                                <?php endif; ?>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                                <div class="swiper-pagination d-lg-none d-block"></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4 d-lg-block d-none">
                        <div class="parent">
                            <div class="swiper amazing-slider-link">
                                <div class="swiper-wrapper">
                                    <?php $__currentLoopData = $amazingOffers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ao): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php
                                        $aoVariant2 = $ao->defaultVariant() ?: $ao->variants->first();
                                        $aoPrice2   = $aoVariant2 ? (float)$aoVariant2->price : 0;
                                        $aoFinal2   = ($aoVariant2 && $aoVariant2->discount_price) ? (float)$aoVariant2->discount_price : $aoPrice2;
                                        $aoHasDisc2 = $aoVariant2 && $aoVariant2->discount_price && $aoVariant2->discount_price < $aoVariant2->price;
                                        $aoImg2     = $ao->featured_image ? asset('uploads/products/' . $ao->featured_image) : asset('theme/assets/image/product/laptop-1.jpg');
                                        $aoInStock2 = $ao->isInStock();
                                    ?>
                                        <div class="swiper-slide">
                                            <div class="item ao-side-item <?php echo e($aoInStock2 ? '' : 'out-of-stock'); ?>">
                                                <div class="image">
                                                    <img src="<?php echo e($aoImg2); ?>" loading="lazy" alt="<?php echo e($ao->title); ?>" class="img-fluid">
                                                </div>
                                                <div class="title">
                                                    <a href="<?php echo e(route('product.show', $ao->slug)); ?>">
                                                        <h6 class="font-14 text-overflow-2 mb-1"><?php echo e($ao->title); ?></h6>
                                                    </a>
                                                    <?php if($ao->title_en): ?>
                                                    <p class="mb-0 text-muted font-12 text-overflow-1"><?php echo e($ao->title_en); ?></p>
                                                    <?php endif; ?>
                                                </div>
                                                <?php if($aoFinal2 > 0): ?>
                                                <div class="price">
                                                    <p class="text-end new-price mb-1 price-off fw-bold">
                                                        <span class="main-color-one-color"><?php echo e(number_format($aoFinal2)); ?></span>
                                                        <small class="font-11">تومان</small>
                                                    </p>
                                                    <?php if($aoHasDisc2): ?>
                                                    <p class="text-end old-price price-discount mb-0"><?php echo e(number_format($aoPrice2)); ?> <small class="font-11">تومان</small></p>
                                                    <?php endif; ?>
                                                </div>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    
    <div class="hp-products product-slider site-slider py-20">
        <div class="container-fluid mt-4">
            <div class="hp-head">
                <h5 class="hp-head-title">آخرین محصولات <span class="hp-accent">فروشگاه</span></h5>
                <a href="/shop?sort=newest" class="hp-head-more">مشاهده همه <i class="bi bi-chevron-double-left"></i></a>
            </div>
        </div>
        <div class="parent">
            <div class="container-fluid">
                <div class="swiper product-slider-swiper">
                    <div class="swiper-wrapper">
                        <?php $__currentLoopData = $latestProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                                $variant     = $product->defaultVariant() ?: $product->variants->first();
                                $secondImage = $product->images->first();
                                $imgBase     = 'uploads/products/';
                                $inStock     = $product->isInStock();
                            ?>
                            <div class="swiper-slide">
                                <div class="product-box hp-product-card <?php echo e($inStock ? '' : 'out-of-stock'); ?>">
                                    <div class="product-timer">
                                        <?php if($variant && $variant->discount_price && $variant->price): ?>
                                            <div class="timer-label">
                                                <span><?php echo e(round((1 - $variant->discount_price / $variant->price) * 100)); ?>% تخفیف</span>
                                            </div>
                                        <?php else: ?>
                                            <span></span>
                                        <?php endif; ?>
                                        <div class="product-header-btn">
                                            <a href="" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="مقایسه"><i class="bi bi-shuffle"></i></a>
                                            <a href="javascript:void(0)" class="wish-toggle" data-product="<?php echo e($product->id); ?>" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="علاقه‌مندی"><i class="bi <?php echo e(auth()->check() && auth()->user()->hasWished($product->id) ? 'bi-heart-fill' : 'bi-heart'); ?>"></i></a>
                                            <a href="<?php echo e(route('product.show', $product->slug)); ?>" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="مشاهده سریع"><i class="bi bi-eye"></i></a>
                                        </div>
                                    </div>
                                    <a href="<?php echo e(route('product.show', $product->slug)); ?>">
                                        <div class="product-image">
                                            <?php if($product->featured_image): ?>
                                                <img src="<?php echo e(asset($imgBase . $product->featured_image)); ?>" loading="lazy" alt="<?php echo e($product->featured_image_alt ?? $product->title); ?>" class="img-fluid one-image">
                                                <img src="<?php echo e($secondImage ? asset($imgBase . $secondImage->image) : asset($imgBase . $product->featured_image)); ?>" loading="lazy" alt="<?php echo e($product->title); ?>" class="img-fluid two-image">
                                            <?php else: ?>
                                                <img src="<?php echo e(asset('theme/assets/image/product/wach1.jpg')); ?>" loading="lazy" alt="<?php echo e($product->title); ?>" class="img-fluid one-image">
                                                <img src="<?php echo e(asset('theme/assets/image/product/wach1.jpg')); ?>" loading="lazy" alt="<?php echo e($product->title); ?>" class="img-fluid two-image">
                                            <?php endif; ?>
                                        </div>
                                    </a>
                                    <div class="product-title d-flex justify-content-between align-items-start">
                                        <div class="title">
                                            <a href="<?php echo e(route('product.show', $product->slug)); ?>">
                                                <p class="text-overflow-2"><?php echo e($product->title); ?></p>
                                            </a>
                                            <span class="text-overflow-1"><?php echo e($product->title_en); ?></span>
                                        </div>

                                        <?php if($product->reviews_avg_rating): ?>
                                        <div class="count-rating text-end">
                                            <span><?php echo e(number_format($product->reviews_avg_rating, 1)); ?></span>
                                            <i class="bi bi-star-fill"></i>
                                        </div>
                                        <?php endif; ?>
                                    </div>
                                    <div class="product-action">
                                        <div class="price">
                                            <?php if($variant && $variant->price): ?>
                                                <?php if($variant->discount_price): ?>
                                                    <p class="new-price mb-0"><?php echo e(number_format($variant->discount_price)); ?> تومان</p>
                                                    <p class="old-price mt-0"><?php echo e(number_format($variant->price)); ?> تومان</p>
                                                <?php else: ?>
                                                    <p class="new-price"><?php echo e(number_format($variant->price)); ?> تومان</p>
                                                <?php endif; ?>
                                            <?php else: ?>
                                                <p class="new-price">تماس بگیرید</p>
                                            <?php endif; ?>
                                        </div>
                                        <div class="link">
                                            <?php if($inStock): ?>
                                                <a href="<?php echo e(route('product.show', $product->slug)); ?>" class="btn border-0 rounded-3 main-color-one-bg">
                                                    <i class="bi bi-basket text-white"></i>
                                                    <span class="text-white">خرید</span>
                                                </a>
                                            <?php else: ?>
                                                <span class="btn border-0 rounded-3 btn-out-of-stock disabled" aria-disabled="true">
                                                    <i class="bi bi-x-circle"></i>
                                                    <span>ناموجود</span>
                                                </span>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                </div>
            </div>
        </div>
    </div>

    
    <div class="hp-banner banner py-20">
        <div class="container-fluid mt-4">
            <div class="row g-3">
                <?php $__currentLoopData = $homeBanners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $banner): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-lg-3 col-6">
                        <?php if($banner['link']): ?>
                            <a href="<?php echo e($banner['link']); ?>" class="banner-link">
                                <img src="<?php echo e($banner['image']); ?>" class="img-fluid" alt="">
                            </a>
                        <?php else: ?>
                            <span class="banner-link">
                                <img src="<?php echo e($banner['image']); ?>" class="img-fluid" alt="">
                            </span>
                        <?php endif; ?>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>

    
    <?php if($bestSellers->isNotEmpty()): ?>
        <div class="hp-bestsellers products-row py-20">
            <div class="container-fluid mt-4">
                <div class="hp-head">
                    <h5 class="hp-head-title"><span class="hp-accent">پرفروش‌ترین</span> محصولات فروشگاه</h5>
                    <a href="/shop?sort=best_sellers" class="hp-head-more">مشاهده همه <i class="bi bi-chevron-double-left"></i></a>
                </div>
                <div class="row g-3">
                    <?php $__currentLoopData = $bestSellers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $idx => $bs): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $bsVariant    = $bs->defaultVariant() ?: $bs->variants->first();
                            $bsPrice      = $bsVariant ? (float) $bsVariant->price : 0;
                            $bsDiscount   = ($bsVariant && $bsVariant->discount_price) ? (float) $bsVariant->discount_price : null;
                            $bsFinal      = $bsDiscount ?? $bsPrice;
                            $bsHasDisc    = $bsDiscount && $bsDiscount < $bsPrice;
                            $bsImg        = $bs->featured_image
                                            ? asset('uploads/products/' . $bs->featured_image)
                                            : asset('theme/assets/image/product/wach1.jpg');
                            $bsInStock    = $bs->isInStock();
                        ?>
                        <div class="col-lg-3 col-sm-6">
                            <a href="<?php echo e(route('product.show', $bs->slug)); ?>" class="bs-card <?php echo e($bsInStock ? '' : 'out-of-stock'); ?>">
                                <div class="bs-rank"><?php echo e(\App\Support\PersianDigits::toPersian($idx + 1)); ?></div>
                                <div class="bs-img">
                                    <img src="<?php echo e($bsImg); ?>" alt="<?php echo e($bs->title); ?>" loading="lazy">
                                </div>
                                <div class="bs-info">
                                    <h6><?php echo e($bs->title); ?></h6>
                                    <?php if($bsInStock && $bsFinal > 0): ?>
                                        <div class="bs-price-wrap">
                                            <span class="bs-price"><?php echo e(\App\Support\PersianDigits::format($bsFinal)); ?> تومان</span>
                                            <?php if($bsHasDisc): ?>
                                                <span class="bs-old-price"><?php echo e(\App\Support\PersianDigits::format($bsPrice)); ?></span>
                                            <?php endif; ?>
                                        </div>
                                    <?php elseif(!$bsInStock): ?>
                                        <div class="bs-price-wrap">
                                            <span class="bs-out-of-stock-badge">ناموجود</span>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </a>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        </div>
    <?php endif; ?>

    
    <?php if($latestBlogPosts->isNotEmpty()): ?>
    <div class="hp-blog blog-slider site-slider site-slider-sm py-20 mt-3">
        <div class="container-fluid mt-4">
            <div class="hp-head">
                <h5 class="hp-head-title">آخرین مطالب <span class="hp-accent">وبلاگ</span></h5>
                <a href="<?php echo e(route('blog.index')); ?>" class="hp-head-more">مشاهده همه <i class="bi bi-chevron-double-left"></i></a>
            </div>
        </div>
        <div class="parent">
            <div class="container-fluid">
                <div class="swiper product-slider-swiper">
                    <div class="swiper-wrapper">
                        <?php $__currentLoopData = $latestBlogPosts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $post): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                                $thumb = $post->featured_image
                                    ? url('uploads/blog/posts/' . $post->featured_image)
                                    : asset('theme/assets/image/blog-' . (($i % 8) + 1) . '.jpg');
                                $date = \App\Support\Jalali::format($post->published_at ?: $post->created_at, 'j F Y');
                            ?>
                            <div class="swiper-slide">
                                <a href="<?php echo e($post->url()); ?>" class="hp-blog-card">
                                    <div class="blog-thumb">
                                        <?php if($post->category): ?>
                                            <span class="blog-cat-badge"><?php echo e($post->category->name); ?></span>
                                        <?php endif; ?>
                                        <img src="<?php echo e($thumb); ?>" alt="<?php echo e($post->featured_image_alt ?: $post->title); ?>">
                                    </div>
                                    <div class="blog-body">
                                        <h4><?php echo e($post->title); ?></h4>
                                        <div class="blog-meta">
                                            <span><i class="bi bi-calendar3"></i> <?php echo e($date); ?></span>
                                            <span><i class="bi bi-eye"></i> <?php echo e(number_format($post->views)); ?> بازدید</span>
                                        </div>
                                    </div>
                                </a>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

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

<?php $__env->startSection('scripts'); ?>
    <script>
        (function () {
            function syncHeroHeight() {
                var slider  = document.querySelector('.hero-main-slider');
                var suggest = document.querySelector('.hero-suggest');
                if (!slider || !suggest) return;
                if (window.matchMedia('(min-width: 992px)').matches) {
                    suggest.style.height = slider.offsetHeight + 'px';
                } else {
                    suggest.style.height = '';
                }
            }
            window.addEventListener('load', syncHeroHeight);
            window.addEventListener('resize', syncHeroHeight);
            setTimeout(syncHeroHeight, 400);
        })();
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('site.layouts.site-layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/louishop/public_html/engine/resources/views/site/index.blade.php ENDPATH**/ ?>