<?php
/**
 * Cart Display Widget — Style Controls
 * Required inside register_controls(); $this is the widget instance.
 */

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

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

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

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

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

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

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'container_box_shadow',
        'label' => __('Box Shadow', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-cart-container',
    ]
);

$this->end_controls_section();

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

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

$this->add_control(
    'table_border_color',
    [
        'label' => __('Border Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-cart-table, {{WRAPPER}} .ggmc-cart-table th, {{WRAPPER}} .ggmc-cart-table td' => 'border-color: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'table_border_width',
    [
        'label' => __('Border Width', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 10,
            ],
        ],
        'default' => [
            'size' => 1,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-cart-table, {{WRAPPER}} .ggmc-cart-table th, {{WRAPPER}} .ggmc-cart-table td' => 'border-width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'table_border_radius',
    [
        'label' => __('Border Radius', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => ['px', '%'],
        'selectors' => [
            '{{WRAPPER}} .ggmc-cart-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', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-cart-table',
    ]
);

$this->end_controls_section();

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

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

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

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

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

$this->end_controls_section();

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

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

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

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

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

$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' => 150,
            ],
        ],
        'default' => [
            'size' => 60,
            'unit' => 'px',
        ],
        'selectors' => [
            '{{WRAPPER}} .product-image' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
            '{{WRAPPER}} .product-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}} .product-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
        'condition' => [
            'show_product_images' => 'yes',
        ],
    ]
);

$this->end_controls_section();

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

$this->add_responsive_control(
    'quantity_width',
    [
        'label' => __('Width', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 50,
                'max' => 150,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .quantity-controls' => 'width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

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

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

$this->add_control(
    'quantity_button_bg_color',
    [
        'label' => __('Button Background', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .qty-minus, {{WRAPPER}} .qty-plus' => 'background-color: {{VALUE}};',
        ],
    ]
);

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

$this->add_control(
    'quantity_button_hover_bg_color',
    [
        'label' => __('Button Hover Background', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .qty-minus:hover, {{WRAPPER}} .qty-plus:hover' => 'background-color: {{VALUE}};',
        ],
    ]
);

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

$this->end_controls_section();

// -------------------------------------------------------------------------
// Continue Shopping Button
// -------------------------------------------------------------------------
$this->start_controls_section(
    'continue_shopping_button_style',
    [
        'label' => __('Continue Shopping Button', 'ggm-commerce'),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'show_continue_shopping' => 'yes',
        ],
    ]
);

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

$this->start_controls_tabs('continue_shopping_tabs');

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

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

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

$this->end_controls_tab();

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

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

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

$this->end_controls_tab();

$this->end_controls_tabs();

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'continue_shopping_border',
        'label' => __('Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-continue-shopping-btn',
        'separator' => 'before',
    ]
);

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

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

$this->end_controls_section();

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

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

$this->start_controls_tabs('checkout_tabs');

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

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

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

$this->end_controls_tab();

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

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

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

$this->end_controls_tab();

$this->end_controls_tabs();

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'checkout_border',
        'label' => __('Border', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-proceed-checkout-btn',
        'separator' => 'before',
    ]
);

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

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

$this->add_responsive_control(
    'button_spacing',
    [
        'label' => __('Button Spacing', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 5,
                'max' => 50,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-cart-actions' => 'gap: {{SIZE}}{{UNIT}};',
        ],
        'separator' => 'before',
    ]
);

$this->end_controls_section();

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

$this->add_responsive_control(
    'remove_button_size',
    [
        'label' => __('Button Size', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => ['px'],
        'range' => [
            'px' => [
                'min' => 20,
                'max' => 50,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .ggmc-remove-from-cart' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->start_controls_tabs('remove_button_tabs');

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

$this->add_control(
    'remove_button_color',
    [
        'label' => __('Icon Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-remove-from-cart' => 'color: {{VALUE}};',
        ],
    ]
);

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

$this->end_controls_tab();

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

$this->add_control(
    'remove_button_hover_color',
    [
        'label' => __('Icon Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-remove-from-cart:hover' => 'color: {{VALUE}};',
        ],
    ]
);

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

$this->end_controls_tab();

$this->end_controls_tabs();

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

$this->end_controls_section();

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

$this->add_control(
    'empty_message_color',
    [
        'label' => __('Message Color', 'ggm-commerce'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .ggmc-empty-cart p' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'name' => 'empty_message_typography',
        'label' => __('Message Typography', 'ggm-commerce'),
        'selector' => '{{WRAPPER}} .ggmc-empty-cart p',
    ]
);

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

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

$this->end_controls_section();

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

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

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

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

$this->add_group_control(
    \Elementor\Group_Control_Background::get_type(),
    [
        'name' => 'total_background',
        'label' => __('Background', 'ggm-commerce'),
        'types' => ['classic', 'gradient'],
        'selector' => '{{WRAPPER}} .cart-total',
    ]
);

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

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

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

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

$this->end_controls_section();
