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

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

$wp_customize->add_section(
	'interior_services_header_options',
	array(
		'panel' => 'interior_services_front_page_options',
		'title' => esc_html__( 'Header Options', 'interior-services' ),
        'priority' => 1,
	)
);


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

// Add control for sticky header setting
$wp_customize->add_control(
	new Interior_Services_Toggle_Switch_Custom_Control(
		$wp_customize,
		'interior_services_enable_sticky_header',
		array(
			'label'   => esc_html__( 'Enable Sticky Header', 'interior-services' ),
			'section' => 'interior_services_header_options',
		)
	)
);

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

// Add control for sticky header setting
$wp_customize->add_control(
	new Interior_Services_Toggle_Switch_Custom_Control(
		$wp_customize,
		'interior_services_enable_header_search_section',
		array(
			'label'   => esc_html__( 'Enable Search', 'interior-services' ),
			'section' => 'interior_services_header_options',
		)
	)
);

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

$wp_customize->add_control(
	'interior_services_phone_number_text',
	array(
		'label'           => esc_html__( 'Phone Text', 'interior-services' ),
		'section'         => 'interior_services_header_options',
		'type'            => 'text',
	)
);

// Contact Section - Phone Number.
$wp_customize->add_setting(
	'interior_services_phone_number',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'interior_services_phone_number',
	array(
		'label'           => esc_html__( 'Phone Number', 'interior-services' ),
		'section'         => 'interior_services_header_options',
		'settings'        => 'interior_services_phone_number',
		'type'            => 'text',
	)
);

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

$wp_customize->add_control( new Interior_Services_Separator_Custom_Control( $wp_customize, 'interior_services_menu_separator', array(
	'label' => __( 'Menu Settings', 'interior-services' ),
	'section' => 'interior_services_header_options',
	'settings' => 'interior_services_menu_separator',
)));

$wp_customize->add_setting( 'interior_services_menu_font_size', array(
    'default'           => 14,
    'sanitize_callback' => 'absint',
));

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

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

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

$wp_customize->add_setting( 'interior_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( 'interior_services_menu_text_transform', array(
    'type'     => 'select',
    'section'  => 'interior_services_header_options', // Adjust the section as needed
    'label'    => __( 'Menu Text Transform', 'interior-services' ),
    'choices'  => array(
        'none'       => __( 'None', 'interior-services' ),
        'capitalize' => __( 'Capitalize', 'interior-services' ),
        'uppercase'  => __( 'Uppercase', 'interior-services' ),
        'lowercase'  => __( 'Lowercase', 'interior-services' ),
    ),
) );

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'interior_services_menu_text_color', 
		array(
			'label' => __('Menu Color', 'interior-services'),
			'section' => 'interior_services_header_options',
		)
	)
);

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'interior_services_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'interior-services'),
			'section' => 'interior_services_header_options',
		)
	)
);

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

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