<header>
    <nav class="navbar navbar-expand-lg p-0">
        <div class="container-fluid font-brand">
            <a class="navbar-brand p-0" href="/">
                <img src="/images/1.png" alt="Logo Petland Resort" class="d-inline-block align-text-top w-25">
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#myNavbar" aria-controls="myNavbar" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="myNavbar">
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                    <li class="nav-item">
                        <% if (user == null) { %>
                            <a class="nav-link active" aria-current="page" href="/">Inicio</a>
                        <%} else { %>
                            <a class="nav-link active" aria-current="page" href="/home">Inicio</a>    
                        <% } %>
                    </li>
                    <li class="nav-item">
                        <% if (user == null) { %>
                            <a class="nav-link" href="/reservations/addReservation">Reservas</a>
                        <%} else { %>
                            <% if (user.role == 'client') { %>
                                <a class="nav-link" href="/reservations">Reservas</a>
                            <%} else { %>
                                <a class="nav-link" href="/reservations/listReservations">Reservas</a>
                            <% } %>
                        <% } %>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/rooms">Habitaciones</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/services">Servicios</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link me-5" href="/aboutus">Nosotros</a>
                    </li>
                </ul>
            </div>
            <% if (user == null) { %>
                <button type="button" class="nav-link ms-5 d-flex" data-bs-toggle="modal" data-bs-target="#popup-iniciarSesion"><i class="bi bi-person-circle me-1"></i>Entrar</button>
                <%- include('../partials/login-popup'); %>
            <%} else { %>
                <div class="dropdown">
                    <button type="button" class="nav-link ms-5 d-flex" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-person-circle me-1"></i><%= user.name %></button>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="/users/editUser">Editar perfil</a></li>
                        <li><a class="dropdown-item text-danger" href="/users/logout">Cerrar sesi√≥n</a></li>
                    </ul>
                </div>
            <% } %>
        </div>
    </nav>
</header>
<%- include('../partials/messages'); %>