<nav class="bg-white">
    <div class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8">
        <div class="relative flex h-16 items-center justify-between">
            <div class="absolute inset-y-0 left-0 flex items-center sm:hidden">
                <button type="button" class="inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white" aria-controls="mobile-menu" aria-expanded="false">
                    <span class="sr-only">Page d'accueil</span>
                    <svg class="block h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
                    </svg>
                    <svg class="hidden h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
                    </svg>
                </button>
            </div>
            <div class="flex flex-1 items-center justify-center sm:items-stretch sm:justify-start">
                <div class="flex flex-shrink-0 items-center">
                    <img class="block h-8 w-auto lg:hidden" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=500" alt="Your Company">
                    <img class="hidden h-8 w-auto lg:block" src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=500" alt="Your Company">
                </div>
                <div class="hidden sm:ml-6 sm:block">
                    <div class="flex space-x-4">
                        <a href="/" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Accueil</a>
                        <a href="/produits" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Produits</a>
                        <%if(user){%>
                            <a href="/commandes" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Mes commandes</a>
                            <a href="/logout" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Se déconnecter</a>
                            <%if(user.isAdmin){%>
                                <a href="/dashboard" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Dashboard</a>
                            <%}%>
                        <%}%>
                    </div>
                </div>
            </div>
            <div class="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0">
                <div class="relative ml-3">
                    <div>
                        <%if(user){%>
                        <a href="/profile" class="flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800"  aria-expanded="false" aria-haspopup="true">
                            <span class="sr-only">Mon profil</span>
                            <img class="h-8 w-8 rounded-full" src="https://www.pngall.com/wp-content/uploads/5/User-Profile-PNG.png" alt="">
                        </a>
                        <%}else{%>
                                <a href="/login" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Se connecter</a>
                        <%}%>
                    </div>
                </div>
                <div class="flex justify-center items-center ml-3 mb-3">
                    <div class="relative py-2">
                        <a href="/panier">
                            <% if(panier) {%>
                            <div class="t-0 absolute left-3">
                                <p class="flex h-2 w-2 items-center justify-center rounded-full bg-red-500 p-3 text-xs text-white"><%- panier.length%></p>
                            </div>
                            <%}%>
                            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="file: mt-4 h-6 w-6">
                                <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 00-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 00-16.536-1.84M7.5 14.25L5.106 5.272M6 20.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm12.75 0a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
                            </svg>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="sm:hidden" id="mobile-menu">
        <div class="space-y-1 px-2 pb-3 pt-2">
            <a href="/" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Accueil</a>
            <a href="/produits" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Produits</a>
            <%if(user){%>
            <a href="/commandes" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Mes commandes</a>
            <a href="/logout" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Se déconnecter</a>
            <%if(user.isAdmin){%>
                <a href="/dashboard" class="text-grey-300 hover:bg-blue-700 hover:text-white rounded-md px-3 py-2 text-sm font-medium">Dashboard</a>
            <%}%>
            <%}%>
        </div>
    </div>
</nav>