<?php
/**
 * Customizer fields for header submenu settings.
 *
 * @package Eronex
 * @since   0.0.1
 */

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

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Font Size', 'eronex' ),
		'settings'   => 'eronex_nav_submenu_font_size',
		'section'    => 'eronex_header_submenu',
		'default'    => array(
			'mobile'  => array(
				'font-size'   => '',
				'line-height' => '',
			),
			'tablet'  => array(
				'font-size'   => '',
				'line-height' => '',
			),
			'desktop' => array(
				'font-size'   => '',
				'line-height' => '',

			),
		),
		'choices'    => array(
			'labels' => array(
				'font-size'   => esc_html__( 'Font Size', 'eronex' ),
				'line-height' => esc_html__( 'Line Height', 'eronex' ),
			),
		),
		'output'     => array(
			array(
				'element'     => '.eronex-navbar ul.sub-menu li a',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);

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

new Color(
	array(
		'label'     => esc_html__( 'Background Color', 'eronex' ),
		'settings'  => 'eronex_nav_submenu_bg_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-navbar nav ul.sub-menu',
				'property' => 'background-color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Background', 'eronex' ),
		'settings'        => 'eronex_sticky_nav_submenu_bg_color',
		'section'         => 'eronex_header_submenu',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-navbar nav ul.sub-menu',
				'property' => 'background-color',
			),
		),
	)
);

new Divider(
	array(
		'settings'        => 'eronex_nav_submenu_colors_tab_separator',
		'section'         => 'eronex_header_submenu',
		'choices'         => array(
			'color' => $separator_color,
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '==',
				'value'    => true,
			),
		),
	)
);

new Radio_Buttonset(
	array(
		'label'     => esc_html__( 'Text Colors', 'eronex' ),
		'settings'  => 'eronex_nav_submenu_colors_tab',
		'section'   => 'eronex_header_submenu',
		'default'   => 'normal',
		'transport' => 'auto',
		'choices'   => array(
			'normal' => esc_html__( 'Normal', 'eronex' ),
			'hover'  => esc_html__( 'Hover', 'eronex' ),
			'active' => esc_html__( 'Active', 'eronex' ),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Text Color', 'eronex' ),
		'settings'  => 'eronex_nav_submenu_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-navbar ul.sub-menu li a',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'  => 'eronex_sticky_nav_submenu_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => 'header.eronex-appear .eronex-navbar ul.sub-menu li a',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Text Color', 'eronex' ),
		'settings'  => 'eronex_nav_submenu_hover_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-navbar ul.sub-menu li a:hover,.eronex-navbar ul.sub-menu li a:focus',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'  => 'eronex_sticky_nav_submenu_hover_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => 'header.eronex-appear .eronex-navbar ul.sub-menu li a:hover,header.eronex-appear .eronex-navbar ul.sub-menu li a:focus',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Text Color', 'eronex' ),
		'settings'  => 'eronex_nav_submenu_active_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-navbar ul.sub-menu li.current-menu-item a',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'  => 'eronex_sticky_nav_submenu_active_color',
		'section'   => 'eronex_header_submenu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => 'header.eronex-appear .eronex-navbar ul.sub-menu li.current-menu-item a',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

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

new Dimensions(
	array(
		'settings'   => 'eronex_nav_submenu_padding',
		'label'      => esc_html__( 'Padding', 'eronex' ),
		'section'    => 'eronex_header_submenu',
		'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-navbar ul.sub-menu li a',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'  => 'auto',
		'responsive' => true,
	)
);

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Margin', 'eronex' ),
		'settings'   => 'eronex_nav_submenu_margin',
		'section'    => 'eronex_header_submenu',
		'default'    => array(
			'mobile'  => array(
				'margin-top'    => '',
				'margin-right'  => '',
				'margin-bottom' => '',
				'margin-left'   => '',
			),
			'tablet'  => array(
				'margin-top'    => '',
				'margin-right'  => '',
				'margin-bottom' => '',
				'margin-left'   => '',
			),
			'desktop' => array(
				'margin-top'    => '',
				'margin-right'  => '',
				'margin-bottom' => '',
				'margin-left'   => '',

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