<header class="sticky top-0 z-50 bg-white border-b-2 border-blinkit-green shadow-md">
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <div class="flex items-center justify-between h-16 sm:h-18">
            <a href="<?php echo e(route('home')); ?>" class="flex items-center gap-3 group">
                <div class="w-10 h-10 rounded-xl bg-gradient-to-br from-blinkit-yellow to-blinkit-green flex items-center justify-center shadow-blinkit group-hover:scale-110 transition-transform">
                    <i class="fas fa-shopping-basket text-white text-lg"></i>
                </div>
                <span class="text-2xl font-black text-gray-900 hidden sm:block">
                    <span class="text-blinkit-yellow">Blink</span><span class="text-blinkit-green">it</span>
                </span>
                <span class="text-xl font-bold text-blinkit-green sm:hidden"><?php echo e($store_name ?? 'Store'); ?></span>
            </a>

            
            <form action="<?php echo e(route('products.index')); ?>" method="GET" class="hidden md:flex flex-1 max-w-2xl mx-6">
                <div class="relative w-full">
                    <input type="search" name="search" value="<?php echo e(request('search')); ?>"
                        placeholder="Search for products..."
                        class="input py-3 pl-12 pr-4 rounded-xl border-2 border-gray-200 focus:border-blinkit-green w-full">
                    <i class="fas fa-search absolute left-4 top-1/2 -translate-y-1/2 text-gray-400"></i>
                </div>
                <button type="submit" class="ml-2 bg-blinkit-green hover:bg-blinkit-green-dark text-white px-6 py-3 rounded-xl font-semibold shadow-md hover:shadow-lg transition-all">
                    Search
                </button>
            </form>

            <nav class="flex items-center gap-3 sm:gap-4">
                <a href="<?php echo e(route('categories.index')); ?>" class="p-2.5 text-gray-700 hover:text-blinkit-green transition rounded-lg hover:bg-gray-50 hidden sm:flex items-center gap-2" title="Categories">
                    <i class="fas fa-th-large"></i>
                    <span class="font-medium">Categories</span>
                </a>
                <a href="<?php echo e(route('cart.show')); ?>" class="relative p-2.5 text-gray-700 hover:text-blinkit-green transition rounded-lg hover:bg-gray-50" title="Cart">
                    <i class="fas fa-shopping-cart text-xl"></i>
                    <?php $cartCount = 0; ?>
                    <?php if(auth()->guard()->check()): ?>
                        <?php $cart = \App\Models\Cart::where('user_id', auth()->id())->with('items')->first(); $cartCount = $cart ? $cart->items->sum('quantity') : 0; ?>
                    <?php else: ?>
                        <?php $cart = \App\Models\Cart::where('session_id', session()->getId())->with('items')->first(); $cartCount = $cart ? $cart->items->sum('quantity') : 0; ?>
                    <?php endif; ?>
                    <?php if($cartCount > 0): ?>
                        <span class="absolute -top-1 -right-1 bg-blinkit-yellow text-gray-900 text-xs font-black rounded-full w-6 h-6 flex items-center justify-center shadow-md border-2 border-white"><?php echo e($cartCount > 99 ? '99+' : $cartCount); ?></span>
                    <?php endif; ?>
                </a>
                <?php if(auth()->guard('web')->check()): ?>
                    <div class="relative group">
                        <button type="button" class="p-2.5 text-gray-700 hover:text-blinkit-green transition rounded-lg hover:bg-gray-50 flex items-center gap-2">
                            <i class="fas fa-user-circle text-xl"></i>
                            <span class="hidden sm:inline text-sm font-semibold"><?php echo e(Str::limit(auth()->guard('web')->user()->name, 15)); ?></span>
                            <i class="fas fa-chevron-down text-xs hidden sm:inline"></i>
                        </button>
                        <div class="absolute right-0 mt-2 w-56 bg-white rounded-xl shadow-card-hover border-2 border-gray-100 py-2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50">
                            <a href="<?php echo e(route('profile.index')); ?>" class="block px-4 py-2.5 text-gray-700 hover:bg-blinkit-green hover:text-white transition font-medium">
                                <i class="fas fa-user mr-2"></i>Profile
                            </a>
                            <a href="<?php echo e(route('orders.index')); ?>" class="block px-4 py-2.5 text-gray-700 hover:bg-blinkit-green hover:text-white transition font-medium">
                                <i class="fas fa-box mr-2"></i>Orders
                            </a>
                            <div class="border-t border-gray-100 my-1"></div>
                            <form method="POST" action="<?php echo e(route('logout')); ?>" class="block">
                                <?php echo csrf_field(); ?>
                                <button type="submit" class="w-full text-left px-4 py-2.5 text-gray-700 hover:bg-red-50 hover:text-red-600 transition font-medium">
                                    <i class="fas fa-sign-out-alt mr-2"></i>Logout
                                </button>
                            </form>
                        </div>
                    </div>
                <?php else: ?>
                    <a href="<?php echo e(route('login')); ?>" class="btn-primary text-sm py-2.5 px-4 hidden sm:inline-block">Login</a>
                    <a href="<?php echo e(route('register')); ?>" class="btn-yellow text-sm py-2.5 px-4 hidden sm:inline-block">Sign Up</a>
                    <a href="<?php echo e(route('login')); ?>" class="p-2.5 text-gray-700 hover:text-blinkit-green sm:hidden">
                        <i class="fas fa-user-circle text-xl"></i>
                    </a>
                <?php endif; ?>
            </nav>
        </div>
        
        <div class="md:hidden pb-3">
            <form action="<?php echo e(route('products.index')); ?>" method="GET" class="flex gap-2">
                <div class="relative flex-1">
                    <input type="search" name="search" value="<?php echo e(request('search')); ?>"
                        placeholder="Search products..."
                        class="input py-2.5 pl-10 pr-4 rounded-xl border-2">
                    <i class="fas fa-search absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
                </div>
                <button type="submit" class="bg-blinkit-green text-white px-4 py-2.5 rounded-xl shadow-md">
                    <i class="fas fa-search"></i>
                </button>
            </form>
        </div>
    </div>
</header>
<?php /**PATH D:\laragon\www\ReactNative\grocery-api\resources\views/store/partials/header.blade.php ENDPATH**/ ?>