<?php
/**
 * Defines the Homepage Layout manager settings for the Customizer.
 *
 * @package Pawfect
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

if ( ! class_exists( 'Pawfect_Options_Homepage_Layout' ) ) :

    /**
     * The Homepage Layout options class.
     */
    class Pawfect_Options_Homepage_Layout extends pawfect_Customize_Base_Option {

        /**
         * Get all the settings and controls.
         *
         * @return array
         */
        public function elements() {

            return array(

                /**
                 * The Layout Manager Control (Enhanced)
                 * This uses our enhanced 'Pawfect_Customize_Layout_Control' class.
                 */
                'layout_manager' => array(
                    'setting' => array(
                        'default' => array(),
                        'sanitize_callback' => array( 'pawfect_Customizer_Sanitize', 'sanitize_frontpage_sortable' ),
                    ),
                    'control' => array(
                        'type'        => 'pawfect_layout_manager',
                        'label'       => esc_html__( 'Front Page Layout', 'pawfect' ),
                        'description' => esc_html__( 'Drag and drop to reorder or disable frontpage sections. Pro-only sections are marked and cannot be enabled in the free version.', 'pawfect' ),
                        'section'     => 'frontpage_layout',
                        'priority'    => 10,
                    ),
                ),









                /**
                 * Global Layout Settings
                 */



                // Animation Settings
                'enable_animations' => array(
                    'setting' => array(
                        'default' => true,
                        'sanitize_callback' => 'wp_validate_boolean',
                    ),
                    'control' => array(
                        'type'        => 'pawfect-toggle',
                        'label'       => esc_html__( 'Enable Section Animations', 'pawfect' ),
                        'description' => esc_html__( 'Enable scroll animations for sections.', 'pawfect' ),
                        'section'     => 'frontpage_layout',
                        'priority'    => 180,
                    ),
                ),

                // Mobile Layout
                'mobile_stack_sections' => array(
                    'setting' => array(
                        'default' => true,
                        'sanitize_callback' => 'wp_validate_boolean',
                    ),
                    'control' => array(
                        'type'        => 'pawfect-toggle',
                        'label'       => esc_html__( 'Stack Sections on Mobile', 'pawfect' ),
                        'description' => esc_html__( 'Stack all sections vertically on mobile devices.', 'pawfect' ),
                        'section'     => 'frontpage_layout',
                        'priority'    => 190,
                    ),
                ),
            );
        }
    }

    // Instantiate the class so its settings get registered.
    new Pawfect_Options_Homepage_Layout();

endif;
