<?php
/**
 * Product Table Widget — TAB_STYLE Controls
 * Included via require inside register_controls(). Uses $this directly.
 */

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

// -------------------------------------------------------------------------
// Table
// -------------------------------------------------------------------------
$this->start_controls_section(
    'table_style',
    [
        'label' => __('Table', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_control(
    'table_background_color',
    [
        'label' => 'Background Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'table_border',
        'label' => 'Border',
        'selector' => '{{WRAPPER}} .ggmc-product-table',
    ]
);

$this->add_responsive_control(
    'table_border_radius',
    [
        'label' => 'Border Radius',
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'table_box_shadow',
        'label' => 'Box Shadow',
        'selector' => '{{WRAPPER}} .ggmc-product-table',
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Header
// -------------------------------------------------------------------------
$this->start_controls_section(
    'header_style',
    [
        'label' => __('Header', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_control(
    'header_background_color',
    [
        'label' => 'Header Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table thead th' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'header_text_color',
    [
        'label' => 'Header Text Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table thead th' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'header_typography',
        'label' => 'Header Typography',
        'selector' => '{{WRAPPER}} .ggmc-product-table thead th',
    ]
);

$this->add_responsive_control(
    'header_padding',
    [
        'label' => 'Header Padding',
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'default' => [
            'top' => '10',
            'right' => '12',
            'bottom' => '10',
            'left' => '12',
            'unit' => 'px',
            'isLinked' => false,
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Row
// -------------------------------------------------------------------------
$this->start_controls_section(
    'row_style',
    [
        'label' => __('Row', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_control(
    'row_background_color',
    [
        'label' => 'Row Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody tr' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'row_hover_background_color',
    [
        'label' => 'Row Hover Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody tr:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'enable_striped_rows',
    [
        'label' => 'Enable Striped Rows',
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => 'Yes',
        'label_off' => 'No',
        'return_value' => 'yes',
        'default' => 'yes',
        'description' => 'Alternate row background colors for better readability',
    ]
);

$this->add_control(
    'alternate_row_background_color',
    [
        'label' => 'Alternate Row Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody tr:nth-child(even)' => 'background-color: {{VALUE}};',
        ],
        'condition' => [
            'enable_striped_rows' => 'yes',
        ],
    ]
);

$this->add_control(
    'row_text_color',
    [
        'label' => 'Row Text Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody td' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'row_typography',
        'label' => 'Row Typography',
        'selector' => '{{WRAPPER}} .ggmc-product-table tbody td',
    ]
);

$this->add_responsive_control(
    'cell_padding',
    [
        'label' => 'Cell Padding',
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'default' => [
            'top' => '8',
            'right' => '12',
            'bottom' => '8',
            'left' => '12',
            'unit' => 'px',
            'isLinked' => false,
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table th, {{WRAPPER}} .ggmc-product-table td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'cell_border',
        'label' => 'Cell Border',
        'selector' => '{{WRAPPER}} .ggmc-product-table th, {{WRAPPER}} .ggmc-product-table td',
    ]
);

$this->add_control(
    'row_hover_lift',
    [
        'label' => 'Hover Lift Effect',
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => 'Yes',
        'label_off' => 'No',
        'return_value' => 'yes',
        'default' => 'no',
        'separator' => 'before',
    ]
);

$this->add_responsive_control(
    'row_hover_lift_offset',
    [
        'label' => 'Lift Offset',
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 20,
            ],
        ],
        'default' => [
            'size' => 2,
            'unit' => 'px',
        ],
        'condition' => [
            'row_hover_lift' => 'yes',
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody tr:hover' => 'transform: translateY(-{{SIZE}}{{UNIT}});',
        ],
    ]
);

$this->add_control(
    'row_hover_transition',
    [
        'label' => 'Transition Duration',
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['ms'],
        'range' => [
            'ms' => [
                'min' => 0,
                'max' => 1000,
                'step' => 50,
            ],
        ],
        'default' => [
            'size' => 300,
            'unit' => 'ms',
        ],
        'condition' => [
            'row_hover_lift' => 'yes',
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody tr' => 'transition: all {{SIZE}}ms ease;',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'row_border',
        'label' => __('Row Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table tbody tr',
        'separator' => 'before',
    ]
);

$this->add_responsive_control(
    'row_border_radius',
    [
        'label' => __('Row Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table tbody tr' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'row_box_shadow',
        'label' => __('Row Box Shadow', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table tbody tr',
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'row_hover_box_shadow',
        'label' => __('Row Hover Box Shadow', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table tbody tr:hover',
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Product Name
// -------------------------------------------------------------------------
$this->start_controls_section(
    'name_style',
    [
        'label' => __('Product Name', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_name_column' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'name_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table .name-cell .product-name',
    ]
);

$this->start_controls_tabs('name_color_tabs');

$this->start_controls_tab(
    'name_normal_tab',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'name_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .name-cell .product-name a' => 'color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'name_hover_tab',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'name_hover_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .name-cell .product-name a:hover' => 'color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

$this->end_controls_section();

// -------------------------------------------------------------------------
// Categories
// -------------------------------------------------------------------------
$this->start_controls_section(
    'categories_style',
    [
        'label' => __('Categories', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_categories' => 'yes',
            'show_name_column' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'categories_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .product-category',
    ]
);

$this->add_control(
    'categories_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-category' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'categories_background_color',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-category' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'categories_hover_color',
    [
        'label' => __('Hover Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-category:hover' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'categories_hover_background_color',
    [
        'label' => __('Hover Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-category:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'categories_spacing',
    [
        'label' => __('Spacing Between Categories', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 20,
            ],
        ],
        'default' => [
            'size' => 5,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .product-categories' => 'gap: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'categories_padding',
    [
        'label' => __('Padding', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .product-category' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'categories_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .product-category' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'categories_margin',
    [
        'label' => __('Margin', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .product-categories' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Rating
// -------------------------------------------------------------------------
$this->start_controls_section(
    'rating_style',
    [
        'label' => __('Product Rating', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_rating_column' => 'yes',
        ],
    ]
);

$this->add_control(
    'rating_color',
    [
        'label' => __('Star Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-rating .star' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'rating_empty_color',
    [
        'label' => __('Empty Star Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-rating .star.empty' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'rating_size',
    [
        'label' => __('Star Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 10,
                'max' => 50,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .product-rating .star' => 'font-size: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'rating_spacing',
    [
        'label' => __('Spacing Between Stars', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .product-rating .star:not(:last-child)' => 'margin-right: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'rating_before_text',
    [
        'label' => __('Before Text', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => '(',
        'description' => __('Text to display before the rating number', 'ggm-commerce'),
    ]
);

$this->add_control(
    'rating_after_text',
    [
        'label' => __('After Text', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => ')',
        'description' => __('Text to display after the rating number', 'ggm-commerce'),
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'rating_text_typography',
        'label' => __('Rating Text Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .product-rating .rating-text',
    ]
);

$this->add_control(
    'rating_text_color',
    [
        'label' => __('Rating Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .product-rating .rating-text' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'rating_text_spacing',
    [
        'label' => __('Space Before Text', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 20,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .product-rating .rating-text' => 'margin-left: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'rating_margin',
    [
        'label' => __('Margin', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .product-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// SKU
// -------------------------------------------------------------------------
$this->start_controls_section(
    'sku_style',
    [
        'label' => __('SKU', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_sku_column' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'sku_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table .product-sku',
    ]
);

$this->add_control(
    'sku_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-sku' => 'color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Badges
// -------------------------------------------------------------------------
$this->start_controls_section(
    'badge_style',
    [
        'label' => __('Badges', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_badges_column' => 'yes',
        ],
    ]
);

$this->add_control(
    'badge_featured_bg',
    [
        'label' => 'Featured Badge Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .badge-featured' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'badge_featured_color',
    [
        'label' => 'Featured Badge Text',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .badge-featured' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'badge_sale_bg',
    [
        'label' => 'Sale Badge Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .badge-sale' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'badge_sale_color',
    [
        'label' => 'Sale Badge Text',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .badge-sale' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'badge_new_bg',
    [
        'label' => 'New Badge Background',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .badge-new' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'badge_new_color',
    [
        'label' => 'New Badge Text',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .badge-new' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'badge_padding',
    [
        'label' => 'Badge Padding',
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', 'em'],
        'default' => [
            'top' => '4',
            'right' => '10',
            'bottom' => '4',
            'left' => '10',
            'unit' => 'px',
            'isLinked' => false,
        ],
        'selectors' => [
            '{{WRAPPER}} .badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'badge_typography',
        'label' => 'Badge Typography',
        'selector' => '{{WRAPPER}} .badge',
    ]
);

$this->add_responsive_control(
    'badge_border_radius',
    [
        'label' => 'Border Radius',
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px', '%'],
        'range' => [
            'px' => ['min' => 0, 'max' => 20],
            '%' => ['min' => 0, 'max' => 50],
        ],
        'default' => [
            'size' => 4,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .badge' => 'border-radius: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Price
// -------------------------------------------------------------------------
$this->start_controls_section(
    'price_style',
    [
        'label' => __('Price', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_price_column' => 'yes',
        ],
    ]
);

$this->add_control(
    'price_regular_color',
    [
        'label' => 'Regular Price Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-price .current-price' => 'color: {{VALUE}};',
            '{{WRAPPER}} .ggmc-product-table .product-price' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'price_sale_color',
    [
        'label' => 'Sale Price Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-price .sale-price' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'price_original_color',
    [
        'label' => 'Original Price Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-price .original-price' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'price_typography',
        'label' => 'Price Typography',
        'selector' => '{{WRAPPER}} .ggmc-product-table .product-price',
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Stock Status
// -------------------------------------------------------------------------
$this->start_controls_section(
    'stock_style',
    [
        'label' => __('Stock Status', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_stock_column' => 'yes',
        ],
    ]
);

$this->add_control(
    'stock_in_stock_color',
    [
        'label' => 'In Stock Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-stock.in-stock' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'stock_low_stock_color',
    [
        'label' => 'Low Stock Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-stock.low-stock' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'stock_out_of_stock_color',
    [
        'label' => 'Out of Stock Color',
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .product-stock.out-of-stock' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'stock_typography',
        'label' => 'Stock Typography',
        'selector' => '{{WRAPPER}} .ggmc-product-table .product-stock',
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Description
// -------------------------------------------------------------------------
$this->start_controls_section(
    'description_style',
    [
        'label' => __('Description', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_description_column' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'description_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table .description-cell',
    ]
);

$this->add_control(
    'description_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .description-cell' => 'color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Product Image
// -------------------------------------------------------------------------
$this->start_controls_section(
    'image_style',
    [
        'label' => __('Product Image', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_image_column' => 'yes',
        ],
    ]
);

$this->add_control(
    'image_hover_effect',
    [
        'label' => 'Hover Effect',
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'zoom',
        'options' => [
            'none' => 'None',
            'zoom' => 'Zoom',
            'slide' => 'Slide',
        ],
    ]
);

$this->add_control(
    'image_hover_trigger',
    [
        'label' => 'Hover Trigger',
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'image',
        'options' => [
            'image' => 'Image Only',
            'item' => 'Entire Table Row',
        ],
        'condition' => [
            'image_hover_effect!' => 'none',
        ],
    ]
);

$this->add_responsive_control(
    'image_width',
    [
        'label' => 'Image Width',
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 40,
                'max' => 200,
            ],
        ],
        'default' => [
            'size' => 60,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .product-image-wrapper img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'image_border_radius',
    [
        'label' => 'Border Radius',
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .product-image-wrapper img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Quick View Button
// -------------------------------------------------------------------------
$this->start_controls_section(
    'quick_view_style',
    [
        'label' => __('Quick View Button', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_quick_view' => 'yes',
            'show_image_column' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'quick_view_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .quick-view-btn',
    ]
);

$this->start_controls_tabs('quick_view_tabs');

$this->start_controls_tab(
    'quick_view_normal',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'quick_view_icon_color',
    [
        'label' => __('Icon Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'quick_view_background_color',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'default' => 'rgba(255, 255, 255, 0.9)',
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'quick_view_hover',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'quick_view_hover_icon_color',
    [
        'label' => __('Icon Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn:hover' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'quick_view_hover_background_color',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

$this->add_responsive_control(
    'quick_view_icon_size',
    [
        'label' => __('Icon Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 12,
                'max' => 48,
            ],
        ],
        'default' => [
            'size' => 20,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn' => 'font-size: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'quick_view_size',
    [
        'label' => __('Button Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 30,
                'max' => 80,
            ],
        ],
        'default' => [
            'size' => 40,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'quick_view_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'default' => [
            'top' => '50',
            'right' => '50',
            'bottom' => '50',
            'left' => '50',
            'unit' => '%',
            'isLinked' => true,
        ],
        'selectors' => [
            '{{WRAPPER}} .quick-view-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Actions Buttons
// -------------------------------------------------------------------------
$this->start_controls_section(
    'actions_style',
    [
        'label' => __('Actions Buttons', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_actions_column' => 'yes',
        ],
    ]
);

// Add to Cart Button
$this->add_control(
    'add_to_cart_heading',
    [
        'label' => __('Add to Cart Button', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
    ]
);

$this->add_control(
    'add_to_cart_show_icon',
    [
        'label' => __('Show Icon', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => __('Show', 'ggm-commerce'),
        'label_off' => __('Hide', 'ggm-commerce'),
        'return_value' => 'yes',
        'default' => 'yes',
    ]
);

$this->add_control(
    'add_to_cart_icon',
    [
        'label' => __('Icon', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'fas fa-shopping-cart',
            'library' => 'fa-solid',
        ],
        'condition' => [
            'add_to_cart_show_icon' => 'yes',
        ],
    ]
);

$this->add_control(
    'add_to_cart_icon_position',
    [
        'label' => __('Icon Position', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'before',
        'options' => [
            'before' => __('Before Text', 'ggm-commerce'),
            'after' => __('After Text', 'ggm-commerce'),
        ],
        'condition' => [
            'add_to_cart_show_icon' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'add_to_cart_icon_spacing',
    [
        'label' => __('Icon Spacing', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 50,
            ],
        ],
        'default' => [
            'unit' => 'px',
            'size' => 5,
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn i' => 'margin-right: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn svg' => 'margin-right: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn.icon-after i' => 'margin-right: 0; margin-left: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn.icon-after svg' => 'margin-right: 0; margin-left: {{SIZE}}{{UNIT}};',
        ],
        'condition' => [
            'add_to_cart_show_icon' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'actions_button_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn',
    ]
);

$this->add_responsive_control(
    'actions_button_padding',
    [
        'label' => __('Padding', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', 'em'],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'actions_button_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->start_controls_tabs('actions_button_tabs');

$this->start_controls_tab(
    'actions_button_normal_tab',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'actions_button_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'actions_button_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'actions_button_border',
        'label' => __('Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn',
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'actions_button_hover_tab',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'actions_button_hover_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn:hover' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'actions_button_hover_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'actions_button_hover_border_color',
    [
        'label' => __('Border Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .ggmc-add-to-cart-btn:hover' => 'border-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

// Wishlist Button
$this->add_control(
    'wishlist_button_heading',
    [
        'label' => __('Wishlist Button', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
        'separator' => 'before',
    ]
);

$this->add_control(
    'wishlist_icon',
    [
        'label' => __('Wishlist Icon', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'eicon-heart-o',
            'library' => 'eicons',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'wishlist_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .wishlist-btn',
    ]
);

$this->add_responsive_control(
    'wishlist_button_size',
    [
        'label' => __('Icon Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 10,
                'max' => 50,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn i' => 'font-size: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->start_controls_tabs('wishlist_button_tabs');

$this->start_controls_tab(
    'wishlist_normal_tab',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'wishlist_button_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn' => 'color: {{VALUE}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn svg' => 'fill: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'wishlist_button_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'wishlist_hover_tab',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'wishlist_button_hover_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn:hover' => 'color: {{VALUE}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn:hover svg' => 'fill: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'wishlist_button_hover_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .wishlist-btn:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

$this->add_responsive_control(
    'wishlist_padding',
    [
        'label' => __('Padding', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .wishlist-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'wishlist_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'default' => [
            'top' => '50',
            'right' => '50',
            'bottom' => '50',
            'left' => '50',
            'unit' => '%',
            'isLinked' => true,
        ],
        'selectors' => [
            '{{WRAPPER}} .wishlist-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

// Compare Button
$this->add_control(
    'compare_button_heading',
    [
        'label' => __('Compare Button', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
        'separator' => 'before',
    ]
);

$this->add_control(
    'compare_icon',
    [
        'label' => __('Compare Icon', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::ICONS,
        'default' => [
            'value' => 'eicon-exchange',
            'library' => 'eicons',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'compare_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .compare-btn',
    ]
);

$this->add_responsive_control(
    'compare_button_size',
    [
        'label' => __('Icon Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 10,
                'max' => 50,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn i' => 'font-size: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->start_controls_tabs('compare_button_tabs');

$this->start_controls_tab(
    'compare_normal_tab',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'compare_button_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn' => 'color: {{VALUE}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn svg' => 'fill: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'compare_button_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'compare_hover_tab',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'compare_button_hover_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn:hover' => 'color: {{VALUE}};',
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn:hover svg' => 'fill: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'compare_button_hover_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-product-table .actions-cell .compare-btn:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

$this->add_responsive_control(
    'compare_padding',
    [
        'label' => __('Padding', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .compare-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'compare_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'default' => [
            'top' => '50',
            'right' => '50',
            'bottom' => '50',
            'left' => '50',
            'unit' => '%',
            'isLinked' => true,
        ],
        'selectors' => [
            '{{WRAPPER}} .compare-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Sorting Controls
// -------------------------------------------------------------------------
$this->start_controls_section(
    'sorting_style',
    [
        'label' => __('Sorting Controls', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'enable_sorting' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'sorting_alignment',
    [
        'label' => __('Alignment', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::CHOOSE,
        'options' => [
            'flex-start' => [
                'title' => __('Left', 'ggm-commerce'),
                'icon' => 'eicon-text-align-left',
            ],
            'center' => [
                'title' => __('Center', 'ggm-commerce'),
                'icon' => 'eicon-text-align-center',
            ],
            'flex-end' => [
                'title' => __('Right', 'ggm-commerce'),
                'icon' => 'eicon-text-align-right',
            ],
        ],
        'default' => 'flex-end',
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls' => 'justify-content: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'sorting_margin',
    [
        'label' => __('Margin', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'sorting_gap',
    [
        'label' => __('Gap', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px', 'em'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 50,
            ],
            'em' => [
                'min' => 0,
                'max' => 3,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls .sorting-group' => 'gap: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'sorting_label_heading',
    [
        'label' => __('Label', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
        'separator' => 'before',
        'condition' => [
            'sorting_show_label' => 'yes',
        ],
    ]
);

$this->add_control(
    'sorting_label_html_tag',
    [
        'label' => __('HTML Tag', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SELECT,
        'default' => 'label',
        'options' => [
            'label' => 'label',
            'span' => 'span',
            'p' => 'p',
            'div' => 'div',
        ],
        'condition' => [
            'sorting_show_label' => 'yes',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'sorting_label_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .table-sorting-controls .sorting-label',
        'condition' => [
            'sorting_show_label' => 'yes',
        ],
    ]
);

$this->add_control(
    'sorting_label_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls .sorting-label' => 'color: {{VALUE}};',
        ],
        'condition' => [
            'sorting_show_label' => 'yes',
        ],
    ]
);

$this->add_control(
    'sorting_dropdown_heading',
    [
        'label' => __('Dropdown', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
        'separator' => 'before',
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'sorting_dropdown_typography',
        'label' => __('Dropdown Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .table-sorting-controls select',
    ]
);

$this->add_responsive_control(
    'sorting_dropdown_padding',
    [
        'label' => __('Padding', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', 'em'],
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'sorting_dropdown_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls select' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'sorting_dropdown_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls select' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'sorting_dropdown_border',
        'label' => __('Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .table-sorting-controls select',
    ]
);

$this->add_responsive_control(
    'sorting_dropdown_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .table-sorting-controls select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_section();

// -------------------------------------------------------------------------
// Pagination
// -------------------------------------------------------------------------
$this->start_controls_section(
    'pagination_style',
    [
        'label' => __('Pagination', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_pagination' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'pagination_margin',
    [
        'label' => __('Margin', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .ggmc-pagination' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'pagination_align',
    [
        'label' => __('Alignment', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::CHOOSE,
        'options' => [
            'flex-start' => [
                'title' => __('Left', 'ggm-commerce'),
                'icon' => 'eicon-text-align-left',
            ],
            'center' => [
                'title' => __('Center', 'ggm-commerce'),
                'icon' => 'eicon-text-align-center',
            ],
            'flex-end' => [
                'title' => __('Right', 'ggm-commerce'),
                'icon' => 'eicon-text-align-right',
            ],
        ],
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .ggmc-pagination' => 'justify-content: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'show_prev_next',
    [
        'label' => __('Show Previous/Next Buttons', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => __('Show', 'ggm-commerce'),
        'label_off' => __('Hide', 'ggm-commerce'),
        'return_value' => 'yes',
        'default' => 'yes',
    ]
);

$this->add_responsive_control(
    'pagination_gap',
    [
        'label' => __('Gap Between Items', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 50,
            ],
        ],
        'default' => [
            'size' => 8,
        ],
        'selectors' => [
            '{{WRAPPER}} .pagination-wrapper' => 'gap: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'pagination_typography',
        'label' => __('Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page, {{WRAPPER}} .pagination-current',
    ]
);

$this->add_responsive_control(
    'pagination_button_size',
    [
        'label' => __('Button Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 20,
                'max' => 80,
            ],
        ],
        'default' => [
            'size' => 40,
        ],
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page, {{WRAPPER}} .pagination-current' => 'min-width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'pagination_button_padding',
    [
        'label' => __('Button Padding', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page, {{WRAPPER}} .pagination-current' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->start_controls_tabs('pagination_style_tabs');

$this->start_controls_tab(
    'pagination_normal_tab',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'pagination_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'pagination_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'pagination_border',
        'label' => __('Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page',
    ]
);

$this->add_responsive_control(
    'pagination_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next, {{WRAPPER}} .pagination-page, {{WRAPPER}} .pagination-current' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'pagination_hover_tab',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'pagination_hover_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev:hover, {{WRAPPER}} .pagination-next:hover, {{WRAPPER}} .pagination-page:hover' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'pagination_hover_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev:hover, {{WRAPPER}} .pagination-next:hover, {{WRAPPER}} .pagination-page:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'pagination_hover_border_color',
    [
        'label' => __('Border Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev:hover, {{WRAPPER}} .pagination-next:hover, {{WRAPPER}} .pagination-page:hover' => 'border-color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'pagination_hover_shadow',
        'label' => __('Box Shadow', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .pagination-prev:hover, {{WRAPPER}} .pagination-next:hover, {{WRAPPER}} .pagination-page:hover',
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'pagination_active_tab',
    [
        'label' => __('Active', 'ggm-commerce'),
    ]
);

$this->add_control(
    'pagination_active_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-current' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'pagination_active_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-current' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'pagination_active_border_color',
    [
        'label' => __('Border Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-current' => 'border-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

// Prev/Next Button Styles
$this->add_control(
    'prev_next_heading',
    [
        'label' => __('Previous/Next Buttons', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
        'separator' => 'before',
        'condition' => [
            'show_prev_next' => 'yes',
        ],
    ]
);

$this->start_controls_tabs(
    'prev_next_tabs',
    [
        'condition' => [
            'show_prev_next' => 'yes',
        ],
    ]
);

$this->start_controls_tab(
    'prev_next_normal_tab',
    [
        'label' => __('Normal', 'ggm-commerce'),
    ]
);

$this->add_control(
    'prev_next_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'prev_next_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev, {{WRAPPER}} .pagination-next' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->start_controls_tab(
    'prev_next_hover_tab',
    [
        'label' => __('Hover', 'ggm-commerce'),
    ]
);

$this->add_control(
    'prev_next_hover_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev:hover, {{WRAPPER}} .pagination-next:hover' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'prev_next_hover_background',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .pagination-prev:hover, {{WRAPPER}} .pagination-next:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

$this->end_controls_section();
