{{-- Header Public Réutilisable --}}
<header class="main-header">
    <nav class="navbar navbar-expand-lg">
        <div class="container">
            {{-- Logo --}}
            <a class="navbar-brand site-logo" href="{{ route('home') }}">
                @if($siteLogo)
                    <img src="{{ $siteLogo }}" alt="{{ $siteName }}" height="{{ $siteLogoHeight ?? 40 }}" class="logo-img">
                @endif
                @if($showLogoText)
                    <span class="logo-text">{{ $siteName }}</span>
                @endif
            </a>
            
            {{-- Mobile Toggle --}}
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            
            {{-- Navigation --}}
            <div class="collapse navbar-collapse" id="mainNav">
                <ul class="navbar-nav ms-auto">
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('home') ? 'active' : '' }}" href="{{ route('home') }}">Accueil</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('shop.*') ? 'active' : '' }}" href="{{ route('shop.index') }}">Boutique</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('about') ? 'active' : '' }}" href="{{ route('about') }}">À Propos</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('contact') ? 'active' : '' }}" href="{{ route('contact') }}">Contact</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {{ request()->routeIs('blog') ? 'active' : '' }}" href="{{ route('blog') }}">Blog</a>
                    </li>
                    
                    @guest
                        <li class="nav-item">
                            <a class="nav-link btn btn-outline-primary ms-lg-2" href="{{ route('login') }}">Connexion</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link btn btn-primary ms-lg-2" href="{{ route('register') }}">Inscription</a>
                        </li>
                    @else
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle" href="#" data-bs-toggle="dropdown">
                                {{ auth()->user()->name }}
                            </a>
                            <ul class="dropdown-menu dropdown-menu-end">
                                <li><a class="dropdown-item" href="{{ route('member.dashboard') }}">Mon Espace</a></li>
                                <li><hr class="dropdown-divider"></li>
                                <li>
                                    <form action="{{ route('logout') }}" method="POST">
                                        @csrf
                                        <button type="submit" class="dropdown-item">Déconnexion</button>
                                    </form>
                                </li>
                            </ul>
                        </li>
                    @endguest
                </ul>
            </div>
        </div>
    </nav>
</header>

<style>
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.main-header .navbar {
    padding: 0.8rem 0;
}

.main-header .site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color, #7c3aed);
    font-weight: 700;
    font-size: 1.4rem;
}

.main-header .site-logo .logo-img {
    margin-right: 10px;
    max-height: 50px;
    object-fit: contain;
}

.main-header .site-logo .logo-text {
    background: linear-gradient(135deg, var(--primary-color, #7c3aed), var(--accent-color, #c084fc));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-header .nav-link {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s;
}

.main-header .nav-link:hover,
.main-header .nav-link.active {
    color: var(--primary-color, #7c3aed);
}

@media (max-width: 991px) {
    .main-header .navbar-collapse {
        background: white;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 10px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
}
</style>
