<?php
/**
 * Applied Discount Widget (Premium)
 *
 * A widget to display currently applied discount on cart/checkout pages.
 *
 * @package GGM_Commerce
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

require_once __DIR__ . '/widget-applied-discount/elementor-render.php';

/**
 * Class GGM_Commerce_Widget_Applied_Discount
 *
 * Premium widget for displaying applied discounts.
 */
class GGM_Commerce_Widget_Applied_Discount extends GGM_Commerce_Premium_Widget {

	/**
	 * Premium widget slug for license activation.
	 *
	 * @var string
	 */
	protected $premium_widget_slug = 'discount-vouchers';

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

	/**
	 * Get widget title.
	 *
	 * @return string Widget title.
	 */
	public function get_title() {
		return 'Applied Discount';
	}

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

	/**
	 * Get widget keywords.
	 *
	 * @return array Widget keywords.
	 */
	public function get_keywords() {
		return array( 'ggm', 'commerce', 'discount', 'applied', 'coupon', 'voucher', 'premium' );
	}

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

	/**
	 * Render the premium widget content.
	 * This is called by the parent class after license verification.
	 */
	protected function render_premium_content() {
		ggmc_applied_discount_render_premium_content( $this );
	}

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