<?php
/**
 * WooCommerce Shop Page Options
 *
 * @package Pawfect
 */

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

if (!class_exists('Pawfect_Options_Shop_Page')):

class Pawfect_Options_Shop_Page extends pawfect_Customize_Base_Option {

    /**
     * Arguments for options.
     *
     * @return array
     */
    public function elements() {

        return array(

            // Advanced Features Heading
            'pawfect_shop_advanced_features_heading' => array(
                'setting' => array(),
                'control' => array(
                    'type'        => 'heading',
                    'priority'    => 1,
                    'label'       => esc_html__('Advanced E-commerce Features', 'pawfect'),
                    'description' => esc_html__('Enable or disable advanced WooCommerce features for enhanced user experience.', 'pawfect'),
                    'section'     => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Enable Cart Dropdown
            'pawfect_cart_dropdown_enabled' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'        => 'toggle',
                    'priority'    => 2,
                    'label'       => esc_html__('Enable Cart Dropdown', 'pawfect'),
                    'description' => esc_html__('Show cart items in a dropdown when hovering over the cart icon.', 'pawfect'),
                    'section'     => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Enable Wishlist
            'pawfect_wishlist_enabled' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'        => 'toggle',
                    'priority'    => 3,
                    'label'       => esc_html__('Enable Wishlist', 'pawfect'),
                    'description' => esc_html__('Allow users to add products to their wishlist with heart icons.', 'pawfect'),
                    'section'     => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Enable Quick View
            'pawfect_quick_view_enabled' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'        => 'toggle',
                    'priority'    => 4,
                    'label'       => esc_html__('Enable Quick View', 'pawfect'),
                    'description' => esc_html__('Allow users to preview products in a modal popup without leaving the current page.', 'pawfect'),
                    'section'     => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Shop Layout
            'pawfect_shop_layout' => array(
                'setting' => array(
                    'default'           => 'sidebar-left',
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_radio'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'simple-radio-image',
                    'priority'        => 5,
                    'label'           => esc_html__('Shop Layout', 'pawfect'),
                    'description'     => esc_html__('Choose the layout for your shop page.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                    'choices'         => array(
                        'sidebar-left'  => PAWFECT_THEME_URL . '/assets/images/icons/left-sidebar.png',
                        'sidebar-right' => PAWFECT_THEME_URL . '/assets/images/icons/right-sidebar.png',
                        'no-sidebar'    => PAWFECT_THEME_URL . '/assets/images/icons/fullwidth.png',
                    ),
                ),
            ),

            // Products Per Row
            'pawfect_shop_columns' => array(
                'setting' => array(
                    'default'           => 3,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_number_range'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-slider',
                    'priority'        => 10,
                    'label'           => esc_html__('Products Per Row', 'pawfect'),
                    'description'     => esc_html__('Number of product columns to display.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                    'input_attrs'     => array(
                        'min'  => 2,
                        'max'  => 6,
                        'step' => 1,
                    ),
                ),
            ),

            // Products Per Page
            'pawfect_shop_products_per_page' => array(
                'setting' => array(
                    'default'           => 12,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_number_range'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-slider',
                    'priority'        => 15,
                    'label'           => esc_html__('Products Per Page', 'pawfect'),
                    'description'     => esc_html__('Number of products to show per page.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                    'input_attrs'     => array(
                        'min'  => 6,
                        'max'  => 48,
                        'step' => 6,
                    ),
                ),
            ),

            // Default Sorting
            'pawfect_shop_default_sorting' => array(
                'setting' => array(
                    'default'           => 'menu_order',
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_radio'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'select',
                    'priority'        => 20,
                    'label'           => esc_html__('Default Product Sorting', 'pawfect'),
                    'description'     => esc_html__('Choose the default sorting for products.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                    'choices'         => array(
                        'menu_order' => esc_html__('Default sorting', 'pawfect'),
                        'popularity' => esc_html__('Sort by popularity', 'pawfect'),
                        'rating'     => esc_html__('Sort by average rating', 'pawfect'),
                        'date'       => esc_html__('Sort by latest', 'pawfect'),
                        'price'      => esc_html__('Sort by price: low to high', 'pawfect'),
                        'price-desc' => esc_html__('Sort by price: high to low', 'pawfect'),
                    ),
                ),
            ),

            // Show Product Count
            'pawfect_shop_show_result_count' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 25,
                    'label'           => esc_html__('Show Result Count', 'pawfect'),
                    'description'     => esc_html__('Display "Showing X-Y of Z results" text.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Show Sorting Dropdown
            'pawfect_shop_show_sorting' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 30,
                    'label'           => esc_html__('Show Sorting Dropdown', 'pawfect'),
                    'description'     => esc_html__('Allow customers to change product sorting.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Product Card Style
            'pawfect_shop_card_style' => array(
                'setting' => array(
                    'default'           => 'modern',
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_radio'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'radio-switch',
                    'priority'        => 35,
                    'label'           => esc_html__('Product Card Style', 'pawfect'),
                    'description'     => esc_html__('Choose the style for product cards.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                    'choices'         => array(
                        'modern'  => esc_html__('Modern', 'pawfect'),
                        'classic' => esc_html__('Classic', 'pawfect'),
                    ),
                ),
            ),

            // Show Sale Badge
            'pawfect_shop_show_sale_badge' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 40,
                    'label'           => esc_html__('Show Sale Badge', 'pawfect'),
                    'description'     => esc_html__('Display sale badges on discounted products.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Show Quick View
            'pawfect_shop_show_quick_view' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 45,
                    'label'           => esc_html__('Show Quick View Button', 'pawfect'),
                    'description'     => esc_html__('Display quick view button on product hover.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Show View Toggle
            'pawfect_shop_show_view_toggle' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 47,
                    'label'           => esc_html__('Show View Toggle Buttons', 'pawfect'),
                    'description'     => esc_html__('Display grid/list view toggle buttons in shop toolbar.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Show Short Description in List View
            'pawfect_shop_show_excerpt_list' => array(
                'setting' => array(
                    'default'           => false,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 48,
                    'label'           => esc_html__('Show Short Description in List View', 'pawfect'),
                    'description'     => esc_html__('Display product short description when using list view.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

            // Sidebar Options
            'pawfect_shop_sidebar_sticky' => array(
                'setting' => array(
                    'default'           => true,
                    'sanitize_callback' => array('pawfect_Customizer_Sanitize', 'sanitize_checkbox'),
                    'transport'         => 'refresh',
                ),
                'control' => array(
                    'type'            => 'pawfect-toggle',
                    'priority'        => 50,
                    'label'           => esc_html__('Sticky Sidebar', 'pawfect'),
                    'description'     => esc_html__('Make the sidebar sticky when scrolling.', 'pawfect'),
                    'section'         => 'pawfect_woocommerce_shop_page',
                ),
            ),

        );
    }
}

new Pawfect_Options_Shop_Page();

endif;



