<?php
/**
 * Product Gallery Widget
 */

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

require_once plugin_dir_path( __FILE__ ) . '../data/class-product-gallery-data-handler.php';
require_once plugin_dir_path( __FILE__ ) . 'widget-product-gallery/elementor-render.php';

class GGM_Commerce_Product_Gallery_Widget extends \GGM_Commerce_Base_Widget {

	/**
	 * Widget name
	 */
	public function get_name() {
		return 'ggmc-product-gallery';
	}

	/**
	 * Widget title
	 */
	public function get_title() {
		return esc_html__( 'Product Gallery', 'ggm-commerce' );
	}

	/**
	 * Widget icon
	 */
	public function get_icon() {
		return 'eicon-gallery-grid';
	}

	/**
	 * Widget categories
	 */
	public function get_categories() {
		return [ 'ggmc-widgets' ];
	}

	/**
	 * Widget keywords
	 */
	public function get_keywords() {
		return [ 'ggm-commerce', 'product', 'gallery', 'images', 'photos' ];
	}

	/**
	 * Get script dependencies
	 */
	public function get_script_depends() {
		return [ 'ggmc-gallery-handler' ];
	}

	/**
	 * Register controls
	 */
	protected function register_controls() {
		require plugin_dir_path( __FILE__ ) . 'widget-product-gallery/elementor-controls.php';
		require plugin_dir_path( __FILE__ ) . 'widget-product-gallery/elementor-controls-style.php';
	}

	/**
	 * Render widget output
	 */
	protected function render() {
		ggmc_product_gallery_render( $this );
	}

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