<?php
/**
 * Urban Courier Logistics Theme Customizer.
 *
 * @link https://developer.wordpress.org/themes/basics/theme-functions/
 *
 * @package urban_courier_logistics
 */

if( ! function_exists( 'urban_courier_logistics_customize_register' ) ):  
/**
 * Add postMessage support for site title and description for the Theme Customizer.F
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function urban_courier_logistics_customize_register( $wp_customize ) {
    require get_parent_theme_file_path('/inc/controls/changeable-icon.php');

    require get_parent_theme_file_path('/inc/controls/sortable-control.php');
    
    //Register the sortable control type.
    $wp_customize->register_control_type( 'Urban_Courier_Logistics_Control_Sortable' ); 
    

    if ( version_compare( get_bloginfo('version'),'4.9', '>=') ) {
        $wp_customize->get_section( 'static_front_page' )->title = __( 'Static Front Page', 'urban-courier-logistics' );
    }
	
    /* Option list of all post */	
    $urban_courier_logistics_options_posts = array();
    $urban_courier_logistics_options_posts_obj = get_posts('posts_per_page=-1');
    $urban_courier_logistics_options_posts[''] = esc_html__( 'Choose Post', 'urban-courier-logistics' );
    foreach ( $urban_courier_logistics_options_posts_obj as $urban_courier_logistics_posts ) {
    	$urban_courier_logistics_options_posts[$urban_courier_logistics_posts->ID] = $urban_courier_logistics_posts->post_title;
    }
    
    /* Option list of all categories */
    $urban_courier_logistics_args = array(
	   'type'                     => 'post',
	   'orderby'                  => 'name',
	   'order'                    => 'ASC',
	   'hide_empty'               => 1,
	   'hierarchical'             => 1,
	   'taxonomy'                 => 'category'
    ); 
    $urban_courier_logistics_option_categories = array();
    $urban_courier_logistics_category_lists = get_categories( $urban_courier_logistics_args );
    $urban_courier_logistics_option_categories[''] = esc_html__( 'Choose Category', 'urban-courier-logistics' );
    foreach( $urban_courier_logistics_category_lists as $urban_courier_logistics_category ){
        $urban_courier_logistics_option_categories[$urban_courier_logistics_category->term_id] = $urban_courier_logistics_category->name;
    }
    
    /** Default Settings */    
    $wp_customize->add_panel( 
        'wp_default_panel',
         array(
            'priority' => 10,
            'capability' => 'edit_theme_options',
            'theme_supports' => '',
            'title' => esc_html__( 'Default Settings', 'urban-courier-logistics' ),
            'description' => esc_html__( 'Default section provided by wordpress customizer.', 'urban-courier-logistics' ),
        ) 
    );
    
    $wp_customize->get_section( 'title_tagline' )->panel                  = 'wp_default_panel';
    $wp_customize->get_section( 'colors' )->panel                         = 'wp_default_panel';
    $wp_customize->get_section( 'header_image' )->panel                   = 'wp_default_panel';
    $wp_customize->get_section( 'background_image' )->panel               = 'wp_default_panel';
    $wp_customize->get_section( 'static_front_page' )->panel              = 'wp_default_panel';
    
    $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
	$wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
    
    /** Default Settings Ends */
    
    /** Site Title control */
    $wp_customize->add_setting( 
        'header_site_title', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'header_site_title',
        array(
            'label'       => __( 'Show / Hide Site Title', 'urban-courier-logistics' ),
            'section'     => 'title_tagline',
            'type'        => 'checkbox',
        )
    );

    /** Tagline control */
    $wp_customize->add_setting( 
        'header_tagline', 
        array(
            'default'           => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'header_tagline',
        array(
            'label'       => __( 'Show / Hide Tagline', 'urban-courier-logistics' ),
            'section'     => 'title_tagline',
            'type'        => 'checkbox',
        )
    );

    $wp_customize->add_setting('logo_width', array(
        'sanitize_callback' => 'absint', 
    ));

    // Add a control for logo width
    $wp_customize->add_control('logo_width', array(
        'label' => __('Logo Width', 'urban-courier-logistics'),
        'section' => 'title_tagline',
        'type' => 'number',
        'input_attrs' => array(
            'min' => '50', 
            'max' => '500', 
            'step' => '5', 
    ),
        'default' => '100', 
    ));

    $wp_customize->add_setting( 'urban_courier_logistics_site_title_size', array(
        'default'           => 24, // Default font size in pixels
        'sanitize_callback' => 'absint', // Sanitize the input as a positive integer
    ) );

    // Add control for site title size
    $wp_customize->add_control( 'urban_courier_logistics_site_title_size', array(
        'type'        => 'number',
        'section'     => 'title_tagline', // You can change this section to your preferred section
        'label'       => __( 'Site Title Font Size', 'urban-courier-logistics' ),
        'input_attrs' => array(
            'min'  => 10,
            'max'  => 100,
            'step' => 1,
        ),
    ) );

    /** Post & Pages Settings */
    $wp_customize->add_panel( 
        'urban_courier_logistics_post_settings',
         array(
            'priority' => 11,
            'capability' => 'edit_theme_options',
            'title' => esc_html__( 'Post & Pages Settings', 'urban-courier-logistics' ),
            'description' => esc_html__( 'Customize Post & Pages Settings', 'urban-courier-logistics' ),
        ) 
    );

        /** Post Layouts */
    
    $wp_customize->add_section(
        'urban_courier_logistics_post_layout_section',
        array(
            'title' => esc_html__( 'Post Layout Settings', 'urban-courier-logistics' ),
            'priority' => 20,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_post_settings',
        )
    );

    $wp_customize->add_setting('urban_courier_logistics_post_layout_setting', array(
        'default'           => 'right-sidebar',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_post_layout',
    ));

    $wp_customize->add_control('urban_courier_logistics_post_layout_setting', array(
        'label'    => __('Post Column Settings', 'urban-courier-logistics'),
        'section'  => 'urban_courier_logistics_post_layout_section',
        'settings' => 'urban_courier_logistics_post_layout_setting',
        'type'     => 'select',
        'choices'  => array(
            'one-column'   => __('One Column', 'urban-courier-logistics'),
            'right-sidebar'   => __('Right Sidebar', 'urban-courier-logistics'),
            'left-sidebar'   => __('Left Sidebar', 'urban-courier-logistics'),
            'three-column'   => __('Three Columns', 'urban-courier-logistics'),
            'four-column'   => __('Four Columns', 'urban-courier-logistics'),
        ),
    ));

     /** Post Layouts Ends */
     
    /** Post Settings */
    $wp_customize->add_section(
        'urban_courier_logistics_post_settings',
        array(
            'title' => esc_html__( 'Post Settings', 'urban-courier-logistics' ),
            'priority' => 20,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_post_settings',
        )
    );

    /** Post Heading control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_post_heading_setting', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_post_heading_setting',
        array(
            'label'       => __( 'Show / Hide Post Heading', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_post_settings',
            'type'        => 'checkbox',
        )
    );

    /** Post Meta control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_post_meta_setting', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_post_meta_setting',
        array(
            'label'       => __( 'Show / Hide Post Meta', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_post_settings',
            'type'        => 'checkbox',
        )
    );

    /** Post Image control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_post_image_setting', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_post_image_setting',
        array(
            'label'       => __( 'Show / Hide Post Image', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_post_settings',
            'type'        => 'checkbox',
        )
    );

    /** Post Content control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_post_content_setting', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_post_content_setting',
        array(
            'label'       => __( 'Show / Hide Post Content', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_post_settings',
            'type'        => 'checkbox',
        )
    );
    /** Post ReadMore control */
     $wp_customize->add_setting( 'urban_courier_logistics_read_more_setting`', array(
        'default'           => true,
        'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
    ) );

    $wp_customize->add_control( 'urban_courier_logistics_read_more_setting`', array(
        'type'        => 'checkbox',
        'section'     => 'urban_courier_logistics_post_settings', 
        'label'       => __( 'Display Read More Button', 'urban-courier-logistics' ),
    ) );

    $wp_customize->add_setting('urban_courier_logistics_blog_meta_order', array(
        'default' => array('heading', 'author', 'featured-image', 'content','button'),
        'sanitize_callback' => 'urban_courier_logistics_sanitize_sortable',
    ));
    $wp_customize->add_control(new Urban_Courier_Logistics_Control_Sortable($wp_customize, 'urban_courier_logistics_blog_meta_order', array(
        'label' => esc_html__('Post Meta Ordering', 'urban-courier-logistics'),
        'description' => __('Drag & drop post items to rearrange the ordering ( this control will not function by post format )', 'urban-courier-logistics') ,
        'section' => 'urban_courier_logistics_post_settings',
        'choices' => array(
            'heading' => __('heading', 'urban-courier-logistics') ,
            'author' => __('author', 'urban-courier-logistics') ,
            'featured-image' => __('featured-image', 'urban-courier-logistics') ,
            'content' => __('content', 'urban-courier-logistics') ,
            'button' => __('button', 'urban-courier-logistics') ,
        ) ,
    )));

    /** Post Settings Ends */

     /** Single Post Settings */
    $wp_customize->add_section(
        'urban_courier_logistics_single_post_settings',
        array(
            'title' => esc_html__( 'Single Post Settings', 'urban-courier-logistics' ),
            'priority' => 20,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_post_settings',
        )
    );

    /** Single Post Meta control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_single_post_meta_setting', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_single_post_meta_setting',
        array(
            'label'       => __( 'Show / Hide Single Post Meta', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_single_post_settings',
            'type'        => 'checkbox',
        )
    );

    /** Single Post Content control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_single_post_content_setting', 
        array(
            'default'           => true,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_single_post_content_setting',
        array(
            'label'       => __( 'Show / Hide Single Post Content', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_single_post_settings',
            'type'        => 'checkbox',
        )
    );

    //Global Color
    $wp_customize->add_section(
        'urban_courier_logistics_global_color',
        array(
            'title' => esc_html__( 'Global Color Settings', 'urban-courier-logistics' ),
            'priority' => 20,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_general_settings',
        )
    );

    $wp_customize->add_setting('urban_courier_logistics_primary_color', array(
        'default'           => '#051A53',
        'sanitize_callback' => 'sanitize_hex_color',
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'urban_courier_logistics_primary_color', array(
        'label'    => __('Theme Primary Color', 'urban-courier-logistics'),
        'section'  => 'urban_courier_logistics_global_color',
        'settings' => 'urban_courier_logistics_primary_color',
    )));    

    $wp_customize->add_setting('urban_courier_logistics_secondary_color', array(
        'default'           => '#DE1E1B',
        'sanitize_callback' => 'sanitize_hex_color',
    ));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'urban_courier_logistics_secondary_color', array(
        'label'    => __('Theme Secondary Color', 'urban-courier-logistics'),
        'section'  => 'urban_courier_logistics_global_color',
        'settings' => 'urban_courier_logistics_secondary_color',
    ))); 

    /** Single Post Settings Ends */

         // Typography Settings Section
    $wp_customize->add_section('urban_courier_logistics_typography_settings', array(
        'title'      => esc_html__('Typography Settings', 'urban-courier-logistics'),
        'priority'   => 30,
        'capability' => 'edit_theme_options',
        'panel' => 'urban_courier_logistics_general_settings',
    ));

    // Array of fonts to choose from
    $font_choices = array(
        ''               => __('Select', 'urban-courier-logistics'),
        'Arial'          => 'Arial, sans-serif',
        'Verdana'        => 'Verdana, sans-serif',
        'Helvetica'      => 'Helvetica, sans-serif',
        'Times New Roman'=> '"Times New Roman", serif',
        'Georgia'        => 'Georgia, serif',
        'Courier New'    => '"Courier New", monospace',
        'Trebuchet MS'   => '"Trebuchet MS", sans-serif',
        'Tahoma'         => 'Tahoma, sans-serif',
        'Palatino'       => '"Palatino Linotype", serif',
        'Garamond'       => 'Garamond, serif',
        'Impact'         => 'Impact, sans-serif',
        'Comic Sans MS'  => '"Comic Sans MS", cursive, sans-serif',
        'Lucida Sans'    => '"Lucida Sans Unicode", sans-serif',
        'Arial Black'    => '"Arial Black", sans-serif',
        'Gill Sans'      => '"Gill Sans", sans-serif',
        'Segoe UI'       => '"Segoe UI", sans-serif',
        'Open Sans'      => '"Open Sans", sans-serif',
        'Inter'         => 'Inter, sans-serif',
        'Lato'           => 'Lato, sans-serif',
        'Montserrat'     => 'Montserrat, sans-serif',
        'Libre Baskerville' => 'Libre Baskerville',
    );

    // Heading Font Setting
    $wp_customize->add_setting('urban_courier_logistics_heading_font_family', array(
        'default'           => '',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_choicess',
    ));
    $wp_customize->add_control('urban_courier_logistics_heading_font_family', array(
        'type'    => 'select',
        'choices' => $font_choices,
        'label'   => __('Select Font for Heading', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_typography_settings',
    ));

    // Body Font Setting
    $wp_customize->add_setting('urban_courier_logistics_body_font_family', array(
        'default'           => '',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_choicess',
    ));
    $wp_customize->add_control('urban_courier_logistics_body_font_family', array(
        'type'    => 'select',
        'choices' => $font_choices,
        'label'   => __('Select Font for Body', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_typography_settings',
    ));

    /** Typography Settings Section End */

    /** General Settings */
    $wp_customize->add_panel( 
        'urban_courier_logistics_general_settings',
         array(
            'priority' => 11,
            'capability' => 'edit_theme_options',
            'title' => esc_html__( 'General Settings', 'urban-courier-logistics' ),
            'description' => esc_html__( 'Customize General Settings', 'urban-courier-logistics' ),
        ) 
    );

    /** General Settings */
    $wp_customize->add_section(
        'urban_courier_logistics_general_settings',
        array(
            'title' => esc_html__( 'Loader Settings', 'urban-courier-logistics' ),
            'priority' => 30,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_general_settings',
        )
    );

    /** Preloader control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_header_preloader', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_header_preloader',
        array(
            'label'       => __( 'Show Preloader', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_general_settings',
            'type'        => 'checkbox',
        )
    );

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

    // Add control for loader layout
    $wp_customize->add_control('urban_courier_logistics_loader_layout_control', array(
        'label' => __('Preloader Layout', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_general_settings',
        'settings' => 'urban_courier_logistics_loader_layout_setting',
        'type' => 'select',
        'choices' => array(
            'load' => __('Preloader 1', 'urban-courier-logistics'),
            'load-one' => __('Preloader 2', 'urban-courier-logistics'),
            'ctn-preloader' => __('Preloader 3', 'urban-courier-logistics'),
        ),
    ));

    /** Topbar Section Settings */
    $wp_customize->add_section(
        'urban_courier_logistics_topbar_section_settings',
        array(
            'title' => esc_html__( 'Topbar Section Settings', 'urban-courier-logistics' ),
            'priority' => 30,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_home_page_settings',
        )
    );

    /** Header Section control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_header_setting', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_header_setting',
        array(
            'label'       => __( 'Show Topbar', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_topbar_section_settings',
            'type'        => 'checkbox',
        )
    );

     /** Topbar Text */
    $wp_customize->add_setting(
        'urban_courier_logistics_topbar_text_1',
        array( 
            'default' => '',
            'sanitize_callback' => 'sanitize_text_field',
            'transport'         => 'refresh'
        )
    );
    
    $wp_customize->add_control(
        'urban_courier_logistics_topbar_text_1',
        array(
            'label' => esc_html__( 'Topbar Text', 'urban-courier-logistics' ),
            'section' => 'urban_courier_logistics_topbar_section_settings',
            'type' => 'text',
        )
    );

    /** Socail Section control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_social_icon_setting', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_social_icon_setting',
        array(
            'label'       => __( 'Show Social Icon', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_topbar_section_settings',
            'type'        => 'checkbox',
        )
    );

    /**  Social Link 1 */
    $wp_customize->add_setting(
        'urban_courier_logistics_social_link_1',
        array( 
            'default' => '',
            'sanitize_callback' => 'esc_url_raw',
            'transport'         => 'refresh'
        )
    );
    
    $wp_customize->add_control(
        'urban_courier_logistics_social_link_1',
        array(
            'label' => esc_html__( 'Add Facebook Link', 'urban-courier-logistics' ),
            'section' => 'urban_courier_logistics_topbar_section_settings',
            'type' => 'url',
        )
    );

    /**  Social Link 2 */
    $wp_customize->add_setting(
        'urban_courier_logistics_social_link_2',
        array( 
            'default' => '',
            'sanitize_callback' => 'esc_url_raw',
            'transport'         => 'refresh'
        )
    );
    
    $wp_customize->add_control(
        'urban_courier_logistics_social_link_2',
        array(
            'label' => esc_html__( 'Add Instagram Link', 'urban-courier-logistics' ),
            'section' => 'urban_courier_logistics_topbar_section_settings',
            'type' => 'url',
        )
    );

    /**  Social Link 3 */
    $wp_customize->add_setting(
        'urban_courier_logistics_social_link_3',
        array( 
            'default' => '',
            'sanitize_callback' => 'esc_url_raw',
            'transport'         => 'refresh'
        )
    );
    
    $wp_customize->add_control(
        'urban_courier_logistics_social_link_3',
        array(
            'label' => esc_html__( 'Add Twitter Link', 'urban-courier-logistics' ),
            'section' => 'urban_courier_logistics_topbar_section_settings',
            'type' => 'url',
        )
    );

    /**  Social Link 4 */
    $wp_customize->add_setting(
        'urban_courier_logistics_social_link_4',
        array( 
            'default' => '',
            'sanitize_callback' => 'esc_url_raw',
            'transport'         => 'refresh'
        )
    );
    
    $wp_customize->add_control(
        'urban_courier_logistics_social_link_4',
        array(
            'label' => esc_html__( 'Add Linkedin Link', 'urban-courier-logistics' ),
            'section' => 'urban_courier_logistics_topbar_section_settings',
            'type' => 'url',
        )
    );

    /** Social Section Settings End */

        // header button Text
    $wp_customize->add_setting('urban_courier_logistics_header_btn_text', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_header_btn_text', 
        array(
        'label'       => __('Header Button Text', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_topbar_section_settings',   
        'settings'    => 'urban_courier_logistics_header_btn_text',
        'type'        => 'text'
        )
    );

    // header button Url
    $wp_customize->add_setting('urban_courier_logistics_header_btn_url', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'esc_url_raw'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_header_btn_url', 
        array(
        'label'       => __('Header Button URL', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_topbar_section_settings',   
        'settings'    => 'urban_courier_logistics_header_btn_url',
        'type'        => 'url'
        )
    );

    $wp_customize->add_setting( 
        'urban_courier_logistics_topbar_settings_upgraded_features',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control(
        'urban_courier_logistics_topbar_settings_upgraded_features', 
        array(
            'type'=> 'hidden',
            'description' => "
                <div class='notice-pro-features'>
                    <div class='notice-pro-icon'>
                        <i class='fas fa-crown'></i>
                    </div>
                    <div class='notice-pro-content'>
                        <h3>Unlock Premium Features</h3>
                        <p>Enhance your website with advanced layouts, premium sections, and powerful customization tools.</p>
                    </div>
                    <div class='notice-pro-button'>
                        <a target='_blank' href='". esc_url(URBAN_COURIER_LOGISTICS_URL) ."' class='notice-upgrade-btn'>
                            Upgrade to Pro<i class='fas fa-rocket'></i>
                        </a>
                    </div>
                </div>
            ",
            'section' => 'urban_courier_logistics_topbar_section_settings'
        )
    );

    /** Header Section Settings */
    $wp_customize->add_section(
        'urban_courier_logistics_header_section_settings',
        array(
            'title' => esc_html__( 'Header Section Settings', 'urban-courier-logistics' ),
            'priority' => 30,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_home_page_settings',
        )
    );

    /** Sticky Header control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_sticky_header', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_sticky_header',
        array(
            'label'       => __( 'Show Sticky Header', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_header_section_settings',
            'type'        => 'checkbox',
        )
    );

    $wp_customize->add_setting( 
        'urban_courier_logistics_header_info_setting', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_header_info_setting',
        array(
            'label'       => __( 'Show Header', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_header_section_settings',
            'type'        => 'checkbox',
        )
    );

    /** LOCATION */

    // Location Icon
    $wp_customize->add_setting('urban_courier_logistics_location_icon', array(
        'default' => 'fas fa-map-marker-alt',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control(new Urban_Courier_Logistics_Changeable_Icon(
        $wp_customize,'urban_courier_logistics_location_icon',array(
        'label' => __('Location Icon','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'icon'
    )));

    // Location Text
    $wp_customize->add_setting('urban_courier_logistics_header_location_text', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_location_text', array(
        'label' => __('Location Text','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    // Location Value
    $wp_customize->add_setting('urban_courier_logistics_header_location', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_location', array(
        'label' => __('Add Location','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    /** Email */

    // Email Icon
    $wp_customize->add_setting('urban_courier_logistics_mail_icon', array(
        'default' => 'fa-regular fa-envelope',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control(new Urban_Courier_Logistics_Changeable_Icon(
        $wp_customize,'urban_courier_logistics_mail_icon',array(
        'label' => __('Mail Icon','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'icon'
    )));

    // Email Text
    $wp_customize->add_setting('urban_courier_logistics_header_email_text', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_email_text', array(
        'label' => __('Email Text','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    // Email Value
    $wp_customize->add_setting('urban_courier_logistics_header_email', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_email',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_email', array(
        'label' => __('Add Email','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    /** TIMING TEXT */

    // Timing Icon
    $wp_customize->add_setting('urban_courier_logistics_timing_icon', array(
        'default' => 'fa-regular fa-clock',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control(new Urban_Courier_Logistics_Changeable_Icon(
        $wp_customize,'urban_courier_logistics_timing_icon',array(
        'label' => __('Timing Icon','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'icon'
    )));

    // Timing Text
    $wp_customize->add_setting('urban_courier_logistics_header_timing_text', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_timing_text', array(
        'label' => __('Timing Text','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    // Timing Value
    $wp_customize->add_setting('urban_courier_logistics_header_phone', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_phone', array(
        'label' => __('Add Timing','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    /** Phone */

    // Phone Icon
    $wp_customize->add_setting('urban_courier_logistics_phone_icon', array(
        'default' => 'fas fa-phone',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control(new Urban_Courier_Logistics_Changeable_Icon(
        $wp_customize,'urban_courier_logistics_phone_icon',array(
        'label' => __('Phone Icon','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'icon'
    )));

    // Phone Text
    $wp_customize->add_setting('urban_courier_logistics_header_phone_text', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_phone_text', array(
        'label' => __('Phone Text','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    // Phone Value
    $wp_customize->add_setting('urban_courier_logistics_header_timing', array(
        'default' => '',
        'sanitize_callback' => 'sanitize_text_field',
    ));
    $wp_customize->add_control('urban_courier_logistics_header_timing', array(
        'label' => __('Add Phone','urban-courier-logistics'),
        'section' => 'urban_courier_logistics_header_section_settings',
        'type' => 'text',
    ));

    // Add Setting for Menu Font Weight
    $wp_customize->add_setting( 'urban_courier_logistics_menu_font_weight', array(
        'default'           => '500',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_font_weight',
    ) );

    // Add Control for Menu Font Weight
    $wp_customize->add_control( 'urban_courier_logistics_menu_font_weight', array(
        'label'    => __( 'Menu Font Weight', 'urban-courier-logistics' ),
        'section'  => 'urban_courier_logistics_header_section_settings',
        'type'     => 'select',
        'choices'  => array(
            '100' => __( '100 - Thin', 'urban-courier-logistics' ),
            '200' => __( '200 - Extra Light', 'urban-courier-logistics' ),
            '300' => __( '300 - Light', 'urban-courier-logistics' ),
            '400' => __( '400 - Normal', 'urban-courier-logistics' ),
            '500' => __( '500 - Medium', 'urban-courier-logistics' ),
            '600' => __( '600 - Semi Bold', 'urban-courier-logistics' ),
            '700' => __( '700 - Bold', 'urban-courier-logistics' ),
            '800' => __( '800 - Extra Bold', 'urban-courier-logistics' ),
            '900' => __( '900 - Black', 'urban-courier-logistics' ),
        ),
    ) );

    // Add Setting for Menu Text Transform
    $wp_customize->add_setting( 'urban_courier_logistics_menu_text_transform', array(
        'default'           => 'uppercase',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_text_transform',
    ) );

    // Add Control for Menu Text Transform
    $wp_customize->add_control( 'urban_courier_logistics_menu_text_transform', array(
        'label'    => __( 'Menu Text Transform', 'urban-courier-logistics' ),
        'section'  => 'urban_courier_logistics_header_section_settings',
        'type'     => 'select',
        'choices'  => array(
            'none'       => __( 'None', 'urban-courier-logistics' ),
            'capitalize' => __( 'Capitalize', 'urban-courier-logistics' ),
            'uppercase'  => __( 'Uppercase', 'urban-courier-logistics' ),
            'lowercase'  => __( 'Lowercase', 'urban-courier-logistics' ),
        ),
    ) );

    // Menu Hover Style	
    $wp_customize->add_setting('urban_courier_logistics_menus_style',array(
        'default' => '',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_choices'
	));
	$wp_customize->add_control('urban_courier_logistics_menus_style',array(
        'type' => 'select',
		'label' => __('Menu Hover Style','urban-courier-logistics'),
		'section' => 'urban_courier_logistics_header_section_settings',
		'choices' => array(
         'None' => __('None','urban-courier-logistics'),
         'Zoom In' => __('Zoom In','urban-courier-logistics'),
      ),
	));

    $wp_customize->add_setting( 
        'urban_courier_logistics_header_settings_upgraded_features',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control(
        'urban_courier_logistics_header_settings_upgraded_features', 
        array(
            'type'=> 'hidden',
            'description' => "
                <div class='notice-pro-features'>
                    <div class='notice-pro-icon'>
                        <i class='fas fa-crown'></i>
                    </div>
                    <div class='notice-pro-content'>
                        <h3>Unlock Premium Features</h3>
                        <p>Enhance your website with advanced layouts, premium sections, and powerful customization tools.</p>
                    </div>
                    <div class='notice-pro-button'>
                        <a target='_blank' href='". esc_url(URBAN_COURIER_LOGISTICS_URL) ."' class='notice-upgrade-btn'>
                            Upgrade to Pro<i class='fas fa-rocket'></i>
                        </a>
                    </div>
                </div>
            ",
            'section' => 'urban_courier_logistics_header_section_settings'
        )
    );

    /** Home Page Settings */
    $wp_customize->add_panel( 
        'urban_courier_logistics_home_page_settings',
         array(
            'priority' => 9,
            'capability' => 'edit_theme_options',
            'title' => esc_html__( 'Home Page Settings', 'urban-courier-logistics' ),
            'description' => esc_html__( 'Customize Home Page Settings', 'urban-courier-logistics' ),
        ) 
    );

    $wp_customize->add_section(
        'urban_courier_logistics_banner_section_settings',
        array(
            'title' => esc_html__( 'Banner Settings', 'urban-courier-logistics' ),
            'priority' => 30,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_home_page_settings',
        )
    );
    /** Banner Section Settings */
    $wp_customize->add_section(
        'urban_courier_logistics_banner_section_settings',
        array(
            'title' => esc_html__( 'Banner Section Settings', 'urban-courier-logistics' ),
            'priority' => 30,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_home_page_settings',
        )
    );

    /** Banner Section control */
    $wp_customize->add_setting( 
        'urban_courier_logistics_banner_setting', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_banner_setting',
        array(
            'label'       => __( 'Show Banner', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_banner_section_settings',
            'type'        => 'checkbox',
        )
    );

    // Section Text
    $wp_customize->add_setting('urban_courier_logistics_banner_text_extra', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_banner_text_extra', 
        array(
        'label'       => __('Banner Sub Title', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_banner_section_settings',   
        'settings'    => 'urban_courier_logistics_banner_text_extra',
        'type'        => 'text'
        )
    );

    // Section Text
    $wp_customize->add_setting('urban_courier_logistics_banner_title', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_banner_title', 
        array(
        'label'       => __('Banner Title', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_banner_section_settings',   
        'settings'    => 'urban_courier_logistics_banner_title',
        'type'        => 'text'
        )
    );

    $wp_customize->add_setting('urban_courier_logistics_banner_content', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_banner_content', 
        array(
        'label'       => __('Banner Content', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_banner_section_settings',   
        'settings'    => 'urban_courier_logistics_banner_content',
        'type'        => 'text'
        )
    );

    // banner button Text
    $wp_customize->add_setting('urban_courier_logistics_banner_btn_text', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_banner_btn_text', 
        array(
        'label'       => __('Banner Button Text', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_banner_section_settings',   
        'settings'    => 'urban_courier_logistics_banner_btn_text',
        'type'        => 'text'
        )
    );

    // banner button Url
    $wp_customize->add_setting('urban_courier_logistics_banner_btn_url', 
        array(
        'default'           => '',
        'type'              => 'theme_mod',
        'capability'        => 'edit_theme_options',    
        'sanitize_callback' => 'esc_url_raw'
        )
    );

    $wp_customize->add_control('urban_courier_logistics_banner_btn_url', 
        array(
        'label'       => __('Banner Button URL', 'urban-courier-logistics'),
        'section'     => 'urban_courier_logistics_banner_section_settings',   
        'settings'    => 'urban_courier_logistics_banner_btn_url',
        'type'        => 'url'
        )
    );

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

    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'urban_courier_logistics_banner_image', array(
        'label' => __('Banner Image', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_banner_section_settings',
        'settings' => 'urban_courier_logistics_banner_image',
    )));

    $wp_customize->add_setting('urban_courier_logistics_banner_background_image', array(
        'default'           => get_template_directory_uri() . '/images/background.png',
        'sanitize_callback' => 'esc_url_raw',
    ));

    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'urban_courier_logistics_banner_background_image', array(
        'label' => __('Banner Background Image', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_banner_section_settings',
        'settings' => 'urban_courier_logistics_banner_background_image',
    )));

    $wp_customize->add_setting( 
        'urban_courier_logistics_banner_settings_upgraded_features',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control(
        'urban_courier_logistics_banner_settings_upgraded_features', 
        array(
            'type'=> 'hidden',
            'description' => "
                <div class='notice-pro-features'>
                    <div class='notice-pro-icon'>
                        <i class='fas fa-crown'></i>
                    </div>
                    <div class='notice-pro-content'>
                        <h3>Unlock Premium Features</h3>
                        <p>Enhance your website with advanced layouts, premium sections, and powerful customization tools.</p>
                    </div>
                    <div class='notice-pro-button'>
                        <a target='_blank' href='". esc_url(URBAN_COURIER_LOGISTICS_URL) ."' class='notice-upgrade-btn'>
                            Upgrade to Pro<i class='fas fa-rocket'></i>
                        </a>
                    </div>
                </div>
            ",
            'section' => 'urban_courier_logistics_banner_section_settings'
        )
    );

   /** Choose Section Start */

   $wp_customize->add_section(
        'urban_courier_logistics_classes_section_settings',
        array(
            'title' => esc_html__( 'Choose Section Settings', 'urban-courier-logistics' ),
            'priority' => 30,
            'capability' => 'edit_theme_options',
            'panel' => 'urban_courier_logistics_home_page_settings',
        )
    );

    $wp_customize->add_setting( 
        'urban_courier_logistics_choose_setting', 
        array(
            'default' => false,
            'sanitize_callback' => 'urban_courier_logistics_sanitize_checkbox',
        ) 
    );

    $wp_customize->add_control(
        'urban_courier_logistics_choose_setting',
        array(
            'label'       => __( 'Show Choose Section', 'urban-courier-logistics' ),
            'section'     => 'urban_courier_logistics_classes_section_settings',
            'type'        => 'checkbox',
        )
    );

    // Choose 1
    $wp_customize->add_setting(
        'urban_courier_logistics_choose_short_title', 
        array(
            'default'           => '',
            'type'              => 'theme_mod',
            'capability'        => 'edit_theme_options',    
            'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control(
        'urban_courier_logistics_choose_short_title', 
        array(
            'label'       => __('Choose Sub Title', 'urban-courier-logistics'),
            'section'     => 'urban_courier_logistics_classes_section_settings',
            'settings'    => 'urban_courier_logistics_choose_short_title',
            'type'        => 'text'
        )
    );

    $wp_customize->add_setting(
        'urban_courier_logistics_choose_heading', 
        array(
            'default'           => '',
            'type'              => 'theme_mod',
            'capability'        => 'edit_theme_options',    
            'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control(
        'urban_courier_logistics_choose_heading', 
        array(
            'label'       => __('Choose Heading', 'urban-courier-logistics'),
            'section'     => 'urban_courier_logistics_classes_section_settings',
            'settings'    => 'urban_courier_logistics_choose_heading',
            'type'        => 'text'
        )
    );
  
    $wp_customize->add_setting(
        'urban_courier_logistics_services_section_text', 
        array(
            'default'           => '',
            'type'              => 'theme_mod',
            'capability'        => 'edit_theme_options',    
            'sanitize_callback' => 'sanitize_text_field'
        )
    );

    $wp_customize->add_control(
        'urban_courier_logistics_services_section_text', 
        array(
            'label'       => __('Content Text', 'urban-courier-logistics'),
            'section'     => 'urban_courier_logistics_classes_section_settings',
            'settings'    => 'urban_courier_logistics_services_section_text',
            'type'        => 'text'
        )
    );

    for ($urban_courier_logistics_i=1; $urban_courier_logistics_i <= 3; $urban_courier_logistics_i++) { 

        $wp_customize->add_setting( 'urban_courier_logistics_services_section_progress_name'.$urban_courier_logistics_i,
            array(
            'default'           => '',
            'capability'        => 'edit_theme_options',
            'sanitize_callback' => 'sanitize_text_field',
            )
        );
        $wp_customize->add_control( 'urban_courier_logistics_services_section_progress_name'.$urban_courier_logistics_i,
            array(
            'label'    => esc_html__( 'Progress Bar Name ', 'urban-courier-logistics' ).$urban_courier_logistics_i,
            'section'  => 'urban_courier_logistics_classes_section_settings',
            'type'     => 'text',
            )
        );

        $wp_customize->add_setting( 'urban_courier_logistics_services_section_progress_count'.$urban_courier_logistics_i,
            array(
            'default'           => '',
            'capability'        => 'edit_theme_options',
            'sanitize_callback' => 'sanitize_text_field',
            )
        );
        $wp_customize->add_control( 'urban_courier_logistics_services_section_progress_count'.$urban_courier_logistics_i,
            array(
            'label'    => esc_html__( 'Progress Bar Count ', 'urban-courier-logistics' ).$urban_courier_logistics_i,
            'section'  => 'urban_courier_logistics_classes_section_settings',
            'type'     => 'text',
            'description' => esc_html__( 'Please Use the following format - eg. 50%', 'urban-courier-logistics' ),
            )
        );

    }

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

    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'urban_courier_logistics_product_image_box', array(
        'label' => __('choose Image', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_classes_section_settings',
        'settings' => 'urban_courier_logistics_product_image_box',
    )));


    $wp_customize->add_setting( 
        'urban_courier_logistics_classes_settings_upgraded_features',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control(
        'urban_courier_logistics_classes_settings_upgraded_features', 
        array(
            'type'=> 'hidden',
            'description' => "
                <div class='notice-pro-features'>
                    <div class='notice-pro-icon'>
                        <i class='fas fa-crown'></i>
                    </div>
                    <div class='notice-pro-content'>
                        <h3>Unlock Premium Features</h3>
                        <p>Enhance your website with advanced layouts, premium sections, and powerful customization tools.</p>
                    </div>
                    <div class='notice-pro-button'>
                        <a target='_blank' href='". esc_url(URBAN_COURIER_LOGISTICS_URL) ."' class='notice-upgrade-btn'>
                            Upgrade to Pro<i class='fas fa-rocket'></i>
                        </a>
                    </div>
                </div>
            ",
            'section' => 'urban_courier_logistics_classes_section_settings'
        )
    );
    /** Choose Section End */
    
    /** Home Page Settings Ends */
    
    /** Footer Section */
    $wp_customize->add_section(
        'urban_courier_logistics_footer_section',
        array(
            'title' => __( 'Footer Settings', 'urban-courier-logistics' ),
            'priority' => 70,
            'panel' => 'urban_courier_logistics_home_page_settings',
        )
    );
    
    /** Copyright Text */
    $wp_customize->add_setting(
        'urban_courier_logistics_footer_copyright_text',
        array(
            'default' => '',
            'sanitize_callback' => 'sanitize_text_field',
        )
    );
    
    $wp_customize->add_control(
        'urban_courier_logistics_footer_copyright_text',
        array(
            'label' => __( 'Copyright Info', 'urban-courier-logistics' ),
            'section' => 'urban_courier_logistics_footer_section',
            'type' => 'text',
        )
    );  
$wp_customize->add_setting('urban_courier_logistics_footer_background_image',
        array(
        'default' => '',
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'absint',
        )
    );


    $wp_customize->add_control(
         new WP_Customize_Cropped_Image_Control($wp_customize, 'urban_courier_logistics_footer_background_image',
            array(
                'label' => esc_html__('Footer Background Image', 'urban-courier-logistics'),
                /* translators: 1: image width in pixels, 2: image height in pixels */
                'description' => sprintf(esc_html__('Recommended Size %1$s px X %2$s px', 'urban-courier-logistics'), 1024, 800),
                'section' => 'urban_courier_logistics_footer_section',
                'width' => 1024,
                'height' => 800,
                'flex_width' => true,
                'flex_height' => true,
            )
        )
    );

    /** Footer Background Image Attachment */
    $wp_customize->add_setting('urban_courier_logistics_background_attachment', array(
        'default'           => 'scroll',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_choices',
    ));

    $wp_customize->add_control('urban_courier_logistics_background_attachment', array(
        'label'    => __('Footer Background Attachment', 'urban-courier-logistics'),
        'section'  => 'urban_courier_logistics_footer_section',
        'settings' => 'urban_courier_logistics_background_attachment',
        'type'     => 'select',
        'choices'  => array(
            'fixed' => __('fixed','urban-courier-logistics'),
            'scroll' => __('scroll','urban-courier-logistics'),
        ),
    ));

    /* Footer Background Color*/
    $wp_customize->add_setting(
        'urban_courier_logistics_footer_background_color',
        array(
            'default' => '',
            'sanitize_callback' => 'sanitize_hex_color',
        )
    );
    $wp_customize->add_control(
        new WP_Customize_Color_Control(
            $wp_customize,
            'urban_courier_logistics_footer_background_color',
            array(
                'label' => __('Footer Widget Area Background Color', 'urban-courier-logistics'),
                'section' => 'urban_courier_logistics_footer_section',
                'type' => 'color',
            )
        )
    );

     $wp_customize->add_setting('urban_courier_logistics_scroll_icon',array(
        'default'   => 'fas fa-arrow-up',
        'sanitize_callback' => 'sanitize_text_field'
    ));
    $wp_customize->add_control(new Urban_Courier_Logistics_Changeable_Icon(
        $wp_customize,'urban_courier_logistics_scroll_icon',array(
        'label' => __('Scroll Top Icon','urban-courier-logistics'),
        'transport' => 'refresh',
        'section'   => 'urban_courier_logistics_footer_section',
        'type'      => 'icon'
    )));

    /** Scroll to top button shape */
    $wp_customize->add_setting('urban_courier_logistics_scroll_to_top_radius', array(
        'default'           => 'curved-box',
        'sanitize_callback' => 'urban_courier_logistics_sanitize_choices',
    ));

    $wp_customize->add_control('urban_courier_logistics_scroll_to_top_radius', array(
        'label'    => __('Scroll Top Button Shape', 'urban-courier-logistics'),
        'section'  => 'urban_courier_logistics_footer_section',
        'settings' => 'urban_courier_logistics_scroll_to_top_radius',
        'type'     => 'select',
        'choices'  => array(
            'box'        => __( 'Box', 'urban-courier-logistics' ),
            'curved-box' => __( 'Curved Box', 'urban-courier-logistics' ),
            'circle'     => __( 'Circle', 'urban-courier-logistics' ),
        ),
    ));

    $wp_customize->add_setting( 
        'urban_courier_logistics_footer_settings_upgraded_features',
        array(
            'sanitize_callback' => 'sanitize_text_field'
        )
    );
    $wp_customize->add_control(
        'urban_courier_logistics_footer_settings_upgraded_features', 
        array(
            'type'=> 'hidden',
            'description' => "
                <div class='notice-pro-features'>
                    <div class='notice-pro-icon'>
                        <i class='fas fa-crown'></i>
                    </div>
                    <div class='notice-pro-content'>
                        <h3>Unlock Premium Features</h3>
                        <p>Enhance your website with advanced layouts, premium sections, and powerful customization tools.</p>
                    </div>
                    <div class='notice-pro-button'>
                        <a target='_blank' href='". esc_url(URBAN_COURIER_LOGISTICS_URL) ."' class='notice-upgrade-btn'>
                            Upgrade to Pro<i class='fas fa-rocket'></i>
                        </a>
                    </div>
                </div>
            ",
            'section' => 'urban_courier_logistics_footer_section'
        )
    );

    // 404 PAGE SETTINGS
    $wp_customize->add_section(
        'urban_courier_logistics_404_section',
        array(
            'title' => __( '404 Page Settings', 'urban-courier-logistics' ),
            'priority' => 70,
            'panel' => 'urban_courier_logistics_general_settings',
        )
    );
   
    $wp_customize->add_setting('404_page_image', array(
        'default' => '',
        'transport' => 'refresh',
        'sanitize_callback' => 'esc_url_raw', // Sanitize as URL
    ));

    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, '404_page_image', array(
        'label' => __('404 Page Image', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_404_section',
        'settings' => '404_page_image',
    )));

    $wp_customize->add_setting('404_pagefirst_header', array(
        'default' => __('404', 'urban-courier-logistics'),
        'transport' => 'refresh',
        'sanitize_callback' => 'sanitize_text_field', // Sanitize as text field
    ));

    $wp_customize->add_control('404_pagefirst_header', array(
        'type' => 'text',
        'label' => __('Heading', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_404_section',
    ));

    // Setting for 404 page header
    $wp_customize->add_setting('404_page_header', array(
        'default' => __('Sorry, that page can\'t be found!', 'urban-courier-logistics'),
        'transport' => 'refresh',
        'sanitize_callback' => 'sanitize_text_field', // Sanitize as text field
    ));

    $wp_customize->add_control('404_page_header', array(
        'type' => 'text',
        'label' => __('Heading', 'urban-courier-logistics'),
        'section' => 'urban_courier_logistics_404_section',
    ));

}
add_action( 'customize_register', 'urban_courier_logistics_customize_register' );
endif;

/**
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
 */
function urban_courier_logistics_customize_preview_js() {
    // Use minified libraries if SCRIPT_DEBUG is false
    $urban_courier_logistics_build  = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '/build' : '';
    $urban_courier_logistics_suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
	wp_enqueue_script( 'urban_courier_logistics_customizer', get_template_directory_uri() . '/js' . $urban_courier_logistics_build . '/customizer' . $urban_courier_logistics_suffix . '.js', array( 'customize-preview' ), '20130508', true );
}
add_action( 'customize_preview_init', 'urban_courier_logistics_customize_preview_js' );