<?php
$data = \App\Helper\admin\siteInformation::siteInfo();
// $contactinfos = \App\Helper\frontend\contactInformation::contactinformation();
$social = \App\Helper\frontend\socialInformation::SocialInfo();
//  dd($social);
// $servicearea = \App\Helper\frontend\Getserarea::servicearea();
// $services = \App\Helper\frontend\ServiceInformation::all();

$current_route = Route::currentRouteName();

use App\Models\MainCategory;
use App\Models\SubCategory;
use App\Models\ChildCategory;

$maincat = MainCategory::all();
$subcat = SubCategory::all();
$childcat = ChildCategory::all();

?>

<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">-->

<style>
    .li-width {
        width: 100%;
        display: flex;

    }

    .li-width1 {
        width: 100%;
        max-width: 75%;
        position: absolute;
        top: 0;
        max-height: 300px;
        background-color: white;
        right: 0;
        display: none;
    }

    .li-width2 {
        max-width: 25%;
        position: relative;
        border: 1px solid #e7e7e7;
        border-top: 0;
        width: 100%;
        border-bottom: 0;
        border-right: 1px solid #c9c9c9
    }

    .li-width1 .navbar_div_9 {
        display: flex;
    }

    .li-width1 .topber_div_8 {
        width: 25%;
        padding-left: 44px;
    }

    .navbar-div4 {
        position: relative;
    }

    .li-width:hover div.li-width1 {
        display: block !important;
        width: 100%;
    }

    .mobile-header-ul {
        display: none;
        padding-left: 44px;
        padding-right: 15px;
    }

    .mobile_header_li_1:hover .mobile-header-ul {
        display: block;
    }

    .mobile-headerli-div {
        display: none;

    }

    .mobile-header-ul:hover .mobile-headerli-div {
        display: block;
    }

    .header-scroll-ul {
        height: 56px;
        overflow: hidden;
        overflow-y: scroll;
    }

    .header-scroll-a {
        color: black;
    }

    .mobile-header-ul-1 {
        display: none;
    }

    .mobile-header-li-1:hover .mobile-header-ul-1 {
        display: block;
    }

    .mobile-headerli-div-p {
        color: #3d47b3;
        font-weight: 700;
    }

    .mobile_header_p_1 {
        position: relative;
    }

    .li-width:first-child div.li-width1 {
        display: block;
    }
    .sidebar-bottom-div-1 {
        padding: 13px;
        font-size: 10px;
        background: #d9d9d9;
    }
    .sidebar-bottom-div-2 {
        padding: 13px;
        font-size: 10px;
        position: relative;
    }
    
</style>
</head>

<body>

    <!-- header -->

    <header>

        <!-- for window -->

        <section class="window_header_div_1">

            <!-- topber -->

            <div class="topber_div_1">
                <div class="container-fluid">
                    <div class="topber_div_2">
                        <div class="row align-items-center">
                            <div class="col-lg-3 col-md-3 col-3">
                                <div class="topber_div_3">
                                    <a href="<?php echo e(route('home')); ?>" class="navbar_a_1">
                                        <img src="<?php echo e(url('/')); ?>/frontend/img/nandisportslogo.png" class="navbar_logo_main">
                                        <!-- <h1 class="navbar_h1" style="color: #5e5e5e;">LOGO</h1> -->
                                    </a>
                                </div>
                            </div>
                            <div class="col-lg-6 col-md-6 col-6">
                                <div class="topber_div_4">
                                    <div class="topber_div_6">
                                        <form action="<?php echo e(route('search_product')); ?>" method="GET" style="width: 100%;display: flex;">
                                            <p class="topber_p_1"><i class="fa fa-search" aria-hidden="true"></i></p>
                                            <input type="text" name="query"  class="topber_input_1" value="<?php echo e(request('query')); ?>" placeholder="Search for products, brands or Health Goals">
                                        </form>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-3 col-3">
                                <div class="topber_div_5">
                                    <ul class="topber_ul_1 text-right">
                                        <li class="topber_li_1 dropdown">
                                            <a href="#" class="topber_a_1">
                                                <p class="topber_p_2">Customer support</p>
                                            </a>
                                            <div class="dropdown-content topber_div_9">
                                                <div class="topber_div_7">
                                                    <div class="row">
                                                        <div class="col-6" style="padding-right: 0px;">
                                                            <div class="topber_div_8">
                                                                <p class="topber_p_3 text-center">Contact us</p>
                                                                <ul class="topber_ul_2">
                                                                    <li class="topber_li_2">
                                                                        <a href="#" class="topber_a_2">
                                                                            <p class="topber_p_4">
                                                                                Email us
                                                                            </p>
                                                                        </a>
                                                                    </li>
                                                                    <li class="topber_li_2">
                                                                        <a href="<?php echo e(route('return')); ?>" class="topber_a_2">
                                                                            <p class="topber_p_4">
                                                                                Return policy
                                                                            </p>
                                                                        </a>
                                                                    </li>
                                                                    <!-- <li class="topber_li_2">
                                                                    <a href="#" class="topber_a_2">
                                                                        <p class="topber_p_4">
                                                                            Ask our experts
                                                                        </p>
                                                                    </a>
                                                                </li> -->
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="col-6">
                                                            <div class="topber_div_8">
                                                                <p class="topber_p_3 text-center">Helpfull link</p>
                                                                <ul class="topber_ul_2" style="border: 0px;">
                                                                    <li class="topber_li_2">
                                                                        <a href="<?php echo e(route('contact_page')); ?>" class="topber_a_2">
                                                                            <p class="topber_p_4">
                                                                                Contact Us
                                                                            </p>
                                                                        </a>
                                                                    </li>

                                                                    <li class="topber_li_2">
                                                                        <a href="<?php echo e(route('faq')); ?>" class="topber_a_2">
                                                                            <p class="topber_p_4">
                                                                                FAQs
                                                                            </p>
                                                                        </a>
                                                                    </li>
                                                                </ul>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                        <li class="topber_li_1 dropdown">
                                            <a href="#" class="topber_a_1">
                                                <p class="topber_p_2">
                                                    <img src="<?php echo e(url('/')); ?>/frontend/img/user.jpg" class="topber_img_1">
                                                </p>
                                            </a>
                                            <div class="dropdown-content topber_div_9">
                                                <div class="topber_div_7">
                                                    <div class="topber_div_10">
                                                        <!--<a href="<?php echo e(route('login_user')); ?>">-->
                                                        <!--    <button class="topber_btn_1">-->
                                                        <!--        Login-->
                                                        <!--    </button>-->
                                                        <!--</a>-->
                                                        
                                                        <?php if(Auth::check()): ?>
    <a href="<?php echo e(route('user.logout')); ?>">
        <button class="topber_btn_1">Logout</button>
    </a>

<?php else: ?>
    <a href="<?php echo e(route('login_user')); ?>">
        <button class="topber_btn_1">Login</button>
    </a>
<?php endif; ?>
                                                        
                                                        <a href="<?php echo e(route('register_user')); ?>">
                                                            <button class="topber_btn_2">
                                                                New user / Sign up
                                                            </button>
                                                        </a>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-12">
                                                            <div class="topber_div_8">
                                                                <a href="<?php echo e(route('myaccount')); ?>">
                                                                    <p class="topber_p_3 text-center">My account</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                        <li class="topber_li_1">
                                            <a href="<?php echo e(route('wishlist_index')); ?>" class="topber_a_1">
                                                <p class="topber_p_2">
                                                    <i class="fa fa-heart" aria-hidden="true"></i>
                                                </p>
                                            </a>
                                        </li>
                                        <li class="topber_li_1" style="border: 0px; position: relative;">
                                            <a href="<?php echo e(route('cart')); ?>" class="topber_a_1">
                                                <p class="topber_p_2">
                                                    <img src="<?php echo e(url('/')); ?>/frontend/img/cart.jpg" class="topber_img_2">
                                                    <?php
                                                        $cartCount = Auth::check() ? \App\Models\cart::where('user_id', Auth::id())->count() : 0;
                                                    ?>
                                                    <span class="cart-count" style="position: absolute; top: -3px; right: -1px; background: #a60404; color: white; border-radius: 50%; padding: 2px 5px; font-size: 8px; line-height: normal;">
                                                        <?php echo e($cartCount); ?>

                                                    </span>
                                                </p>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- /topbar -->

            <!-- navber -->

            <nav class="navbar_div_1">
                <div class="container-fluid">
                    <div class="navbar_div_2">
                        <div class="navbar_div_3">
                            <ul class="navbar_ul_1">
                                <li class="navbar_li_1 dropdown">
                                    <a href="<?php echo e(route('home')); ?>" class="navbar_a_2">
                                        <p class="navbar_p_1">Home</p>
                                    </a>
                                </li>
                                <li class="navbar_li_1 dropdown">
                                    <a href="javascript:void(0);" class="navbar_a_2">
                                        <p class="navbar_p_1">Category</p>
                                    </a>
                                    <div class="dropdown-content navbar_div_5 " style="left: 85px;">
                                        <ul class="navbar_div_4 navbar-div4">

                                            <?php $__currentLoopData = $maincat; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $maincategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <li class="li-width">
                                                <div class="li-width2">
                                                    <a href="<?php echo e(route('products.bymainCategory', $maincategory->maincat_slug)); ?>">
                                                        <p class="navbar_p_3">
                                                            <?php echo e($maincategory->maincategory); ?>

                                                            <span class="navbar_span_1">
                                                                <i class="fa fa-angle-right" aria-hidden="true"></i>
                                                            </span>
                                                        </p>
                                                    </a>
                                                </div>

                                                <?php
                                                // Fetch subcategories for the current main category
                                                $subcategories = SubCategory::where('maincatid', $maincategory->id)->get();
                                                ?>

                                                <?php if($subcategories->isNotEmpty()): ?>
                                                <div class="li-width1">
                                                    <div class="navbar_div_9 li-new-div">
                                                        <?php $__currentLoopData = $subcategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subcategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div class="topber_div_8">
                                                            <a href="<?php echo e(route('products.bysubCategory', $subcategory->subcat_slug)); ?>" class="topber_a_2">
                                                                <p class="topber_p_3"><?php echo e($subcategory->subcatname); ?></p>
                                                            </a>

                                                            <?php
                                                            // Fetch child categories for the current subcategory
                                                            $childcategories = ChildCategory::where('subcatid', $subcategory->id)->get();
                                                            ?>

                                                            <?php if($childcategories->isNotEmpty()): ?>
                                                            <ul class="topber_ul_2">
                                                                <?php $__currentLoopData = $childcategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $childcategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <li class="topber_li_2">
                                                                    <a href="<?php echo e(route('products.byCategory', $childcategory->childcat_slug)); ?>" class="topber_a_2">
                                                                        <p class="topber_p_4"><?php echo e($childcategory->childcatname); ?></p>
                                                                    </a>
                                                                </li>
                                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                            </ul>
                                                            <?php endif; ?>
                                                        </div>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </div>
                                                </div>
                                                <?php endif; ?>
                                            </li>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                        </ul>


                                    </div>
                                </li>

                                <li class="navbar_li_1 dropdown">
                                    <a href="<?php echo e(route('products')); ?>" class="navbar_a_2">
                                        <p class="navbar_p_1">Bestsellers</p>
                                    </a>
                                    <div class="dropdown-content navbar_div_5" style="left: 85px;">

                                    </div>
                                </li>

                                <li class="navbar_li_1 dropdown">
                                    <a href="<?php echo e(route('products')); ?>" class="navbar_a_2">
                                        <p class="navbar_p_1">Deals</p>
                                    </a>
                                    <div class="dropdown-content navbar_div_5" style="left: 85px;">

                                    </div>
                                </li>

                                <li class="navbar_li_1 dropdown">
                                    <a href="<?php echo e(route('blog_page')); ?>" class="navbar_a_2">
                                        <p class="navbar_p_1">Blog, Videos & More</p>
                                    </a>
                                    <div class="dropdown-content navbar_div_5" style="left: 85px;">

                                    </div>
                                </li>

                                <li class="navbar_li_1 dropdown">
                                    <a href="<?php echo e(route('contact_page')); ?>" class="navbar_a_2">
                                        <p class="navbar_p_1">Find a Store</p>
                                    </a>
                                    <div class="dropdown-content navbar_div_5" style="left: 85px;">

                                    </div>
                                </li>

                            </ul>
                        </div>
                    </div>
                </div>
            </nav>

            <!-- /navber -->

        </section>

        <!-- /for window -->

        <!-- for mobile -->

        <section class="mobile_header_div_1">
            <div class="mobile_header_div_2">
                <div class="row">
                    <div class="col-2" style="padding: 0px;">
                        <div class="mobile_header_div_4">
                            <span style="" class="mobile_header_span_1" onclick="openNav()">
                                <i class="fa fa-align-left" aria-hidden="true"></i>
                            </span>
                            <div id="mySidenav" class="sidenav">
                                <a href="<?php echo e(route('home')); ?>" class="closebtn" onclick="closeNav()">&times;</a>
                                <div class="mobile_header_div_6">
                                    <!-- <h1 style="color: #5e5e5e;">LOGO</h1> -->
                                    <img src="<?php echo e(url('/')); ?>/frontend/img/nandisportslogo.png" class="mobile_logo">
                                </div>
                                <ul class="mobile_header_ul_1">
                                    <li class="mobile_header_li_1">
                                        <a href="<?php echo e(route('home')); ?>" class="mobile_header_a_1">
                                            <p class="mobile_header_p_1">Home</p>
                                        </a>
                                    </li>

                                    <li class="mobile_header_li_1">
                                        <a href="javascript:void(0);" class="mobile_header_a_1">
                                            <p class="mobile_header_p_1 ">Category
                                                <span class="navbar_span_1">
                                                    <i class="fa fa-angle-down" aria-hidden="true"></i>
                                                </span>
                                            </p>

                                        </a>
                                        <ul class="mobile-header-ul">
                                            <?php $__currentLoopData = $maincat; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $maincategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <li class="mobile-header-li-1">

                                                <p class="mobile_header_p_1 px-2">
                                                    <a href="<?php echo e(route('products.bymainCategory', $maincategory->maincat_slug)); ?>">
                                                        <?php echo e($maincategory->maincategory); ?>

                                                    </a>

                                                    <span class="navbar_span_1">
                                                        <i class="fa fa-angle-down" aria-hidden="true"></i>
                                                    </span>

                                                </p>


                                                <?php
                                                // Fetch subcategories for the current main category
                                                $subcategories = SubCategory::where('maincatid', $maincategory->id)->get();
                                                ?>
                                                <?php if($subcategories->isNotEmpty()): ?>

                                                <div class="mobile-headerli-div">
                                                    <?php $__currentLoopData = $subcategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subcategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <a href="<?php echo e(route('products.bysubCategory', $subcategory->subcat_slug)); ?>">
                                                        <p class="mobile-headerli-div-p"><?php echo e($subcategory->subcatname); ?></p>
                                                    </a>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                                    <?php
                                                    // Fetch child categories for the current subcategory
                                                    $childcategories = ChildCategory::where('subcatid', $subcategory->id)->get();
                                                    ?>

                                                    <?php if($childcategories->isNotEmpty()): ?>
                                                    <ul class="header-scroll-ul">
                                                        <?php $__currentLoopData = $childcategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $childcategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <li>
                                                            <a href="<?php echo e(route('products.byCategory', $childcategory->childcat_slug)); ?>" class="header-scroll-a"><?php echo e($childcategory->childcatname); ?></a>
                                                        </li>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </ul>
                                                    <?php endif; ?>

                                                </div>
                                                <?php endif; ?>

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

                                    <li class="mobile_header_li_1">
                                        <a href="<?php echo e(route('products')); ?>" class="mobile_header_a_1">
                                            <p class="mobile_header_p_1">Bestsellers</p>
                                        </a>
                                    </li>


                                    <li class="mobile_header_li_1">
                                        <a href="<?php echo e(route('products')); ?>" class="mobile_header_a_1">
                                            <p class="mobile_header_p_1">Deals</p>
                                        </a>
                                    </li>


                                    <li class="mobile_header_li_1">
                                        <a href="<?php echo e(route('blog_page')); ?>" class="mobile_header_a_1">
                                            <p class="mobile_header_p_1">Blog, Videos & More</p>
                                        </a>
                                    </li>


                                    <li class="mobile_header_li_1">
                                        <a href="<?php echo e(route('contact_page')); ?>" class="mobile_header_a_1">
                                            <p class="mobile_header_p_1">Find a Store</p>
                                        </a>
                                    </li>
                                    
                                    <?php if(Auth::check()): ?>
                                    <li class="mobile_header_li_3 mt-2 px-2">
                                        <a href="<?php echo e(route('user.logout')); ?>" class="mobile_header_a_1">
                                            <p class="topber_btn_1  text-center">Logout</p>
                                        </a>
                                    </li>
                                    <?php else: ?>
    <a href="<?php echo e(route('login_user')); ?>" class="mobile_header_a_1">
     <p class="topber_btn_1  text-center">Login</p>
    </a>
<?php endif; ?>
                                    
                                    <li class="mobile_header_li_1 mt-2 px-2">
                                        <a href="<?php echo e(route('register_user')); ?>" class="mobile_header_a_1">
                                            <p class="topber_btn_2 text-center "> New user / Sign up</p>
                                        </a>
                                    </li>
                                    <li class="mobile_header_li_1 mt-2 ">
                                        <a href="<?php echo e(route('myaccount')); ?>" class="mobile_header_a_1">
                                            <p class="topber_p_3 text-center ">My account</p>
                                        </a>
                                    </li>
                                    <!--<li class="mobile_header_li_1">-->
                                    <!--    <a href="<?php echo e(route('wishlist_index')); ?>" class="mobile_header_a_1">-->
                                    <!--        <p class="mobile_header_p_1"><i class="fa fa-heart pr-2" aria-hidden="true"></i> Wishlist</p>-->
                                    <!--    </a>-->
                                    <!--</li>-->
                                    <!--<li class="mobile_header_li_1">-->
                                    <!--    <a href="<?php echo e(route('contact_page')); ?>" class="mobile_header_a_1">-->
                                    <!--        <p class="topber_p_2 mobile_header_p_1">-->
                                    <!--            <img src="https://nandisports.com/frontend/img/cart.jpg" class="topber_img_2">-->
                                    <!--            <span class="cart-count" style="position: absolute; top: 4px; left: 42px; background: #a60404; color: white; border-radius: 50%; padding: 2px 5px; font-size: 8px; line-height: normal;">-->
                                    <!--                0-->
                                    <!--            </span>-->
                                    <!--            <span class="px-2 " style="font-size: 16px; letter-spacing: 0px; font-weight: 400; color: #5e5e5e; line-height: 24px;">Add to cart</span>-->
                                    <!--        </p>-->
                                    <!--    </a>-->
                                    <!--</li>-->
                                    
                                </ul>
                                <div class="d-flex">
                                    <div class="sidebar-bottom-div-1">
                                        <a href="<?php echo e(route('wishlist_index')); ?>" class="mobile_header_a_1">
                                            <p class="mobile_header_p_3"><i class="fa fa-heart pr-2" aria-hidden="true"></i> Wishlist</p>
                                        </a>
                                    </div>
                                    <div class="sidebar-bottom-div-2">
                                        <a href="<?php echo e(route('cart')); ?>" class="mobile_header_a_1">
                                            <p class="topber_p_2 mobile_header_p_3">
                                                <img src="<?php echo e(url('/')); ?>/frontend/img/cart.jpg" class="topber_img_2">
                                                <?php
                                                        $cartCount = Auth::check() ? \App\Models\cart::where('user_id', Auth::id())->count() : 0;
                                                    ?>
                                                    <span class="cart-count" style="position: absolute; top: 4px; left: 28px; background: #a60404; color: white; border-radius: 50%; padding: 2px 5px; font-size: 8px; line-height: normal;">
                                                        <?php echo e($cartCount); ?>

                                                    </span>
                                                <span class="px-2 " style="font-size: 16px; letter-spacing: 0px; font-weight: 400; color: #5e5e5e; line-height: 24px;">Your cart</span>
                                            </p>
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-10" style="padding: 0px;">
                        <div class="mobile_header_div_5">
                            <div class="topber_div_6">
                                <form action="<?php echo e(route('search_product')); ?>" method="GET" style="width: 100%;display: flex;">
                                    <p class="topber_p_1"><i class="fa fa-search" aria-hidden="true"></i></p>
                                    <input type="text" name="query" class="topber_input_1" placeholder="Search for products" value="<?php echo e(request('query')); ?>">
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- /for mobile -->

    </header>

    <!-- /header -->

    <!-- back to top button -->

    <section>
        <div class="backtotop_btn_div_1">
            <button class="btn-3 fullbody_btn_1" id="button">
                <i class="fa fa-angle-up" aria-hidden="true"></i>
            </button>
        </div>
    </section>

    <!-- /back to top button --><?php /**PATH /home/nandisports/public_html/resources/views/frontend/layout/header.blade.php ENDPATH**/ ?>