<?php
$footer_class = get_post_meta( get_the_ID(), 'framework-footer_class', true );
?>
<div class="footer footer--style2 <?php echo esc_attr( $footer_class ); ?>">
	<div class="container">
		<div class="row">
			<?php
			global $bestel_opt;
			if ( ! empty( $bestel_opt['bestel-footer-catelog'] ) && ( $bestel_opt['bestel-footer-catelog'] == 1 ) ) {
				do_action( 'bestel_footer_catelog' );
			}
			?>
			<div class="col-lg-8 d-flex flex-column position-static">
				<div class="row mb-3 mb-lg-5">
					<div class="col-sm-auto">
						<?php
						 $bestel_logo    = $bestel_opt['bestel-footer_logo'];
						 $footer_content = $bestel_opt['bestel-footer_content'];
						?>
						<img src="<?php echo esc_url( $bestel_logo['url'] ); ?>"
							alt="<?php echo esc_attr( 'logo' ); ?> ">
					</div>
					<div class="col-sm mt-2 mt-sm-0"><?php echo wp_kses_post( $footer_content ); ?></div>
				</div>
				<div class="row">
					<?php if ( ! empty( $bestel_opt['bestel-footer-contact-info'] ) && ( $bestel_opt['bestel-footer-contact-info'] == 1 ) ) { ?>
					<div class="col-sm-auto">
						<h4>
							<?php
							if ( ! empty( $bestel_opt['bestel-page-footer-title'] ) && ( $bestel_opt['bestel-page-footer-title'] != '' ) ) {
								echo wp_kses_post( $bestel_opt['bestel-page-footer-title'] );
							}
							?>
						</h4>
						<ul class="icn-list">
							<?php if ( ! empty( $bestel_opt['bestel-phone-caption'] ) && ( $bestel_opt['bestel-phone-caption'] != '' ) ) { ?>
							<li> <i
									class="icon-placeholder"></i><?php echo wp_kses_post( $bestel_opt['bestel-phone-caption'] ); ?>
							</li>
							<?php } ?>
							<?php if ( ! empty( $bestel_opt['bestel-phone-number'] ) && ( $bestel_opt['bestel-phone-number'] != '' ) ) { ?>
							<li><i class="icon-telephone"></i><a
									href="tel:<?php echo esc_attr( $bestel_opt['bestel-phone-number'] ); ?>"><?php echo wp_kses_post( $bestel_opt['bestel-phone-number'] ); ?>
								</a></li>
							<?php } ?>
							<?php if ( ! empty( $bestel_opt['bestel-page-email-text'] ) && ( $bestel_opt['bestel-page-email-text'] != '' ) ) { ?>
							<li><i class="icon-closed-envelope"></i><a
									href="mailto:<?php echo esc_attr( $bestel_opt['bestel-page-email-text'] ); ?>"><?php echo wp_kses_post( $bestel_opt['bestel-page-email-text'] ); ?></a>
							</li>
							<?php } ?>
						</ul>
					</div>
					<?php } ?>
					<div class="col-sm mt-3 mt-sm-0 pl-lg-8">
						<?php
						if ( is_active_sidebar( 'footer_useful_links' ) ) {
							dynamic_sidebar( 'footer_useful_links' );
						}
						?>
					</div>
				</div>
				<div class="row mt-2 mt-lg-5 mb-1 mt-lg-auto mb-md-0 align-items-center">
					<div class="col-sm-auto col-lg-12 col-xl-auto">
						<div class="footer-copyright text-left">
							<?php
							if ( ! empty( $bestel_opt['bestel-footer_copyright'] ) && ( $bestel_opt['bestel-footer_copyright'] != '' ) ) {
								echo wp_kses_post( $bestel_opt['bestel-footer_copyright'] );
							}
							?>
							<div class="clearfix d-md-none"></div>
							<?php
							if ( ! empty( $bestel_opt['bestel_footer_term_condition_enable'] ) && ( $bestel_opt['bestel_footer_term_condition_enable'] == 1 ) ) {
								if ( ! empty( $bestel_opt['bestel_footer_copyright_conditions'] ) && ( $bestel_opt['bestel_footer_copyright_conditions'] != '' ) ) {
									echo wp_kses_post( $bestel_opt['bestel_footer_copyright_conditions'] );
								}
							}
							?>
						</div>
					</div>
					<?php if ( ! empty( $bestel_opt['bestel-footer-social-info'] ) && ( $bestel_opt['bestel-footer-social-info'] == 1 ) ) { ?>
					<div class="col-sm mt-2 mt-sm-0 mt-md-1 mt-xl-0">
						<div class="footer-social text-left text-sm-right text-lg-left text-xl-right">
							<?php if ( ! empty( $bestel_opt['bestel-footer-facebook'] ) && ! empty( $bestel_opt['bestel-footer-facebook'] ) ) { ?>
							<a href="<?php echo esc_url( $bestel_opt['bestel-footer-facebook'] ); ?>"><i
									class="icon-facebook-logo"></i></a>
							<?php } ?>
							<?php if ( ! empty( $bestel_opt['bestel-footer-twitter'] ) && ! empty( $bestel_opt['bestel-footer-twitter'] ) ) { ?>
							<a href="<?php echo esc_url( $bestel_opt['bestel-footer-twitter'] ); ?>"><i
									class="icon-twitter-logo1"></i></a>
							<?php } ?>
							<?php if ( ! empty( $bestel_opt['bestel-footer-google-plus'] ) && ! empty( $bestel_opt['bestel-footer-google-plus'] ) ) { ?>
							<a href="<?php echo esc_url( $bestel_opt['bestel-footer-google-plus'] ); ?>"><i
									class="icon-google-logo"></i></a>
							<?php } ?>
							<?php if ( ! empty( $bestel_opt['bestel-footer-instagram'] ) && ! empty( $bestel_opt['bestel-footer-instagram'] ) ) { ?>
							<a href="<?php echo esc_url( $bestel_opt['bestel-footer-instagram'] ); ?>"><i
									class="icon-instagram-logo"></i></a>
							<?php } ?>
						</div>
					</div>
					<?php } ?>
				</div>
				<?php do_action( 'bestel_after_footer' ); ?>
			</div>
		</div>
	</div>
</div>
