<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after
 *
 * @package Classic Plumbing Services
 */
?>
<div id="footer">
  <?php 
    $classic_plumbing_services_footer_widget_enabled = get_theme_mod('classic_plumbing_services_footer_widget', true);
    if ($classic_plumbing_services_footer_widget_enabled !== false && $classic_plumbing_services_footer_widget_enabled !== '') { ?>
    <?php 
        $classic_plumbing_services_widget_areas = get_theme_mod('classic_plumbing_services_footer_widget_areas', '4');
        if ($classic_plumbing_services_widget_areas == '3') {
            $classic_plumbing_services_cols = 'col-lg-4 col-md-6';
        } elseif ($classic_plumbing_services_widget_areas == '4') {
            $classic_plumbing_services_cols = 'col-lg-3 col-md-6';
        } elseif ($classic_plumbing_services_widget_areas == '2') {
            $classic_plumbing_services_cols = 'col-lg-6 col-md-6';
        } else {
            $classic_plumbing_services_cols = 'col-lg-12 col-md-12';
        }
    ?>
    <div class="footer-widget">
        <div class="container">
          <div class="row wow bounceInUp delay-3000" data-wow-duration="2s">
            <!-- Footer 1 -->
            <div class="<?php echo esc_attr($classic_plumbing_services_cols); ?> footer-block">
                <?php if (is_active_sidebar('footer-1')) : ?>
                    <?php dynamic_sidebar('footer-1'); ?>
                <?php else : ?>
                    <aside id="categories" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer1', 'classic-plumbing-services'); ?>">
                        <h3 class="widget-title"><?php esc_html_e('Categories', 'classic-plumbing-services'); ?></h3>
                        <ul>
                            <?php wp_list_categories('title_li='); ?>
                        </ul>
                    </aside>
                <?php endif; ?>
            </div>

            <!-- Footer 2 -->
            <div class="<?php echo esc_attr($classic_plumbing_services_cols); ?> footer-block">
                <?php if (is_active_sidebar('footer-2')) : ?>
                    <?php dynamic_sidebar('footer-2'); ?>
                <?php else : ?>
                    <aside id="archives" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer2', 'classic-plumbing-services'); ?>">
                        <h3 class="widget-title"><?php esc_html_e('Archives', 'classic-plumbing-services'); ?></h3>
                        <ul>
                            <?php wp_get_archives(array('type' => 'monthly')); ?>
                        </ul>
                    </aside>
                <?php endif; ?>
            </div>

            <!-- Footer 3 -->
            <div class="<?php echo esc_attr($classic_plumbing_services_cols); ?> footer-block">
                <?php if (is_active_sidebar('footer-3')) : ?>
                    <?php dynamic_sidebar('footer-3'); ?>
                <?php else : ?>
                    <aside id="meta" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer3', 'classic-plumbing-services'); ?>">
                        <h3 class="widget-title"><?php esc_html_e('Meta', 'classic-plumbing-services'); ?></h3>
                        <ul>
                            <?php wp_register(); ?>
                            <li><?php wp_loginout(); ?></li>
                            <?php wp_meta(); ?>
                        </ul>
                    </aside>
                <?php endif; ?>
            </div>

            <!-- Footer 4 -->
            <div class="<?php echo esc_attr($classic_plumbing_services_cols); ?> footer-block">
                <?php if (is_active_sidebar('footer-4')) : ?>
                    <?php dynamic_sidebar('footer-4'); ?>
                <?php else : ?>
                    <aside id="search-widget" class="widget py-3" role="complementary" aria-label="<?php esc_attr_e('footer4', 'classic-plumbing-services'); ?>">
                        <h3 class="widget-title"><?php esc_html_e('Search', 'classic-plumbing-services'); ?></h3>
                        <?php the_widget('WP_Widget_Search'); ?>
                    </aside>
                <?php endif; ?>
            </div>
          </div>
        </div>
    </div>

    <?php } ?>
    <div class="clear"></div>
    <div class="copywrap text-center <?php if( get_theme_mod( 'classic_plumbing_services_sticky_copyright_enable', false) == 1) { ?> sticky-copyright<?php } else { ?>close-sticky <?php } ?>">
        <?php $classic_plumbing_services_social_links_present = get_theme_mod('classic_plumbing_services_footer_facebook_link') || get_theme_mod('classic_plumbing_services_footer_instagram_link') || get_theme_mod('classic_plumbing_services_footer_pinterest_link') || get_theme_mod('classic_plumbing_services_footer_twitter_link') || get_theme_mod('classic_plumbing_services_footer_youtube_link'); ?>
        <div class="container copywrap-info <?php echo $classic_plumbing_services_social_links_present ? '' : 'center-content'; ?>">
            <p>
                <a href="<?php 
                $classic_plumbing_services_copyright_link = get_theme_mod('classic_plumbing_services_copyright_link', '');
                if (empty($classic_plumbing_services_copyright_link)) {
                    echo esc_url('https://www.theclassictemplates.com/products/classic-plumbing-services');
                } else {
                    echo esc_url($classic_plumbing_services_copyright_link);
                } ?>" target="_blank">
                <?php echo esc_html(get_theme_mod('classic_plumbing_services_copyright_line', __('Classic Plumbing Services WordPress Theme', 'classic-plumbing-services'))); ?>
                </a> 
                <?php echo esc_html('By Classic Templates', 'classic-plumbing-services'); ?>
            </p>
            <?php if ( $classic_plumbing_services_social_links_present ) { ?>
                <div class="footer-social d-flex gap-3">
                    <?php if ( get_theme_mod('classic_plumbing_services_footer_facebook_link') ) { ?>
                        <a title="<?php echo esc_attr('facebook', 'classic-plumbing-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_plumbing_services_footer_facebook_link')); ?>"><i class="fa-brands fa-facebook-f"></i></a> 
                    <?php } ?>
                    <?php if ( get_theme_mod('classic_plumbing_services_footer_instagram_link') ) { ?> 
                        <a title="<?php echo esc_attr('instagram', 'classic-plumbing-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_plumbing_services_footer_instagram_link')); ?>"><i class="fa-brands fa-instagram"></i></a>
                    <?php } ?>
                    <?php if ( get_theme_mod('classic_plumbing_services_footer_pinterest_link') ) { ?>
                        <a title="<?php echo esc_attr('pinterest', 'classic-plumbing-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_plumbing_services_footer_pinterest_link')); ?>"><i class="fa-brands fa-pinterest"></i></a>
                    <?php } ?>
                    <?php if ( get_theme_mod('classic_plumbing_services_footer_twitter_link') ) { ?> 
                        <a title="<?php echo esc_attr('twitter', 'classic-plumbing-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_plumbing_services_footer_twitter_link')); ?>"><i class="fa-brands fa-twitter"></i></a>
                    <?php } ?>
                    <?php if ( get_theme_mod('classic_plumbing_services_footer_youtube_link') ) { ?>
                        <a title="<?php echo esc_attr('youtube', 'classic-plumbing-services'); ?>" target="_blank" href="<?php echo esc_url(get_theme_mod('classic_plumbing_services_footer_youtube_link')); ?>"><i class="fa-brands fa-youtube"></i></a>
                    <?php } ?>
                </div>
            <?php } ?>
        </div>
    </div>
</div>

<?php if(get_theme_mod('classic_plumbing_services_scroll_hide',true)){ ?>
    <a id="button" class="scroll-btn"><?php echo esc_html( get_theme_mod('classic_plumbing_services_scroll_text',__('TOP', 'classic-plumbing-services' )) ); ?></a>
<?php } ?>
<?php if(get_theme_mod('classic_plumbing_services_progress_bar', false)){ ?>
    <div id="progress-bar"></div>
<?php } ?>  
<?php if(get_theme_mod('classic_plumbing_services_cursor_outline', false )== true): ?>
    <!-- Custom cursor -->
    <div class="cursor-point-outline"></div>
    <div class="cursor-point"></div>
    <!-- .Custom cursor -->
<?php endif; ?> 
<?php wp_footer(); ?>
</body>
</html>
