</main><!-- /#site-main -->

<?php
$footer_class = 'across_footer' == get_option( 'copyright_location' ) ? 'site-footer pt-5' : 'site-footer py-5';
?>

<footer id="site-footer" class="<?php echo $footer_class ?>">
<?php

use Tech360\Utils as Utils;

switch( get_option( 'footer_layout', 'four_col' ) ) {
	case 'two_col':
		$col_class = 'widget-wrapper col-md-6';
		break;
	case 'three_col':
		$col_class = 'widget-wrapper col-lg-4';
		break;
	case 'four_col':
		$col_class = 'widget-wrapper col-md-6 col-lg-3';
		break;
	default:
}

$contact_info = [ 'office_address', 'phone_number', 'toll_free_number', 'email' ];

?>

	<div class="container">
		<div class="row">

			<div class="<?php echo $col_class ?>">
				<?php
				if( Utils::has_contact_info( $contact_info ) || Utils::has_social_networks() ) {
				?>
				<div class="footer-widget">
					<h4 class="footer-widget-title"><?php echo get_bloginfo( 'name' ) ?></h4>
					<ul class="contact-info">
					<?php
					if( Utils::has_contact_info( $contact_info ) ) {
						Utils::render_contact_info_list_tags( $contact_info );
					}
					if( Utils::has_social_networks() ) {
					?>
						<li class="social-links-wrapper"><?php Utils::the_social_links() ?></li>
					<?php
					}
					?>
					</ul>
				</div>
				<?php
				}

				dynamic_sidebar( 'footer-col-1' );

				if( 'footer_col_1' == get_option( 'copyright_location' ) ) {
				?>
				<p>
					<?php
					if( ! get_option( 'copyright_info' ) ) {
						$copyright_text = 'Copyright © {{year}} {{site}}. All rights reserved.';
					} else {
						$copyright_text = get_option( 'copyright_info' );
					}
					$replace = [
						'{{year}}' => date( 'Y' ),
						'{{site}}' => sprintf( '<a href="%s">%s</a>', site_url(), get_bloginfo( 'name' ) )
					];
					if( get_option( 'credits' ) ) {
						$copyright_text .= ' Website designed and built by <a href="https://www.tech360group.com/" target="_blank">Tech360 Group</a>.';
					}
					echo strtr( $copyright_text, $replace );
					?>
				</p>
				<?php
				}
				?>
			</div>

			<div class="<?php echo $col_class ?>">
				<?php
				if( has_nav_menu( 'footer_menu_quicklinks' ) ) {
				?>
				<div class="footer-widget">
					<h4 class="footer-widget-title"><?php esc_html_e( 'Quick Links', 'tech360' ) ?></h4>
					<?php
						$menu_args = [
							'theme_location' => 'footer_menu_quicklinks',
							'menu_id' => 'quicklinks-footer-menu',
							'menu_class' => 'footer-menu',
							'item_spacing' => 'discard',
							'before' => '<i class="fas fa-fw fa-caret-right"></i>'
						];
						wp_nav_menu( $menu_args );
					?>
				</div>
				<?php
				}
				dynamic_sidebar( 'footer-col-2' );
				?>
			</div>
			<?php
			if( get_option( 'footer_layout' ) == 'three_col' || get_option( 'footer_layout' ) == 'four_col' ) {
			?>
			<div class="<?php echo $col_class ?>">
				<?php
				if( has_nav_menu( 'footer_menu_services' ) ) {
				?>
				<div class="footer-widget">
					<h4 class="footer-widget-title"><?php esc_html_e( 'Services', 'tech360' ) ?></h4>
					<?php
					$menu_args = [
						'theme_location' => 'footer_menu_services',
						'menu_id' => 'services-footer-menu',
						'menu_class' => 'footer-menu',
						'item_spacing' => 'discard',
						'before' => '<i class="fas fa-fw fa-caret-right"></i>'
					];
					wp_nav_menu( $menu_args );
					?>
				</div>
				<?php
				}
				dynamic_sidebar( 'footer-col-3' );
				?>
			</div>
			<?php
			}
			if( get_option( 'footer_layout' ) == 'four_col' ) {
			?>
			<div class="<?php echo $col_class ?>">
				<?php
				if( Utils::wpcf7_exists( 'Newsletter Subscription' ) ) {
				?>
				<div class="footer-widget">
					<h4 class="footer-widget-title"><?php esc_html_e( 'Stay up to date', 'tech360' ) ?></h4>
					<?php echo do_shortcode( '[contact-form-7 title="Newsletter Subscription"]' ) ?>
				</div>
				<?php
				}
				dynamic_sidebar( 'footer-col-4' );
				?>
			</div>
			<?php
			}
			?>
		</div>
	</div>
	<?php
	if( 'across_footer' == get_option( 'copyright_location' ) ) {
	?>
	<p class="mt-5 p-3 text-center copyright-text">
		<?php
		if( ! get_option( 'copyright_info' ) ) {
			$copyright_text = 'Copyright © {{year}} {{site}}. All rights reserved.';
		} else {
			$copyright_text = get_option( 'copyright_info' );
		}
		$replace = [
			'{{year}}' => date( 'Y' ),
			'{{site}}' => sprintf( '<a href="%s">%s</a>', site_url(), get_bloginfo( 'name' ) )
		];
		if( get_option( 'credits' ) ) {
			$copyright_text .= ' Website designed and built by <a href="https://www.tech360group.com/" target="_blank">Tech360 Group</a>.';
		}
		echo strtr( $copyright_text, $replace );
		?>
	</p>
	<?php
	}
	?>
</footer><!-- /#site-footer -->

<button id="back-to-top" class="back-to-top z-index-99999"><i class="fas fa-fw fa-caret-up"></i></button>

<?php wp_footer(); ?>
<script>
	lightbox.option({
		disableScrolling: true,
		fadeDuration: 350,
		imageFadeDuration: 350,
		resizeDuration: 350,
		alwaysShowNavOnTouchDevices: true
	});
</script>
</body>
</html>
