<?php
/**
 * Header Section
 *
 * @package electrical_services
 */

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

$wp_customize->add_section(
	'electrical_services_header_options',
	array(
		'panel' => 'electrical_services_front_page_options',
		'title' => esc_html__( 'Header Options', 'electrical-services' ),
        'priority' => 1,
	)
);

// Add setting for Linkedin Link
$wp_customize->add_setting(
	'electrical_services_header_linkedin_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'electrical_services_header_linkedin_link',
	array(
		'label'           => esc_html__( 'Linkedin Link', 'electrical-services'  ),
		'section'         => 'electrical_services_header_options',
		'settings'        => 'electrical_services_header_linkedin_link',
		'type'      => 'url',
	)
);

$wp_customize->add_setting(
    'electrical_services_header_linkedin_icon',
    array(
        'default' => 'fab fa-linkedin-in',
        'sanitize_callback' => 'sanitize_text_field',
        'capability' => 'edit_theme_options',
    )
);

$wp_customize->add_control(new Electrical_Services_Change_Icon_Control(
    $wp_customize, 
    'electrical_services_header_linkedin_icon',
    array(
        'label'    => __('Linkedin Icon','electrical-services'),
        'section'  => 'electrical_services_header_options',
        'iconset'  => 'fa',
    )
));

// Add setting for Twitter Link
$wp_customize->add_setting(
	'electrical_services_header_twitter_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'electrical_services_header_twitter_link',
	array(
		'label'           => esc_html__( 'Twitter Link', 'electrical-services'  ),
		'section'         => 'electrical_services_header_options',
		'settings'        => 'electrical_services_header_twitter_link',
		'type'      => 'url',
	)
);

$wp_customize->add_setting(
    'electrical_services_header_twitter_icon',
    array(
        'default' => 'fab fa-twitter',
        'sanitize_callback' => 'sanitize_text_field',
        'capability' => 'edit_theme_options',
    )
);

$wp_customize->add_control(new Electrical_Services_Change_Icon_Control(
    $wp_customize, 
    'electrical_services_header_twitter_icon',
    array(
        'label'    => __('Twitter Icon','electrical-services'),
        'section'  => 'electrical_services_header_options',
        'iconset'  => 'fa',
    )
));

// Add setting for Instagram Link
$wp_customize->add_setting(
	'electrical_services_header_instagram_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'electrical_services_header_instagram_link',
	array(
		'label'           => esc_html__( 'Instagram Link', 'electrical-services'  ),
		'section'         => 'electrical_services_header_options',
		'settings'        => 'electrical_services_header_instagram_link',
		'type'      => 'url',
	)
);

$wp_customize->add_setting(
    'electrical_services_header_instagram_icon',
    array(
        'default' => 'fab fa-instagram',
        'sanitize_callback' => 'sanitize_text_field',
        'capability' => 'edit_theme_options',
    )
);

$wp_customize->add_control(new Electrical_Services_Change_Icon_Control(
    $wp_customize, 
    'electrical_services_header_instagram_icon',
    array(
        'label'    => __('Instagram Icon','electrical-services'),
        'section'  => 'electrical_services_header_options',
        'iconset'  => 'fa',
    )
));

// Add setting for Youtube Link
$wp_customize->add_setting(
	'electrical_services_header_youtube_link',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'electrical_services_header_youtube_link',
	array(
		'label'           => esc_html__( 'Youtube Link', 'electrical-services'  ),
		'section'         => 'electrical_services_header_options',
		'settings'        => 'electrical_services_header_youtube_link',
		'type'      => 'url',
	)
);

$wp_customize->add_setting(
    'electrical_services_header_youtube_icon',
    array(
        'default' => 'fab fa-youtube',
        'sanitize_callback' => 'sanitize_text_field',
        'capability' => 'edit_theme_options',
    )
);

$wp_customize->add_control(new Electrical_Services_Change_Icon_Control(
    $wp_customize, 
    'electrical_services_header_youtube_icon',
    array(
        'label'    => __('Youtube Icon','electrical-services'),
        'section'  => 'electrical_services_header_options',
        'iconset'  => 'fa',
    )
));

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

$wp_customize->add_control( new Electrical_Services_Separator_Custom_Control( $wp_customize, 'electrical_services_menu_separator', array(
	'label' => __( 'Menu Settings', 'electrical-services' ),
	'section' => 'electrical_services_header_options',
	'settings' => 'electrical_services_menu_separator',
)));

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

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

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

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

$wp_customize->add_setting( 'electrical_services_menu_text_transform', array(
    'default'           => 'capitalize', // Default value for text transform
    'sanitize_callback' => 'sanitize_text_field',
) );

// Add control for menu text transform
$wp_customize->add_control( 'electrical_services_menu_text_transform', array(
    'type'     => 'select',
    'section'  => 'electrical_services_header_options', // Adjust the section as needed
    'label'    => __( 'Menu Text Transform', 'electrical-services' ),
    'choices'  => array(
        'none'       => __( 'None', 'electrical-services' ),
        'capitalize' => __( 'Capitalize', 'electrical-services' ),
        'uppercase'  => __( 'Uppercase', 'electrical-services' ),
        'lowercase'  => __( 'Lowercase', 'electrical-services' ),
    ),
) );

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'electrical_services_menu_text_color', 
		array(
			'label' => __('Menu Color', 'electrical-services'),
			'section' => 'electrical_services_header_options',
		)
	)
);

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'electrical_services_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'electrical-services'),
			'section' => 'electrical_services_header_options',
		)
	)
);

// Topbar Padding Setting
$wp_customize->add_setting('electrical_services_topbar_padding',array(
		'default' => '',
		'sanitize_callback' => 'absint'
	)
);
$wp_customize->add_control('electrical_services_topbar_padding',array(
		'label' => __('Topbar Padding','electrical-services'),
		'section' => 'electrical_services_header_options',
		'type' => 'number',
		'input_attrs' => array(
			'min' => 0,
			'max' => 50,
			'step' => 1
		)
	)
);
