<?php
/**
 * Theme Customizer Controls
 *
 * @package pawwell
 */

defined( 'ABSPATH' ) || exit;


if ( ! function_exists( 'pawwell_customizer_footer_register' ) ) :
function pawwell_customizer_footer_register( $wp_customize ) {
 	
 	/**
     * Footer Settings Section
     */
    $wp_customize->add_section(
        'pawwell_footer_settings',
        array(
            'priority'   => 25,
            'capability' => 'edit_theme_options',
            'title'      => esc_html__( 'Footer Settings', 'pawwell' ),
        )
    );

    // Title label - Copyright
    $wp_customize->add_setting(
        'pawwell_footer_copyright_label',
        array(
            'sanitize_callback' => 'pawwell_sanitize_title',
        )
    );

    $wp_customize->add_control(
        new Pawwell_Title_Info_Control( $wp_customize, 'pawwell_footer_copyright_label',
        array(
            'label'    => esc_html__( 'Copyright Settings', 'pawwell' ),
            'section'  => 'pawwell_footer_settings',
            'type'     => 'pawwell-title',
            'settings' => 'pawwell_footer_copyright_label',
        )
    ));

    // Copyright text
    $wp_customize->add_setting(
        'pawwell_footer_copyright_text',
        array(
            'type'              => 'theme_mod',
            'sanitize_callback' => 'pawwell_sanitize_textarea_field',
        )
    );

    $wp_customize->add_control(
        'pawwell_footer_copyright_text',
        array(
            'settings'    => 'pawwell_footer_copyright_text',
            'section'     => 'pawwell_footer_settings',
            'type'        => 'textarea',
            'label'       => esc_html__( 'Footer Copyright Text', 'pawwell' ),
            'description' => esc_html__( 'Copyright text to be displayed in the footer. No HTML allowed.', 'pawwell' ),
        )
    );

    // Title label - Footer Bottom Links
    $wp_customize->add_setting(
        'pawwell_footer_bottom_links_label',
        array(
            'sanitize_callback' => 'pawwell_sanitize_title',
        )
    );

    $wp_customize->add_control(
        new Pawwell_Title_Info_Control( $wp_customize, 'pawwell_footer_bottom_links_label',
        array(
            'label'    => esc_html__( 'Footer Bottom Links', 'pawwell' ),
            'section'  => 'pawwell_footer_settings',
            'type'     => 'pawwell-title',
            'settings' => 'pawwell_footer_bottom_links_label',
        )
    ));

    // Privacy Policy URL
    $wp_customize->add_setting(
        'pawwell_footer_privacy_policy_url',
        array(
            'type'              => 'theme_mod',
            'sanitize_callback' => 'pawwell_sanitize_url',
        )
    );

    $wp_customize->add_control(
        'pawwell_footer_privacy_policy_url',
        array(
            'settings'    => 'pawwell_footer_privacy_policy_url',
            'section'     => 'pawwell_footer_settings',
            'type'        => 'url',
            'label'       => esc_html__( 'Privacy Policy URL', 'pawwell' ),
            'description' => esc_html__( 'Enter the URL for the Privacy Policy page.', 'pawwell' ),
        )
    );

    // Cookie Policy URL
    $wp_customize->add_setting(
        'pawwell_footer_cookie_policy_url',
        array(
            'type'              => 'theme_mod',
            'sanitize_callback' => 'pawwell_sanitize_url',
        )
    );

    $wp_customize->add_control(
        'pawwell_footer_cookie_policy_url',
        array(
            'settings'    => 'pawwell_footer_cookie_policy_url',
            'section'     => 'pawwell_footer_settings',
            'type'        => 'url',
            'label'       => esc_html__( 'Cookie Policy URL', 'pawwell' ),
            'description' => esc_html__( 'Enter the URL for the Cookie Policy page.', 'pawwell' ),
        )
    );

    // Terms & Conditions URL
    $wp_customize->add_setting(
        'pawwell_footer_terms_url',
        array(
            'type'              => 'theme_mod',
            'sanitize_callback' => 'pawwell_sanitize_url',
        )
    );

    $wp_customize->add_control(
        'pawwell_footer_terms_url',
        array(
            'settings'    => 'pawwell_footer_terms_url',
            'section'     => 'pawwell_footer_settings',
            'type'        => 'url',
            'label'       => esc_html__( 'Terms & Conditions URL', 'pawwell' ),
            'description' => esc_html__( 'Enter the URL for the Terms & Conditions page.', 'pawwell' ),
        )
    );
}
endif;

add_action( 'customize_register', 'pawwell_customizer_footer_register' );