<?php
/**
 * Footer
 */
?>
</main>

</div>

<!-- footer -->

<footer class="footer mt-auto datebook-footer-container">
	<div id="datebook-footer">

		<div class="datebook-footer-above">

			<?php if (is_active_sidebar('datebook-footer-1') || is_active_sidebar('datebook-footer-2') || is_active_sidebar('datebook-footer-3') || is_active_sidebar('datebook-footer-4')) { ?>

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

					<?php if (is_active_sidebar('datebook-footer-1')) { ?>

					<div class="col-lg-3 col-md-3 col-sm-3">

						<?php dynamic_sidebar( 'datebook-footer-1' ); ?>

					</div>

					<?php } ?>

					<?php if (is_active_sidebar('datebook-footer-2')) { ?>

					<div class="col-lg-3 col-md-3 col-sm-3">

						<?php dynamic_sidebar( 'datebook-footer-2' ); ?>

					</div>

					<?php } ?>

					<?php if (is_active_sidebar('datebook-footer-3')) { ?>

					<div class="col-lg-3 col-md-3 col-sm-3">

						<?php dynamic_sidebar( 'datebook-footer-3' ); ?>

					</div>

					<?php } ?>

					<?php if (is_active_sidebar('datebook-footer-4')) { ?>

					<div class="col-lg-3 col-md-3 col-sm-3">

						<?php dynamic_sidebar( 'datebook-footer-4' ); ?>

					</div>

					<?php } ?>

				</div>
			</div>

			<?php

			}
			
			wp_footer();

			if ( has_nav_menu( 'datebook-footer-menu-' . DATEBOOK_WPLANG ) ) {

			?>

			<nav class="navbar navbar-expand-md navbar-light justify-content-center shadow-none p-1 grey lighten-3">
				<div class="container">
					<div class="m-auto datebook-footer-menu dropup">
						<button class="navbar-toggler grey lighten-3" type="button" data-toggle="collapse" data-target="#footer-navbar-collapse" aria-controls="footer-navbar-collapse" aria-expanded="false" aria-label="<?php esc_html_e( 'Menu', 'datebook' ); ?>"><span class="navbar-toggler-icon"></span></button>
						<div id="footer-navbar-collapse" class="navbar-collapse collapse">

							<?php 
							
							wp_nav_menu(array(
								'theme_location'  => 'datebook-footer-menu-' . DATEBOOK_WPLANG,
								'container'       => 'div',
								'container_id'    => 'datebook-footer-menu-' . DATEBOOK_WPLANG,
								'container_class' => 'm-auto',
								'menu_id'         => false,
								'menu_class'      => 'navbar-nav datebook-footer-menu',
								'depth'           => 2,
								'fallback_cb'     => 'bs4navwalker::fallback',
								'walker'          => new bs4navwalker()
							));

							?>
							&nbsp;
							<?php do_action('datebook_login_register_links'); ?>

						</div>
					</div>
				</div>
			</nav>

			<?php } ?>
			
		</div>

		<div class="bg-dark text-light datebook-footer">
			<div class="container">

				<?php 

				if( class_exists( 'DateBook' ) ) {

					do_action('datebook_footer');

				} else {

					get_template_part( 'templates/page', 'footer' );

				}

				?>

			</div>
		</div>
	</div>
</footer>
<!-- /footer -->

</body>
</html>