<section class="page-hero">
    <div class="container page-hero-inner">
        <div>
            <span class="eyebrow">Hot, fresh, yours</span>
            <h1>Order Online</h1>
            <p>Choose your favorites and we will get the kitchen moving.</p>
        </div>
        <form class="menu-search" action="<?= e(url('/menu')) ?>" method="get">
            <label for="menu-query">Search the menu</label>
            <div class="search-row">
                <input id="menu-query" type="search" name="q" value="<?= e($query) ?>" placeholder="Burger, chicken, fries...">
                <button class="button" type="submit">Search</button>
            </div>
        </form>
    </div>
</section>

<div class="category-jump">
    <div class="container">
        <?php foreach ($categories as $category): ?>
            <a href="#<?= e($category['slug']) ?>"><?= e($category['name']) ?></a>
        <?php endforeach; ?>
    </div>
</div>

<div class="container menu-page section">
    <?php if (!$categories): ?>
        <div class="empty-state">
            <span class="eyebrow">No match yet</span>
            <h2>We could not find “<?= e($query) ?>”</h2>
            <p>Try another search or browse the full menu.</p>
            <a class="button" href="<?= e(url('/menu')) ?>">Clear Search</a>
        </div>
    <?php endif; ?>
    <?php foreach ($categories as $category): ?>
        <section class="menu-category" id="<?= e($category['slug']) ?>">
            <div class="menu-category-heading">
                <div>
                    <span class="category-index"><?= str_pad((string) $category['display_order'], 2, '0', STR_PAD_LEFT) ?></span>
                    <h2><?= e($category['name']) ?></h2>
                </div>
                <p><?= e($category['description']) ?></p>
            </div>
            <div class="menu-grid">
                <?php foreach ($category['items'] as $item): ?>
                    <?php \FatBottom\Core\View::partial('partials/menu-card', compact('item')); ?>
                <?php endforeach; ?>
            </div>
        </section>
    <?php endforeach; ?>
</div>
