<div class="navs-container navbar-fixed-top">
    <div class="top_nav bg-white">
        <div class="container">
            <div class="in-flex">
                <a class="navbar-brand" href="{{route('home')}}">
                    <img src="{{url('')}}/assets/web/images/logo.png" class="logo" alt=""/>
                </a>
                <div class="nav_end d-flex flex-column">
                    <div class="top_icons align-items-center d-flex mb-3 justify-content-end w-100">
                        <div class="dropdown me-4">
                            <button class="currency_butn text-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
                                <img src="{{asset($currency->image)}}" class="icon me-2" alt=""/>  {{$currency->name}}
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
                                @foreach($header_countries as $row)
                                    @if($currency->id != $row->id)
                                        <li>
                                            <a class="dropdown-item" href="{{route('currency.set',$row->id)}}">{{$row->name}}</a>
                                        </li>
                                    @endif
                                @endforeach
                            </ul>
                        </div>
                        <div class="search_box">
                            <form class="form" action="{{route('search')}}">
                                <div class="form-group mb-0">
                                    <input name="product" onkeyup="productSearch(this)" type="text" @isset($request) value="{{$request->product}}" @endif class="form-control" id="searchInput" placeholder=" {{__('web.what_you_looking_for')}} "/>
                                    <button class="search_butn" id="searchButn" type="button"><i class="fal fa-search mx-0"></i></button>
                                    <div class="prodItemsBox" id="sampleSearch">
                                        
                                    </div>
                                </div>
                            </form>
                        </div>

                        @if(getCurrentLocale() == 'ar')
                            <a href="{{LaravelLocalization::getLocalizedUrl('en')}}" class="lng text-dark ps-3 ms-3 border-start border-1"> EN </a>
                        @else
                            <a href="{{LaravelLocalization::getLocalizedUrl('ar')}}" class="lng text-dark ps-3 ms-3 border-start border-1"> AR </a>
                        @endif

                    </div>
                    <div class="bottom_icons d-flex align-items-center justify-content-end">
                        <div class="dropdown me-2">
                            <button class="butn sm_butn primary_butn rounded-circle color-primary" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
                                <i class="fal fa-user mx-0"></i>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
                                @if(\Auth::user())
                                    <li><a class="dropdown-item" href="{{route('profile')}}">{{__('web.profile')}}</a></li>
                                    <li><a class="dropdown-item" href="{{route('logout')}}">{{__('web.logout')}}</a></li>
                                @else
                                    <li><a class="dropdown-item" href="{{route('login')}}">{{__('web.login')}}</a></li>
                                    <li><a class="dropdown-item" href="{{route('regist')}}">{{__('web.new_acc')}}</a></li>
                                @endif
                            </ul>
                        </div>
                        <a href="{{route('product.carts')}}" class="butn sm_butn primary_butn rounded-circle color-primary me-2">
                            <i class="fal fa-shopping-cart mx-0"></i>
                            <span id='cart_count' @if(!$count_cart) style="display:none" @endif class="num">{{$count_cart}}</span>
                        </a>
                        <a href="{{route('product.favorites')}}" class="butn sm_butn primary_butn rounded-circle color-primary me-2">
                            <i class="fal fa-heart mx-0"></i>
                            <span id='fav_count' @if(!$count_fav) style="display:none" @endif class="num">{{$count_fav}}</span>
                        </a>
                        @if(\Auth::user())
                            <a href="{{route('profile')}}?notification=on" class="butn sm_butn primary_butn rounded-circle color-primary me-0">
                                <i class="fal fa-bell mx-0"></i>
                                @if($count_notifications)<span class="num">{{$count_notifications}}</span>@endif
                            </a>
                        @endif
                    </div>

                </div>
            </div>
        </div>
    </div>
    <!--Start main-nav-->
    <nav class="navbar navbar-expand-lg navbar-light bg-dark">
        <div class="container">
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <form>
                    <ul class="navbar-nav  mb-2 mb-lg-0">
                        <li class="nav-item ">
                            <a class="nav-link active" href="{{route('home')}}">{{__('web.home')}}</a>
                        </li>
                        <li class="nav-item ">
                            <a class="nav-link" href="{{route('aboutus')}}">{{__('web.about_us')}}</a>
                        </li>
                        @foreach($nav_categories as $category)
                            @if(count($category->models) > 0)
                                <li class="nav-item has_dropdown">
                                    <a class="nav-link" style="cursor: pointer">{{$category->name}}</a>
                                    <div class="drop_down d-flex flex-wrap ">
                                        @foreach($category->models as $model)
                                            <a href="{{route('filter',$model->id)}}" class="link_item">
                                                <img src="{{asset($model->image)}}" class="categ_img" alt=""/>
                                                {{$model->descriptions()->name}}
                                            </a>
                                        @endforeach
                                    </div>
                                </li>
                            @else
                                @if(count($category->sampleProduct) == 0)
                                    <li class="nav-item ">
                                        <a class="nav-link" href="{{route('filter',$category->id)}}">{{$category->name}}</a>
                                    </li>
                                @else
                                    <li class="nav-item has_dropdown has_search_dropdown">
                                        <a class="nav-link" href="#">{{$category->name}}</a>
                                        <div class="prodItemsBox">
                                            @foreach($category->sampleProduct as $product)
                                                @include('web.pages.components.product.navbar',['product' => $product])
                                            @endforeach
                                            <a href="{{route('filter',$category->id)}}" class="butn primary_butn w-100 more_butn"><b>{{__('web.see_more')}}</b></a>
                                        </div>

                                    </li>
                                @endif
                            @endif
                        @endforeach
                        @if(!\Auth::user())
                            <li class="nav-item ">
                                <a class="nav-link" href="{{route('regist.company')}}">{{__('web.regist_company')}}</a>
                            </li>
                        @endif
                        <li class="nav-item ">
                            <a class="nav-link" href="{{route('contactus')}}">{{__('web.contactus')}}</a>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </nav>
</div>
