<?php
$html_id = pxl_get_element_id($settings);
?>
<div class="pxl-categories pxl-categories1">
    <div class="pxl-item-inner <?php echo esc_attr($settings['pxl_animate']); ?>" 
         data-wow-delay="<?php echo esc_attr($settings['pxl_animate_delay']); ?>ms">
        
        <?php if (!empty($settings['title'])) : ?>
            <div class="pxl-item-title">
                <?php echo esc_html($settings['title']); ?>
            </div>
        <?php endif; ?>

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

        if (isset($settings['lists']) && !empty($settings['lists']) && count($settings['lists'])) : ?>
            <div class="pxl-list-categories">
                <?php foreach ($settings['lists'] as $key => $value): 
                    $icon_key = $widget->get_repeater_setting_key('pxl_icon', 'icons', $key);
                    $widget->add_render_attribute($icon_key, [
                        'class' => $value['pxl_icon'],
                        'aria-hidden' => 'true',
                    ]);
                    ?>
                    <div class="pxl--item">
                        <?php if (!empty($value['pxl_icon'])) : ?>
                            <div class="pxl-icon pxl-mr-16">
                                <?php if ($is_new) : 
                                    \Elementor\Icons_Manager::render_icon($value['pxl_icon'], ['aria-hidden' => 'true']);
                                else : ?>
                                    <i class="<?php echo esc_attr($value['pxl_icon']); ?>" aria-hidden="true"></i>
                                <?php endif; ?>
                            </div>
                        <?php endif; ?>
                        <div class="pxl-item-text"><?php echo esc_html($value['text']); ?></div>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php endif; ?>

        <div class="pxl-share">
            <?php if (!empty($settings['title_share'])) : ?>
                <div class="pxl-title-share">
                    <?php echo esc_html($settings['title_share']); ?>
                </div>
            <?php endif; ?>

            <?php 
            $team_social = !empty($settings['social']) ? json_decode($settings['social'], true) : []; 
            if (!empty($team_social)) : ?>
                <div class="pxl-social--icon">
                    <?php foreach ($team_social as $social_item): ?>
                        <a href="<?php echo esc_url($social_item['url']); ?>" target="_blank">
                            <i class="<?php echo esc_attr($social_item['icon']); ?>"></i>
                        </a>
                    <?php endforeach; ?>
                </div>
            <?php endif; ?>
        </div>
    </div>
</div>