<?php $__env->startSection('title', 'Store'); ?>  


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


<div class="hero-section text-white text-center position-relative">
    <div class="container position-relative">
        <h1 class="display-3 fw-bold text-uppercase mb-3"><?php echo e($settings->website_name); ?></h1>
        <h5 class="fw-light fs-3 opacity-90 mb-5"><?php echo e($settings->homepage_highlight); ?></h5>

        <a href="#store" class="btn text-white fw-bold px-5 py-3 rounded-pill shadow-lg"
           style="background: var(--primary); font-size: 1.15rem;">
            Start Shopping
        </a>
    </div>
</div>


<section class="py-5" id="store">
    <div class="container">
        <div class="row g-5">

            
            <div class="col-lg-3 col-md-4">
                <div class="category-sidebar">
                    <h4 class="mb-4 text-white fw-bold text-center text-lg-start">
                        Categories
                    </h4>

                    <?php $__currentLoopData = $categorys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($category->packages->count() > 0): ?>
                            <div class="category-package <?php echo e($loop->first ? 'active' : ''); ?>"
                                 data-category="<?php echo e($category->category_id); ?>">

                                <?php echo e($category->category_name); ?>


                                <span class="badge bg-secondary float-end">
                                    <?php echo e($category->packages->count()); ?>

                                </span>

                                <?php if($category->badge_text): ?>
                                    <span class="badge bg-danger ms-2">
                                        <?php echo e($category->badge_text); ?>

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

            
            <div class="col-lg-9 col-md-8">
                <div id="package-container">

                    
                    <div class="package-grid row g-4" id="grid-all">
                        <?php $__currentLoopData = $packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $package): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="col-12 col-sm-6 col-lg-4">
                                <div class="position-relative h-100">
                                    <div class="cyber-card">
                                        <div class="cyber-glow"></div>
                                        <?php echo $__env->make('store.partials.item-card', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>

                    
                    <?php $__currentLoopData = $categorys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($category->packages->count() > 0): ?>
                            <div class="package-grid row g-4 d-none"
                                 id="grid-<?php echo e($category->category_id); ?>">

                                <?php $__currentLoopData = $category->packages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $package): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div class="col-12 col-sm-6 col-lg-4">
                                        <div class="position-relative h-100">
                                            <div class="cyber-card">
                                                <div class="cyber-glow"></div>
                                                <?php echo $__env->make('store.partials.item-card', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                                            </div>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

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

                </div>
            </div>

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

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



<?php $__env->startPush('scripts'); ?>
<?php $__env->startPush('scripts'); ?>
<script>
document.addEventListener('DOMContentLoaded', function () {
    const categories = document.querySelectorAll('.category-package');
    const grids = document.querySelectorAll('.package-grid');

    // HIDE ALL GRIDS FIRST
    grids.forEach(grid => grid.classList.add('d-none'));

    //AUTO-SELECT FIRST CATEGORY IF EXISTS
    const firstCategory = categories[0];
    if (firstCategory) {
        firstCategory.classList.add('active');
        const firstTarget = firstCategory.getAttribute('data-category');
        const firstGrid = document.getElementById('grid-' + firstTarget);
        if (firstGrid) {
            firstGrid.classList.remove('d-none');
        }
    }

    categories.forEach(cat => {
        cat.addEventListener('click', function () {
            const target = this.getAttribute('data-category');

            categories.forEach(c => c.classList.remove('active'));
            this.classList.add('active');

            grids.forEach(grid => grid.classList.add('d-none'));

            const selectedGrid = document.getElementById('grid-' + target);
            if (selectedGrid) {
                selectedGrid.classList.remove('d-none');
            }
        });
    });
});
</script>
<?php $__env->stopPush(); ?>

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

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home2/reckons1/public_html/resources/views/store.blade.php ENDPATH**/ ?>