

<?php $__env->startSection('title', \App\Models\Setting::get('site_name', 'KiyoKart') . ' - Home'); ?>

<?php $__env->startSection('content'); ?>
<!-- Hero Banner Section -->
<?php if($banners && $banners->count() > 0): ?>
<section class="hero-banner">
    <div id="heroCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel" data-bs-interval="5000" data-bs-pause="hover">
        <div class="carousel-inner">
            <?php $__currentLoopData = $banners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $banner): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="carousel-item <?php echo e($index === 0 ? 'active' : ''); ?>">
                    <div class="hero-banner-wrapper position-relative">
                        <img src="<?php echo e(asset('storage/' . $banner->image_path)); ?>" 
                             class="d-block w-100 hero-banner-image" 
                             alt="<?php echo e($banner->title ?? 'Banner'); ?>"
                             loading="eager"
                             decoding="async"
                             fetchpriority="high">
                         <div class="hero-banner-content">
                            <div class="container">
                                <div class="row align-items-center">
                                    <div class="col-lg-6">
                                        <h1 class="hero-title">
                                            <?php if($banner->title): ?>
                                                <?php echo e($banner->title); ?>

                                            <?php else: ?>
                                                <span style="font-style: italic; font-weight: 400; font-size: 2rem;">Welcome to</span><br>
                                                <span><?php echo strtoupper(\App\Models\Setting::get('site_name', 'KIYOKART')); ?></span>
                                            <?php endif; ?>
                                        </h1>
                                        <?php
                                            $siteDescription = \App\Models\Setting::get('site_description', 'Premium Quality Products');
                                        ?>
                                        <p class="hero-subtitle"><?php echo e($siteDescription); ?></p>
                                        <?php if($banner->link): ?>
                                            <a href="<?php echo e($banner->link); ?>" class="btn btn-hero-cta">
                                                SHOP NOW
                                            </a>
                                        <?php else: ?>
                                            <a href="#featured-products" class="btn btn-hero-cta">
                                                SHOP NOW
                                            </a>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div> 
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</section>
<?php endif; ?>

<!-- Shop by Categories Section -->
<?php if($categories->count()): ?>
<section class="shop-categories bg-secondary-light py-5" id="categories">
    <div class="container">
        <div class="section-header text-center mb-4">
            <h2 class="section-title">SHOP BY CATEGORIES</h2>
            <p class="section-subtitle">Find Your Perfect Match</p>
        </div>
        <div class="row g-3">
            <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-6 col-sm-4 col-md-3 col-lg-2">
                    <a href="<?php echo e(route('collections.show', $category->slug)); ?>" class="category-card">
                        <div class="category-image-wrapper">
                            <?php if($category->image_path): ?>
                                <img src="<?php echo e(asset('storage/' . $category->image_path)); ?>" 
                                     alt="<?php echo e($category->name); ?>" 
                                     class="category-image"
                                     loading="lazy"
                                     decoding="async"
                                     onerror="this.onerror=null; this.style.display='none'; this.nextElementSibling.style.display='flex';">
                                <div class="category-placeholder" style="display: none;">
                                    <i class="bi bi-tag"></i>
                                </div>
                            <?php else: ?>
                                <div class="category-placeholder">
                                    <i class="bi bi-tag"></i>
                                </div>
                            <?php endif; ?>
                        </div>
                        <h5 class="category-name"><?php echo e(strtoupper($category->name)); ?></h5>
                    </a>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</section>
<?php endif; ?>

<!-- Best Sellers / New Arrivals Section -->
<section class="products-section pt-5 pb-3" id="featured-products">
    <div class="container">
        <div class="section-header text-center mb-4">
            <h2 class="section-title">YOU ARE IN <span class="pointing-emoji">👇</span></h2>
        </div>
        
        <!-- Tabs -->
        <ul class="nav nav-tabs justify-content-center mb-4 product-tabs" id="productTabs" role="tablist">
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="bestsellers-tab" data-bs-toggle="tab" data-bs-target="#bestsellers" type="button" role="tab">
                    Best Sellers
                </button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link active" id="newarrivals-tab" data-bs-toggle="tab" data-bs-target="#newarrivals" type="button" role="tab">
                    New Arrivals
                </button>
            </li>
        </ul>

        <!-- Tab Content -->
        <div class="tab-content" id="productTabsContent">
            <!-- Best Sellers Tab -->
            <div class="tab-pane fade" id="bestsellers" role="tabpanel" data-section="bestsellers">
                <?php if(isset($bestSellers) && $bestSellers->count() > 0): ?>
                    <div class="row g-4">
                        <?php $__currentLoopData = $bestSellers->take(12); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-6 col-md-4 col-lg-2">
                                <?php echo $__env->make('partials.product-card', ['product' => $product], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                    <div class="text-center mt-4">
                        <a href="<?php echo e(route('collections.show', 'best-sellers')); ?>" class="btn btn-outline-dark btn-shop-all">
                            View All Best Sellers
                        </a>
                    </div>
                <?php else: ?>
                    <div class="text-center py-5">
                        <p class="text-muted">No best sellers available at the moment.</p>
                    </div>
                <?php endif; ?>
            </div>

            <!-- New Arrivals Tab -->
            <div class="tab-pane fade show active" id="newarrivals" role="tabpanel" data-section="newarrivals">
                <?php if(isset($newArrivals) && $newArrivals->count() > 0): ?>
                    <div class="row g-4">
                        <?php $__currentLoopData = $newArrivals->take(12); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-6 col-md-4 col-lg-2">
                                <?php echo $__env->make('partials.product-card', ['product' => $product], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                    <div class="text-center mt-4">
                        <a href="<?php echo e(route('collections.show', 'new-arrivals')); ?>" class="btn btn-outline-dark btn-shop-all">
                            View All New Arrivals
                        </a>
                    </div>
                <?php else: ?>
                    <div class="text-center py-5">
                        <p class="text-muted">No new arrivals available at the moment.</p>
                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</section>

<!-- On Sale Section -->
<?php if(isset($onSaleProducts) && $onSaleProducts->count() > 0): ?>
<section class="on-sale-section py-3 bg-primary-light" id="on-sale">
    <div class="container">
        <div class="section-header text-center mb-4">
            <h2 class="section-title">ON SALE <span class="hourglass-emoji">⏳</span></h2>
        </div>
        <div class="row g-4">
            <?php $__currentLoopData = $onSaleProducts->take(12); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-6 col-md-4 col-lg-2">
                    <?php echo $__env->make('partials.product-card', ['product' => $product, 'showDiscount' => true], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</section>
<?php endif; ?>

<!-- Category-wise Products Section -->
<?php if(isset($categoryWiseProducts) && count($categoryWiseProducts) > 0): ?>
    <?php $__currentLoopData = $categoryWiseProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $categoryData): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
            $category = $categoryData['category'];
            $products = $categoryData['products'];
            $hasMore = $categoryData['hasMore'] ?? false;
        ?>
        <section class="category-products-section  <?php echo e($loop->even ? 'bg-primary-light' : ''); ?>" id="category-<?php echo e($category->id); ?>">
            <div class="container">
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <div>
                        <h2 class="section-title mb-1 mt-2"><?php echo e(strtoupper($category->name)); ?></h2>
                        <p class="text-muted mb-0">Discover our premium collection</p>
                    </div>
                    <a href="<?php echo e(route('collections.show', $category->slug)); ?>" class="btn btn-outline-dark btn-shop-all">
                        View All <i class="bi bi-arrow-right"></i>
                    </a>
                </div>
                <div class="row g-4">
                    <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-6 col-md-4 col-lg-2">
                            <?php echo $__env->make('partials.product-card', ['product' => $product], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        </section>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
<?php endif; ?>

<!-- Feature Highlights Bar -->
<section class="features-bar py-1">
    <div class="container-fluid px-0">
        <div class="features-scroll">
            <div class="features-track d-flex flex-nowrap align-items-center gap-4 px-3">
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-shield-check feature-icon"></i>
                    <span class="feature-text mb-0">Trusted by 1 Lakh+ Customers</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-lock feature-icon"></i>
                    <span class="feature-text mb-0">Safe & Secure Delivery</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-gem feature-icon"></i>
                    <span class="feature-text mb-0">Premium Quality</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-globe feature-icon"></i>
                    <span class="feature-text mb-0">International Shipping</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-arrow-repeat feature-icon"></i>
                    <span class="feature-text mb-0">Easy Returns</span>
                </div>
                <!-- duplicate for seamless scroll -->
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-shield-check feature-icon"></i>
                    <span class="feature-text mb-0">Trusted by 1 Lakh+ Customers</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-lock feature-icon"></i>
                    <span class="feature-text mb-0">Safe & Secure Delivery</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-gem feature-icon"></i>
                    <span class="feature-text mb-0">Premium Quality</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-globe feature-icon"></i>
                    <span class="feature-text mb-0">International Shipping</span>
                </div>
                <div class="feature-item d-flex align-items-center gap-2">
                    <i class="bi bi-arrow-repeat feature-icon"></i>
                    <span class="feature-text mb-0">Easy Returns</span>
                </div>
            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('styles'); ?>
<link rel="stylesheet" href="<?php echo e(asset('css/homepage.css')); ?>">
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/shivajewellers_uat/resources/views/home.blade.php ENDPATH**/ ?>