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

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

$wp_customize->add_section(
	'doctor_physician_header_options',
	array(
		'panel' => 'doctor_physician_front_page_options',
		'title' => esc_html__( 'Header Options', 'doctor-physician' ),
        'priority' => 1,
	)
);

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

// Add control for sticky header setting
$wp_customize->add_control(
	new Doctor_Physician_Toggle_Switch_Custom_Control(
		$wp_customize,
		'doctor_physician_enable_sticky_header',
		array(
			'label'   => esc_html__( 'Enable Sticky Header', 'doctor-physician' ),
			'section' => 'doctor_physician_header_options',
		)
	)
);

// Banner Section - Enable Section.
$wp_customize->add_setting(
	'doctor_physician_enable_header_search_section',
	array(
		'default'           => true,
		'sanitize_callback' => 'doctor_physician_sanitize_switch',
	)
);

$wp_customize->add_control(
	new Doctor_Physician_Toggle_Switch_Custom_Control(
		$wp_customize,
		'doctor_physician_enable_header_search_section',
		array(
			'label'    => esc_html__( 'Enable Search Section', 'doctor-physician' ),
			'section'  => 'doctor_physician_header_options',
			'settings' => 'doctor_physician_enable_header_search_section',
		)
	)
);

// Banner Section - Button Label.
$wp_customize->add_setting(
	'doctor_physician_header_button_label_',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'doctor_physician_header_button_label_',
	array(
		'label'           => esc_html__( 'Button Label', 'doctor-physician'  ),
		'section'         => 'doctor_physician_header_options',
		'settings'        => 'doctor_physician_header_button_label_',
		'type'            => 'text',
	)
);

// Banner Section - Button Link.
$wp_customize->add_setting(
	'doctor_physician_banner_button_link_',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'doctor_physician_banner_button_link_',
	array(
		'label'           => esc_html__( 'Button Link', 'doctor-physician' ),
		'section'         => 'doctor_physician_header_options',
		'settings'        => 'doctor_physician_banner_button_link_',
		'type'            => 'url',
	)
);

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

$wp_customize->add_control( new Doctor_Physician_Separator_Custom_Control( $wp_customize, 'doctor_physician_menu_separator', array(
	'label' => __( 'Menu Settings', 'doctor-physician' ),
	'section' => 'doctor_physician_header_options',
	'settings' => 'doctor_physician_menu_separator',
)));

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

// Add control for site title size
$wp_customize->add_control( 'doctor_physician_menu_font_size', array(
    'type'        => 'number',
    'section'     => 'doctor_physician_header_options',
    'label'       => __( 'Menu Font Size ', 'doctor-physician' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
));

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

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

$wp_customize->add_setting( 'doctor_physician_menu_text_transform', array(
    'default'           => 'capitalize', 
    'sanitize_callback' => 'sanitize_text_field',
) );

// Add control for menu text transform
$wp_customize->add_control( 'doctor_physician_menu_text_transform', array(
    'type'     => 'select',
    'section'  => 'doctor_physician_header_options',
    'label'    => __( 'Menu Text Transform', 'doctor-physician' ),
    'choices'  => array(
        'none'       => __( 'None', 'doctor-physician' ),
        'capitalize' => __( 'Capitalize', 'doctor-physician' ),
        'uppercase'  => __( 'Uppercase', 'doctor-physician' ),
        'lowercase'  => __( 'Lowercase', 'doctor-physician' ),
    ),
) );

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'doctor_physician_menu_text_color', 
		array(
			'label' => __('Menu Color', 'doctor-physician'),
			'section' => 'doctor_physician_header_options',
		)
	)
);

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'doctor_physician_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'doctor-physician'),
			'section' => 'doctor_physician_header_options',
		)
	)
);

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

$wp_customize->add_control(
	'doctor_physician_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(DOCTOR_PHYSICIAN_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'doctor_physician_header_options'
	)
);