<?php
/**
 * @package     productive-forms
 * @author      productiveminds.com
 * @copyright   productiveminds.com
 */

// Start:: Content
$this->start_controls_section(
    'section_content_header',
    [
        'label' => esc_html__( 'Heading', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'section_content_header_is_show_section_header',
    [
        'label' => esc_html__( 'Show Header', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SWITCHER,
        'label_on' => esc_html__( 'Show', 'productive-forms' ),
        'label_off' => esc_html__( 'Hide', 'productive-forms' ),
        'return_value' => 'yes',
        'default' => 'yes',
    ]
);

$this->add_control(
    'section_content_header_is_show_section_header_info',
    [
        'label' => esc_html__( 'Switch the toggle to show the header', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
        'condition' => [
                'section_content_header_is_show_section_header' => '',
        ],
    ]
);

$this->add_control(
    'section_content_header_hr_1',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
                'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->add_control(
    'google_map_display_physical_address',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Display Physical Address', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_yes_or_no_options(),
        'default' => '1',
        'condition' => [
            'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->add_control(
    'section_title',
    [
        'label' => esc_html__( 'Title', 'productive-forms' ),
        'label_block' => true,
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__( 'How to Locate Us', 'productive-forms' ),
        'dynamic' => [
            'active' => true,
        ],
        'condition' => [
            'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->add_control(
    'section_title_html_tag',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'HTML Tag for Title', 'productive-forms' ),
        'options' => productive_global_get_content_html_tags(),
        'default' => 'h2',
        'condition' => [
            'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->add_control(
    'section_content_header_hr_title_end',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
                'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->add_control(
    'section_intro',
    [
        'label' => esc_html__( 'Intro', 'productive-forms' ),
        'label_block' => true,
        'type' => \Elementor\Controls_Manager::WYSIWYG,
        'default' => '',
        'dynamic' => [
            'active' => true,
        ],
        'condition' => [
            'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->end_controls_section();
// End:: Content



/**
 * 
 * Start:: Styles
 * 
 */
$this->start_controls_section(
    'section_style_header',
    [
        'label' => esc_html__( 'Heading', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
                'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

// Start:: Header
$this->add_control(
    'section_style_title_text_color',
    [
        'label' => esc_html__( 'Title Color', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
                '{{WRAPPER}} .section-title' => 'color: {{VALUE}};',
        ],
    ]
);

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

$this->add_responsive_control(
    'section_style_title_margin',
    [
        'label' => esc_html__( 'Title Margin', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
                '{{WRAPPER}} .section-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_title_padding',
    [
        'label' => esc_html__( 'Title Padding', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
                '{{WRAPPER}} .section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);


$this->add_control(
    'section_style_header_hr_1',
    [
            'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);

$this->add_control(
    'section_style_intro_text_color',
    [
        'label' => esc_html__( 'Intro Color', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
                '{{WRAPPER}} .section-intro.g-maps-intro-text' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'label' => 'Intro Typography',
        'name' => 'section_style_intro_typography',
        'selector' => '{{WRAPPER}} .section-intro.g-maps-intro-text',
    ]
);

$this->add_responsive_control(
    'section_style_intro_padding',
    [
        'label' => esc_html__( 'Intro Padding', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
                '{{WRAPPER}} .section-intro.g-maps-intro-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);


$this->add_control(
    'section_style_header_hr_physical_address',
    [
            'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);

$this->add_control(
    'section_style_physical_address_text_color',
    [
        'label' => esc_html__( 'Address Color', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
                '{{WRAPPER}} .section-intro.physical-address' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'label' => 'Address Typography',
        'name' => 'section_style_physical_address_typography',
        'selector' => '{{WRAPPER}} .section-intro.physical-address',
    ]
);

$this->add_responsive_control(
    'section_style_physical_address_padding',
    [
        'label' => esc_html__( 'Address Padding', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
                '{{WRAPPER}} .section-intro.physical-address' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);


// Header Alignments and Width Settings
$this->add_control(
    'section_content_header_hr_alignments',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
                'section_content_header_is_show_section_header' => 'yes',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_header_width_content_box',
    [
        'label' => esc_html__( 'Width', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', '%' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 32000,
                'step' => 10,
            ],
            '%' => [
                'min' => 10,
                'max' => 100,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => '%',
            'size' => 100,
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section-header-container .productiveminds_section-header-container_uno' => 'width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_header_max_width_content_box',
    [
        'label' => esc_html__( 'Max Width (px)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 3000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section-header-container .productiveminds_section-header-container_uno' => 'max-width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

// Content Alignment
$this->add_responsive_control(
    'section_style_header_align_text',
    [
        'label' => esc_html__( 'Alignment', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::CHOOSE,
        'options' => [
                'left' => [
                        'title' => esc_html__( 'Left', 'productive-forms' ),
                        'icon' => 'eicon-text-align-left',
                ],
                'center' => [
                        'title' => esc_html__( 'Center', 'productive-forms' ),
                        'icon' => 'eicon-text-align-center',
                ],
                'right' => [
                        'title' => esc_html__( 'Right', 'productive-forms' ),
                        'icon' => 'eicon-text-align-right',
                ],
        ],
        'toggle' => true,
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section-header-container' => 'text-align: {{VALUE}};',
            '{{WRAPPER}} .productiveminds_section-header-container .section-title' => 'text-align: {{VALUE}};',
            '{{WRAPPER}} .productiveminds_section-header-container .section-intro' => 'text-align: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_header_align_box',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Container Justification', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_horizontal_css_align_options(),
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section-header-container' => 'justify-content: {{VALUE}}; justify-items: {{VALUE}}',
        ],
    ]
);

$this->end_controls_section();
// End:: Styles
 