<?php
/**
 * Stripe Gateway Widget - Style Controls
 *
 * @package GGM_Commerce
 */

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

// $this is the GGM_Commerce_Widget_Stripe_Gateway instance.

// Style section.
$this->start_controls_section(
	'section_style',
	array(
		'label' => __( 'Style', 'ggm-commerce' ),
		'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
	)
);

$this->add_control(
	'title_color',
	array(
		'label'     => __( 'Title Color', 'ggm-commerce' ),
		'type'      => \Elementor\Controls_Manager::COLOR,
		'selectors' => array(
			'{{WRAPPER}} .ggmc-stripe-title' => 'color: {{VALUE}};',
		),
	)
);

$this->add_group_control(
	\Elementor\Group_Control_Typography::get_type(),
	array(
		'name'     => 'title_typography',
		'label'    => __( 'Title Typography', 'ggm-commerce' ),
		'selector' => '{{WRAPPER}} .ggmc-stripe-title',
	)
);

$this->add_control(
	'container_background',
	array(
		'label'     => __( 'Container Background', 'ggm-commerce' ),
		'type'      => \Elementor\Controls_Manager::COLOR,
		'selectors' => array(
			'{{WRAPPER}} .ggmc-stripe-container' => 'background-color: {{VALUE}};',
		),
	)
);

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

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

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

$this->end_controls_section();
