<?php
/**
 * Metabox definition for the 'restaurant_menu' post type.
 *
 * @package Sifency
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

return array(
	'menu_item_options' => array(
		'title'     => esc_html__( 'Menu Item Details', 'sifency-addons' ),
		'post_type' => 'menu',
		'context'   => 'normal',
		'priority'  => 'high',
		'class'     => 'sifency-metabox',
		'fields'    => array(
			array(
				'id'     => 'menu_item_pricing',
				'type'   => 'repeater',
				'title'  => esc_html__( 'Pricing', 'sifency-addons' ),
				'desc'   => esc_html__( 'Add one or more prices for this item (e.g., Small/Large, Cup/Bowl). If only one price, leave "Size / Type" blank.', 'sifency-addons' ),
				'fields' => array(
					array(
						'id'    => 'size',
						'type'  => 'text',
						'title' => esc_html__( 'Size / Type', 'sifency-addons' ),
					),
					array(
						'id'    => 'price',
						'type'  => 'text',
						'title' => esc_html__( 'Price', 'sifency-addons' ),
					),
				),
			),
			array(
				'id'      => 'menu_item_featured',
				'type'    => 'button_set',
				'title'   => esc_html__( 'Featured Item', 'sifency-addons' ),
				'desc'    => esc_html__( 'Set to "Yes" to highlight this item as a special or featured dish.', 'sifency-addons' ),
				'options' => array(
					'yes' => esc_html__( 'Yes', 'sifency-addons' ),
					'no'  => esc_html__( 'No', 'sifency-addons' ),
				),
				'default' => 'no',
			),
			array(
				'id'      => 'menu_item_labels',
				'type'    => 'checkbox',
				'title'   => esc_html__( 'Dietary & Allergen Labels', 'sifency-addons' ),
				'options' => array(
					'vegetarian'     => esc_html__( 'Vegetarian', 'sifency-addons' ),
					'vegan'          => esc_html__( 'Vegan', 'sifency-addons' ),
					'gluten_free'    => esc_html__( 'Gluten-Free', 'sifency-addons' ),
					'spicy'          => esc_html__( 'Spicy', 'sifency-addons' ),
					'contains_nuts'  => esc_html__( 'Contains Nuts', 'sifency-addons' ),
					'contains_dairy' => esc_html__( 'Contains Dairy', 'sifency-addons' ),
				),
			),
			array(
				'id'    => 'menu_item_calories',
				'type'  => 'number',
				'title' => esc_html__( 'Nutritional Info: Calories', 'sifency-addons' ),
				'desc'  => esc_html__( 'Enter a numerical value (e.g., 450).', 'sifency-addons' ),
			),
			array(
				'id'    => 'menu_item_protein',
				'type'  => 'number',
				'title' => esc_html__( 'Nutritional Info: Protein (g)', 'sifency-addons' ),
				'desc'  => esc_html__( 'Enter a numerical value for grams of protein.', 'sifency-addons' ),
			),
			array(
				'id'    => 'menu_item_fat',
				'type'  => 'number',
				'title' => esc_html__( 'Nutritional Info: Fat (g)', 'sifency-addons' ),
				'desc'  => esc_html__( 'Enter a numerical value for grams of fat.', 'sifency-addons' ),
			),
			array(
				'id'    => 'menu_item_sku',
				'type'  => 'text',
				'title' => esc_html__( 'SKU / POS ID', 'sifency-addons' ),
				'desc'  => esc_html__( 'Optional: For Point of Sale integration.', 'sifency-addons' ),
			),
		),
	),
);
