<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

use EasyRestaurantManager\Services\Arr;
$classicMenus = [];
foreach ($menus as $menuKey => $menu ) {
    foreach ($menu['items'] as $menuItems) {
        $menuItems['category'] = $menu['name'];
        $classicMenus[] = $menuItems;
    }
}
?>
<div class="erm_classic_temp-menu">
    <div class="easyRestaurantManager-menu-title">
        <h2><?php echo esc_html(Arr::get($settings, 'menus_title')); ?></h2>
        <p><?php echo esc_html(Arr::get($settings, 'menus_short_desc')); ?></p>
    </div>
    <div class="erm_classic_temp-tabs">
        <?php foreach($categories as $index=>$category):?>
        <span class="erm_classic_temp-tab <?php echo $index == 0 ? 'erm_classic_tem_active' : '' ?>"
            data-category_id="<?php echo esc_attr( $category->id ) ?>"
        >
            <?php echo esc_html( $category->name ) ?>
        </span>
        <?php endforeach; ?>
    </div>
    <div class="erm_classic_temp-items">
        <?php foreach($classicMenus as $classicMenu): ?>
        <div class="erm_classic_temp-item"  data-category_id="<?php echo esc_attr( Arr::get($classicMenu, 'category_id') ) ?>">
            <img src="<?php echo esc_attr(Arr::get($classicMenu, 'image')) ?>" alt="Fish Fry" class="erm_classic_temp-item-image" />
            <div class="erm_classic_temp-item-details" style="width: 100%;">
                <div class="erm_classic_temp-item-title">
                    <h3><?php echo esc_html(Arr::get($classicMenu, 'name')) ?></h3>
                    <hr>
                    <span class="erm_price"><?php echo esc_html(Arr::get($classicMenu, 'price')) ?></span>
                </div>
                <p class="erm_classic_temp-item-description"><?php echo wp_kses_post(Arr::get($classicMenu, 'description')) ?></p>
            </div>
        </div>
        <?php endforeach; ?>
        <!-- More items can be added here in the same structure -->
    </div>
</div>