<?php
/**
 * Checkout Widget - Style Controls
 *
 * Included inside register_controls() — $this refers to the widget instance.
 *
 * @package GGM_Commerce
 */

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

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

$this->add_group_control(
    \Elementor\Group_Control_Background::get_type(),
    [
        'name' => 'section_background',
        'selector' => '{{WRAPPER}} .checkout-section',
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'section_border',
        'selector' => '{{WRAPPER}} .checkout-section',
    ]
);

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

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

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

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'section_box_shadow',
        'selector' => '{{WRAPPER}} .checkout-section',
    ]
);

$this->end_controls_section();

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

$this->add_control(
    'heading_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .checkout-section h3' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'heading_typography',
        'selector' => '{{WRAPPER}} .checkout-section h3',
    ]
);

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

$this->end_controls_section();

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

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

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'label_typography',
        'selector' => '{{WRAPPER}} .checkout-section label',
    ]
);

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

$this->end_controls_section();

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

$this->start_controls_tabs('input_tabs');

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

$this->add_control(
    'input_text_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .checkout-section input' => 'color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section select' => 'color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section textarea' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'input_background_color',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .checkout-section input' => 'background-color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section select' => 'background-color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section textarea' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'input_border',
        'selector' => '{{WRAPPER}} .checkout-section input, {{WRAPPER}} .checkout-section select, {{WRAPPER}} .checkout-section textarea',
    ]
);

$this->end_controls_tab();

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

$this->add_control(
    'input_focus_text_color',
    [
        'label' => __('Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .checkout-section input:focus' => 'color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section select:focus' => 'color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section textarea:focus' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'input_focus_background_color',
    [
        'label' => __('Background Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .checkout-section input:focus' => 'background-color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section select:focus' => 'background-color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section textarea:focus' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'input_focus_border_color',
    [
        'label' => __('Border Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .checkout-section input:focus' => 'border-color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section select:focus' => 'border-color: {{VALUE}};',
            '{{WRAPPER}} .checkout-section textarea:focus' => 'border-color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_tab();

$this->end_controls_tabs();

$this->add_responsive_control(
    'input_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%', 'em'],
        'selectors' => [
            '{{WRAPPER}} .checkout-section input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
            '{{WRAPPER}} .checkout-section select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
            '{{WRAPPER}} .checkout-section textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
        'separator' => 'before',
    ]
);

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

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'input_typography',
        'selector' => '{{WRAPPER}} .checkout-section input, {{WRAPPER}} .checkout-section select, {{WRAPPER}} .checkout-section textarea',
    ]
);

$this->end_controls_section();

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

$this->start_controls_tabs('button_tabs');

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

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

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

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'button_border',
        'selector' => '{{WRAPPER}} .checkout-button',
    ]
);

$this->end_controls_tab();

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

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

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

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

$this->end_controls_tab();

$this->end_controls_tabs();

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

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

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'button_typography',
        'selector' => '{{WRAPPER}} .checkout-button',
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'button_box_shadow',
        'selector' => '{{WRAPPER}} .checkout-button',
    ]
);

$this->end_controls_section();

// Order Summary Container Style
$this->start_controls_section(
    'order_summary_container_style',
    [
        'label' => __('Order Summary Container', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Background::get_type(),
    [
        'name' => 'order_summary_background',
        'selector' => '{{WRAPPER}} .order-summary',
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'order_summary_border',
        'selector' => '{{WRAPPER}} .order-summary',
    ]
);

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

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

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

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'order_summary_box_shadow',
        'selector' => '{{WRAPPER}} .order-summary',
    ]
);

$this->end_controls_section();

// Order Summary Heading Style
$this->start_controls_section(
    'order_summary_heading_style',
    [
        'label' => __('Order Summary Heading', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_control(
    'order_summary_heading_color',
    [
        'label' => __('Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .order-summary h3' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'order_summary_heading_typography',
        'selector' => '{{WRAPPER}} .order-summary h3',
    ]
);

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

$this->end_controls_section();

// Order Summary Items Style
$this->start_controls_section(
    'order_summary_items_style',
    [
        'label' => __('Order Summary Items', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

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

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'order_item_typography',
        'selector' => '{{WRAPPER}} .order-item',
    ]
);

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

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'order_item_border',
        'selector' => '{{WRAPPER}} .order-item',
    ]
);

// Product Image Style Controls
$this->add_control(
    'product_image_heading',
    [
        'label' => __('Product Image', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
        'separator' => 'before',
        'condition' => [
            'show_product_images' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'product_image_size',
    [
        'label' => __('Image Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 30,
                'max' => 120,
            ],
        ],
        'default' => [
            'size' => 50,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .order-item .item-image' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .order-item .item-image img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
        'condition' => [
            'show_product_images' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'product_image_border_radius',
    [
        'label' => __('Image Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .order-item .item-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
        'condition' => [
            'show_product_images' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'product_image_gap',
    [
        'label' => __('Image Gap', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 30,
            ],
        ],
        'default' => [
            'size' => 12,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .order-item .item-image' => 'margin-right: {{SIZE}}{{UNIT}};',
        ],
        'condition' => [
            'show_product_images' => 'yes',
        ],
    ]
);

$this->end_controls_section();

// Order Summary Totals Style
$this->start_controls_section(
    'order_summary_totals_style',
    [
        'label' => __('Order Summary Totals', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_control(
    'subtotal_color',
    [
        'label' => __('Subtotal Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .order-subtotal' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'tax_color',
    [
        'label' => __('Tax Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .order-tax' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'shipping_color',
    [
        'label' => __('Shipping Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .order-shipping' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'total_color',
    [
        'label' => __('Total Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .order-total' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'totals_typography',
        'selector' => '{{WRAPPER}} .order-subtotal, {{WRAPPER}} .order-tax, {{WRAPPER}} .order-shipping, {{WRAPPER}} .order-total',
    ]
);

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

$this->add_responsive_control(
    'totals_spacing',
    [
        'label' => __('Spacing Between Rows', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 50,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .order-subtotal, {{WRAPPER}} .order-tax, {{WRAPPER}} .order-shipping' => 'margin-bottom: {{SIZE}}{{UNIT}};',
        ],
    ]
);

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

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'total_border',
        'label' => __('Total Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .order-total',
    ]
);

$this->end_controls_section();

// Discount Code Style Section
$this->start_controls_section(
    'discount_style_section',
    [
        'label' => __('Discount Code', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_discount_input' => 'yes',
        ],
    ]
);

// Section Container Controls
$this->add_control(
    'discount_section_heading',
    [
        'label' => __('Section Container', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::HEADING,
    ]
);

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

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

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

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'discount_section_border',
        'label' => __('Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-discount-section',
    ]
);

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

$this->add_control(
    'discount_label_color',
    [
        'label' => __('Label Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-label' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'discount_label_typography',
        'selector' => '{{WRAPPER}} .ggmc-discount-section .discount-label',
    ]
);

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

$this->add_control(
    'discount_input_bg',
    [
        'label' => __('Input Background', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-input' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'discount_input_color',
    [
        'label' => __('Input Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-input' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'discount_input_border',
        'selector' => '{{WRAPPER}} .ggmc-discount-section .discount-input',
    ]
);

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

$this->add_control(
    'discount_button_bg',
    [
        'label' => __('Button Background', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-apply-btn' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'discount_button_color',
    [
        'label' => __('Button Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-apply-btn' => 'color: {{VALUE}};',
        ],
    ]
);

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

$this->add_control(
    'discount_applied_bg',
    [
        'label' => __('Applied Background', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-applied' => 'background-color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'discount_applied_color',
    [
        'label' => __('Applied Text Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-discount-section .discount-applied' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'discount_row_color',
    [
        'label' => __('Discount Row Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .total-row.discount-row' => 'color: {{VALUE}};',
        ],
    ]
);

$this->end_controls_section();
