<?php

//Label
$init->add_control(
	str_replace( ' ', '_', $label ) . '_subtitle_label',
	[ 
		'type' => \Elementor\Controls_Manager::HEADING,
		'label' => __( $label, 'ostech-addon' ),
		'separator' => 'after',
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_group_control(
	\Elementor\Group_Control_Typography::get_type(),
	[ 
		'name' => str_replace( ' ', '_', $label ) . '_typography',
		'selector' => $selector,
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_color',
	[ 
		'label' => __( 'Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'selectors' => [ 
			$selector => 'color' . ': {{VALUE}}',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_bg_color',
	[ 
		'label' => __( 'Background Color', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::COLOR,
		'selectors' => [ 
			$selector => 'background-color' . ': {{VALUE}}',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_responsive_control(
	str_replace( ' ', '_', $label ) . '_margin',
	[ 
		'label' => __( ' Margin', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::DIMENSIONS,
		'size_units' => [ 'px', 'em', '%' ],
		'selectors' => [ 
			$selector => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_responsive_control(
	str_replace( ' ', '_', $label ) . '_padding',
	[ 
		'label' => __( 'Padding', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::DIMENSIONS,
		'size_units' => [ 'px', 'em', '%' ],
		'selectors' => [ 
			$selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_group_control(
	\Elementor\Group_Control_Border::get_type(),
	[ 
		'name' => str_replace( ' ', '_', $label ) . '_border',
		'selector' => $selector,
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_border_radius',
	[ 
		'label' => __( 'Border Radius', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::DIMENSIONS,
		'size_units' => [ 'px', '%' ],
		'selectors' => [ 
			$selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_group_control(
	\Elementor\Group_Control_Box_Shadow::get_type(),
	[ 
		'name' => str_replace( ' ', '_', $label ) . '_box_shadow',
		'selector' => $selector,
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_width',
	[ 
		'label' => esc_html__( 'Width', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'px', '%', 'em' ],
		'range' => [ 
			'px' => [ 
				'min' => 0,
				'max' => 1000,
				'step' => 5,
			],
			'%' => [ 
				'min' => 0,
				'max' => 100,
			],
		],
		'selectors' => [ 
			$selector => 'width: {{SIZE}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);

$init->add_control(
	str_replace( ' ', '_', $label ) . '_height',
	[ 
		'label' => esc_html__( 'Height', 'ostech-addon' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => [ 'px', '%', 'em' ],
		'range' => [ 
			'px' => [ 
				'min' => 0,
				'max' => 1000,
				'step' => 5,
			],
			'%' => [ 
				'min' => 0,
				'max' => 100,
			],
		],
		'selectors' => [ 
			$selector => 'height: {{SIZE}}{{UNIT}};',
		],
		'condition' => [ 
			'layout_type' => $condition
		]
	]
);