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

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

return [
	'menu_item_options' => [
		'title'     => esc_html__( 'Menu Item Details', 'sifency-addons' ),
		'post_type' => 'menu',
		'context'   => 'normal',
		'priority'  => 'high',
		'class'     => 'sifency-metabox',
		'fields'    => [
			[
				'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' => [
					[
						'id'    => 'size',
						'type'  => 'text',
						'title' => esc_html__( 'Size / Type', 'sifency-addons' ),
					],
					[
						'id'    => 'price',
						'type'  => 'text',
						'title' => esc_html__( 'Price', 'sifency-addons' ),
					],
				],
			],
			[
				'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' => [
					'yes' => esc_html__( 'Yes', 'sifency-addons' ),
					'no'  => esc_html__( 'No', 'sifency-addons' ),
				],
				'default' => 'no',
			],
			[
				'id'      => 'menu_item_labels',
				'type'    => 'checkbox', // The new field type we will add.
				'title'   => esc_html__( 'Dietary & Allergen Labels', 'sifency-addons' ),
				'options' => [
					'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' ),
				],
			],
			[
				'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' ),
			],
			[
				'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' ),
			],
			[
				'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' ),
			],
			[
				'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' ),
			],
		],
	],
];