<?php
/**
 * Theme admin
 *
 * @package wpstream-theme
 */

// require customizer file.
require_once 'classes/class-wpstream-customizer.php';
require_once 'customizer-settings/customizer-button-settings.php';
require_once 'customizer-settings/customizer-taxonomies-settings.php';
require_once 'customizer-settings/customizer-metadata-share-settings.php';
require_once 'customizer-settings/customizer-comments-settings.php';
require_once 'customizer-settings/customizer-broadcaster-section-settings.php';
require_once 'customizer-settings/customizer-dashboard-options.php';

/**
 * Theme customizer
 *
 * @param WP_Customize_Manager $wp_customize class.
 *
 * @return void
 */
function wpstream_custom_theme_customizer( WP_Customize_Manager $wp_customize ) {
	require_once 'customizer-controls/class-wpstream-range-control.php';
	require_once 'customizer-controls/class-wpstream-slides-control.php';
	require_once 'customizer-controls/class-wpstream-toogle-control.php';
	require_once 'customizer-controls/class-wpstream-bootstrap-select-control.php';
	require_once 'customizer-controls/class-wpstream-separator-control.php';
	require_once 'customizer-controls/class-wpstream-title-control.php';

	$system_fonts = wpstream_theme_get_fonts( 'system' );
	$google_fonts = wpstream_theme_get_fonts( 'google' );
	$optgroup     = array(
		__( 'Default', 'hello-wpstream' )      => array( '' => __( 'Default', 'hello-wpstream' ) ),
		__( 'System fonts', 'hello-wpstream' ) => array_combine( array_map( fn( $v ) => 'system_fonts_' . $v, $system_fonts ), $system_fonts ),
		__( 'Google fonts', 'hello-wpstream' ) => array_combine( array_map( fn( $v ) => 'google_fonts_' . $v, $google_fonts ), $google_fonts ),
	);
	$font_weight  = array(
		'' => __( 'Default', 'hello-wpstream' ),
	) + wpstream_theme_get_font_weight();

	$font_style = array_merge(
		array(
			'' => __( 'Default', 'hello-wpstream' ),
		),
		wpstream_theme_get_font_style()
	);

	$wp_customize->remove_control('bm-theme');
	$wp_customize->remove_section('better_messages_light_mode');
	$wp_customize->remove_section('better_messages_dark_mode');
	// Remove the WP colors panel because we cannot add
	$wp_customize->remove_section('colors');

	$static_front_page        = $wp_customize->get_section( 'static_front_page' );
	$static_front_page->title = esc_html__( 'Home Page Settings', 'hello-wpstream' );

	$wp_customize->add_panel(
		'wpstream_general_design',
		array(
			'title'    => esc_html__( 'General Design Settings & Colors', 'hello-wpstream' ),
			'priority' => 55,
		)
	);

	// Add the General Settings section
	$wp_customize->add_section(
		'wpstream_general_settings',
		array(
			'title' => esc_html__( 'General Settings', 'hello-wpstream' ),
			'panel' => 'wpstream_general_design',
		)
	);

	// Add the background_color that is by default in the WP colors panel
	$wp_customize->get_control('background_color')->section = 'wpstream_general_settings';

	// Add width container setting - General Settings section
	$wp_customize->add_setting(
		'wpstream_theme_width_container',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		'wpstream_theme_width_container',
		array(
			'label'    => esc_html__( 'Container width in px', 'hello-wpstream' ),
			'section'  => 'wpstream_general_settings',
			'type'     => 'text',
		)
	);

	// Add the Colors section
	$wp_customize->add_section(
		'wpstream_buttons_colors',
		array(
			'title' => esc_html__( 'Button settings', 'hello-wpstream' ),
			'panel' => 'wpstream_general_design',
		)
	);

	// Add settings and controls for button type 1
	wpstream_add_button_color_settings($wp_customize, 'type_1');

	// Separator
	$wp_customize->add_control(
		new Wpstream_Separator_Control(
			$wp_customize,
			array(
				'section' => 'wpstream_buttons_colors',
			)
		)
	);

	// Add settings and controls for button type 2
	wpstream_add_button_color_settings($wp_customize, 'type_2');

	// Add the WooCommerce cart section
	$wp_customize->add_section(
		'wpstream_woocommerce_cart',
		array(
			'title' => esc_html__( 'WooCommerce Cart', 'hello-wpstream' ),
			'panel' => 'wpstream_general_design',
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_cart_font_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_woocommerce_cart_font_size',
			array(
				'label'   => esc_html__( 'Font Size', 'hello-wpstream' ),
				'section' => 'wpstream_woocommerce_cart',
				'unit'    => 'px',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_cart_font_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_cart_font_color',
			array(
				'label'    => esc_html__( 'Font Color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_cart_product_name_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_cart_product_name_color',
			array(
				'label'    => esc_html__( 'Product name color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_cart_product_name_hover_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_cart_product_name_hover_color',
			array(
				'label'    => esc_html__( 'Product name hover color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_add_to_cart_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_add_to_cart_color',
			array(
				'label'    => esc_html__( '"Add to cart" color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_add_to_cart_hover_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_add_to_cart_hover_color',
			array(
				'label'    => esc_html__( '"Add to cart" hover color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_control(
		new Wpstream_Title_Control(
			$wp_customize,
			array(
				'label'    => esc_html__( 'Header buttons style', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_header_search_button_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_header_search_button_color',
			array(
				'label'    => esc_html__( 'Search color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_header_search_button_hover_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_header_search_button_hover_color',
			array(
				'label'    => esc_html__( 'Search hover color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_header_cart_button_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_header_cart_button_color',
			array(
				'label'    => esc_html__( 'Cart color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_header_cart_button_hover_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_header_cart_button_hover_color',
			array(
				'label'    => esc_html__( 'Cart hover color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_header_account_button_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_header_account_button_color',
			array(
				'label'    => esc_html__( 'Account color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_woocommerce_header_account_button_hover_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_woocommerce_header_account_button_hover_color',
			array(
				'label'    => esc_html__( 'Account hover color', 'hello-wpstream' ),
				'section'  => 'wpstream_woocommerce_cart',
			)
		)
	);

	// Add the Categories, tags, actors & media categories section
	wpstream_add_taxonomies_settings( $wp_customize );

	// Add the metadata (views, likes, comments) and share settings section
	wpstream_add_metadata_share_settings( $wp_customize );

	// Add the comments section settings
	wpstream_add_comments_settings( $wp_customize );

	// Add the Broadcaster section settings
	wpstream_broadcaster_section_settings( $wp_customize );

	wpstream_dashboard_settings( $wp_customize );

	if ( function_exists( 'wc_get_account_menu_items' ) ) {
		$woocommerce           = $wp_customize->get_panel( 'woocommerce' );
		$woocommerce->priority = 70;
	}

	$custom_css           = $wp_customize->get_section( 'custom_css' );
	$custom_css->priority = 71;

	$wp_customize->remove_section( 'header_image' );
	$wp_customize->remove_section( 'background_image' );

	$wp_customize->add_panel(
		'wpstream_typography',
		array(
			'title'    => esc_html__( 'Typography', 'hello-wpstream' ),
			'priority' => 54,
		)
	);

	$wp_customize->add_section(
		'wpstream_typography_body',
		array(
			'title' => esc_html__( 'Body', 'hello-wpstream' ),
			'panel' => 'wpstream_typography',
		)
	);

	// FONTS SETTINGS START
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_body_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_body_font_family',
			array(
				'label'    => __( 'Select font family', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_body',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_body_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_body_font_weight',
			array(
				'label'      => __( 'Select font weight', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_body',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_body_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_body_font_style',
			array(
				'label'      => __( 'Select font style', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_body',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	$wp_customize->add_section(
		'wpstream_typography_links',
		array(
			'title' => esc_html__( 'Links', 'hello-wpstream' ),
			'panel' => 'wpstream_typography',
		)
	);

	// FONTS SETTINGS START
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_links_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_links_font_family',
			array(
				'label'    => __( 'Select font family', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_links',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_links_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_links_font_weight',
			array(
				'label'      => __( 'Select font weight', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_links',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_links_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_links_font_style',
			array(
				'label'      => __( 'Select font style', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_links',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	$wp_customize->add_section(
		'wpstream_typography_headings',
		array(
			'title' => esc_html__( 'Headings', 'hello-wpstream' ),
			'panel' => 'wpstream_typography',
		)
	);

	// FONTS SETTINGS START H1
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h1_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h1_font_family',
			array(
				'label'    => __( 'Select font family for H1', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_headings',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h1_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h1_font_weight',
			array(
				'label'      => __( 'Select font weight for H1', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h1_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h1_font_style',
			array(
				'label'      => __( 'Select font style for H1', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// SEPARATOR
	$wp_customize->add_control(
		new Wpstream_Separator_Control(
			$wp_customize,
			array(
				'section' => 'wpstream_typography_headings',
			)
		)
	);

	// FONTS SETTINGS START H2
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h2_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h2_font_family',
			array(
				'label'    => __( 'Select font family for H2', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_headings',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h2_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h2_font_weight',
			array(
				'label'      => __( 'Select font weight for H2', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h2_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h2_font_style',
			array(
				'label'      => __( 'Select font style for H2', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// SEPARATOR
	$wp_customize->add_control(
		new Wpstream_Separator_Control(
			$wp_customize,
			array(
				'section' => 'wpstream_typography_headings',
			)
		)
	);

	// FONTS SETTINGS START H3
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h3_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h3_font_family',
			array(
				'label'    => __( 'Select font family for H3', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_headings',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h3_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h3_font_weight',
			array(
				'label'      => __( 'Select font weight for H3', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h3_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h3_font_style',
			array(
				'label'      => __( 'Select font style for H3', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// SEPARATOR
	$wp_customize->add_control(
		new Wpstream_Separator_Control(
			$wp_customize,
			array(
				'section' => 'wpstream_typography_headings',
			)
		)
	);

	// FONTS SETTINGS START H4
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h4_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h4_font_family',
			array(
				'label'    => __( 'Select font family for H4', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_headings',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h4_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h4_font_weight',
			array(
				'label'      => __( 'Select font weight for H4', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h4_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h4_font_style',
			array(
				'label'      => __( 'Select font style for H4', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// SEPARATOR
	$wp_customize->add_control(
		new Wpstream_Separator_Control(
			$wp_customize,
			array(
				'section' => 'wpstream_typography_headings',
			)
		)
	);

	// FONTS SETTINGS START H5
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h5_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h5_font_family',
			array(
				'label'    => __( 'Select font family for H5', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_headings',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h5_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h5_font_weight',
			array(
				'label'      => __( 'Select font weight for H5', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h5_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h5_font_style',
			array(
				'label'      => __( 'Select font style for H5', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// SEPARATOR
	$wp_customize->add_control(
		new Wpstream_Separator_Control(
			$wp_customize,
			array(
				'section' => 'wpstream_typography_headings',
			)
		)
	);

	// FONTS SETTINGS START H6
	// Font family.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h6_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h6_font_family',
			array(
				'label'    => __( 'Select font family for H6', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_typography_headings',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h6_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h6_font_weight',
			array(
				'label'      => __( 'Select font weight for H6', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_typography_headings_h6_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_typography_headings_h6_font_style',
			array(
				'label'      => __( 'Select font style for H6', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_typography_headings',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	$wp_customize->add_section(
		'wpstream_appearance',
		array(
			'title'    => esc_html__( 'Appearance', 'hello-wpstream' ),
			'priority' => 51,
		)
	);

	// Add "Theme style switcher" option.
	$wp_customize->add_setting(
		'wpstream_theme_style_white',
		array(
			'default'           => false,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add "Theme style switcher" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_style_white',
			array(
				'label'    => esc_html__( 'Light Mode Style?', 'hello-wpstream' ),
				'section'  => 'wpstream_appearance',
			)
		)
	);

	// Add max width logo control.
	$wp_customize->add_setting(
		'wpstream_theme_max_width_logo',
		array(
			'default'           => '120',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_max_width_logo',
			array(
				'label'    => esc_html__( 'Max width logo', 'hello-wpstream' ),
				'section'  => 'title_tagline',
				'unit'     => 'px',
				'min'      => 0,
				'max'      => 150,
				'step'     => 1,
				'priority' => 9,
			)
		)
	);

	// Add max height logo control.
	$wp_customize->add_setting(
		'wpstream_theme_max_height_logo',
		array(
			'default'           => '48',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_max_height_logo',
			array(
				'label'    => esc_html__( 'Max height logo', 'hello-wpstream' ),
				'section'  => 'title_tagline',
				'unit'     => 'px',
				'min'      => 0,
				'max'      => 150,
				'step'     => 1,
				'priority' => 9,
			)
		)
	);

	// Add a control to upload the transparent header logo.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_logo',
		array(
			'default'   => '',
			'transport' => 'refresh',
			'sanitize_callback' => 'wpstream_theme_sanitize_image',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Media_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_logo',
			array(
				'label'     => __( 'Transparent header logo', 'hello-wpstream' ),
				'section'   => 'title_tagline',
				'mime_type' => 'image',
				'priority'  => 8,
			)
		)
	);

	// Add a control to upload the retina logo.
	$wp_customize->add_setting(
		'wpstream_theme_header_retina_logo',
		array(
			'default'   => '',
			'transport' => 'refresh',
			'sanitize_callback' => 'wpstream_theme_sanitize_image',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Media_Control(
			$wp_customize,
			'wpstream_theme_header_retina_logo',
			array(
				'label'     => __( 'Retina logo', 'hello-wpstream' ),
				'section'   => 'title_tagline',
				'mime_type' => 'image',
				'priority'  => 8,
			)
		)
	);

	// Add a control to upload the transparent header retina logo.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_retina_logo',
		array(
			'default'   => '',
			'transport' => 'refresh',
			'sanitize_callback' => 'wpstream_theme_sanitize_image',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Media_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_retina_logo',
			array(
				'label'     => __( 'Transparent header retina logo', 'hello-wpstream' ),
				'section'   => 'title_tagline',
				'mime_type' => 'image',
				'priority'  => 8,
			)
		)
	);

	// Add a control to upload the transparent header retina logo.
	$wp_customize->add_setting(
		'wpstream_theme_dashboard_retina_logo',
		array(
			'default'   => '',
			'transport' => 'refresh',
			'sanitize_callback' => 'wpstream_theme_sanitize_image',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Media_Control(
			$wp_customize,
			'wpstream_theme_dashboard_retina_logo',
			array(
				'label'     => __( 'Dashboard retina logo', 'hello-wpstream' ),
				'section'   => 'title_tagline',
				'mime_type' => 'image',
				'priority'  => 8,
			)
		)
	);

	$wp_customize->add_setting(
		'dashboard_logo',
		array(
			'default'   => '',
			'transport' => 'refresh',
			'sanitize_callback' => 'wpstream_theme_sanitize_image',
		)
	);

	// Add a control to upload the additional logo.
	$wp_customize->add_control(
		new WP_Customize_Media_Control(
			$wp_customize,
			'dashboard_logo',
			array(
				'label'    => __( 'Dashboard Logo', 'hello-wpstream' ),
				'section'  => 'title_tagline',
				'settings' => 'dashboard_logo',
				'priority' => 8,
			)
		)
	);

	$wp_customize->add_setting(
		'dashboard_logo_collapsed',
		array(
			'default'   => '',
			'transport' => 'refresh',
			'sanitize_callback' => 'wpstream_theme_sanitize_image',
		)
	);

	// Add a control to upload the additional logo.
	$wp_customize->add_control(
		new WP_Customize_Media_Control(
			$wp_customize,
			'dashboard_logo_collapsed',
			array(
				'label'    => __( 'Dashboard Logo - Collpsed version', 'hello-wpstream' ),
				'section'  => 'title_tagline',
				'settings' => 'dashboard_logo_collapsed',
				'priority' => 9,
			)
		)
	);

	$wp_customize->add_panel(
		'wpstream_sidebar_settings',
		array(
			'title'    => esc_html__( 'Sidebar Settings', 'hello-wpstream' ),
			'priority' => 32,
		)
	);



	$wp_customize->add_section(
		'wpstream_cache',
		array(
			'title'    => esc_html__( 'Theme Cache', 'hello-wpstream' ),
			'priority' => 46,
		)
	);
	// allow users to stream etting.
	$wp_customize->add_setting(
		'wpstream_enable_theme_cache_setting',
		array(
			'default'           => '',
			'transport'         => 'refresh',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'wpstream_enable_theme_cache',
		array(
			'label'    => esc_html__( 'Enable Theme Cache', 'hello-wpstream' ),
			'section'  => 'wpstream_cache',
			'settings' => 'wpstream_enable_theme_cache_setting',
			'type'     => 'checkbox',
		)
	);

	if ( class_exists( 'Wpstream_Player' ) ) {
		// streaming Section.
		$wp_customize->add_section(
			'wpstream_streaming',
			array(
				'title' => esc_html__('Streaming Settings', 'hello-wpstream'),
				'priority' => 30,
			)
		);

		// allow users to stream etting.
		$wp_customize->add_setting(
			'wpstream_allow_users_to_stream_setting',
			array(
				'default' => true,
				'transport' => 'refresh',
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_allow_users_to_stream_control_id',
				array(
					'label' => esc_html__('Allow Users to Stream', 'hello-wpstream'),
					'section' => 'wpstream_streaming',
					'settings' => 'wpstream_allow_users_to_stream_setting',
				)
			)
		);

		// how many channels.
		$wp_customize->add_setting(
			'wpstream_return_max_channels_per_user',
			array(
				'default' => 1,
				'transport' => 'refresh',
				'sanitize_callback' => 'absint',
			)
		);

		$wp_customize->add_control(
			'wpstream_return_max_channels_per_user_control',
			array(
				'label' => esc_html__('How many channels a user can create', 'hello-wpstream'),
				'section' => 'wpstream_streaming',
				'settings' => 'wpstream_return_max_channels_per_user',
				'type' => 'text',
			)
		);

		// can create paid channels.
		$wp_customize->add_setting(
			'wpstream_user_can_create_paid',
			array(
				'default' => false,
				'transport' => 'refresh',
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		$wp_customize->add_control(
			'wpstream_user_can_create_paid_control',
			array(
				'label' => esc_html__('Allow Users to create paid channels', 'hello-wpstream'),
				'section' => 'wpstream_streaming',
				'settings' => 'wpstream_user_can_create_paid',
				'type' => 'checkbox',
			)
		);
	}

	// Add a new panel for header options.
	$wp_customize->add_panel(
		'wpstream_theme_header_panel',
		array(
			'title'    => __( 'Header Settings', 'hello-wpstream' ),
			'priority' => 31,
		)
	);

	// Add a section "Header Type" for the header settings panel.
	$wp_customize->add_section(
		'wpstream_theme_header_design_type',
		array(
			'title'    => __( 'Header Type', 'hello-wpstream' ),
			'priority' => 30,
			'panel'    => 'wpstream_theme_header_panel',
																		// Add this line to associate with the panel.
		)
	);

	// Add settings for "Header Type" section.
	$wp_customize->add_setting(
		'wpstream_theme_header_design_type',
		array(
			'default'           => 'header-type-1',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	// Add options control to "Header Type" section.
	$wp_customize->add_control(
		'wpstream_theme_header_design_type',
		array(
			'label'   => __( 'Select Header Type Option', 'hello-wpstream' ),
			'section' => 'wpstream_theme_header_design_type',
			'type'    => 'radio',

			'choices' => array(
				'header-type-1' => __( 'Header 1', 'hello-wpstream' ),
				'header-type-2' => __( 'Header 2', 'hello-wpstream' ),
				'header-type-3' => __( 'Header 3', 'hello-wpstream' ),
			),
		)
	);

	// FONTS & COLORS START.

	// Add "Fonts & Colors" section for header settings panel.
	$wp_customize->add_section(
		'wpstream_theme_header_styles',
		array(
			'title'    => esc_html__( 'Fonts & Colors', 'hello-wpstream' ),
			'priority' => 32,
			'panel'    => 'wpstream_theme_header_panel',
		)
	);

	// Add color controls for header background with transparency support.
	$wp_customize->add_setting(
		'wpstream_theme_header_background_color',
		array(
			'default'           => '',
			// Default value.
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

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

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_header_background_color',
			array(
				'label'    => esc_html__( 'Header Background Color', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_header_background_opacity',
			array(
				'label'   => esc_html__( 'Header Background Opacity', 'hello-wpstream' ),
				'section' => 'wpstream_theme_header_styles',
				'min'     => 0,
				'max'     => 1,
				'step'    => 0.1,
			)
		)
	);

	// Add menu font color controls (normal and hover).
	$wp_customize->add_setting(
		'wpstream_theme_menu_font_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_menu_font_color',
			array(
				'label'    => esc_html__( 'Menu Font Color', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);


	// Add menu hover font color
	$wp_customize->add_setting(
		'wpstream_theme_menu_font_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_menu_font_color_hover',
			array(
				'label'    => esc_html__( 'Menu Font Color (Hover)', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);




	// Add menu hover back  color
	$wp_customize->add_setting(
		'wpstream_theme_menu_back_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_menu_back_color_hover',
			array(
				'label'    => esc_html__( 'Menu Background Color (Hover)', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);





	// Add menu font size control.
	$wp_customize->add_setting(
		'wpstream_theme_menu_font_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_menu_font_size',
			array(
				'label'   => esc_html__( 'Menu Font Size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_header_styles',
				'unit'    => 'px',
			)
		)
	);

	// Add submenu background color control.
	$wp_customize->add_setting(
		'wpstream_theme_submenu_background_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_submenu_background_color',
			array(
				'label'    => esc_html__( 'Submenu Background Color', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);

	// Add submenu dropdown menu font color controls (normal and hover).
	$wp_customize->add_setting(
		'wpstream_theme_submenu_font_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_submenu_font_color',
			array(
				'label'    => esc_html__( 'Submenu Font Color', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
				'settings' => 'wpstream_theme_submenu_font_color',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_submenu_font_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_submenu_font_color_hover',
			array(
				'label'    => esc_html__( 'Submenu Font Color (Hover)', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream-header-menu-item-back-color-hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream-header-menu-item-back-color-hover',
			array(
				'label'    => esc_html__( 'Menu item Hover Background Color', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);

	// Add submenu font size control.
	$wp_customize->add_setting(
		'wpstream_theme_submenu_font_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_submenu_font_size',
			array(
				'label'   => esc_html__( 'Submenu Font Size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_header_styles',
				'unit'    => 'px',
			)
		)
	);

	// Add border color for the search form control.
	$wp_customize->add_setting(
		'wpstream_theme_search_form_border_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_search_form_border_color',
			array(
				'label'    => esc_html__( 'Search Form Border Color', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);

	// Add border bottom color control.
	$wp_customize->add_setting(
		'wpstream_theme_header_border_bottom_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_header_border_bottom_color',
			array(
				'label'   => esc_html__( 'Border Bottom Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_header_styles',
			)
		)
	);

	// Add border bottom height control.
	$wp_customize->add_setting(
		'wpstream_theme_header_border_bottom_height',
		array(
			'default'           => 0,
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_header_border_bottom_height',
			array(
				'label'   => esc_html__( 'Border Bottom Height', 'hello-wpstream' ),
				'section' => 'wpstream_theme_header_styles',
				'unit'    => 'px',
				'min'     => 0,
				'max'     => 100,
			)
		)
	);

	// FONTS SETTINGS START
	// Font family.
	$wp_customize->add_setting(
		'wpstream_theme_header_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_header_font_family',
			array(
				'label'    => __( 'Select font family', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_theme_header_styles',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_theme_header_font_weight',
		array(
			'default'           => '400',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_header_font_weight',
			array(
				'label'      => __( 'Select font weight', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_theme_header_styles',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_theme_header_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_header_font_style',
			array(
				'label'      => __( 'Select font style', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_theme_header_styles',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// FONTS & COLORS END.

	// Transparent Header Fonts & Color START.

	// Add "Transparent Header Fonts & Color" section for header settings panel.
	$wp_customize->add_section(
		'wpstream_theme_transparent_header_styles',
		array(
			'title'    => esc_html__( 'Transparent Header Fonts & Color', 'hello-wpstream' ),
			'priority' => 33,
			'panel'    => 'wpstream_theme_header_panel',
		)
	);

	// Add menu font color controls (normal and hover).
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_menu_font_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_menu_font_color',
			array(
				'label'   => esc_html__( 'Menu Font Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);


	






	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_menu_font_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_menu_font_color_hover',
			array(
				'label'   => esc_html__( 'Menu Font Color (Hover)', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_menu_back_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_menu_back_color_hover',
			array(
				'label'   => esc_html__( 'Menu Background Color (Hover)', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);








	// Add menu font size control.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_menu_font_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_menu_font_size',
			array(
				'label'   => esc_html__( 'Menu Font Size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
				'unit'    => 'px',
			)
		)
	);

	// Add submenu background color control.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_submenu_background_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_submenu_background_color',
			array(
				'label'   => esc_html__( 'Submenu Background Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	// Add submenu dropdown menu font color controls (normal and hover).
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_submenu_font_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_submenu_font_color',
			array(
				'label'   => esc_html__( 'Submenu Font Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_submenu_font_color_hover',
		array(
			'default'           => '#f1f1f1',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_submenu_font_color_hover',
			array(
				'label'   => esc_html__( 'Submenu Font Color (Hover)', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_menu_item_back_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_menu_item_back_color_hover',
			array(
				'label'   => esc_html__( 'Menu item Hover Background Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	// Add submenu font size control.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_submenu_font_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_submenu_font_size',
			array(
				'label'   => esc_html__( 'Submenu Font Size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
				'unit'    => 'px',
			)
		)
	);

	// Add border color for the search form control.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_search_form_border_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_search_form_border_color',
			array(
				'label'   => esc_html__( 'Search Form Border Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	// Add border bottom color control.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_border_bottom_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_border_bottom_color',
			array(
				'label'   => esc_html__( 'Border Bottom Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	// Add border bottom height control.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_border_bottom_height',
		array(
			'default'           => 0,
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_border_bottom_height',
			array(
				'label'   => esc_html__( 'Border Bottom Height', 'hello-wpstream' ),
				'section' => 'wpstream_theme_transparent_header_styles',
				'unit'    => 'px',
				'min'     => 0,
				'max'     => 100,
			)
		)
	);

	// FONTS SETTINGS START
	// Font family.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_transparent_header_font_family',
			array(
				'label'    => __( 'Select font family', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_theme_transparent_header_styles',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_transparent_header_font_weight',
			array(
				'label'      => __( 'Select font weight', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_theme_transparent_header_styles',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_transparent_header_font_style',
			array(
				'label'      => __( 'Select font style', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_theme_transparent_header_styles',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// FONTS & COLORS END.

	// Login/Register settings START.

	// Add "Login/Register settings" section for header settings panel.
	$wp_customize->add_section(
		'wpstream_theme_login_register_settings',
		array(
			'title'    => __( 'Login/Register settings', 'hello-wpstream' ),
			'priority' => 34,
			'panel'    => 'wpstream_theme_header_panel',

																			// Add this line to associate with the panel.
		)
	);

	// Add settings for "Login/Register" section.
	$wp_customize->add_setting(
		'wpstream_theme_login_register_settings',
		array(
			'default'           => 'position-left',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	// Add options control to "Login/Register options" section.
	$wp_customize->add_control(
		'wpstream_theme_login_register_settings',
		array(
			'label'   => __( 'Select Login/Register menu position', 'hello-wpstream' ),
			'section' => 'wpstream_theme_login_register_settings',
			'type'    => 'radio',

			'choices' => array(
				'position-left'  => __( 'Position left', 'hello-wpstream' ),
				'position-right' => __( 'Position right', 'hello-wpstream' ),
			),
		)
	);

	// Login/Register settings END.

	// Add "Options" section for header settings panel.
	$wp_customize->add_section(
		'wpstream_theme_header_settings',
		array(
			'title'    => esc_html__( 'Show/Hide Options', 'hello-wpstream' ),
			'priority' => 31,
			'panel'    => 'wpstream_theme_header_panel',

																	// Add this line to associate with the panel.
		)
	);

	// Add the login menu display setting
	$wp_customize->add_setting(
		'wpstream_theme_display_login_menu',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_display_login_menu_id',
			array(
				'label'    => esc_html__( 'Show user login menu in header', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_settings',
				'settings' => 'wpstream_theme_display_login_menu',
			)
		)
	);

	// Add the cart icon display setting.
	$wp_customize->add_setting(
		'wpstream_theme_display_cart_icon',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the cart icon display control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_display_cart_icon_id',
			array(
				'label'    => esc_html__( 'Show cart in header', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_settings',
				'settings' => 'wpstream_theme_display_cart_icon',
			)
		)
	);


	// Add the cart icon display setting.
	$wp_customize->add_setting(
		'wpstream_theme_display_search_icon',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the cart icon display control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_display_search_icon_id',
			array(
				'label'    => esc_html__( 'Show Search Icon/Form', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_settings',
				'settings' => 'wpstream_theme_display_search_icon',
			)
		)
	);

	// Add the wide header setting.
	$wp_customize->add_setting(
		'wpstream_theme_wide_header',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_wide_header_id',
			array(
				'label'    => esc_html__( 'Wide Header', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_settings',
				'settings' => 'wpstream_theme_wide_header',
			)
		)
	);

	// Add the transparent header setting.
	$wp_customize->add_setting(
		'wpstream_theme_transparent_header',
		array(
			'default'           => false,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_transparent_header_id',
			array(
				'label'    => esc_html__( 'Transparent Header', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_header_settings',
				'settings' => 'wpstream_theme_transparent_header',
			)
		)
	);

	// Add a new panel for footer options.
	$wp_customize->add_panel(
		'wpstream_theme_footer_panel',
		array(
			'title'    => esc_html__( 'Footer Settings', 'hello-wpstream' ),
			'priority' => 33,
		)
	);

	// Add the "Colors & Font Size" section to the "Footer" panel.
	$wp_customize->add_section(
		'wpstream_theme_footer_color_font_size',
		array(
			'title'    => esc_html__( 'Colors & Font Size', 'hello-wpstream' ),
			'priority' => 1,
			'panel'    => 'wpstream_theme_footer_panel',
		)
	);

	// controls for footer background color.
	$wp_customize->add_setting(
		'wpstream_theme_footer_background_color',
		array(
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_footer_background_color',
			array(
				'label'   => esc_html__( 'Footer Background Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// Footer Sidebar Title font color.
	$wp_customize->add_setting(
		'wpstream_theme_footer_sidebar_title_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_footer_sidebar_title_color',
			array(
				'label'   => esc_html__( 'Footer Sidebar Title color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// font size for footer title sidebar.
	$wp_customize->add_setting(
		'wpstream_theme_footer_sidebar_title_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_footer_sidebar_title_size',
			array(
				'label'   => esc_html__( 'Footer Sidebar Title size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
				'unit'    => 'px',
			)
		)
	);

	// Footer Sidebar item list font color (normal).
	$wp_customize->add_setting(
		'wpstream_theme_footer_sidebar_item_list_color',
		array(
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_footer_sidebar_item_list_color',
			array(
				'label'   => esc_html__( 'Footer Sidebar item list color (normal)', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// Footer Sidebar item list font color (normal).
	$wp_customize->add_setting(
		'wpstream_theme_footer_sidebar_item_list_color_hover',
		array(
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_footer_sidebar_item_list_color_hover',
			array(
				'label'   => esc_html__( 'Footer Sidebar item list color (hover)', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// font size for footer item list.
	$wp_customize->add_setting(
		'wpstream_theme_footer_sidebar_item_list_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_footer_sidebar_item_list_size',
			array(
				'label'   => esc_html__( 'Footer Sidebar item list size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
				'unit'    => 'px',
			)
		)
	);

	// copyright area - background color.
	$wp_customize->add_setting(
		'wpstream_theme_footer_copyright_area_background_color',
		array(
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_footer_copyright_area_background_color',
			array(
				'label'   => esc_html__( 'Copyright area background color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// copyright area - text color.
	$wp_customize->add_setting(
		'wpstream_theme_footer_copyright_area_text_color',
		array(
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_footer_copyright_area_text_color',
			array(
				'label'   => esc_html__( 'Copyright area text color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// font size for footer item list.
	$wp_customize->add_setting(
		'wpstream_theme_footer_copyright_area_text_size',
		array(
			'default'           => '14',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_footer_copyright_area_text_size',
			array(
				'label'   => esc_html__( 'Copyright area text size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_footer_color_font_size',
				'unit'    => 'px',
			)
		)
	);

	// FONTS SETTINGS START
	// Font family.
	$wp_customize->add_setting(
		'wpstream_theme_footer_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_footer_font_family',
			array(
				'label'    => __( 'Select font family', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_theme_footer_color_font_size',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_theme_footer_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_footer_font_weight',
			array(
				'label'      => __( 'Select font weight', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_theme_footer_color_font_size',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_theme_footer_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_footer_font_style',
			array(
				'label'      => __( 'Select font style', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_theme_footer_color_font_size',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END

	// Add the "Footer Settings" section to the "Footer" panel.
	$wp_customize->add_section(
		'wpstream_theme_footer_settings',
		array(
			'title'    => esc_html__( 'Settings', 'hello-wpstream' ),
			'priority' => 10,
			'panel'    => 'wpstream_theme_footer_panel',

																	// Add this line to associate with the panel.
		)
	);

	// Add the "Show Footer" setting under "Footer > Settings".
	$wp_customize->add_setting(
		'wpstream_theme_show_footer',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show Footer" control under "Footer > Settings".
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_show_footer',
			array(
				'label'    => esc_html__( 'Show Footer', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_footer_settings',
			)
		)
	);

	// Add the "Show Footer Copyright Area" option.
	$wp_customize->add_setting(
		'wpstream_theme_show_footer_copyright',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show Footer Copyright Area" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_show_footer_copyright',
			array(
				'label'    => esc_html__( 'Show Footer Copyright Area', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_footer_settings',
			)
		)
	);

	// Add the "Copyright Message" input field.
	$wp_customize->add_setting(
		'wpstream_theme_copyright_message',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'wpstream_theme_copyright_message',
		array(
			'label'   => __( 'Copyright Message', 'hello-wpstream' ),
			'section' => 'wpstream_theme_footer_settings',
			'type'    => 'text',
		)
	);

	// Add the "Wide Footer" option.
	$wp_customize->add_setting(
		'wpstream_theme_wide_footer',
		array(
			'default'           => false,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Wide Footer" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_theme_wide_footer',
			array(
				'label'    => esc_html__( 'Wide Footer', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_footer_settings',
			)
		)
	);

	// Add the "Footer Type" option.
	$wp_customize->add_setting(
		'wpstream_theme_footer_type',
		array(
			'default'           => '4-equal-columns',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'wpstream_theme_footer_type',
		array(
			'label'   => __( 'Footer Type', 'hello-wpstream' ),
			'section' => 'wpstream_theme_footer_settings',
			'type'    => 'select',
			'choices' => array(
				'4-equal-columns'               => __( '4 Equal Columns', 'hello-wpstream' ),
				'3-equal-columns'               => __( '3 Equal Columns', 'hello-wpstream' ),
				'2-equal-columns'               => __( '2 Equal Columns', 'hello-wpstream' ),
				'100%_width-column'             => __( '100% Width Column', 'hello-wpstream' ),
				'5-columns-1/2-1/2-1/2-1/2-1/4' => __( '5 Columns: 1/2 - 1/2 - 1/2 - 1/2 - 1/4', 'hello-wpstream' ),
				'3-columns-1/2-1/4-1/4'         => __( '3 Columns: 1/2 - 1/4 - 1/4', 'hello-wpstream' ),
				'3-columns-1/4-1/2-1/4'         => __( '3 Columns: 1/4 - 1/2 - 1/4', 'hello-wpstream' ),
				'3-columns-1/4-1/4-1/2'         => __( '3 Columns: 1/4 - 1/4 - 1/2', 'hello-wpstream' ),
				'2-columns-2/3-1/3'             => __( '2 Columns: 2/3 - 1/3', 'hello-wpstream' ),
				'2-columns-1/3-2/3'             => __( '2 Columns: 1/3 - 2/3', 'hello-wpstream' ),
			),
		)
	);

	// Add a new section for "Footer Style" under the "Footer" panel.
	$wp_customize->add_section(
		'wpstream_theme_footer_style',
		array(
			'title'    => esc_html__( 'Styles', 'hello-wpstream' ),
			'priority' => 20,
			'panel'    => 'wpstream_theme_footer_panel',

																// Add this line to associate with the panel.
		)
	);

	// Add the "Background Image for Footer" setting under "Footer > Style".
	$wp_customize->add_setting(
		'wpstream_theme_footer_bg_image',
		array(
			'default'           => '',
			'sanitize_callback' => 'esc_url_raw',
		)
	);

	// Add the "Background Image for Footer" control under "Footer > Style".
	$wp_customize->add_control(
		new WP_Customize_Image_Control(
			$wp_customize,
			'wpstream_theme_footer_bg_image',
			array(
				'label'    => __( 'Background Image for Footer', 'hello-wpstream' ),
				'section'  => 'wpstream_theme_footer_style',
				'settings' => 'wpstream_theme_footer_bg_image',
			)
		)
	);

	// Add the "Repeat Footer Background" option.
	$wp_customize->add_setting(
		'wpstream_theme_repeat_footer_bg',
		array(
			'default'           => 'repeat',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);

	$wp_customize->add_control(
		'wpstream_theme_repeat_footer_bg',
		array(
			'label'   => __( 'Repeat Footer Background', 'hello-wpstream' ),
			'section' => 'wpstream_theme_footer_style',
			'type'    => 'select',
			'choices' => array(
				'repeat'    => __( 'Repeat', 'hello-wpstream' ),
				'repeat-x'  => __( 'Repeat X', 'hello-wpstream' ),
				'repeat-y'  => __( 'Repeat Y', 'hello-wpstream' ),
				'no-repeat' => __( 'No Repeat', 'hello-wpstream' ),
			),
		)
	);

	// Blog Post Options.
	$wp_customize->add_section(
		'wpstream_blog_post_settings',
		array(
			'title'    => esc_html__('Blog Settings','hello-wpstream'),
			'priority' => 62,
		)
	);

	// Add the "Sidebar" option.
	$wp_customize->add_setting(
		'wpstream_blog_post_sidebar',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Sidebar" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_sidebar',
			array(
				'label'    => esc_html__( 'Show Sidebar', 'hello-wpstream' ),
				'section'  => 'wpstream_blog_post_settings',
			)
		)
	);

	// Add the "Show/hide author section" option.
	$wp_customize->add_setting(
		'wpstream_blog_post_show_author_section',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show/hide author section" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_show_author_section',
			array(
				'label'   => esc_html__( 'Hide/Show Author section', 'hello-wpstream' ),
				'section' => 'wpstream_blog_post_settings',
			)
		)
	);

	// Add the "Show /hide - related posts section" option.
	$wp_customize->add_setting(
		'wpstream_blog_post_show_related_posts_section',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show /hide - related posts section" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_show_related_posts_section',
			array(
				'label'   => esc_html__( 'Hide/Show Related posts section', 'hello-wpstream' ),
				'section' => 'wpstream_blog_post_settings',
			)
		)
	);

	// Add the "Show /hide - latest posts section" option.
	$wp_customize->add_setting(
		'wpstream_blog_post_show_latest_posts_section',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show /hide - latest posts section" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_show_latest_posts_section',
			array(
				'label'   => esc_html__( 'Hide/Show Latest posts section', 'hello-wpstream' ),
				'section' => 'wpstream_blog_post_settings',
			)
		)
	);

	// Add the "Show /hide - trending posts section" option.
	$wp_customize->add_setting(
		'wpstream_blog_post_show_trending_posts_section',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show /hide - trending posts section" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_show_trending_posts_section',
			array(
				'label'   => esc_html__( 'Hide/Show Trending posts section', 'hello-wpstream' ),
				'section' => 'wpstream_blog_post_settings',
			)
		)
	);

	// Pages Options.
	$wp_customize->add_section(
		'wpstream_page_settings',
		array(
			'title'    => esc_html__( 'Page Settings', 'hello-wpstream' ),
			'priority' => 63,
		)
	);

	// Add the "Sidebar" option.
	$wp_customize->add_setting(
		'wpstream_page_sidebar',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Sidebar" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_page_sidebar',
			array(
				'label'    => esc_html__( 'Show Sidebar', 'hello-wpstream' ),
				'section'  => 'wpstream_page_settings',
			)
		)
	);

	// Add the "Show /hide - Page title" option.
	$wp_customize->add_setting(
		'wpstream_page_show_page_title',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the "Show /hide - Page title" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_page_show_page_title',
			array(
				'label'   => esc_html__( 'Hide/Show Page title', 'hello-wpstream' ),
				'section' => 'wpstream_page_settings',
			)
		)
	);

	if ( class_exists( 'Wpstream_Player' ) ) {
		// Video on demand Options.
		$wp_customize->add_section(
			'wpstream_video_on_demand_settings',
			array(
				'title' => esc_html__('Video On Demand Settings', 'hello-wpstream'),
				'priority' => 63,
			)
		);

		// Add the Video on demand "Sidebar" option.
		$wp_customize->add_setting(
			'wpstream_video_on_demand_sidebar',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the Video on demand "Sidebar" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_video_on_demand_sidebar',
				array(
					'label' => esc_html__('Show Sidebar', 'hello-wpstream'),
					'section' => 'wpstream_video_on_demand_settings',
				)
			)
		);

		$wp_customize->add_setting(
			'wpstream_video_on_demand_show_chat',
			array(
				'default' => false,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_video_on_demand_show_chat',
				array(
					'label' => esc_html__('Show Chat vod - Better Messages plugin', 'hello-wpstream'),
					'section' => 'wpstream_video_on_demand_settings',
				)
			)
		);

		// Add the "Show /hide - Comments section" option.
		$wp_customize->add_setting(
			'wpstream_video_on_demand_show_comments_section',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show /hide - Comments section" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_video_on_demand_show_comments_section',
				array(
					'label' => esc_html__('Hide/Show Comments section', 'hello-wpstream'),
					'section' => 'wpstream_video_on_demand_settings',
				)
			)
		);

		// Add the "Show/hide - More from this broadcaster" option.
		$wp_customize->add_setting(
			'wpstream_video_on_demand_show_more_from_broadcaster',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - More from this broadcaster" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_video_on_demand_show_more_from_broadcaster',
				array(
					'label' => esc_html__('Hide/Show More from this broadcaster', 'hello-wpstream'),
					'section' => 'wpstream_video_on_demand_settings',
				)
			)
		);

		// Add the "Show/hide - Latest videos" option.
		$wp_customize->add_setting(
			'wpstream_video_on_demand_show_latest_videos',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - Latest videos" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_video_on_demand_show_latest_videos',
				array(
					'label' => esc_html__('Hide/Show Latest videos', 'hello-wpstream'),
					'section' => 'wpstream_video_on_demand_settings',
				)
			)
		);

		// Add the "Show/hide - Trending posts section" option.
		$wp_customize->add_setting(
			'wpstream_video_on_demand_show_trending_posts_section',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - Trending posts section" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_video_on_demand_show_trending_posts_section',
				array(
					'label' => esc_html__('Hide/Show Trending posts section', 'hello-wpstream'),
					'section' => 'wpstream_video_on_demand_settings',
				)
			)
		);
	}

	if ( class_exists( 'Wpstream_Player' ) ) {
		// Free-To-View Live Options.
		$wp_customize->add_section(
			'wpstream_free_to_view_live_settings',
			array(
				'title' => esc_html__('Live Channels Settings', 'hello-wpstream'),
				'priority' => 63,
			)
		);

		// Add the Free-To-View Live "Sidebar" option.
		$wp_customize->add_setting(
			'wpstream_free_to_view_live_sidebar',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the Free-To-View Live "Sidebar" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_free_to_view_live_sidebar',
				array(
					'label' => esc_html__('Show Sidebar', 'hello-wpstream'),
					'section' => 'wpstream_free_to_view_live_settings',
				)
			)
		);

		$wp_customize->add_setting(
			'wpstream_free_to_view_live_show_chat',
			array(
				'default' => false,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_free_to_view_live_show_chat',
				array(
					'label' => esc_html__('Show Chat free to view - Better Messages plugin', 'hello-wpstream'),
					'section' => 'wpstream_free_to_view_live_settings',
				)
			)
		);

		// Add the "Show/hide - Comments section" option.
		$wp_customize->add_setting(
			'wpstream_free_to_view_live_show_comments_section',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - Comments section" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_free_to_view_live_show_comments_section',
				array(
					'label' => esc_html__('Hide/Show Comments section', 'hello-wpstream'),
					'section' => 'wpstream_free_to_view_live_settings',
				)
			)
		);

		// Add the "Show/hide - similar streams" option.
		$wp_customize->add_setting(
			'wpstream_free_to_view_live_show_similar_streams',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - similar streams" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_free_to_view_live_show_similar_streams',
				array(
					'label' => esc_html__('Hide/Show Similar streams', 'hello-wpstream'),
					'section' => 'wpstream_free_to_view_live_settings',
				)
			)
		);

		// Add the "Show/hide - similar streams" option.
		$wp_customize->add_setting(
			'wpstream_free_to_view_live_show_past_broadcast',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - similar streams" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_free_to_view_live_show_past_broadcast',
				array(
					'label' => esc_html__('Hide/Show Past broadcast', 'hello-wpstream'),
					'section' => 'wpstream_free_to_view_live_settings',
				)
			)
		);

		// Add the "Show/hide - trending streams" option.
		$wp_customize->add_setting(
			'wpstream_free_to_view_live_show_trending_streams',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - trending streams" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_free_to_view_live_show_trending_streams',
				array(
					'label' => esc_html__('Hide/Show Trending streams', 'hello-wpstream'),
					'section' => 'wpstream_free_to_view_live_settings',
				)
			)
		);
	}

	$wp_customize->add_panel(
		'wpstream_blog_post_settings',
		array(
			'title'    => esc_html__( 'Blog Post Card Settings', 'hello-wpstream' ),
			'priority' => 60,
		)
	);

	// Section "Settings" in "Video Card Settings" panel.
	$wp_customize->add_section(
		'wpstream_blog_post_settings_settings',
		array(
			'title' => esc_html__('Settings', 'hello-wpstream'),
			'panel' => 'wpstream_blog_post_settings',

		)
	);

	// Settings "Show/hide views".
	$wp_customize->add_setting(
		'wpstream_blog_post_card_show_hide_views',
		array(
			'default' => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_card_show_hide_views_id',
			array(
				'label' => esc_html__('Hide/Show views', 'hello-wpstream'),
				'section' => 'wpstream_blog_post_settings_settings',
				'settings' => 'wpstream_blog_post_card_show_hide_views',
			)
		)
	);

	// Settings "Show/hide views".
	$wp_customize->add_setting(
		'wpstream_blog_post_card_show_hide_metadata',
		array(
			'default' => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_blog_post_card_show_hide_metadata_id',
			array(
				'label' => esc_html__('Hide/Show Post Metadata', 'hello-wpstream'),
				'section' => 'wpstream_blog_post_settings_settings',
				'settings' => 'wpstream_blog_post_card_show_hide_metadata',
				'type' => 'toggle_switch',
			)
		)
	);

	// Section "Customize Colors".
	$wp_customize->add_section(
		'wpstream_blog_post_card_settings_customize_colors_section',
		array(
			'title' => esc_html__( 'Customize Blog Post Unit', 'hello-wpstream' ),
			'panel' => 'wpstream_blog_post_settings',

		)
	);

	// Settings "Title Color".
	$wp_customize->add_setting(
		'wpstream_blog_post_unit_card_title_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	// Controls "Title Color".
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_blog_post_unit_card_title_color',
			array(
				'label'    => esc_html__( 'Title Color', 'hello-wpstream' ),
				'section'  => 'wpstream_blog_post_card_settings_customize_colors_section',
			)
		)
	);

	// Settings "Author name Color".
	$wp_customize->add_setting(
		'wpstream_blog_post_unit_card_meta_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	// Controls "Author name Color".
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_blog_post_unit_card_meta_color',
			array(
				'label'    => esc_html__( 'Meta information color', 'hello-wpstream' ),
				'section'  => 'wpstream_blog_post_card_settings_customize_colors_section',
				'settings' => 'wpstream_blog_post_unit_card_meta_color',
			)
		)
	);

	// Settings "Views Color".
	$wp_customize->add_setting(
		'wpstream_blog_post_unit_card_views_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	// Controls "Views Color".
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_blog_post_unit_card_views_color',
			array(
				'label'    => esc_html__( 'Reads color', 'hello-wpstream' ),
				'section'  => 'wpstream_blog_post_card_settings_customize_colors_section',
				'settings' => 'wpstream_blog_post_unit_card_views_color',
			)
		)
	);

	// Settings "Views Background Color".
	$wp_customize->add_setting(
		'wpstream_blog_post_unit_card_views_background_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	// Controls "Views Background Color".
	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_blog_post_unit_card_views_background_color',
			array(
				'label'    => esc_html__( 'Reads background color', 'hello-wpstream' ),
				'section'  => 'wpstream_blog_post_card_settings_customize_colors_section',
				'settings' => 'wpstream_blog_post_unit_card_views_background_color',
			)
		)
	);

	// Controls "Image Border Radius".
	$wp_customize->add_setting(
		'wpstream_blog_post_unit_card_image_border_radius',
		array(
			'default'           => '8',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	// Settings "Image Border Radius".
	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_blog_post_unit_card_image_border_radius',
			array(
				'label'   => esc_html__( 'Image border radius (default 8px) ', 'hello-wpstream' ),
				'section' => 'wpstream_blog_post_card_settings_customize_colors_section',
				'min'     => 0,
				'max'     => 100,
				'step'    => 1,
				'unit'    => 'px',
			)
		)
	);
	/*
	$wp_customize->add_setting(
		'wpstream_blog_post_unit_card_image_height',
		array(
			'default'           => '183',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	// Settings "Image Border Radius".
	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_blog_post_unit_card_image_height',
			array(
				'label'   => esc_html__( 'Image height (default 183px)', 'hello-wpstream' ),
				'section' => 'wpstream_blog_post_card_settings_customize_colors_section',
				'min'     => 100,
				'max'     => 700,
				'step'    => 1,
				'unit'    => 'px',
			)
		)
	);
	*/

	if ( class_exists( 'Wpstream_Player' ) ) {
		/*
		*   / UNIT CARD SETTINGS START.
		*
		*
		*   // Panel "Video Card Settings".
		*/
		$wp_customize->add_panel(
			'wpstream_unit_card_settings',
			array(
				'title' => esc_html__('Video Card Settings', 'hello-wpstream'),
				'priority' => 61,
			)
		);

		// Section "Settings" in "Video Card Settings" panel.
		$wp_customize->add_section(
			'wpstream_unit_card_settings_settings',
			array(
				'title' => esc_html__('Settings', 'hello-wpstream'),
				'panel' => 'wpstream_unit_card_settings',
				'priority' => 1,
			)
		);

		// Settings "Select Unit Design Type".
		$wp_customize->add_setting(
			'wpstream_theme_video_unit_design_type',
			array(
				'default' => 1,
				'sanitize_callback' => 'sanitize_text_field',
			)
		);

		// Controls "Select Unit Design Type".
		$wp_customize->add_control(
			'wpstream_theme_video_unit_design_type',
			array(
				'label' => esc_html__('Select Unit Design Type', 'hello-wpstream'),
				'section' => 'wpstream_unit_card_settings_settings',
				'type' => 'radio',
				'choices' => array(
					1 => esc_html__('Design Type 1', 'hello-wpstream'),
					2 => esc_html__('Design Type 2', 'hello-wpstream'),
				),
			)
		);

		// Settings "Use video preview on hover?".
		$wp_customize->add_setting(
			'wpstream_unit_card_use_video',
			array(
				'default' => false,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_unit_card_use_video_id',
				array(
					'label' => esc_html__('Use video preview on hover?', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_settings',
					'settings' => 'wpstream_unit_card_use_video',
				)
			)
		);

		// Section "Show/Hide section".
		$wp_customize->add_section(
			'wpstream_unit_card_settings_show_hide_section',
			array(
				'title' => esc_html__('Show/Hide section', 'hello-wpstream'),
				'panel' => 'wpstream_unit_card_settings',
				'priority' => 2,
			)
		);

		// Settings "Show/hide user thumb".
		$wp_customize->add_setting(
			'wpstream_unit_card_show_hide_user_thumb',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Controls "Show/hide user thumb".

		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_unit_card_show_hide_user_thumb_id',
				array(
					'label' => esc_html__('Hide/Show user thumb', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_show_hide_section',
					'settings' => 'wpstream_unit_card_show_hide_user_thumb',
					'type' => 'toggle_switch',
				)
			)
		);

		// Settings "Show/hide views".
		$wp_customize->add_setting(
			'wpstream_unit_card_show_hide_views',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_unit_card_show_hide_views_id',
				array(
					'label' => esc_html__('Hide/Show views', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_show_hide_section',
					'settings' => 'wpstream_unit_card_show_hide_views',
					'type' => 'toggle_switch',
				)
			)
		);

		// Section "Customize Colors".
		$wp_customize->add_section(
			'wpstream_unit_card_settings_customize_colors_section',
			array(
				'title' => esc_html__('Customize Video Unit', 'hello-wpstream'),
				'panel' => 'wpstream_unit_card_settings',
				'priority' => 3,
			)
		);

		// Settings "Title Color".
		$wp_customize->add_setting(
			'wpstream_unit_card_title_color',
			array(
				'default' => '',
				'sanitize_callback' => 'sanitize_hex_color',
			)
		);

		// Controls "Title Color".
		$wp_customize->add_control(
			new WP_Customize_Color_Control(
				$wp_customize,
				'wpstream_unit_card_title_color',
				array(
					'label' => esc_html__('Title Color', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_customize_colors_section',
				)
			)
		);

		// Settings "Title Hover Color".
		$wp_customize->add_setting(
			'wpstream_unit_card_title_hover_color',
			array(
				'default' => '',
				'sanitize_callback' => 'sanitize_hex_color',
			)
		);

		// Controls "Title Color".
		$wp_customize->add_control(
			new WP_Customize_Color_Control(
				$wp_customize,
				'wpstream_unit_card_title_hover_color',
				array(
					'label' => esc_html__('Title Hover Color', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_customize_colors_section',
				)
			)
		);

		// Settings "Author name Color".
		$wp_customize->add_setting(
			'wpstream_unit_card_author_name_color',
			array(
				'default' => '',
				'sanitize_callback' => 'sanitize_hex_color',
			)
		);

		// Controls "Author name Color".
		$wp_customize->add_control(
			new WP_Customize_Color_Control(
				$wp_customize,
				'wpstream_unit_card_author_name_color',
				array(
					'label' => esc_html__('Author name color', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_customize_colors_section',
				)
			)
		);

		// Settings "Views Color".
		$wp_customize->add_setting(
			'wpstream_unit_card_views_color',
			array(
				'default' => '',
				'sanitize_callback' => 'sanitize_hex_color',
			)
		);

		// Controls "Views Color".
		$wp_customize->add_control(
			new WP_Customize_Color_Control(
				$wp_customize,
				'wpstream_unit_card_views_color',
				array(
					'label' => esc_html__('Views color', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_customize_colors_section',
				)
			)
		);

		// Settings "Views Background Color".
		$wp_customize->add_setting(
			'wpstream_unit_card_views_background_color',
			array(
				'default' => '',
				'sanitize_callback' => 'sanitize_hex_color',
			)
		);

		// Controls "Views Background Color".
		$wp_customize->add_control(
			new WP_Customize_Color_Control(
				$wp_customize,
				'wpstream_unit_card_views_background_color',
				array(
					'label' => esc_html__('Views background color', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_customize_colors_section',
					'settings' => 'wpstream_unit_card_views_background_color',
				)
			)
		);

		// Controls "Image Border Radius".
		$wp_customize->add_setting(
			'wpstream_unit_card_image_border_radius',
			array(
				'default' => '8',
				'sanitize_callback' => 'wpstream_sanitize_number_field',
			)
		);

		// Settings "Image Border Radius".
		$wp_customize->add_control(
			new Wpstream_Range_Control(
				$wp_customize,
				'wpstream_unit_card_image_border_radius',
				array(
					'label' => esc_html__('Image border radius (default 8px)', 'hello-wpstream'),
					'section' => 'wpstream_unit_card_settings_customize_colors_section',
					'min' => 0,
					'max' => 100,
					'step' => 1,
					'unit' => 'px',
				)
			)
		);
		/*
			$wp_customize->add_setting(
				'wpstream_unit_card_image_height',
				array(
					'default'           => '183',
					'sanitize_callback' => 'wpstream_sanitize_number_field',
				)
			);

			// Settings "Image Border Radius".
			$wp_customize->add_control(
				new Wpstream_Range_Control(
					$wp_customize,
					'wpstream_unit_card_image_height',
					array(
						'label'   => esc_html__( 'Image height (default 183px)', 'hello-wpstream' ),
						'section' => 'wpstream_unit_card_settings_customize_colors_section',
						'min'     => 100,
						'max'     => 700,
						'step'    => 1,
						'unit'    => 'px',
					)
				)
			);
		*/
		// UNIT CARD SETTINGS END.
	}

	if ( class_exists( 'Wpstream_Player' ) ) {
		// Collection Free-To-View Options.
		$wp_customize->add_section(
			'wpstream_collection_free_to_view_settings',
			array(
				'title' => esc_html__('Collection Free-To-View Settings', 'hello-wpstream'),
				'priority' => 74,
			)
		);

		// Add the Free-To-View Live "Sidebar" option.
		$wp_customize->add_setting(
			'wpstream_collection_free_to_view_sidebar',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the Free-To-View Live "Sidebar" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_collection_free_to_view_sidebar',
				array(
					'label' => esc_html__('Show Sidebar', 'hello-wpstream'),
					'section' => 'wpstream_collection_free_to_view_settings',
				)
			)
		);

		// Add the "Show/hide - similar bundle section" option.
		$wp_customize->add_setting(
			'wpstream_collection_free_to_view_show_similar_bundle_section',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - similar bundle section" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_collection_free_to_view_show_similar_bundle_section',
				array(
					'label' => esc_html__('Hide/Show Similar bundle section', 'hello-wpstream'),
					'section' => 'wpstream_collection_free_to_view_settings',
				)
			)
		);
	}

	// Collection Free-To-View Options.
	$wp_customize->add_section(
		'wpstream_archive_page_settings',
		array(
			'title'    => esc_html__('Archive/Categories/Tags Page Settings','hello-wpstream'),
			'priority' => 75,
		)
	);

	// Add the Free-To-View Live "Sidebar" option.
	$wp_customize->add_setting(
		'wpstream_archive_sidebar',
		array(
			'default'           => true,
			'sanitize_callback' => 'wpstream_sanitize_boolean_field',
		)
	);

	// Add the Free-To-View Live "Sidebar" control.
	$wp_customize->add_control(
		new WP_Customize_Toggle_Control(
			$wp_customize,
			'wpstream_archive_sidebar',
			array(
				'label'    => esc_html__( 'Show Sidebar', 'hello-wpstream' ),
				'section'  => 'wpstream_archive_page_settings',
			)
		)
	);




	$wp_customize->add_setting(
		'wpstream_archive_items_per_row',
		array(
			'default'           => 3,
			'transport'         => 'refresh',
			'sanitize_callback' => 'absint',
		)
	);

	$wp_customize->add_control(
		'wpstream_archive_items_per_row',
		array(
			'label'    => esc_html__( 'How many items per row', 'hello-wpstream' ),
			'section'  => 'wpstream_archive_page_settings',
			'settings' => 'wpstream_archive_items_per_row',
			'type'     => 'text',
		)
	);

	if ( class_exists( 'WooCommerce' ) ) {
		// Product Details page Options.
		$wp_customize->add_section(
			'wpstream_product_details_page_settings',
			array(
				'title' => esc_html__('WooCommerce Product Page Settings', 'hello-wpstream'),
				'priority' => 74,
			)
		);

		// Add the Free-To-View Live "Sidebar" option.
		$wp_customize->add_setting(
			'wpstream_product_details_page_sidebar',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the Free-To-View Live "Sidebar" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_product_details_page_sidebar',
				array(
					'label' => esc_html__('Show Sidebar', 'hello-wpstream'),
					'section' => 'wpstream_product_details_page_settings',
				)
			)
		);

		$wp_customize->add_setting(
			'wpstream_product_how_chat',
			array(
				'default' => false,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_product_how_chat',
				array(
					'label' => esc_html__('Show Chat  Product- Better Messages plugin', 'hello-wpstream'),
					'section' => 'wpstream_product_details_page_settings',
				)
			)
		);

		// Add the "Show/hide - comments section" option.
		$wp_customize->add_setting(
			'wpstream_product_show_comments_section',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - comments section" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_product_show_comments_section',
				array(
					'label' => esc_html__('Hide/Show Comments section', 'hello-wpstream'),
					'section' => 'wpstream_product_details_page_settings',
				)
			)
		);

		// Add the "Show/hide - related products" option.
		$wp_customize->add_setting(
			'wpstream_product_show_related_products',
			array(
				'default' => true,
				'sanitize_callback' => 'wpstream_sanitize_boolean_field',
			)
		);

		// Add the "Show/hide - related products" control.
		$wp_customize->add_control(
			new WP_Customize_Toggle_Control(
				$wp_customize,
				'wpstream_product_show_related_products',
				array(
					'label' => esc_html__('Hide/Show Related products', 'hello-wpstream'),
					'section' => 'wpstream_product_details_page_settings',
				)
			)
		);
	}

	// wpstream_sidebar_settings.

	// Add "Colors and Font Size" section for sidebar panel.
	$wp_customize->add_section(
		'wpstream_theme_sidebar_styles',
		array(
			'title' => esc_html__( 'Colors and Font Size', 'hello-wpstream' ),
			'panel' => 'wpstream_sidebar_settings',
		)
	);

	// Sidebar Title color.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_title_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_sidebar_title_color',
			array(
				'label'   => esc_html__( 'Sidebar Title Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_sidebar_styles',
			)
		)
	);

	// Sidebar Title size.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_title_size',
		array(
			'default'           => '24',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_sidebar_title_size',
			array(
				'label'   => esc_html__( 'Sidebar Title Size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_sidebar_styles',
				'unit'    => 'px',
			)
		)
	);

	// Sidebar Item color.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_item_color',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_sidebar_item_color',
			array(
				'label'   => esc_html__( 'Sidebar Item Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_sidebar_styles',
			)
		)
	);

	// Sidebar Item color (hover).
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_item_color_hover',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_sidebar_item_color_hover',
			array(
				'label'   => esc_html__( 'Sidebar Item Color (hover)', 'hello-wpstream' ),
				'section' => 'wpstream_theme_sidebar_styles',
			)
		)
	);

	// Sidebar Item size.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_item_size',
		array(
			'default'           => '16',
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Range_Control(
			$wp_customize,
			'wpstream_theme_sidebar_item_size',
			array(
				'label'   => esc_html__( 'Sidebar Item Size', 'hello-wpstream' ),
				'section' => 'wpstream_theme_sidebar_styles',
				'unit'    => 'px',
			)
		)
	);

	// Sidebar background color.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_widget_background_color',
		array(
			'sanitize_callback' => 'sanitize_hex_color',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Color_Control(
			$wp_customize,
			'wpstream_theme_sidebar_widget_background_color',
			array(
				'label'   => esc_html__( 'Sidebar Widget Background Color', 'hello-wpstream' ),
				'section' => 'wpstream_theme_sidebar_styles',
			)
		)
	);

	// Sidebar padding.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_widget_padding_top',
		array(
			'default'           => 0,
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_sidebar_widget_padding_right',
		array(
			'default'           => 0,
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_sidebar_widget_padding_bottom',
		array(
			'default'           => 0,
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_setting(
		'wpstream_theme_sidebar_widget_padding_left',
		array(
			'default'           => 0,
			'sanitize_callback' => 'wpstream_sanitize_number_field',
		)
	);

	$wp_customize->add_control(
		new Wpstream_Slides_Control(
			$wp_customize,
			'wpstream_theme_sidebar_widget_padding',
			array(
				'section'  => 'wpstream_theme_sidebar_styles',
				'label'    => __( 'Sidebar Widget Padding', 'hello-wpstream' ),
				'settings' => array(
					'top'    => 'wpstream_theme_sidebar_widget_padding_top',
					'right'  => 'wpstream_theme_sidebar_widget_padding_right',
					'bottom' => 'wpstream_theme_sidebar_widget_padding_bottom',
					'left'   => 'wpstream_theme_sidebar_widget_padding_left',
				),
				'min'      => 0,
				'max'      => 30,
				'unit'     => 'px',
			)
		)
	);

	// FONTS SETTINGS START
	// Font family.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_font_family',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_sidebar_font_family',
			array(
				'label'    => __( 'Select font family', 'hello-wpstream' ),
				'optgroup' => $optgroup,
				'section'  => 'wpstream_theme_sidebar_styles',
			)
		)
	);

	// Font weight.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_font_weight',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_sidebar_font_weight',
			array(
				'label'      => __( 'Select font weight', 'hello-wpstream' ),
				'choices'    => $font_weight,
				'section'    => 'wpstream_theme_sidebar_styles',
				'searchable' => false,
			)
		)
	);

	// Font style.
	$wp_customize->add_setting(
		'wpstream_theme_sidebar_font_style',
		array(
			'default'           => '',
			'sanitize_callback' => 'sanitize_text_field',
		)
	);
	$wp_customize->add_control(
		new Wpstream_Bootstrap_Select(
			$wp_customize,
			'wpstream_theme_sidebar_font_style',
			array(
				'label'      => __( 'Select font style', 'hello-wpstream' ),
				'choices'    => $font_style,
				'section'    => 'wpstream_theme_sidebar_styles',
				'searchable' => false,
			)
		)
	);
	// FONT SETTINGS END
}

add_action( 'customize_register', 'wpstream_custom_theme_customizer', PHP_INT_MAX );



add_action( 'admin_post_wpstream_theme_purge_cache', 'wpstream_theme_purge_cache' );

if ( ! function_exists( 'wpstream_theme_purge_cache' ) ) :

	function wpstream_theme_purge_cache() {
		if ( isset( $_GET['action'], $_GET['_wpnonce'] ) ) {
			if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'theme_purge_cache' ) ) {
				wp_nonce_ays( '' );
			}

			wpstream_theme_delete_cache();
			wp_redirect( wp_get_referer() );
			die();
		}
	}

endif;

/*
* Delete cache
*
*
*/

if ( ! function_exists( 'wpstream_theme_delete_cache' ) ) :

	function wpstream_theme_delete_cache() {
		global $wpdb;
		
		$find = 'transient_';
		$like = '%' . $wpdb->esc_like( $find ) . '%';
		
		$sql = $wpdb->prepare(
			"
			SELECT option_name AS name, option_value AS value
			FROM {$wpdb->options}
			WHERE option_name LIKE %s
			ORDER BY option_name
			",
			$like
		);

		$results = $wpdb->get_results( $sql );
		$transients = array();

		foreach ( $results as $result ) {
			if ( 0 === strpos( $result->name, '_transient_wpstream_theme' ) ) {
				$transient_name = str_replace( '_transient_', '', $result->name );
				delete_transient( $transient_name );
			}
		}
	}

endif;





