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


// Start:: Content Tab
$this->start_controls_section(
    'section_content_social_media_share',
    [
        'label' => esc_html__( 'Social Media Share', 'productive-commerce' ),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'section_show_social_media_share',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show Share Buttons', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
    ]
);

$this->add_control(
    'section_show_social_media_share_on_copy',
    [
        'label' => esc_html__( 'Share on copy', 'productive-commerce' ),
        'label_block' => true,
        'type' => \Elementor\Controls_Manager::TEXT,
        'default' => esc_html__( 'Share on:', 'productive-commerce' ),
        'placeholder' => esc_html__( 'Share on:', 'productive-commerce' ),
        'dynamic' => [
            'active' => true,
        ],
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'section_show_social_media_share_on_copy_location',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Position of "Share on" copy', 'productive-commerce' ),
        'options' => [
            'top' => esc_html__( 'Above Icons', 'productive-commerce' ),
            'inline' => esc_html__( 'Beside Icons', 'productive-commerce' ),
        ],
        'default' => 'inline',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'section_show_social_media_platform_name',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show Platform Names', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '0',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_platform_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);
$this->add_control(
    'do_social_share_platform_group_label',
    [
        'label' => esc_html__( 'Platforms', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_linkedin',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show Linkedin', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_facebook',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show Facebook', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_twitter',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show X (Twitter)', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_instagram',
    [
        'label' => esc_html__( 'Show Instagram', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::HIDDEN,
        'default' => '0',
    ]
);

$this->add_control(
    'do_social_share_pinterest',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show Pinterest', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_whatsapp',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show WhatsApp', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'do_social_share_email',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Show Email', 'productive-commerce' ),
        'options' => [
                '0' => esc_html__( 'Hide', 'productive-commerce' ),
                '1' => esc_html__( 'Show', 'productive-commerce' ),
        ],
        'default' => '1',
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

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



// Start:: Style
$this->start_controls_section(
    'section_style_social_media_share',
    [
        'label' => esc_html__( 'Social Media Share', 'productive-commerce' ),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        'condition' => [
            'section_show_social_media_share' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'section_style_social_media_share_design_options_label',
    [
        'label' => esc_html__( 'Layout & Design', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_control(
    'social_media_share_icons_icons_boxes_layout',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Icons Layout', 'productive-commerce' ),
        'options' => [
            'horizontal' => esc_html__( 'Horizontal', 'productive-commerce' ),
            'vertical' => esc_html__( 'Vertical', 'productive-commerce' ),
        ],
        'default' => 'horizontal',
    ]
);

$this->add_control(
    'display_contact_social_media_icons_style',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Icons Color Scheme', 'productive-commerce' ),
        'options' => productive_global_add_social_media_icons_style_options( 1 ),
        'default' => 'brand_color_around_white_icon',
    ]
);

$this->add_control(
    'social_media_share_icons_icons_boxes_spread',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Icons Spread', 'productive-commerce' ),
        'options' => [
            'initial' => esc_html__( 'Fit Content', 'productive-commerce' ),
            'auto' => esc_html__( 'Full Width', 'productive-commerce' ),
        ],
        'default' => 'initial',
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_icon_and_name_box' => 'flex: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_social_media_share_box_each_icon_alignment_inline',
    [
        'label' => esc_html__( 'Each Icon Alignment', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::CHOOSE,
        'options' => [
                'left' => [
                        'title' => esc_html__( 'Left', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-left',
                ],
                'center' => [
                        'title' => esc_html__( 'Center', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-center',
                ],
                'right' => [
                        'title' => esc_html__( 'Right', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-right',
                ],
        ],
        'toggle' => true,
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_icon_and_name_box' => 'justify-items: {{VALUE}}; justify-content: {{VALUE}};',
        ],
        'condition' => [
            'social_media_share_icons_icons_boxes_spread' => [ 'auto' ],
        ],
    ]
);

$this->add_responsive_control(
    'section_style_social_media_share_box_alignment_inline',
    [
        'label' => esc_html__( 'Section Alignment', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::CHOOSE,
        'options' => [
                'left' => [
                        'title' => esc_html__( 'Left', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-left',
                ],
                'center' => [
                        'title' => esc_html__( 'Center', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-center',
                ],
                'right' => [
                        'title' => esc_html__( 'Right', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-right',
                ],
        ],
        'toggle' => true,
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_container' => 'justify-items: {{VALUE}}; justify-content: {{VALUE}};',
        ],
        'condition' => [
            'social_media_share_icons_icons_boxes_spread' => [ 'initial' ],
        ],
    ]
);

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

$this->add_control(
    'section_style_social_media_share_copy_options_label',
    [
        'label' => esc_html__( '"Share On" Copy', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'label' => esc_html__( 'Typography', 'productive-commerce' ),
        'name' => 'section_show_social_media_share_on_copy_typography',
        'selector' => '{{WRAPPER}} .social_media_share_icons_copy',
    ]
);

$this->add_control(
    'section_show_social_media_share_on_copy_color',
    [
        'label' => esc_html__( 'Color', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
                '{{WRAPPER}} .social_media_share_icons_copy' => 'color: {{VALUE}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_social_media_share_copy_alignment_inline',
    [
        'label' => esc_html__( 'Alignment', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::CHOOSE,
        'options' => [
                'left' => [
                        'title' => esc_html__( 'Left', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-left',
                ],
                'center' => [
                        'title' => esc_html__( 'Center', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-center',
                ],
                'right' => [
                        'title' => esc_html__( 'Right', 'productive-commerce' ),
                        'icon' => 'eicon-text-align-right',
                ],
        ],
        'toggle' => true,
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_copy' => 'justify-items: {{VALUE}}; justify-content: {{VALUE}};',
        ],
        'condition' => [
            'section_show_social_media_share_on_copy_location' => [ 'top' ],
        ],
        'condition' => [
            'social_media_share_icons_icons_boxes_spread' => [ 'auto' ],
        ],
    ]
);
    
$this->add_control(
    'section_style_social_media_share_copy_vertical_align',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Vertical Alignment', 'productive-commerce' ),
        'options' => [
        ] + productive_global_get_vertical_css_align_options(),
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_copy' => 'align-self: {{VALUE}};',
        ],
        'condition' => [
            'section_show_social_media_share_on_copy_location' => [ 'inline', ],
        ],
    ]
);

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

$this->add_control(
    'section_style_social_media_share_options_label_1',
    [
        'label' => esc_html__( 'Icons', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_control(
    'section_style_content_social_media_icons_color',
    [
        'label' => esc_html__( 'Icons Color', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} a.social_media_share_icons_icon_and_name_box svg path' => 'fill: {{VALUE}};',
        ],
        'condition' => [
            'display_contact_social_media_icons_style' => [ 'selected_color_custom', ],
        ],
    ]
);

$this->add_control(
    'section_style_content_social_media_icons_bg',
    [
        'label' => esc_html__( 'Icon Background', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} a.social_media_share_icons_icon_and_name_box' => 'background: {{VALUE}};',
        ],
        'condition' => [
            'display_contact_social_media_icons_style' => [ 'selected_color_custom', ],
        ],
    ]
);

$this->add_control(
    'section_style_content_social_media_icons_bg_hover',
    [
        'label' => esc_html__( 'Icon Background (on Hover)', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} a.social_media_share_icons_icon_and_name_box:hover' => 'background: {{VALUE}};',
        ],
        'condition' => [
            'display_contact_social_media_icons_style' => [ 'selected_color_custom', ],
        ],
    ]
);

$this->add_responsive_control(
    'section_style_media_icons_icons_size',
    [
        'label' => esc_html__( 'Icons Size', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', 'rem' ],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 200,
                'step' => 1,
            ],
            'rem' => [
                'min' => 0,
                'max' => 10.0,
                'step' => 0.1,
            ],
        ],
        'default' => [
            'unit' => 'px',
            'size' => 21,
        ],
        'selectors' => [
            '{{WRAPPER}} a.social_media_share_icons_icon_and_name_box svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'section_content_social_media_share_icon_spacing',
    [
        'label' => esc_html__( 'Icon Spacing', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', 'rem' ],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 100,
                'step' => 1,
            ],
            'rem' => [
                'min' => 0,
                'max' => 5.0,
                'step' => 0.1,
            ],
        ],
        'default' => [
            'unit' => 'px',
            'size' => 10,
        ],
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_icons_boxes' => 'gap: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_content_social_media_share_icon_padding',
    [
        'label' => esc_html__( 'Icon Padding', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
            '{{WRAPPER}} a.social_media_share_icons_icon_and_name_box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_content_social_media_share_icon_border_radius',
    [
        'label' => esc_html__( 'Icon Border Radius', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'px', '%' ],
        'selectors' => [
            '{{WRAPPER}} a.social_media_share_icons_icon_and_name_box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'section_style_social_media_share_platform_name_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
        'condition' => [
            'section_show_social_media_platform_name' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'section_style_social_media_share_platform_name_options_label',
    [
        'label' => esc_html__( 'Platform Names', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
        'condition' => [
            'section_show_social_media_platform_name' => [ '1', ],
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Typography::get_type(),
    [
        'label' => esc_html__( 'Typography', 'productive-commerce' ),
        'name' => 'section_show_social_media_share_platform_name_typography',
        'selector' => '{{WRAPPER}} .social_media_share_icons_icon_and_name_box_text',
        'condition' => [
            'section_show_social_media_platform_name' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'section_show_social_media_share_platform_name_color',
    [
        'label' => esc_html__( 'Color', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
                '{{WRAPPER}} .social_media_share_icons_icon_and_name_box_text' => 'color: {{VALUE}};',
        ],
        'condition' => [
            'section_show_social_media_platform_name' => [ '1', ],
        ],
    ]
);

$this->add_control(
    'section_style_social_media_share_platform_name_spacing',
    [
        'label' => esc_html__( 'Spacing', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', 'rem' ],
        'range' => [
            'px' => [
                'min' => 0,
                'max' => 100,
                'step' => 1,
            ],
            'rem' => [
                'min' => 0,
                'max' => 5.0,
                'step' => 0.1,
            ],
        ],
        'default' => [
            'unit' => 'px',
            'size' => 5,
        ],
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_icon_and_name_box' => 'gap: {{SIZE}}{{UNIT}};',
        ],
        'condition' => [
            'section_show_social_media_platform_name' => [ '1', ],
        ],
    ]
);
    
$this->add_control(
    'section_style_social_media_share_platform_name_vertical_align',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Vertical Alignment', 'productive-commerce' ),
        'options' => [
        ] + productive_global_get_vertical_css_align_options(),
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .social_media_share_icons_icon_and_name_box .social_media_share_icons_icon_and_name_box_text' => 'align-self: {{VALUE}};',
        ],
        'condition' => [
            'section_show_social_media_platform_name' => [ '1', ],
        ],
    ]
);







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

$this->add_control(
    'section_style_social_media_share_options_label_3',
    [
        'label' => esc_html__( 'Section Container', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Background::get_type(),
    [
        'name' => 'section_content_social_media_share_section_bg',
        'types' => [ 'classic', 'gradient' ],
        'selector' => '{{WRAPPER}} .productiveminds_section.social-media-share .productiveminds_section_uno',
    ]
);

$this->add_responsive_control(
    'section_content_social_media_share_padding',
    [
        'label' => esc_html__( 'Padding', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.social-media-share .productiveminds_section_uno' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_control(
    'section_content_social_media_share_border_radius',
    [
        'label' => esc_html__( 'Border Radius', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ '%', 'px' ],
        'selectors' => [
                '{{WRAPPER}} .productiveminds_section.social-media-share .productiveminds_section_uno' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_content_social_media_share_margin',
    [
        'label' => esc_html__( 'Margin', 'productive-commerce' ),
        'type' => \Elementor\Controls_Manager::DIMENSIONS,
        'size_units' => [ 'rem', 'px', '%' ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.social-media-share .productiveminds_section_uno' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
        ],
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Border::get_type(),
    [
        'name' => 'section_content_social_media_share_border',
        'selector' => '{{WRAPPER}} .productiveminds_section.social-media-share .productiveminds_section_uno',
    ]
);

$this->add_group_control(
    \Elementor\Group_Control_Box_Shadow::get_type(),
    [
        'name' => 'section_content_social_media_share_shadow',
        'selector' => '{{WRAPPER}} .productiveminds_section.social-media-share .productiveminds_section_uno',
    ]
);

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