
<?php 
    $html_id = pxl_get_element_id($settings);
    $is_features = isset($settings['features']) && !empty($settings['features']) && count($settings['features']) || false;
    $img_size = !empty($settings['img_size']) ? $settings['img_size'] : 'full';
    $grid_item = '';
    $grid_custom = '';
    if(!empty($settings['grid_custom'])) {
        $flex_grow = !empty($settings['flex_grow']) ? 'pxl-flex-grow' : '';
        $flex_shrink = !empty($settings['flex_shrink']) ? 'pxl-flex-shrink' : '';
        $grid_item = $flex_shrink.' '.$flex_grow;
        $grid_custom = 'pxl-grid-custom';
    }else {
        $col_xxl = ($settings['col_xxl'] == '5') ? 'pxl5' : intval(12/$widget->get_setting('col_xxl', 4));
        $col_xl = ($settings['col_xl'] == '5') ? 'pxl5' : 12 / intval($widget->get_setting('col_xl', 4));
        $col_lg = 12 / intval($widget->get_setting('col_lg', 4));
        $col_md = 12 / intval($widget->get_setting('col_md', 3));
        $col_sm = 12 / intval($widget->get_setting('col_sm', 2));
        $col_xs = 12 / intval($widget->get_setting('col_xs', 1));
        $grid_item = "col-xxl-{$col_xxl} col-xl-{$col_xl} col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-{$col_xs}";
    }
?>

<?php if($is_features): ?>
    <div id="<?php echo esc_attr($html_id); ?>" class="pxl-grid pxl-features-grid pxl-features-grid1 <?php echo esc_attr($grid_custom); ?>">
        <div class="pxl-grid-container">
            <div class="pxl-grid-inner row">
                <?php foreach($settings['features'] as $key => $feature) : ?>
                    <?php
                        $thumbnail = solarva_get_thumbnail($feature['image']['id'], $img_size);
                    ?>
                    <div class="pxl-grid-item  <?php echo esc_attr('elementor-repeater-item-'.$feature['_id'].' '.$grid_item.' '.$settings['pxl_animate']); ?>" data-wow-delay="<?php echo esc_attr($settings['pxl_animate_delay'].'ms'); ?>">
                        <div class="pxl-item--inner">
                            <div class="pxl-item--image el-empty">
                                <?php pxl_print_html($thumbnail); ?>
                            </div>
                            <span class="pxl-item--title">
                                <?php echo esc_html($feature['title']); ?>
                            </span>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>
<?php endif; ?>