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

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

$wp_customize->add_section(
	'design_studio_header_options',
	array(
		'panel' => 'design_studio_front_page_options',
		'title' => esc_html__( 'Header Options', 'design-studio' ),
        'priority' => 1,
	)
);

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

$wp_customize->add_control(
	'design_studio_header_button_text',
	array(
		'label'           => sprintf( esc_html__( 'Telephone Text', 'design-studio' )),
		'section'         => 'design_studio_header_options',
		'settings'        => 'design_studio_header_button_text',
		'type'            => 'text',
	)
);

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

$wp_customize->add_control(
	'design_studio_header_button_link' ,
	array(
		'label'           => sprintf( esc_html__( 'Telephone Number', 'design-studio' )  ),
		'section'         => 'design_studio_header_options',
		'settings'        => 'design_studio_header_button_link' ,
		'type'            => 'url',
	)
);

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

$wp_customize->add_control( new Design_Studio_Separator_Custom_Control( $wp_customize, 'design_studio_menu_separator', array(
	'label' => __( 'Menu Settings', 'design-studio' ),
	'section' => 'design_studio_header_options',
	'settings' => 'design_studio_menu_separator',
)));

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

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

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

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

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

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

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'design_studio_menu_text_color', 
		array(
			'label' => __('Menu Color', 'design-studio'),
			'section' => 'design_studio_header_options',
		)
	)
);

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'design_studio_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'design-studio'),
			'section' => 'design_studio_header_options',
		)
	)
);

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