<?php
$is_new = \Elementor\Icons_Manager::is_migration_allowed();

$col_xs = $widget->get_setting('col_xs', '');
$col_sm = $widget->get_setting('col_sm', '');
$col_md = $widget->get_setting('col_md', '');
$col_lg = $widget->get_setting('col_lg', '');
$col_xl = $widget->get_setting('col_xl', '');

$col_xl = 12 / intval($col_xl);
$col_lg = 12 / intval($col_lg);
$col_md = 12 / intval($col_md); 
$col_sm = 12 / intval($col_sm);
$col_xs = 12 / intval($col_xs);

$grid_sizer = "col-xl-{$col_xl} col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-{$col_xs}";
$item_class = "pxl-grid-item col-xl-{$col_xl} col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-{$col_xs}";
$html_id = pxl_get_element_id($settings);
?>
<?php if(isset($settings['number']) && !empty($settings['number']) && count($settings['number'])): ?>
<div class="pxl-grid pxl-number-grid pxl-number-grid1" data-layout="<?php echo esc_attr($settings['data_layout']); ?>">
    <div class="pxl-grid-inner pxl-grid-masonry row" data-gutter="15">
        <?php foreach ($settings['number'] as $key => $value):
            $number_text = isset($value['number_text']) ? $value['number_text'] : '';
            $title = isset($value['title']) ? $value['title'] : '';
            $desc = isset($value['desc']) ? $value['desc'] : '';
            ?>
            <div class="<?php echo esc_attr($item_class); ?>">
                <div class="pxl-item--inner">
                    <div class="pxl-item-icon <?php echo esc_attr($settings['pxl_animate']); ?>">
                        <svg id="Layer_1" enable-background="new 0 0 20 20" height="512" viewBox="0 0 20 20" width="512" xmlns="http://www.w3.org/2000/svg"><path d="m12 2-1.4 1.4 5.6 5.6h-16.2v2h16.2l-5.6 5.6 1.4 1.4 8-8z" fill="rgb(0,0,0)"/></svg>
                    </div>
                    <div class="pxl-item--number">
                        <?php echo pxl_print_html($number_text); ?>
                    </div>
                    <div class="pxl-item--title">
                        <?php echo pxl_print_html($title); ?>
                    </div>
                    <div class="pxl-item--content">
                        <?php echo pxl_print_html($desc); ?>
                    </div>
                </div>
            </div>
        <?php endforeach; ?>
        <div class="grid-sizer <?php echo esc_attr($grid_sizer); ?>"></div>
    </div>
</div>
<?php endif; ?>
