{{-- Main navigation, laid out in the header's flex row: [desktop links, centred] [search + demo button + menu button]. Items come from config('site.nav'). The desktop bar shows from 1280px; below that the menu button opens the mobile menu. Desktop: small centred links on the frosted bar. An item with a menu opens a panel that grows down from the bar, full width, while the page behind is dimmed (the veil lives in header.blade.php). The panel comes from the item's 'mega' (columns of links and an optional highlight) or, failing that, from its flat 'children'. The mobile menu and the search use App\Support\Nav::children(), i.e. the first mega column, so those links are written once. It opens on hover and on keyboard focus, with no JavaScript. Every hover/focus class is tied to the named group "item" (this item) so one open menu never opens another. The mobile menu uses
. --}} @php $isActive = fn (array $item) => request()->routeIs(...($item['active'] ?? [$item['route']])); $cta = config('site.cta_button'); $productOf = fn (array $child) => isset($child['product']) ? config('products.items.'.$child['product']) : null; $linkOf = fn (array $child) => isset($child['product']) ? route('products.show', $child['product']) : route($child['route'], $child['params'] ?? []).(isset($child['fragment']) ? '#'.$child['fragment'] : ''); $menuOf = fn (array $item) => $item['mega'] ?? (! empty($item['children']) ? ['columns' => [['title' => $item['label'], 'links' => $item['children']]]] : null); // A panel's columns fade up one after the other once it opens; --d is each column's delay (none when closing). $rise = 'translate-y-2 opacity-0 transition duration-300 ease-out [transition-delay:0ms] motion-reduce:transition-none motion-reduce:translate-y-0 ' .'group-hover/item:translate-y-0 group-hover/item:opacity-100 group-hover/item:[transition-delay:var(--d)] ' .'group-focus-within/item:translate-y-0 group-focus-within/item:opacity-100 group-focus-within/item:[transition-delay:var(--d)]'; @endphp {{-- Right side: search, demo button (desktop), menu button (below 1280px). Buttons are at least 40px square. --}}
{{-- Mobile menu (drops down below the header bar) --}}