<?php
/**
 * Header Section Settings
 *
 * @package wheel_alignment_service
 */

// ---------------------------------------- HEADER OPTIONS ----------------------------------------------------

$wp_customize->add_section(
	'wheel_alignment_service_header_options',
	array(
		'panel' => 'wheel_alignment_service_front_page_options',
		'title' => esc_html__( 'Header Options', 'wheel-alignment-service' ),
        'priority' => 1,
	)
);

// Add setting for sticky header
$wp_customize->add_setting(
	'wheel_alignment_service_enable_sticky_header',
	array(
		'sanitize_callback' => 'wheel_alignment_service_sanitize_switch',
		'default'           => false,
	)
);

// Add control for sticky header setting
$wp_customize->add_control(
	new Wheel_Alignment_Service_Toggle_Switch_Custom_Control(
		$wp_customize,
		'wheel_alignment_service_enable_sticky_header',
		array(
			'label'   => esc_html__( 'Enable Sticky Menu', 'wheel-alignment-service' ),
			'section' => 'wheel_alignment_service_header_options',
		)
	)
);

// Post Options - Show / Hide Sidebar.
$wp_customize->add_setting(
	'wheel_alignment_service_post_hide_header_sidebar',
	array(
		'default'           => false,
		'sanitize_callback' => 'wheel_alignment_service_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Wheel_Alignment_Service_Toggle_Switch_Custom_Control(
		$wp_customize,
		'wheel_alignment_service_post_hide_header_sidebar',
		array(
			'label'   => esc_html__( 'Show / Hide Header Sidebar', 'wheel-alignment-service' ),
			'section' => 'wheel_alignment_service_header_options',
		)
	)
);

// Add Separator Custom Control
$wp_customize->add_setting( 'wheel_alignment_service_menu_separator', array(
	'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control( new Wheel_Alignment_Service_Separator_Custom_Control( $wp_customize, 'wheel_alignment_service_menu_separator', array(
	'label' => __( 'Menu Settings', 'wheel-alignment-service' ),
	'section' => 'wheel_alignment_service_header_options',
	'settings' => 'wheel_alignment_service_menu_separator',
)));

$wp_customize->add_setting( 'wheel_alignment_service_menu_font_size', array(
    'default'           => 15,
    'sanitize_callback' => 'absint',
) );

// Add control for site title size
$wp_customize->add_control( 'wheel_alignment_service_menu_font_size', array(
    'type'        => 'number',
    'section'     => 'wheel_alignment_service_header_options',
    'label'       => __( 'Menu Font Size ', 'wheel-alignment-service' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
));

// Add setting for menu font weight
$wp_customize->add_setting('wheel_alignment_service_menu_font_weight', array(
    'default'           => '500',
    'sanitize_callback' => 'sanitize_text_field',
));

// Add control for menu font weight
$wp_customize->add_control('wheel_alignment_service_menu_font_weight', array(
    'type'     => 'select',
    'section'  => 'wheel_alignment_service_header_options', 
    'label'    => __('Menu Font Weight', 'wheel-alignment-service'),
    'choices'  => array(
		'100' => __('100','wheel-alignment-service'),
		'200' => __('200','wheel-alignment-service'),
		'300' => __('300','wheel-alignment-service'),
		'400' => __('400','wheel-alignment-service'),
		'500' => __('500','wheel-alignment-service'),
		'600' => __('600','wheel-alignment-service'),
		'700' => __('700','wheel-alignment-service'),
		'800' => __('800','wheel-alignment-service'),
		'900' => __('900','wheel-alignment-service'),
    ),
));

// Add setting for menu text transform
$wp_customize->add_setting('wheel_alignment_service_menu_text_transform', array(
    'default'           => 'uppercase', // Default value for text transform
    'sanitize_callback' => 'sanitize_text_field',
));

// Add control for menu text transform
$wp_customize->add_control('wheel_alignment_service_menu_text_transform', array(
    'type'     => 'select',
    'section'  => 'wheel_alignment_service_header_options', // Section where the control will appear
    'label'    => __('Menu Text Transform', 'wheel-alignment-service'),
    'choices'  => array(
        'none'       => __('None', 'wheel-alignment-service'),
        'capitalize' => __('Capitalize', 'wheel-alignment-service'),
        'uppercase'  => __('Uppercase', 'wheel-alignment-service'),
        'lowercase'  => __('Lowercase', 'wheel-alignment-service'),
    ),
));

// Menu Text Color 
$wp_customize->add_setting(
	'wheel_alignment_service_menu_text_color', 
	array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'wheel_alignment_service_menu_text_color', 
		array(
			'label' => __('Menu Color', 'wheel-alignment-service'),
			'section' => 'wheel_alignment_service_header_options',
		)
	)
);

// Sub Menu Text Color 
$wp_customize->add_setting(
	'wheel_alignment_service_sub_menu_text_color', 
	array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'wheel_alignment_service_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'wheel-alignment-service'),
			'section' => 'wheel_alignment_service_header_options',
		)
	)
);

$wp_customize->add_setting( 
	'wheel_alignment_service_header_settings_upgraded_features',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control(
	'wheel_alignment_service_header_settings_upgraded_features', 
	array(
		'type'=> 'hidden',
		'description' => "
			<div class='customizer-upgraded-features'>
				<i class='fas fa-info-circle'></i>
				<span class='pro-text'>
					Unlock Premium <strong>Features</strong> ?<br>
					<a target='_blank' href='". esc_url(WHEEL_ALIGNMENT_SERVICE_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'wheel_alignment_service_header_options'
	)
);