<?php
/** Site footer. @package Fragrance_Trade */
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

$fragrance_social_links = array(
	'facebook_url' => __( 'Facebook', 'fragrance-trade' ), 'twitter_url' => __( 'X / Twitter', 'fragrance-trade' ),
	'youtube_url' => __( 'YouTube', 'fragrance-trade' ), 'linkedin_url' => __( 'LinkedIn', 'fragrance-trade' ),
	'instagram_social_url' => __( 'Instagram', 'fragrance-trade' ),
);
$fragrance_whatsapp = fragrance_trade_whatsapp_number();
$fragrance_store_name = fragrance_trade_get_mod( 'b2b_hero_title' );
$fragrance_store_phone = fragrance_trade_get_mod( 'store_phone' );
$fragrance_phone_href = preg_replace( '/[^0-9+]/', '', $fragrance_store_phone );
$fragrance_store_address = fragrance_trade_get_mod( 'store_address' );
$fragrance_store_hours = fragrance_trade_get_mod( 'store_hours' );
$fragrance_contact_name = fragrance_trade_get_mod( 'store_contact_person' );
$fragrance_icp_number = fragrance_trade_get_mod( 'icp_number', '' );
$fragrance_icp_url = fragrance_trade_get_mod( 'icp_url', '' );
?>
<footer class="site-footer b2b-footer">
	<div class="container py-5">
		<div class="row g-5">
			<div class="col-lg-5">
				<h2 class="h3 text-white mb-3"><?php echo esc_html( $fragrance_store_name ); ?></h2>
				<p class="footer-positioning"><?php echo esc_html( fragrance_trade_get_mod( 'footer_text' ) ); ?></p>
				<p class="footer-kicker mb-0"><?php esc_html_e( '需求沟通 · 方案确认 · 施工交付', 'fragrance-trade' ); ?></p>
			</div>
			<div class="col-sm-6 col-lg-3">
				<h2 class="h6 text-uppercase text-white mb-3"><?php esc_html_e( '快速导航', 'fragrance-trade' ); ?></h2>
				<ul class="list-unstyled footer-links">
					<li><a href="<?php echo esc_url( home_url( '/services/' ) ); ?>"><?php esc_html_e( '服务项目', 'fragrance-trade' ); ?></a></li>
					<li><a href="<?php echo esc_url( home_url( '/cases/' ) ); ?>"><?php esc_html_e( '案例作品', 'fragrance-trade' ); ?></a></li>
					<li><a href="<?php echo esc_url( fragrance_trade_news_url() ); ?>"><?php esc_html_e( '新闻资讯', 'fragrance-trade' ); ?></a></li>
					<li><a href="<?php echo esc_url( home_url( '/about/' ) ); ?>"><?php esc_html_e( '关于门店', 'fragrance-trade' ); ?></a></li>
					<li><a href="<?php echo esc_url( home_url( '/contact/' ) ); ?>"><?php esc_html_e( '联系我们', 'fragrance-trade' ); ?></a></li>
				</ul>
			</div>
			<div class="col-sm-6 col-lg-4">
				<h2 class="h6 text-uppercase text-white mb-3"><?php esc_html_e( '联系门店', 'fragrance-trade' ); ?></h2>
				<?php if ( $fragrance_contact_name ) : ?><p><?php echo esc_html( sprintf( __( '联系人：%s', 'fragrance-trade' ), $fragrance_contact_name ) ); ?></p><?php endif; ?>
				<?php if ( $fragrance_store_phone ) : ?><p><a href="tel:<?php echo esc_attr( $fragrance_phone_href ); ?>"><?php echo esc_html( $fragrance_store_phone ); ?></a></p><?php endif; ?>
				<?php if ( $fragrance_store_address ) : ?><p><?php echo esc_html( $fragrance_store_address ); ?></p><?php endif; ?>
				<?php if ( $fragrance_store_hours ) : ?><p><?php echo esc_html( sprintf( __( '营业时间：%s', 'fragrance-trade' ), $fragrance_store_hours ) ); ?></p><?php endif; ?>
				<?php if ( $fragrance_whatsapp ) : ?><p><a href="<?php echo esc_url( fragrance_trade_get_inquiry_url() ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( '通过 WhatsApp 联系我们', 'fragrance-trade' ); ?></a></p><?php endif; ?>
				<ul class="list-unstyled d-flex flex-wrap gap-3 footer-social mb-0">
					<?php foreach ( $fragrance_social_links as $setting => $label ) : $url = fragrance_trade_get_mod( $setting, '' ); if ( $url ) : ?>
						<li><a href="<?php echo esc_url( $url ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $label ); ?></a></li>
					<?php endif; endforeach; ?>
				</ul>
			</div>
		</div>
		<div class="footer-bottom d-flex flex-wrap justify-content-between gap-2 pt-4 mt-4 border-top">
			<p class="mb-0">&copy; <?php echo esc_html( wp_date( 'Y' ) ); ?> <?php echo esc_html( $fragrance_store_name ); ?></p>
			<?php if ( $fragrance_icp_number ) : ?>
				<p class="footer-icp mb-0">
					<?php if ( $fragrance_icp_url ) : ?>
						<a href="<?php echo esc_url( $fragrance_icp_url ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $fragrance_icp_number ); ?></a>
					<?php else : ?>
						<?php echo esc_html( $fragrance_icp_number ); ?>
					<?php endif; ?>
				</p>
			<?php endif; ?>
			<p class="mb-0"><?php esc_html_e( '项目、价格、工期与质保以门店最终确认为准。', 'fragrance-trade' ); ?></p>
		</div>
	</div>
</footer>
<?php wp_footer(); ?>
</body>
</html>
