<?php

$default = prime_beauty_salon_get_default_theme_options();
/**
* Add Header Top Panel
*/
$wp_customize->add_panel( 'header_top_panel', array(
    'title'          => __( 'Header Top', 'prime-beauty-salon' ),
    'priority'       => 20,
    'capability'     => 'edit_theme_options',
) );
$wp_customize->add_setting( 'prime_beauty_salon_site_title_size', array(
    'default'           => 30, // Default font size in pixels
    'sanitize_callback' => 'absint', // Sanitize the input as a positive integer
) );

// Show/hide site title
$wp_customize->add_setting('prime_beauty_salon_show_site_title', array(
    'default' => false, 
    'transport' => 'refresh',
    'sanitize_callback' => 'prime_beauty_salon_sanitize_checkbox',
));

$wp_customize->add_control('prime_beauty_salon_show_site_title', array(
    'label' => __('Show Site Title', 'prime-beauty-salon'),
    'section' => 'title_tagline',
    'settings' => 'prime_beauty_salon_show_site_title',
    'type' => 'checkbox',
));

// Add control for site title size
$wp_customize->add_control( 'prime_beauty_salon_site_title_size', array(
    'type'        => 'number',
    'section'     => 'title_tagline', // You can change this section to your preferred section
    'label'       => __( 'Site Title Font Size (px)', 'prime-beauty-salon' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
) );
$wp_customize->add_setting('show_site_description', array(
    'default' => false, // Set default to true (show site description)
    'transport' => 'refresh',
    'sanitize_callback' => 'prime_beauty_salon_sanitize_checkbox',
));

$wp_customize->add_control('show_site_description_control', array(
    'label' => __('Show Tagline', 'prime-beauty-salon'),
    'section' => 'title_tagline',
    'settings' => 'show_site_description',
    'type' => 'checkbox',
));
/** Header contact info section */
$wp_customize->add_section(
    'header_contact_info_section',
    array(
        'title'    => __( 'Contact Info', 'prime-beauty-salon' ),
        'panel'    => 'header_top_panel',
        'priority' => 10,
    )
);

$wp_customize->add_setting( 'theme_options[prime_beauty_salon_header_donate_btn_text]', array(
    'default'           => $default['prime_beauty_salon_header_donate_btn_text'],
    'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_header_donate_btn_text]',
    array(
        'label'           => __( 'Button Text', 'prime-beauty-salon' ),
        'description'     => __( 'Enter Button Text.', 'prime-beauty-salon' ),
        'section'         => 'header_contact_info_section',
    )
);

$wp_customize->add_setting( 'theme_options[prime_beauty_salon_header_donate_btn_url]', array(
    'default'           => $default['prime_beauty_salon_header_donate_btn_url'],
    'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_header_donate_btn_url]',
    array(
        'label'           => __( 'Button URL', 'prime-beauty-salon' ),
        'description'     => __( 'Enter Button URL.', 'prime-beauty-salon' ),
        'section'         => 'header_contact_info_section',
    )
);

/** Header social links section */
$wp_customize->add_section(
    'header_social_links_section',
    array(
        'title'    => __( 'Social Links', 'prime-beauty-salon' ),
        'panel'    => 'header_top_panel',
        'priority' => 20,
    )
);

/** Header social links control */
$wp_customize->add_setting( 
    'theme_options[prime_beauty_salon_show_header_social_links]', 
    array(
        'default'           => $default['prime_beauty_salon_show_header_social_links'],
        'sanitize_callback' => 'prime_beauty_salon_sanitize_checkbox',
    ) 
);

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_show_header_social_links]',
    array(
        'label'       => __( 'Show Social Links', 'prime-beauty-salon' ),
        'section'     => 'header_social_links_section',
        'type'        => 'checkbox',
    )
);

// Setting social_links.
$wp_customize->add_setting( 
    'theme_options[prime_beauty_salon_social_link_1]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_social_link_1]',
    array(
        'label'           => __( 'Social Link 1', 'prime-beauty-salon' ),
        'description'     => __( 'Enter valid url.', 'prime-beauty-salon' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_beauty_salon_social_links_active',
    )
);

$wp_customize->add_setting( 
    'theme_options[prime_beauty_salon_social_link_2]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_social_link_2]',
    array(
        'label'           => __( 'Social Link 2', 'prime-beauty-salon' ),
        'description'     => __( 'Enter valid url.', 'prime-beauty-salon' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_beauty_salon_social_links_active',
    )
);

$wp_customize->add_setting( 
    'theme_options[prime_beauty_salon_social_link_3]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_social_link_3]',
    array(
        'label'           => __( 'Social Link 3', 'prime-beauty-salon' ),
        'description'     => __( 'Enter valid url.', 'prime-beauty-salon' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_beauty_salon_social_links_active',
    )
);

$wp_customize->add_setting( 
    'theme_options[prime_beauty_salon_social_link_4]', 
    array(
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[prime_beauty_salon_social_link_4]',
    array(
        'label'           => __( 'Social Link 4', 'prime-beauty-salon' ),
        'description'     => __( 'Enter valid url.', 'prime-beauty-salon' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_beauty_salon_social_links_active',
    )
);