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

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

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;

new Select(
	array(
		'label'           => esc_html__( 'Show On', 'eronex' ),
		'settings'        => 'eronex_hamburger_show_on',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => 'tablet',
		'choices'         => array(
			'desktop' => esc_html__( 'Desktop', 'eronex' ),
			'tablet'  => esc_html__( 'Tablet', 'eronex' ),
			'mobile'  => esc_html__( 'Mobile', 'eronex' ),
		),
	)
);

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

new Select(
	array(
		'label'    => esc_html__( 'Toggle Icon', 'eronex' ),
		'settings' => 'eronex_hamburger_toggle_icon',
		'section'  => 'eronex_hamburger_toggle',
		'default'  => 'bars-3',
		'choices'  => array(
			'bars-3'              => esc_html__( 'Icon 1', 'eronex' ),
			'bars-2'              => esc_html__( 'Icon 2', 'eronex' ),
			'bars-3-bottom-left'  => esc_html__( 'Icon 3', 'eronex' ),
			'bars-3-bottom-right' => esc_html__( 'Icon 4', 'eronex' ),
			'bars-3-center-left'  => esc_html__( 'Icon 5', 'eronex' ),
		),
	)
);

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

new Dimension(
	array(
		'label'      => esc_html__( 'Icon Size', 'eronex' ),
		'settings'   => 'eronex_hamburger_toggle_size',
		'section'    => 'eronex_hamburger_toggle',
		'transport'  => 'auto',
		'responsive' => true,
		'default'    => array(
			'desktop' => '',
			'tablet'  => '',
			'mobile'  => '',
		),
		'output'     => array(
			array(
				'element'     => '.eronex-hamburger-toggle-btn > i',
				'property'    => 'font-size',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
	)
);

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

new Dimension(
	array(
		'label'      => esc_html__( 'Background Size', 'eronex' ),
		'settings'   => 'eronex_hamburger_toggle_bg_size',
		'section'    => 'eronex_hamburger_toggle',
		'transport'  => 'auto',
		'responsive' => true,
		'default'    => array(
			'desktop' => '',
			'tablet'  => '',
			'mobile'  => '',
		),
		'output'     => array(
			array(
				'element'     => '.eronex-hamburger-toggle-btn',
				'property'    => 'height',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
			array(
				'element'     => '.eronex-hamburger-toggle-btn',
				'property'    => 'width',
				'media_query' => array(
					'desktop' => $desktop_media_query,
					'tablet'  => $tablet_media_query,
					'mobile'  => $mobile_media_query,
				),
			),
		),
	)
);

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

new Radio_Buttonset(
	array(
		'label'     => esc_html__( 'Colors', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_colors_tab',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => 'normal',
		'transport' => 'auto',
		'choices'   => array(
			'normal' => esc_html__( 'Normal', 'eronex' ),
			'hover'  => esc_html__( 'Hover', 'eronex' ),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Icon Color', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_color',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-hamburger-toggle-btn',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Background Color', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_bg',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-hamburger-toggle-btn',
				'property' => 'background-color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Border Color', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_border_color',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-hamburger-toggle-btn',
				'property' => 'border-color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'        => 'eronex_sticky_hamburger_toggle_color',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-hamburger-toggle-btn',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Background', 'eronex' ),
		'settings'        => 'eronex_sticky_hamburger_toggle_bg',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-hamburger-toggle-btn',
				'property' => 'background-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Border', 'eronex' ),
		'settings'        => 'eronex_sticky_hamburger_toggle_border_color',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-hamburger-toggle-btn',
				'property' => 'border-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Icon Color', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_hover_color',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-hamburger-toggle-btn:hover,.eronex-hamburger-toggle-btn:focus',
				'property' => 'color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Background Color', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_hover_bg',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-hamburger-toggle-btn:hover,.eronex-hamburger-toggle-btn:focus',
				'property' => 'background-color',
			),
		),
	)
);

new Color(
	array(
		'label'     => esc_html__( 'Border Color', 'eronex' ),
		'settings'  => 'eronex_hamburger_toggle_hover_border',
		'section'   => 'eronex_hamburger_toggle',
		'default'   => '',
		'transport' => 'auto',
		'choices'   => array(
			'alpha' => true,
		),
		'output'    => array(
			array(
				'element'  => '.eronex-hamburger-toggle-btn:hover,.eronex-hamburger-toggle-btn:focus',
				'property' => 'border-color',
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Color', 'eronex' ),
		'settings'        => 'eronex_sticky_hamburger_toggle_hover_color',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-hamburger-toggle-btn:hover,header.eronex-appear .eronex-hamburger-toggle-btn:focus',
				'property' => 'color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Background', 'eronex' ),
		'settings'        => 'eronex_sticky_hamburger_toggle_hover_bg',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-hamburger-toggle-btn:hover,header.eronex-appear .eronex-hamburger-toggle-btn:focus',
				'property' => 'background-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

new Color(
	array(
		'label'           => esc_html__( 'Sticky Border', 'eronex' ),
		'settings'        => 'eronex_sticky_hamburger_toggle_hover_border',
		'section'         => 'eronex_hamburger_toggle',
		'default'         => '',
		'transport'       => 'auto',
		'choices'         => array(
			'alpha' => true,
		),
		'output'          => array(
			array(
				'element'  => 'header.eronex-appear .eronex-hamburger-toggle-btn:hover,header.eronex-appear .eronex-hamburger-toggle-btn:focus',
				'property' => 'border-color',
			),
		),
		'active_callback' => array(
			array(
				'setting'  => 'eronex_header_sticky',
				'operator' => '===',
				'value'    => true,
			),
		),
	)
);

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Border', 'eronex' ),
		'settings'   => 'eronex_hamburger_toggle_border',
		'section'    => 'eronex_hamburger_toggle',
		'default'    => array(
			'mobile'  => array(
				'border-top-width'    => '',
				'border-right-width'  => '',
				'border-bottom-width' => '',
				'border-left-width'   => '',
			),
			'tablet'  => array(
				'border-top-width'    => '',
				'border-right-width'  => '',
				'border-bottom-width' => '',
				'border-left-width'   => '',
			),
			'desktop' => array(
				'border-top-width'    => '',
				'border-right-width'  => '',
				'border-bottom-width' => '',
				'border-left-width'   => '',

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

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

new Dimensions(
	array(
		'label'      => esc_html__( 'Border Radius', 'eronex' ),
		'settings'   => 'eronex_hamburger_toggle_radius',
		'section'    => 'eronex_hamburger_toggle',
		'default'    => array(
			'mobile'  => array(
				'border-top-left-radius'     => '',
				'border-top-right-radius'    => '',
				'border-bottom-left-radius'  => '',
				'border-bottom-right-radius' => '',
			),
			'tablet'  => array(
				'border-top-left-radius'     => '',
				'border-top-right-radius'    => '',
				'border-bottom-left-radius'  => '',
				'border-bottom-right-radius' => '',
			),
			'desktop' => array(
				'border-top-left-radius'     => '',
				'border-top-right-radius'    => '',
				'border-bottom-left-radius'  => '',
				'border-bottom-right-radius' => '',

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