<?php
/**
 * Product Filter Widget
 *
 * Includes AJAX filtering, price slider, categories/tags, and full Elementor controls.
 *
 * @package GGM_Commerce
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require_once __DIR__ . '/widget-product-filter/elementor-render.php';

/**
 * Class GGM_Commerce_Product_Filter_Widget
 */
class GGM_Commerce_Product_Filter_Widget extends \GGM_Commerce_Base_Widget {

	/**
	 * Get widget name.
	 *
	 * @return string
	 */
	public function get_name() {
		return 'ggmc-product-filter';
	}

	/**
	 * Get widget title.
	 *
	 * @return string
	 */
	public function get_title() {
		return __( 'Product Filter', 'ggm-commerce' );
	}

	/**
	 * Get widget icon.
	 *
	 * @return string
	 */
	public function get_icon() {
		return 'eicon-filter';
	}

	/**
	 * Get widget categories.
	 *
	 * @return array
	 */
	public function get_categories() {
		return [ 'ggmc-widgets' ];
	}

	/**
	 * Get widget keywords.
	 *
	 * @return array
	 */
	public function get_keywords() {
		return [ 'filter', 'product', 'search', 'ggm-commerce' ];
	}

	/**
	 * Get script dependencies.
	 *
	 * @return array
	 */
	public function get_script_depends() {
		return [ 'ggmc-widget-product-filter' ];
	}

	/**
	 * Get style dependencies.
	 *
	 * @return array
	 */
	public function get_style_depends() {
		return [ 'ggmc-widget-product-filter' ];
	}

	/**
	 * Register widget controls.
	 */
	protected function register_controls() {
		require __DIR__ . '/widget-product-filter/elementor-controls.php';
		require __DIR__ . '/widget-product-filter/elementor-controls-layout.php';
		require __DIR__ . '/widget-product-filter/elementor-controls-style.php';
	}

	/**
	 * Render the widget output.
	 */
	protected function render() {
		ggmc_product_filter_render( $this );
	}

	/**
	 * Get default styles for this widget.
	 * Uses centralized configuration from default-widget-styles.php.
	 *
	 * @return array
	 */
	public static function get_static_default_styles() {
		return self::get_defaults_from_config();
	}
}
