<?php 
$global_socials   = cs_get_option('benqu_global_social');
$contact_infos   = cs_get_option('ft_contact_info');
$social_title   = cs_get_option('social-title');
$ft_copyright   = cs_get_option('benqu_copywrite_text');
$sticky_footer_diable   = cs_get_option('sticky_footer_diable');
$no_top_footer = '';
if(!is_active_sidebar('footer-1') || !is_active_sidebar('footer-2') || !is_active_sidebar('footer-3') || !is_active_sidebar('footer-4')){
    $no_top_footer = 'no-top-footer';
}
?>
<footer class="pfy-site-footer <?php if($sticky_footer_diable == true){echo esc_attr('bnq__sticky_footer');}?> <?php echo esc_attr($no_top_footer);?>">
    <?php if(is_active_sidebar('footer-1') || is_active_sidebar('footer-2') || is_active_sidebar('footer-3') || is_active_sidebar('footer-4')):?>
    <div class="pfy-footer-top">
        <div class="container">
            <div class="row">
                <?php if(is_active_sidebar( 'footer-1' )):?>
                <div class="col-xl-3 col-md-6 ft_widget-item">
                    <?php dynamic_sidebar( 'footer-1' );?>

                    <?php if(!empty($contact_infos)):?>
                    <div class="pfy-contact-info">
                        <ul>
                            <?php foreach($contact_infos as $item):?>
                                <li><a href="<?php echo esc_url($item['link']);?>"><i class="<?php echo esc_attr($item['icon']);?>"></i> <?php echo benqu_wp_kses($item['info']);  ?></a></li>
                            <?php endforeach;?>
                        </ul>
                    </div>
                    <?php endif;?>

                    <?php if(!empty($global_socials)):?>
                    <div class="pfy-global-social">
                        <?php if(!empty($social_title)):?>
                            <span><?php echo esc_html($social_title);?></span>
                        <?php endif;?>
                        <ul>
                            <?php foreach($global_socials as $item):?>
                                <li><a href="<?php echo esc_url($item['link']);?>"><i class="<?php echo esc_attr($item['icon']);?>"></i></a></li>
                            <?php endforeach;?>
                        </ul>
                    </div>
                    <?php endif;?>
                </div>
                <?php endif;?>                
                <?php if(is_active_sidebar( 'footer-3' )):?>
                <div class="col-xl-2 col-md-6 ft_widget-item">
                    <?php dynamic_sidebar( 'footer-3' );?>
                </div>
                <?php endif;?>
                <?php if(is_active_sidebar( 'footer-2' )):?>
                <div class="col-xl-4 col-md-6 ft_widget-item">
                    <?php dynamic_sidebar( 'footer-2' );?>
                </div>
                <?php endif;?>
                <?php if(is_active_sidebar( 'footer-4' )):?>
                <div class="col-xl-3 col-md-6 ft_widget-item">
                    <?php dynamic_sidebar( 'footer-4' );?>
                </div>
                <?php endif;?>
            </div>
        </div>
    </div>
    <?php endif;?>
    <div class="pfy-footer-bottm">
        <div class="container">
            <div class="row">
                <div class="col-xl-7 col-lg-7 col-md-12">
                    <div class="footer-btm-nav">
                        <?php benqu_footer_nav();?>
                    </div>
                </div>
                <div class="col-xl-5 col-lg-5 col-md-12">
                    <div class="footer-copyright text-end">
                        <?php if($ft_copyright):
                            echo benqu_wp_kses(wpautop($ft_copyright));    
                        else: 
                        ?>
                        <p><?php esc_html_e('© 2022, benqu All Rights Reserved', 'benqu');?></p>
                        <?php endif;?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</footer>