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

use Kirki\Field\Color;
use Kirki\Field\Dimensions;
use Kirki\Field\Radio_Buttonset;
use Kirki\Field\Select;
use Kirki\Pro\Field\Divider;

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

new Select(
	array(
		'label'       => esc_html__( 'Font Family', 'eronex' ),
		'settings'    => 'eronex_nav_menu_font_family',
		'section'     => 'eronex_header_menu',
		'default'     => 'primary',
		'choices'     => array(
			'primary'   => esc_html__( 'Primary', 'eronex' ),
			'secondary' => esc_html__( 'Secondary', 'eronex' ),
		),
	)
);

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

new Dimensions(
	array(
		'label'       => esc_html__( 'Font Size', 'eronex' ),
		'settings'    => 'eronex_nav_menu_font_size',
		'section'     => 'eronex_header_menu',
		'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 .eronex-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_menu_colors_tab_separator',
		'section'  => 'eronex_header_menu',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Radio_Buttonset(
	array(
		'label'       => esc_html__( 'Colors', 'eronex' ),
		'settings'    => 'eronex_nav_menu_colors_tab',
		'section'     => 'eronex_header_menu',
		'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_menu_color',
		'section'   => 'eronex_header_menu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-header .eronex-brand a,.eronex-navbar .eronex-menu li a',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'  => 'eronex_sticky_nav_menu_color',
		'section'   => 'eronex_header_menu',
		'default'   => '',
		'transport' => 'auto',
		'output'    => array(
			array(
				'element'  => 'header.eronex-appear .eronex-brand a,header.eronex-appear .eronex-navbar .eronex-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_menu_hover_color',
		'section'   => 'eronex_header_menu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-navbar .eronex-menu li a:hover,.eronex-navbar .eronex-menu li a:focus',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'  => 'eronex_sticky_nav_menu_hover_color',
		'section'   => 'eronex_header_menu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => 'header.eronex-appear .eronex-navbar .eronex-menu li a:hover,header.eronex-appear .eronex-navbar .eronex-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_menu_active_color',
		'section'   => 'eronex_header_menu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-navbar .eronex-menu li.current-menu-item a',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'  => 'eronex_sticky_nav_menu_active_color',
		'section'   => 'eronex_header_menu',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => 'header.eronex-appear .eronex-navbar .eronex-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_menu_tab_separator',
		'section'  => 'eronex_header_menu',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Dimensions(
	array(
		'settings'    => 'eronex_nav_menu_padding',
		'label'       => esc_html__( 'Padding', 'eronex' ),
		'section'     => 'eronex_header_menu',
		'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 .eronex-menu li.current-menu-item 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_menu_padding_separator',
		'section'  => 'eronex_header_menu',
		'choices'  => array(
			'color' => $separator_color,
		),
	)
);

new Dimensions(
	array(
		'label'       => esc_html__( 'Margin', 'eronex' ),
		'settings'    => 'eronex_nav_menu_margin',
		'section'     => 'eronex_header_menu',
		'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 .eronex-menu li.current-menu-item a',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
		'transport'   => 'auto',
		'responsive'  => true,
	)
);
