

<?php $__env->startSection('content'); ?>
    <div class="home-page-wrapper py-3 py-md-4">

        
        <?php if(isset($largeSliders) && $largeSliders->count()): ?>
            <section class="home-hero mb-3 mb-md-4">
                <div class="container">
                    <div id="homeMainSlider" class="carousel slide home-hero-slider" data-bs-ride="carousel">
                        <div class="carousel-inner">
                            <?php $__currentLoopData = $largeSliders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $slider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <div class="carousel-item <?php echo e($loop->first ? 'active' : ''); ?>">
                                    <img src="<?php echo e(asset('storage/' . $slider->image)); ?>"
                                         class="d-block w-100 home-hero-img"
                                         alt="<?php echo e($slider->alt ?? 'Slider Image'); ?>">
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>

                        
                        <button class="carousel-control-prev" type="button" data-bs-target="#homeMainSlider" data-bs-slide="prev">
                            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                            <span class="visually-hidden">Previous</span>
                        </button>
                        <button class="carousel-control-next" type="button" data-bs-target="#homeMainSlider" data-bs-slide="next">
                            <span class="carousel-control-next-icon" aria-hidden="true"></span>
                            <span class="visually-hidden">Next</span>
                        </button>
                    </div>
                </div>
            </section>
        <?php endif; ?>

        
        <?php if(isset($homeSections)): ?>
            <?php $__currentLoopData = $homeSections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php echo $__env->make('frontend.partials.home-section-block', ['section' => $section], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <?php endif; ?>

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

<?php $__env->startPush('style'); ?>
    <style>
        .home-page-wrapper {
            background-color: #f5f5f5;
        }

        /* HERO SLIDER */
        .home-hero-slider {
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
        }

        .home-hero-img {
            height: 260px;
            object-fit: cover;
        }

        .home-hero .carousel-control-prev,
        .home-hero .carousel-control-next {
            width: 5%;
        }

        .home-hero .carousel-control-next-icon,
        .home-hero .carousel-control-prev-icon {
            background-color: rgba(0, 0, 0, 0.55);
            border-radius: 999px;
            padding: 10px;
        }

        /* COMMON SECTION */
        .home-block {
            padding: 1.5rem 0;
        }

        .home-block + .home-block {
            border-top: 1px solid #e5e7eb;
        }

        .home-block-header {
            margin-bottom: 0.75rem;
        }

        .home-block-title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 0.15rem;
        }

        .home-block-subtitle {
            font-size: 0.82rem;
            color: #6b7280;
            margin-bottom: 0.2rem;
        }

        .home-block-submenus {
            font-size: 0.82rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }

        .home-submenu-link {
            text-decoration: none;
            color: #2563eb;
        }

        .home-submenu-link:hover {
            text-decoration: underline;
        }

        .home-block-more {
            font-size: 0.82rem;
            padding: 4px 10px;
        }

        /* PRODUCT CARD (section গুলোর ভেতর use হচ্ছে) */
        .home-product-card-link {
            text-decoration: none;
            color: inherit;
        }

        .home-product-card {
            background-color: #ffffff;
            border-radius: 6px;
            border: 1px solid #e5e7eb;
            padding: 0.45rem 0.45rem 0.6rem;
            transition: box-shadow 0.15s ease-out, transform 0.15s ease-out;
        }

        .home-product-card:hover {
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
            transform: translateY(-2px);
        }

        .home-product-img-wrap {
            position: relative;
            background-color: #ffffff;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 140px;
        }

        .home-product-img-wrap img {
            max-height: 130px;
            object-fit: contain;
        }

        .home-discount-badge {
            position: absolute;
            left: 6px;
            top: 6px;
            background-color: #e11d48;
            color: #ffffff;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 999px;
        }

        .home-product-body {
            margin-top: 0.35rem;
        }

        .home-product-name {
            font-size: 0.8rem;
            color: #111827;
            min-height: 32px;
        }

        .home-product-price-wrap {
            display: flex;
            align-items: baseline;
            gap: 0.35rem;
        }

        .home-price-main {
            font-size: 0.9rem;
            font-weight: 700;
            color: #111827;
        }

        .home-price-old {
            font-size: 0.8rem;
            color: #9ca3af;
            text-decoration: line-through;
        }

        .home-price-tag {
            display: inline-block;
            margin-top: 0.25rem;
            font-size: 0.75rem;
            background-color: #22c55e;
            color: #ffffff;
            padding: 1px 8px;
            border-radius: 999px;
        }

        @media (max-width: 767.98px) {
            .home-hero-img {
                height: 180px;
            }

            .home-block {
                padding: 1.1rem 0;
            }

            .home-product-img-wrap {
                min-height: 120px;
            }

            .home-product-img-wrap img {
                max-height: 110px;
            }
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script>
        window.dataLayer = window.dataLayer || [];

        (function () {
            const affiliation = <?php echo json_encode(config('app.name', 'SEF Card'), 512) ?>;
            const itemListId = "home_sections_products";
            const itemListName = "Homepage Sections Products";

            // page load এ view_item_list
            document.addEventListener('DOMContentLoaded', function () {
                const cards = document.querySelectorAll('.home-product-card-link');
                if (!cards.length) return;

                let items = [];
                cards.forEach(function (card, index) {
                    const price = parseFloat(card.dataset.productPrice || '0') || 0;

                    items.push({
                        item_id: String(card.dataset.productId || ''),
                        item_name: card.dataset.productName || '',
                        affiliation: affiliation,
                        item_brand: affiliation,
                        item_category: card.dataset.productCategory || '',
                        index: index,
                        price: price,
                        google_business_vertical: "retail",
                        quantity: 1
                    });
                });

                window.dataLayer.push({ecommerce: null});
                window.dataLayer.push({
                    event: "view_item_list",
                    ecommerce: {
                        item_list_id: itemListId,
                        item_list_name: itemListName,
                        items: items
                    }
                });
            });

            // select_item যখন ইউজার কার্ডে ক্লিক করে
            window.gaSelectItemFromList = function (cardEl, index) {
                const price = parseFloat(cardEl.dataset.productPrice || '0') || 0;

                const item = {
                    item_id: String(cardEl.dataset.productId || ''),
                    item_name: cardEl.dataset.productName || '',
                    affiliation: affiliation,
                    item_brand: affiliation,
                    item_category: cardEl.dataset.productCategory || '',
                    index: index,
                    price: price,
                    google_business_vertical: "retail",
                    quantity: 1
                };

                window.dataLayer.push({ecommerce: null});
                window.dataLayer.push({
                    event: "select_item",
                    ecommerce: {
                        item_list_id: itemListId,
                        item_list_name: itemListName,
                        items: [item]
                    }
                });
            };

            // anchor click এ select_item কল
            document.addEventListener('click', function (e) {
                const link = e.target.closest('.home-product-card-link');
                if (!link) return;

                const cards = Array.from(document.querySelectorAll('.home-product-card-link'));
                const index = cards.indexOf(link);

                if (index > -1) {
                    window.gaSelectItemFromList(link, index);
                }
            });
        })();
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('frontend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/emdadtwa/sefcard.com/resources/views/frontend/home.blade.php ENDPATH**/ ?>