<?php
/**
* Header Options.
*
* @package Local Supermarket
*/

$local_supermarket_default = local_supermarket_get_default_theme_options();

// Header Section.
$wp_customize->add_section( 'local_supermarket_button_header_setting',
	array(
	'title'      => esc_html__( 'Header Settings', 'local-supermarket' ),
	'priority'   => 10,
	'capability' => 'edit_theme_options',
	'panel'      => 'local_supermarket_theme_option_panel',
	)
);

$wp_customize->add_setting( 'local_supermarket_header_email_id',
    array(
    'default'           => $local_supermarket_default['local_supermarket_header_email_id'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'local_supermarket_header_email_id',
    array(
    'label'    => esc_html__( 'Header Email Id', 'local-supermarket' ),
    'section'  => 'local_supermarket_button_header_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'local_supermarket_header_phone_number',
    array(
    'default'           => $local_supermarket_default['local_supermarket_header_phone_number'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'local_supermarket_header_phone_number',
    array(
    'label'    => esc_html__( 'Header Phone Number', 'local-supermarket' ),
    'section'  => 'local_supermarket_button_header_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'local_supermarket_header_address',
    array(
    'default'           => $local_supermarket_default['local_supermarket_header_address'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'sanitize_text_field',
    )
);
$wp_customize->add_control( 'local_supermarket_header_address',
    array(
    'label'    => esc_html__( 'Header Address', 'local-supermarket' ),
    'section'  => 'local_supermarket_button_header_setting',
    'type'     => 'text',
    )
);

$wp_customize->add_setting( 'local_supermarket_header_layout_wishlist',
    array(
    'default'           => $local_supermarket_default['local_supermarket_header_layout_wishlist'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'esc_url_raw',
    )
);
$wp_customize->add_control( 'local_supermarket_header_layout_wishlist',
    array(
    'label'    => esc_html__( 'Wishlist Link', 'local-supermarket' ),
    'section'  => 'local_supermarket_button_header_setting',
    'type'     => 'url',
    )
);

$wp_customize->add_setting('local_supermarket_header_search',
    array(
        'default'           => $local_supermarket_default['local_supermarket_header_search'],
        'capability' => 'edit_theme_options',
        'sanitize_callback' => 'local_supermarket_sanitize_checkbox',
    )
);
$wp_customize->add_control('local_supermarket_header_search',
    array(
        'label' => esc_html__('Enable/Disable search', 'local-supermarket'),
        'section' => 'local_supermarket_button_header_setting',
        'type' => 'checkbox',
    )
);

$wp_customize->add_setting('local_supermarket_menu_font_size',
    array(
        'default'           => $local_supermarket_default['local_supermarket_menu_font_size'],
        'capability'        => 'edit_theme_options',
        'sanitize_callback' => 'local_supermarket_sanitize_number_range',
    )
);
$wp_customize->add_control('local_supermarket_menu_font_size',
    array(
        'label'       => esc_html__('Menu Font Size', 'local-supermarket'),
        'section'     => 'local_supermarket_button_header_setting',
        'type'        => 'number',
        'input_attrs' => array(
           'min'   => 1,
           'max'   => 30,
           'step'   => 1,
        ),
    )
);

$wp_customize->add_setting( 'local_supermarket_menu_text_transform',
    array(
    'default'           => $local_supermarket_default['local_supermarket_menu_text_transform'],
    'capability'        => 'edit_theme_options',
    'sanitize_callback' => 'local_supermarket_sanitize_menu_transform',
    )
);
$wp_customize->add_control( 'local_supermarket_menu_text_transform',
    array(
    'label'       => esc_html__( 'Menu Text Transform', 'local-supermarket' ),
    'section'     => 'local_supermarket_button_header_setting',
    'type'        => 'select',
    'choices'     => array(
        'capitalize' => esc_html__( 'Capitalize', 'local-supermarket' ),
        'uppercase'  => esc_html__( 'Uppercase', 'local-supermarket' ),
        'lowercase'    => esc_html__( 'Lowercase', 'local-supermarket' ),
        ),
    )
);