<?php
/**
 * Main Class
 *
 * @author   Fernando_Acosta
 * @since    1.0.0
 * @package  make-column-clickable-elementor
 */

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

if (!class_exists('Pakrco_Elementor_Column_Width')) :

    /**
     * The main Make_Column_Clickable_Setup class
     */
    class Pakrco_Elementor_Column_Width {
        public function __construct() {
            add_action('elementor/element/column/layout/before_section_end', array($this, 'widget_extensions'), 10, 2);
        }

        public function init(){
            add_action('elementor/frontend/column/before_render', array($this, 'before_render_options'), 10);
        }

        public function widget_extensions($element, $args) {
            $element->add_responsive_control(
                'lb_column_width',
                [
                    'label' => esc_html__( 'LB Column Width', 'pakrco' ),
                    'type' => \Elementor\Controls_Manager::TEXT,
                    'label_block' => true,
                    'description' => 'E.g 100px, 20%, calc(100% - 100px)',
                    'selectors' => [
                        '{{WRAPPER}}' => 'width: {{VALUE}}!important',
                    ],
                ]
            );
        }
    }

endif;

new Pakrco_Elementor_Column_Width();
