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

    <div id="showM">
        <div class="overlap g8mmenu-close"></div>
        <?php echo $__env->make('frontend.partials.mobile.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        <?php echo $__env->make('frontend.partials.mobile.sidebar-menu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        <div class="content">
            <section class="box">
                <div class="box__detail">
                    <div class="pbox">
                        <div class="promotionInfo m">
                            <div class="promo_dropown">
                                <a href="#" data-toggle="dropdown" aria-expanded="false">
                                    All Promotions<span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu promotab">
                                    <li><a href="#" class="ptb" d="a">All Promotions</a></li>
                                </ul>
                            </div>
                            
                            <div class="ptballbox">
                                <?php $__empty_1 = true; $__currentLoopData = $promotion; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $promo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <div class="ptbox all">
                                        <img src="<?php echo e(asset('uploads/'.$promo->gambar) ?? '/assets/custom/img/default-promo.png'); ?>" alt="<?php echo e($promo->title ?? 'Promosi'); ?>" style="width: 100%; border-radius: 5px 5px 0 0;">
                                        <div class="promotion-title">
                                            <span><?php echo e($promo->judul ?? 'Judul Promosi'); ?></span>
                                            <a href="#" style="cursor: pointer;">Detail</a>
                                        </div>
                                    </div>
                                    <div class="panel-content" style="display: none;">
                                        <div class="panel-body">
                                            <?php echo $promo->text ?? 'Syarat dan Ketentuan berlaku.'; ?>

                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <div style="text-align: center; padding: 30px; color: #fff;">
                                        Belum ada promosi yang aktif saat ini.
                                    </div>
                                <?php endif; ?>
                            </div>

                        </div>
                    </div>
                </div>
            </section>
        </div>
        <?php echo $__env->make('frontend.partials.mobile.bottom-nav', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>
    <div id="showD">
        <?php echo $__env->make('frontend.partials.desktop.header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

        <section class="slider">
            <section class="marquee">
                <div class="wrapper">
                    <div class="s-a">
                        <div class="marquee__bullhorn">
                            <i class="fas fa-bullhorn"></i>
                        </div>
                        <marquee scrolldelay="150" behavior="scroll" onmouseover="this.stop();" onmouseout="this.start();" direction="left">
                            <div style="width: 100000px; transform: translateX(0px);" class="js-marquee-wrapper">
                                <div class="js-marquee" style="margin-right: 0px; float: left;"><?php echo e(general()->title); ?></div>
                            </div>
                        </marquee>
                    </div>
                </div>
            </section>
        </section>

        <section class="pbox">
            <div class="wrapper">
                <section class="promotion info">
                    
                    <div class="info__left">
                        <ul class="promotab">
                            <li class="active">
                                <a href="#" class="ptb" d="a">All</a>
                            </li>
                        </ul>
                    </div>

                    <div class="info__right">
                        <?php $__empty_1 = true; $__currentLoopData = $promotion; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $promo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="ptbox all">
                                <img src="<?php echo e(asset('uploads/'.$promo->gambar) ?? '/assets/custom/img/default-promo.png'); ?>" alt="<?php echo e($promo->title ?? 'Promosi'); ?>" style="width: 100%; border-radius: 5px 5px 0 0;">
                                <div class="promotion-title">
                                    <span><?php echo e($promo->judul ?? 'Judul Promosi'); ?></span>
                                    <a href="#" style="cursor: pointer;">Detail</a>
                                </div>
                            </div>
                            <div class="panel-content" style="display: none;">
                                <div class="panel-body">
                                    <?php echo $promo->text ?? 'Syarat dan Ketentuan berlaku.'; ?>

                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <div style="text-align: center; padding: 50px; color: #fff; width: 100%;">
                                Belum ada promosi yang aktif saat ini.
                            </div>
                        <?php endif; ?>
                    </div>

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

        <section class="sidebar s-sidebar"></section>
        
        <?php echo $__env->make('frontend.partials.desktop.footer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </div>

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

<?php $__env->startPush('scripts'); ?>
<script type="text/javascript">
window.loadMeIfReady = function() {
    
    // Fitur Buka/Tutup Detail Promosi (Accordion)
    $(document).off("click", ".promotion-title a").on("click", ".promotion-title a", function(e) {
        e.preventDefault();
        // Menutup semua panel yang sedang terbuka agar rapi (Opsional, bisa dihapus jika ingin bisa buka banyak sekaligus)
        // $('.panel-content').slideUp(300); 
        
        // Membuka/menutup panel yang diklik
        $(this).closest(".ptbox").next(".panel-content").slideToggle(300);
        return false;
    });

    // Fitur Dropdown Kategori di Mobile
    $(document).off("click", ".promo_dropown").on("click", ".promo_dropown", function(e) {
        e.preventDefault();
        $(this).toggleClass('open');
        return false;
    });

    // Fitur Klik Kategori Mobile & Desktop (Disembunyikan jika tidak ada kategori spesifik di DB Anda)
    $(document).off('click', '.ptb').on('click', '.ptb', function(e) {
        e.preventDefault();
        let pd = $(this).closest('.promo_dropown');
        if(pd.length) {
            pd.find('> a:first').text($(this).text());
            pd.removeClass('open');
        }
        
        if ($(this).closest('.pbox').find('.info__left').length) {
            $(this).closest('ul').find('li').removeClass('active');
            $(this).parent().addClass('active');
        }
        
        let d = $(this).attr('d');
        if (d == 'a') {
            $('.ptbox').fadeIn(400);
        } else {
            $('.ptbox, .panel-content').hide();
            $('.ptbox.' + d).fadeIn(400);
        }
        return false;
    });

}; // End of loadMeIfReady
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('frontend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/website/sewa/gbo86/resources/views/frontend/pages/secure/promotions.blade.php ENDPATH**/ ?>