<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5685GJP9');</script>
<!-- End Google Tag Manager -->
</head>
<style>
.mobonly{
    display:none !important;
}

/* MOBILE MENU FIX */
@media (max-width:770px){

.list-main{
    width:100% !important;
}

.list-main li{
    display:block !important;
    width:100% !important;
    text-align:left !important;
    padding:8px 0 !important;
}

.list-main li a{
    display:inline-block !important;
}

/* hide on desktop */
.mobonly{
    display:none !important;
}

/* show only on mobile */
.mobonly{
    display:block !important;
}

}


/* MOBILE MENU FIX */
@media (max-width:770px){

.list-main{
    width:100% !important;
}

.list-main li{
    display:block !important;
    width:100% !important;
    text-align:left !important;
    padding:8px 0 !important;
}

.list-main li a{
    display:inline-block !important;
}

/* hide on desktop */
.mobonly{
    display:none !important;
}

/* show only on mobile */
.mobonly{
    display:block !important;
}

}


</style>
<body>
    <!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5685GJP9"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
    <header class="header shop">
        <!-- Topbar -->
        <div class="topbar">
            <div class="container">
                <div class="row">
                    <div class="col-lg-6 col-md-12 col-12">
                        <!-- Top Left -->
                        <div class="top-left">
                            <ul class="list-main">
                                @php
                                $settings=DB::table('settings')->get();

                                @endphp
                                <li><i class="ti-headphone-alt"></i>@foreach($settings as $data) {{$data->phone}} @endforeach</li>
                                <li><i class="ti-email"></i> @foreach($settings as $data) {{$data->email}} @endforeach</li>
                            </ul>
                        </div>
                        <!--/ End Top Left -->
                    </div>




                    <div class="col-lg-6 col-md-12 col-12">
                        <!-- Top Right -->
                        <div class="right-content">
                            <ul class="list-main">
                                <li><i class="ti-location-pin"></i> <a href="{{route('order.track')}}">Track Order</a></li>
                                <li class="mobonly">
            <i class="ti-heart"></i>
            <a href="{{route('wishlist')}}">Wishlist</a>
        </li>

        <!-- Mobile Only Cart -->
        <li class="mobonly">
            <i class="ti-shopping-cart"></i>
            <a href="{{route('cart')}}">Cart</a>
        </li>
                                {{-- <li><i class="ti-alarm-clock"></i> <a href="#">Daily deal</a></li> --}}
                                @auth
                                @if(Auth::user()->role=='admin')
                                <li><i class="ti-user"></i> <a href="{{route('admin')}}" target="_blank">Dashboard</a></li>
                                @else
                                <li><i class="ti-user"></i> <a href="{{route('user')}}" target="_blank">Dashboard</a></li>
                                @endif
                                <li><i class="ti-power-off"></i> <a href="{{route('user.logout')}}">Logout</a></li>

                                @else
                                <li><i class="ti-power-off"></i><a href="{{route('login.form')}}">Login /</a> <a href="{{route('register.form')}}">Register</a></li>
                                @endauth
                            </ul>
                        </div>
                        <!-- End Top Right -->
                    </div>
                </div>
            </div>
        </div>




        <!-- End Topbar -->
        <!-- <div class="middle-inner"> -->
        <div class="middle-inner py-1">
            <div class="container">
                <div class="row">
                    <div class="col-lg-2 col-md-2 col-12">
                        <!-- Logo -->
                        <div class="logo">
                            @php
                            $settings=DB::table('settings')->get();
                            @endphp
                            <a href="{{route('home')}}"><img src="@foreach($settings as $data) {{$data->logo}} @endforeach" alt="logo" style="max-height:55px"></a>
                        </div>
                        <!--/ End Logo -->
                        <!-- Search Form -->
                        <div class="search-top">
                            <div class="top-search"><a href="#0"><i class="ti-search"></i></a></div>
                            <!-- Search Form -->
                            <div class="search-top">
                                <form class="search-form">
                                    <input type="text" placeholder="Search here..." name="search">
                                    <button value="search" type="submit"><i class="ti-search"></i></button>
                                </form>
                            </div>
                            <!--/ End Search Form -->
                        </div>
                        <!--/ End Search Form -->
                        <div class="mobile-nav"></div>
                    </div>




                    <div class="col-lg-8 col-md-7 col-12">
                        <div class="search-bar-top">
                            <div class="search-bar">

                                <select>
                                    <option value="">All Category</option>

                                    @php
                                    $mainCategories = DB::table('categories')
                                    ->where('is_parent',1)
                                    ->where('status','active')
                                    ->get();
                                    @endphp

                                    @foreach($mainCategories as $main)

                                    <option disabled style="font-weight:bold;">
                                        {{ $main->title }}
                                    </option>

                                    @php
                                    $subCategories = DB::table('categories')
                                    ->where('parent_id',$main->id)
                                    ->where('status','active')
                                    ->get();
                                    @endphp

                                    @foreach($subCategories as $sub)
                                    <option value="{{ $sub->slug }}">
                                        &nbsp;&nbsp;— {{ $sub->title }}
                                    </option>
                                    @endforeach

                                    @endforeach

                                </select>
                                <form method="POST" action="{{route('product.search')}}">
                                    @csrf
                                    <input name="search" placeholder="Search Products Here....." type="search">
                                    <button class="btnn" type="submit"><i class="ti-search"></i></button>
                                </form>

                            </div>
                        </div>
                    </div>
                    <div class="col-lg-2 col-md-3 col-12">
                        <div class="right-bar">
                            <!-- Search Form -->
                            <div class="sinlge-bar shopping">

                            <a href="{{ route('wishlist') }}" class="single-icon">
                                <i class="fa fa-heart-o"></i>
                                <span class="total-count">{{ Helper::wishlistCount() }}</span>
                            </a>

                            @auth
                                <div class="shopping-item">
                                    <div class="dropdown-cart-header">
                                        <span>{{ count(Helper::getAllProductFromWishlist()) }} Items</span>
                                        <a href="{{ route('wishlist') }}">View Wishlist</a>
                                    </div>

                                    <ul class="shopping-list">
                                        @foreach(Helper::getAllProductFromWishlist() as $data)
                                            @php $photo = explode(',', $data->product['photo']); @endphp
                                            <li>
                                                <a href="{{ route('wishlist-delete', $data->id) }}" class="remove">
                                                    <i class="fa fa-remove"></i>
                                                </a>
                                                <a class="cart-img" href="#">
                                                    <img src="{{ $photo[0] }}" alt="">
                                                </a>
                                                <h4>
                                                    <a href="{{ route('product-detail', $data->product['slug']) }}">
                                                        {{ $data->product['title'] }}
                                                    </a>
                                                </h4>
                                                <p class="quantity">
                                                    {{ $data->quantity }} x
                                                    <span class="amount">
                                                        ${{ number_format($data->price,2) }}
                                                    </span>
                                                </p>
                                            </li>
                                        @endforeach
                                    </ul>

                                    <div class="bottom">
                                        <div class="total">
                                            <span>Total</span>
                                            <span class="total-amount">
                                                ₹{{ number_format(Helper::totalWishlistPrice(),2) }}
                                            </span>
                                        </div>
                                        <a href="{{ route('cart') }}" class="btn animate">Cart</a>
                                    </div>
                                </div>
                            @endauth
                        </div>

                            {{-- <div class="sinlge-bar">
                            <a href="{{route('wishlist')}}" class="single-icon"><i class="fa fa-heart-o" aria-hidden="true"></i></a>
                        </div> --}}

                        <div class="sinlge-bar shopping">
                            <a href="{{route('cart')}}" class="single-icon"><i class="ti-bag"></i> <span class="total-count">{{Helper::cartCount()}}</span></a>
                            <!-- Shopping Item -->
                            @auth
                            <div class="shopping-item">
                                <div class="dropdown-cart-header">
                                    <span>{{count(Helper::getAllProductFromCart())}} Items</span>
                                    <a href="{{route('cart')}}">View Cart</a>
                                </div>
                                <ul class="shopping-list">

                                    @foreach(Helper::getAllProductFromCart() as $data)

                                    {{-- PRODUCT ITEM --}}
                                    @if($data->item_type === 'product' && $data->product)

                                    @php
                                    $photo = explode(',', $data->product->photo);
                                    @endphp

                                    <li>
                                        <a href="{{ route('cart-delete', $data->id) }}" class="remove">
                                            <i class="fa fa-remove"></i>
                                        </a>

                                        <a class="cart-img" href="#">
                                            <img src="{{ $photo[0] }}" alt="{{ $data->product->title }}">
                                        </a>

                                        <h4>
                                            <a href="{{ route('product-detail', $data->product->slug) }}" target="_blank">
                                                {{ $data->product->title }}
                                            </a>
                                        </h4>

                                        <p class="quantity">
                                            {{ $data->quantity }} ×
                                            <span class="amount">Rs. {{ number_format($data->price, 2) }}</span>
                                        </p>
                                    </li>

                                    {{-- SUBSCRIPTION ITEM --}}
                                    @elseif($data->item_type === 'subscription' && $data->subscription)

                                    <li>
                                        <a href="{{ route('cart-delete', $data->id) }}" class="remove">
                                            <i class="fa fa-remove"></i>
                                        </a>

                                        {{-- Optional icon instead of image --}}
                                        <div class="cart-img d-flex align-items-center justify-content-center"
                                            style="background:#f5f5f5; width:70px; height:70px;">
                                            <i class="fa fa-briefcase fa-2x"></i>
                                        </div>

                                        <h4>
                                            {{ $data->subscription->package_name }}
                                        </h4>

                                        <p class="quantity">
                                            1 ×
                                            <span class="amount">Rs. {{ number_format($data->price, 2) }}</span>
                                        </p>

                                        <small class="text-muted">Subscription Package</small>
                                    </li>

                                    @endif

                                    @endforeach

                                </ul>

                                <div class="bottom">
                                    <div class="total">
                                        <span>Total</span>
                                        <span class="total-amount">Rs. {{number_format(Helper::totalCartPrice(),2)}}</span>
                                    </div>
                                    <a href="{{route('checkout')}}" class="btn animate">Checkout</a>
                                </div>
                            </div>
                            @endauth
                            <!--/ End Shopping Item -->


                        </div>

                    </div>

                </div>
            </div>

        </div>
        </div>
        <!-- Header Inner -->
        <div class="header-inner">
            <div class="container">
                <div class="cat-nav-head">
                    <div class="row">
                        <div class="col-lg-12 col-12">
                            <div class="menu-area">
                                <!-- Main Menu -->
                                <nav class="navbar navbar-expand-lg">
                                    <div class="navbar-collapse">
                                        <div class="nav-inner">
                                            <ul class="nav main-menu menu navbar-nav">
                                                <li class="{{Request::path()=='home' ? 'active' : ''}}"><a href="{{route('home')}}">Home</a></li>
                                                <li class="{{Request::path()=='about-us' ? 'active' : ''}}"><a href="{{route('about-us')}}">About Us</a></li>
                                                <li class="@if(Request::path()=='product-grids'||Request::path()=='product-lists')  active  @endif"><a href="{{route('product-grids')}}">Products</a><span class="new">New</span></li>
                                                {{Helper::getHeaderCategory()}}
                                                <!-- <li class="{{Request::path()=='blog' ? 'active' : ''}}"><a href="{{route('blog')}}">Blog</a></li>									 -->
                                                <!--Industrial Package Section Commented by Dhaval
                                                <li class="{{ Request::path() == 'subscription' ? 'active' : '' }}">
                                                    <a href="{{ route('subscription') }}">Industrial Package</a>
                                                
                                                </li>-->

                                                <li class="{{Request::path()=='contact' ? 'active' : ''}}"><a href="{{route('contact')}}">Contact Us</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                </nav>
                                <!--/ End Main Menu -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--/ End Header Inner -->
    </header>
</body>

</html>