<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <title>Malasangre Bar - Menú</title>

    <link href="<?php echo e(asset('assets/css/style.css?v=07122021')); ?>" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
    <script src="https://kit.fontawesome.com/dd87e83dab.js"></script>
</head>
<body id="top" class="page-menu">
<div class="container">
    <header class="content">
        <div class="cont-logo-menu">
            <div class="logo">
                <a href="<?php echo e(URL::to('/')); ?>#top" class="logo">
                    <img src="img/logo.png" alt="">
                </a>
            </div>
            <div class="close-mobile-menu close"></div>
            <nav class="burger">
                <span></span>
                <ul class="cont-mobile-menu">
                    <li class="menu-logo">
                        <a href="<?php echo e(URL::to('/')); ?>#top" class="logo">
                            <img src="img/logo.png" alt="">
                        </a>
                    </li>
                    <li>
                        <a href="/menu">Menú</a>
                    </li>
                    <li>
                        <a <?php if($linkReservations): ?> href="<?php echo e($linkReservations->link); ?>" target="_blank" <?php endif; ?>>Reservas</a>
                    </li>


























                    <li class="mobile redes-mobile">
                        <a target="_blank" href="https://www.instagram.com/malasangre.bar/?hl=es">
                            <i class="fab fa-instagram"></i>
                        </a>



                    </li>
                </ul>
            </nav>
        </div>
        <div class="redes">
            <a target="_blank" href="https://www.instagram.com/malasangre.bar/?hl=es">
                <i class="fab fa-instagram"></i>
            </a>



        </div>
    </header>

    <div class="content titulo">
        <h1>Menú</h1>
    </div>
    <section class="cont-menu">
        <div class="" id="tab-menu">
            <?php
            $contCategories = 0;
            asort($sortCategories);
            asort($sortSubCategories);
            ?>
            <ul class="tab" id="listCategories">
                <?php $__currentLoopData = $sortCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $x => $x_value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li id="list_<?php echo e($x); ?>" class="btn-tab" style=" <?php if(!is_numeric(substr($x_value, 0, 1))): ?> display:none; <?php endif; ?>">
                        <a onclick="selectionCategory(<?php echo e($x); ?>)" style="cursor: pointer;"  class="" >
                            <?php
                            $firstCategoryName = explode('-', $x_value);
                            if (count($firstCategoryName) > 1){
                                $titleCategoryName = $firstCategoryName[1];
                            } else {
                                $titleCategoryName = $x_value;
                            }
                            ?>

                            <?php echo e($titleCategoryName); ?>

                        </a>
                    </li>
                    <?php
                    $contCategories ++;
                    ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <li id="seeAllCategories" class="btn-tab" >
                    <a style="cursor: pointer;font-size: 2.4rem;" >+</a>
                </li>
            </ul>

            <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php $__currentLoopData = $category; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if($c['productCategoryId'] == '' && $c['name'] != 'Inactivos'): ?>
                               <div id="tab_<?php echo e($c['id']); ?>" class="tabcontent info" style="display: none;">
                                   <?php
                                   $categoryName = explode('-', $c['name']);
                                   if (count($categoryName) > 1){
                                       $nameCategory = $categoryName[1];
                                   } else {
                                       $nameCategory = $c['name'];
                                   }
                                   ?>

                                       <h2><?php echo e($nameCategory); ?></h2>
                                   <ul id="products_<?php echo e($c['id']); ?>">
                                       <?php
                                       $contProducts = 0;
                                       $contProductsActives = 0;
                                       ?>
                                    <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php $__currentLoopData = $product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($p['productCategoryId'] == $c['id'] && $p['price'] != 0 && $p['active'] == true): ?>
                                                <?php
                                                       $style = '';
                                                       $class = '';
                                                       $productName = explode('-', $p['name']);
                                                       if (count($productName) > 1){
                                                           $name = $productName[1];
                                                           $contProductsActives++;
                                                       } else {
                                                           $name = $p['name'];
                                                           $style = 'display:none';
                                                           $class = 'productHidden';
                                                       }
                                                       ?>
                                                <?php if(substr($p['name'], 0, 1) != '#'): ?>
                                                    <li id="<?php echo e($p['name']); ?>" class="<?php echo e($class); ?>" style="<?php echo e($style); ?>">
                                                        <div class="producto">
                                                            <div class="producto"> <?php echo e(trim($name, '@')); ?></div>
                                                            <div class="desc-producto producto"> <?php echo e($p['description']); ?></div>

                                                            <div class="precio"> $ <?php echo e($p['price']); ?></div>

                                                        </div>
                                                    </li>
                                                       <?php
                                                       $contCategories ++;
                                                       $contProducts++;
                                                       ?>
                                                <?php endif; ?>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                           <?php if($contProducts != $contProductsActives): ?>
                                           <li id="zzzzzzz" class="seeAllProducts" style="">
                                               <div class="producto">
                                                   <div class="producto">
                                                       <a style="cursor: pointer;" >+ Ver Más</a>
                                                   </div>
                                               </div>
                                           </li>
                                           <?php endif; ?>
                                    </ul>
                                   <?php $__currentLoopData = $sortSubCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $x => $x_value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $id = explode('-',$x);
                                            ?>
                                               <?php if($id[1] == $c['id'] ): ?>
                                                    <?php
                                                    $subCategoryName = explode('-', $x_value);
                                                    if (count($subCategoryName) > 1){
                                                        $categorySubName = $subCategoryName[1];
                                                    } else {
                                                        $categorySubName = $x_value;
                                                    }
                                                    ?>

                                                        <h2><?php echo e($categorySubName); ?></h2>
                                                   <ul id="products_<?php echo e($id[0]); ?>">
                                                       <?php
                                                       $contProductsSub = 0;
                                                       $contProductsActivesSub = 0;
                                                       ?>
                                                       <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                           <?php $__currentLoopData = $product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                               <?php if($p['productCategoryId'] == $id[0] && $p['price'] != 0 && $p['active'] == true): ?>
                                                                   <?php
                                                                   $style = '';
                                                                   $class = '';
                                                                   $productName = explode('-', $p['name']);
                                                                   if (count($productName) > 1){
                                                                       $name = $productName[1];
                                                                       $contProductsActivesSub++;
                                                                   } else {
                                                                       $name = $p['name'];
                                                                       $style = 'display:none';
                                                                       $class = 'productHidden';
                                                                   }
                                                                   ?>
                                                                   <?php if(substr($p['name'], 0, 1) != '#'): ?>
                                                                       <li id="<?php echo e($p['name']); ?>" class="<?php echo e($class); ?>" style="<?php echo e($style); ?>">
                                                                           <div class="producto">
                                                                               <div class="producto"> <?php echo e(trim($name, '@')); ?></div>
                                                                               <div class="desc-producto producto"> <?php echo e($p['description']); ?></div>

                                                                               <div class="precio"> $ <?php echo e($p['price']); ?></div>
                                                                           </div>
                                                                       </li>
                                                                           <?php
                                                                           $contProductsSub ++;
                                                                           ?>
                                                                   <?php endif; ?>
                                                               <?php endif; ?>
                                                           <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                       <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                           <?php if($contProductsSub != $contProductsActivesSub && $contProductsActivesSub != 0): ?>
                                                               <li id="zzzzzzz" class="seeAllProducts" style="">
                                                                   <div class="producto">
                                                                       <div class="producto">
                                                                           <a style="cursor: pointer;" >+ Ver Más</a>
                                                                       </div>
                                                                   </div>
                                                               </li>
                                                           <?php endif; ?>
                                                   </ul>
                                               <?php endif; ?>
                                       <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </section>

    <footer class="content">
        <div class="direccion">
            Av. Cramer 2704, Belgrano, CABA
        </div>
        <div class="copyright">
            Todos los derechos reservados
        </div>
    </footer>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="<?php echo e(asset('assets/js/burguer.js?v=234234')); ?>"></script>
<script src="<?php echo e(asset('assets/js/smooth.js')); ?>"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="<?php echo e(asset('assets/js/sticky.js')); ?>"></script>

<script>
    $( function() {
        let firstCategory = '<?php echo array_key_first($sortCategories);?>';
        $('#list_'+firstCategory).addClass('ui-tabs-active ui-state-active');
        selectionCategory(firstCategory);

        $('#seeAllCategories').click(function (){
            $('#listCategories li').each(function() {
                $(this).css('display', 'block');
            })
            $(this).css('display', 'none');
        });

        $('.seeAllProducts').click(function (){
            let listContainer = $(this).closest('ul').attr('id');
            $('#'+listContainer+ ' li').each(function() {
                $(this).css('display', 'block');
            })
            $(this).css('display', 'none');
        });
    } );
    function sort(id){
        const ul = document.getElementById('products_' + id);
        Array.from(ul.getElementsByTagName("LI"))
            .sort((a, b) => a.id.localeCompare(b.id))
            .forEach(li => ul.appendChild(li));
    }

    function selectionCategory(id){
        $('.seeAllProducts').css('display', 'block');
        $('.productHidden').css('display', 'none');
        $('.btn-tab').removeClass('ui-tabs-active ui-state-active');
        $('#list_'+id).addClass('ui-tabs-active ui-state-active');
        $('.info').css('display', 'none');
        $('#tab_'+id).css('display', 'block');
    }

    <?php $__currentLoopData = $sortSubCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $x => $x_value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
            $idSubProduct = explode('-',$x);
            echo 'sort('.$idSubProduct[0].');';
        ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php $__currentLoopData = $sortCategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $x => $x_value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php
            echo 'sort('.$x.');';
            ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</script>
</body>
</html>


<?php /**PATH C:\xampp\htdocs\malasangrebar-laravel\resources\views/menu.blade.php ENDPATH**/ ?>