<?php
/**
 * Cart Display Widget
 */

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

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

class GGM_Commerce_Widget_Cart_Display extends \GGM_Commerce_Base_Widget {

    public function get_name() {
        return 'ggmc-cart-display';
    }

    public function get_title() {
        return 'Cart Display';
    }

    public function get_icon() {
        return 'eicon-cart-medium';
    }

    public function get_categories() {
        return ['ggmc-widgets'];
    }

    public function get_script_depends() {
        return ['ggmc-cart'];
    }

    public function get_style_depends() {
        return ['ggmc-cart'];
    }

    public function get_keywords() {
        return ['ggm-commerce', 'cart', 'display', 'shopping', 'items'];
    }

    protected function register_controls() {
        require plugin_dir_path(__FILE__) . 'widget-cart-display/elementor-controls.php';
        require plugin_dir_path(__FILE__) . 'widget-cart-display/elementor-controls-style.php';
    }

    protected function render() {
        ggmc_cart_display_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();
    }
}
