<?php

if (!class_exists('Solarva_Footer')) {

    class Solarva_Footer
    {
        public function getFooter()
        {
            if(is_singular('elementor_library')) return;
            
            $footer_layout = (int)solarva()->get_opt('footer_layout');
            
            if ($footer_layout <= 0 || !class_exists('Pxltheme_Core') || !is_callable( 'Elementor\Plugin::instance' )) {
                get_template_part( 'template-parts/footer/default');
            } else {
                $args = [
                    'footer_layout' => $footer_layout
                ];
                get_template_part( 'template-parts/footer/elementor','', $args );
            } 

            // Back To Top
            $back_totop_on = solarva()->get_theme_opt('back_totop_on', true);
            $back_top_top_style = solarva()->get_opt('back_top_top_style', 'style-default');
            if (isset($back_totop_on) && $back_totop_on) : ?>
                <a class="pxl-scroll-top <?php echo esc_attr($back_top_top_style); ?>" href="#">
                    <svg class="pxl-arrow-top" xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
                        <path d="M13 6.14286L7.85714 11.2857M13 6.14286L7.85714 1M13 6.14286L1 6.14286" stroke="white" stroke-width="1.71429" stroke-linecap="round" stroke-linejoin="round" transform="rotate(-90 7 6)"/>
                    </svg>

                    <svg class="pxl-scroll-progress-circle" width="100%" height="100%" viewBox="-1 -1 102 102">
                        <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98"/>
                    </svg>
                </a>
            <?php endif;

            // Mouse Move Animation
            solarva_mouse_move_animation();

            // Cookie Policy
            solarva_cookie_policy();

            // Subscribe Popup
            solarva_subscribe_popup();

            // Cart Sidebar
            solarva_hook_anchor_cart();
            
        }
 
    }
}
 