<?php
/**
 * The template for displaying the footer (Customizer-driven layout).
 *
 * @package express-movers
 */

?>
<footer id="colophon" class="site-footer footer-modern-wrap">
	<div class="footer-modern">
		<div class="footer-modern__grid">
			<div class="footer-modern__col footer-modern__col--brand">
				<div class="footer-modern__brand-head">
					<i class="<?php echo esc_attr( get_theme_mod( 'express_movers_footer_brand_icon', 'fa-solid fa-cube' ) ); ?> footer-modern__brand-icon" aria-hidden="true"></i>
					<span class="footer-modern__brand-title"><?php echo esc_html( get_theme_mod( 'express_movers_footer_brand_title', 'SwiftShip' ) ); ?></span>
				</div>
				<p class="footer-modern__about"><?php echo nl2br( esc_html( get_theme_mod( 'express_movers_footer_about_text', 'Trusted logistics partner delivering speed and reliability across ocean, air, and ground—connecting businesses to 150+ countries with 24/7 support.' ) ) ); ?></p>
				<div class="footer-modern__stats">
					<?php
					$express_movers_footer_stat_fallback = array(
						1 => array( 'fa-solid fa-globe', '150+', 'Countries' ),
						2 => array( 'fa-solid fa-award', '25+', 'Years' ),
						3 => array( 'fa-solid fa-headset', '24/7', 'Support' ),
					);
					for ( $si = 1; $si <= 3; $si++ ) {
						$st_icon  = get_theme_mod( 'express_movers_footer_stat_' . $si . '_icon', $express_movers_footer_stat_fallback[ $si ][0] );
						$st_num   = get_theme_mod( 'express_movers_footer_stat_' . $si . '_number', $express_movers_footer_stat_fallback[ $si ][1] );
						$st_label = get_theme_mod( 'express_movers_footer_stat_' . $si . '_label', $express_movers_footer_stat_fallback[ $si ][2] );
						if ( ( ! is_string( $st_num ) || '' === trim( $st_num ) ) && ( ! is_string( $st_label ) || '' === trim( $st_label ) ) ) {
							continue;
						}
						?>
					<div class="footer-modern__stat">
						<?php if ( is_string( $st_icon ) && '' !== trim( $st_icon ) ) : ?>
						<i class="<?php echo esc_attr( $st_icon ); ?> footer-modern__stat-icon" aria-hidden="true"></i>
						<?php endif; ?>
						<?php if ( is_string( $st_num ) && '' !== trim( $st_num ) ) : ?>
						<span class="footer-modern__stat-num"><?php echo esc_html( $st_num ); ?></span>
						<?php endif; ?>
						<?php if ( is_string( $st_label ) && '' !== trim( $st_label ) ) : ?>
						<span class="footer-modern__stat-label"><?php echo esc_html( $st_label ); ?></span>
						<?php endif; ?>
					</div>
						<?php
					}
					?>
				</div>
				<div class="footer-modern__social">
					<?php
					$express_movers_footer_soc_icon_fallback = array(
						1 => 'fa-brands fa-facebook-f',
						2 => 'fa-brands fa-x-twitter',
						3 => 'fa-brands fa-linkedin-in',
						4 => 'fa-brands fa-instagram',
					);
					for ( $soc = 1; $soc <= 4; $soc++ ) {
						$icon_cl = get_theme_mod( 'express_movers_foot_featured_icon_footer' . $soc, $express_movers_footer_soc_icon_fallback[ $soc ] );
						$soc_url = get_theme_mod( 'express_movers_featured_icon_url_footer' . $soc, '' );
						if ( ! is_string( $icon_cl ) || '' === trim( $icon_cl ) ) {
							continue;
						}
						$href = ( is_string( $soc_url ) && '' !== trim( $soc_url ) ) ? $soc_url : '#';
						printf(
							'<a class="footer-modern__social-btn" href="%1$s" target="_blank" rel="noopener noreferrer" aria-label="%2$s"><i class="%3$s" aria-hidden="true"></i></a>',
							esc_url( $href ),
							esc_attr(
								sprintf(
									/* translators: %d: social icon slot 1–4 */
									__( 'Social link %d', 'express-movers' ),
									$soc
								)
							),
							esc_attr( $icon_cl )
						);
					}
					?>
				</div>
			</div>
			<div class="footer-modern__col">
				<h3 class="footer-modern__col-title"><?php echo esc_html( get_theme_mod( 'express_movers_footer_col2_title', 'Quick Links' ) ); ?></h3>
				<ul class="footer-modern__links">
					<?php
					$express_movers_footer_quick_lbl = array( 'About Us', 'Careers', 'News & Media', 'Support' );
					for ( $q = 1; $q <= 4; $q++ ) {
						express_movers_footer_link_li( 'express_movers_footer_quick_' . $q . '_label', 'express_movers_footer_quick_' . $q . '_url', $express_movers_footer_quick_lbl[ $q - 1 ] );
					}
					?>
				</ul>
			</div>
			<div class="footer-modern__col">
				<h3 class="footer-modern__col-title"><?php echo esc_html( get_theme_mod( 'express_movers_footer_col3_title', 'Our Services' ) ); ?></h3>
				<ul class="footer-modern__links">
					<?php
					$express_movers_footer_svc_lbl = array( 'Ocean Freight', 'Air Freight', 'Ground Transport', 'Warehousing' );
					for ( $v = 1; $v <= 4; $v++ ) {
						express_movers_footer_link_li( 'express_movers_footer_service_' . $v . '_label', 'express_movers_footer_service_' . $v . '_url', $express_movers_footer_svc_lbl[ $v - 1 ] );
					}
					?>
				</ul>
			</div>
			<div class="footer-modern__col">
				<h3 class="footer-modern__col-title"><?php echo esc_html( get_theme_mod( 'express_movers_footer_col4_title', 'Contact Us' ) ); ?></h3>
				<div class="footer-modern__contact-lines">
					<?php
					$f_addr = get_theme_mod( 'express_movers_footer_contact_address', '123 Logistics Ave, Suite 500 New York, NY 10001' );
					if ( is_string( $f_addr ) && '' !== trim( $f_addr ) ) :
						?>
					<div class="footer-modern__contact-row">
						<i class="fa-solid fa-location-dot" aria-hidden="true"></i>
						<span><?php echo nl2br( esc_html( $f_addr ) ); ?></span>
					</div>
						<?php
					endif;
					$f_phone = get_theme_mod( 'express_movers_footer_contact_phone', '+1 (800) 123-4567' );
					if ( is_string( $f_phone ) && '' !== trim( $f_phone ) ) :
						$digits = preg_replace( '/\D+/', '', $f_phone );
						?>
					<div class="footer-modern__contact-row">
						<i class="fa-solid fa-phone" aria-hidden="true"></i>
						<a href="<?php echo $digits ? 'tel:' . esc_attr( $digits ) : '#'; ?>"><?php echo esc_html( $f_phone ); ?></a>
					</div>
						<?php
					endif;
					$f_mail = get_theme_mod( 'express_movers_footer_contact_email', 'info@swiftship.com' );
					if ( is_string( $f_mail ) && '' !== trim( $f_mail ) ) :
						?>
					<div class="footer-modern__contact-row">
						<i class="fa-solid fa-envelope" aria-hidden="true"></i>
						<a href="mailto:<?php echo esc_attr( $f_mail ); ?>"><?php echo esc_html( $f_mail ); ?></a>
					</div>
						<?php endif; ?>
				</div>
				<?php
				$cta_txt = get_theme_mod( 'express_movers_footer_cta_text', 'Get a Quote' );
				$cta_url = get_theme_mod( 'express_movers_footer_cta_url', '' );
				if ( is_string( $cta_txt ) && '' !== trim( $cta_txt ) ) :
					$f_cta_href = ( is_string( $cta_url ) && '' !== trim( $cta_url ) ) ? $cta_url : '#';
					?>
				<a class="footer-modern__cta" href="<?php echo esc_url( $f_cta_href ); ?>">
					<?php echo esc_html( $cta_txt ); ?>
					<i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
				</a>
				<?php endif; ?>
			</div>
		</div>
	</div>
	<div class="footer-modern__subbar">
		<div class="footer-modern__subbar-inner">
			<p class="footer-modern__copyright"><?php echo esc_html( get_theme_mod( 'express_movers_foot_themename', '© 2026 SwiftShip Logistics. All rights reserved.' ) ); ?></p>
			<div class="footer-modern__legal">
				<?php
				$legal_keys   = array( 'privacy', 'terms', 'cookie', 'sitemap' );
				$legal_labels = array(
					'privacy' => 'Privacy Policy',
					'terms'   => 'Terms & Conditions',
					'cookie'  => 'Cookie Policy',
					'sitemap' => 'Sitemap',
				);
				foreach ( $legal_keys as $lk ) {
					$lbl    = get_theme_mod( 'express_movers_footer_legal_' . $lk . '_label', isset( $legal_labels[ $lk ] ) ? $legal_labels[ $lk ] : '' );
					$lk_url = get_theme_mod( 'express_movers_footer_legal_' . $lk . '_url', '' );
					if ( ! is_string( $lbl ) || '' === trim( $lbl ) ) {
						continue;
					}
					$h = ( is_string( $lk_url ) && '' !== trim( $lk_url ) ) ? $lk_url : '#';
					printf(
						'<a href="%1$s">%2$s</a>',
						esc_url( $h ),
						esc_html( $lbl )
					);
				}
				?>
			</div>
		</div>
	</div>
	<?php if ( get_theme_mod( 'featured_scrooltopbtn_on_off', true ) == true ) { ?>
	<div class="scroll-to-top">
		<a href="#" id="scroll-to-top"><i class="fas fa-caret-up"></i></a>
	</div>
	<?php } ?>
</footer>
</div><!-- #page -->

<?php wp_footer(); ?>

</body>
</html>
