<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
use EasyRestaurantManager\Services\Arr;
?>
<div class="erm_menu_container">
    <div class="easyRestaurantManager-menu-sections">
        <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>
        
        <?php foreach ($menus as $index => $section): ?>
        
            <div class="easyRestaurantManager-menu-section">
                <div class="erm_menu_item_title">
                    <p>&bull; MENU & PRICING</p>
                    <h3><?php echo esc_html(Arr::get($section, 'name', '')); ?></h3>
                </div>

                <div class="easyRestaurantManager-menu-items">
                    <?php foreach (Arr::get($section, 'items', []) as $itemIndex => $item): ?>
                        <div class="easyRestaurantManager-menu-item">
                            <div class="erm_menu_item_img">
                                <img alt="<?php echo esc_attr(Arr::get($item, 'name', '')); ?>" src="<?php echo esc_url(Arr::get($item, 'image', '')); ?>" height="60" width="60" />
                            </div>
                            <div class="easyRestaurantManager-menu-item-info">
                                <h4><?php echo esc_html(Arr::get($item, 'name', '')); ?></h4>
                                <p><?php echo wp_kses_post(Arr::get($item, 'description', '')); ?></p>
                            </div>
                            <div class="easyRestaurantManager-menu-item-right">
                                <div class="easyRestaurantManager-menu-item-price">$<?php echo esc_html(Arr::get($item, 'price', '0.00')); ?></div>
                            </div>
                        </div>
                    <?php endforeach; ?>
                </div>
            </div>
        <?php endforeach; ?> 
    </div>
</div>
