<?php 
    $is_cubes = (isset($settings['cubes']) && !empty($settings['cubes']) && count($settings['cubes'])) || false;
    $message = $settings['message'] ?? '';
    $info = $settings['info'] ?? '';
    $link = solarva_get_link($settings['link']);
    $hidden_s1400 = !(empty($settings['hidden_s1400'])) ? 'pxl-hidden-s1400' : '';
    $cube_hidden_xs = (!empty($settings['cube_hidden_xs'])) ? 'pxl-hidden-xs' : '';
    $cube_hidden_sm = (!empty($settings['cube_hidden_sm'])) ? 'pxl-hidden-sm' : '';
    $cube_hidden_md = (!empty($settings['cube_hidden_md'])) ? 'pxl-hidden-md' : '';
    $cube_hidden_lg = (!empty($settings['cube_hidden_lg'])) ? 'pxl-hidden-lg' : '';
    $cube_hidden_xl = (!empty($settings['cube_hidden_xl'])) ? 'pxl-hidden-xl' : '';
    $cube_hidden_xxl = (!empty($settings['cube_hidden_xxl'])) ? 'pxl-hidden-xxl' : '';
    $cube_responsive = $cube_hidden_xs.' '.$cube_hidden_sm.' '.$cube_hidden_md.' '.$cube_hidden_lg.' '.$cube_hidden_xl.' '.$cube_hidden_xxl;  
?>

<div class="pxl-contact-box pxl-contact-box1 <?php echo  esc_attr($settings['style_l1'].' '.$settings['pxl_animate']); ?>">
    <div class="pxl-item--container">
        <div class="pxl-item--inner">
            <?php if($is_cubes) : ?>
                <?php foreach($settings['cubes'] as $cube) : ?>
                    <svg class="pxl-item--cube <?php echo esc_attr($cube['cube_position'].' '.$cube_responsive); ?>" width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <rect x="2.5" y="2.5" width="10" height="10" transform="rotate(45 7.5 7.5)" fill="#4AAB3D">
                            <?php if($cube['cube_effect'] === 'spin') : ?>
                                <animateTransform attributeName="transform" attributeType="XML" type="rotate" from="0 7.5 7.5" to="360 7.5 7.5" dur="5s" repeatCount="indefinite"/>
                            <?php endif;?>
                        </rect>
                    </svg>
                <?php endforeach; ?>
            <?php endif; ?>
            <?php if(!empty($settings['pxl_icon']['value'])) : ?>
                <a class="btn pxl-item--icon pxl-icon--link" <?php pxl_print_html($link); ?>>
                    <?php \Elementor\Icons_Manager::render_icon($settings['pxl_icon'], ['aria-hidden' => 'true', 'class' => esc_attr($settings['icon_animate'])], 'i'); ?>
                </a>
            <?php endif; ?>
            <div class="pxl-item--content <?php echo esc_attr($hidden_s1400); ?>">
                <span class="pxl-item--message"><?php echo esc_html($message); ?></span>
                <a class="pxl-item--info pxl-text--link" <?php pxl_print_html($link); ?>>
                    <?php echo esc_attr($info); ?>
                </a>
            </div>
        </div>
    </div>
</div>
