<?php
/**
 * Customizer fields for hamburger panel layout settings.
 *
 * @package Eronex
 * @since   0.0.1
 */

use Kirki\Field\Image;
use Kirki\Field\Background;
use Kirki\Field\Color;
use Kirki\Field\Dimension;
use Kirki\Field\Dimensions;
use Kirki\Field\Select;
use Kirki\Pro\Field\Divider;
use Kirki\Pro\Field\HeadlineToggle;

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

new Select(
	array(
		'label'       => esc_html__( 'Layout', 'eronex' ),
		'settings'    => 'eronex_hamburger_style',
		'section'     => 'eronex_hamburger_layout',
		'default'     => '1',
		'choices'     => array(
			'1' => esc_html__( 'Style 1', 'eronex' ),
			'2' => esc_html__( 'Style 2', 'eronex' ),
			'3' => esc_html__( 'Style 3', 'eronex' ),
			'4' => esc_html__( 'Style 4', 'eronex' ),
			'5' => esc_html__( 'Style 5', 'eronex' ),
		),
	)
);

new Divider(
	array(
		'settings'        => 'eronex_hamburger_width_separator',
		'section'         => 'eronex_hamburger_layout',
		'choices'         => array(
			'color' => $separator_color,
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_hamburger_style',
				'operator' => 'contains',
				'value'    => array( '1', '2' ),
			),
		),
	)
);

new Dimension(
	array(
		'label'           => esc_html__( 'Width', 'eronex' ),
		'settings'        => 'eronex_hamburger_width',
		'section'         => 'eronex_hamburger_layout',
		'transport'       => 'auto',
		'responsive'      => true,
		'default'         => array(
			'desktop' => '',
			'tablet'  => '',
			'mobile'  => '',
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_hamburger_style',
				'operator' => 'contains',
				'value'    => array( '1', '2' ),
			),
		),
		'output'          => array(
			array(
				'element'     => '.eronex-hamburger-layout-1 .eronex-hamburger-menu-wrapper,.eronex-hamburger-layout-2 .eronex-hamburger-menu-wrapper',
				'property'    => 'width',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_hamburger_overlay_separator',
		'section'  => 'eronex_hamburger_layout',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Color(
	array(
		'label'       => esc_html__( 'Overlay', 'eronex' ),
		'settings'    => 'eronex_hamburger_overlay',
		'section'     => 'eronex_hamburger_layout',
		'default'     => '',
		'transport'   => 'auto',
		'choices'     => array(
			'alpha' => true,
		),
		'output'      => array(
			array(
				'element'  => '.eronex-hamburger-overlay',
				'property' => 'background-color',
			),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_hamburger_bg_separator',
		'section'  => 'eronex_hamburger_layout',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Background(
	array(
		'label'       => esc_html__( 'Background', 'eronex' ),
		'settings'    => 'eronex_hamburger_bg',
		'section'     => 'eronex_hamburger_layout',
		'transport'   => 'auto',
		'default'     => array(
			'background-color'      => '',
			'background-image'      => '',
			'background-repeat'     => '',
			'background-position'   => '',
			'background-size'       => '',
			'background-attachment' => '',
		),
		'output'      => array(
			array(
				'element' => '.eronex-hamburger-menu-wrapper',
			),
		),
	)
);

new Divider(
	array(
		'settings' => 'eronex_hamburger_padding_separator',
		'section'  => 'eronex_hamburger_layout',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Dimensions(
	array(
		'label'       => esc_html__( 'Padding', 'eronex' ),
		'settings'    => 'eronex_hamburger_padding',
		'section'     => 'eronex_hamburger_layout',
		'default'     => array(
			'mobile'  => array(
				'padding-top'    => '',
				'padding-right'  => '',
				'padding-bottom' => '',
				'padding-left'   => '',
			),
			'tablet'  => array(
				'padding-top'    => '',
				'padding-right'  => '',
				'padding-bottom' => '',
				'padding-left'   => '',
			),
			'desktop' => array(
				'padding-top'    => '',
				'padding-right'  => '',
				'padding-bottom' => '',
				'padding-left'   => '',

			),
		),
		'choices'     => array(
			'labels' => array(
				'padding-top'    => esc_html__( 'Top', 'eronex' ),
				'padding-right'  => esc_html__( 'Right', 'eronex' ),
				'padding-bottom' => esc_html__( 'Bottom', 'eronex' ),
				'padding-left'   => esc_html__( 'Left', 'eronex' ),
			),
		),
		'output'      => array(
			array(
				'element'     => '.eronex-hamburger-wrapper .eronex-hamburger-menu-wrapper',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'   => 'auto',
		'responsive'  => true,
	)
);
