<?php
if (! defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}
$copyright_switch = get_theme_mod('curamedix_copyright_switch', 'on');
$copyright_bg_color = get_theme_mod('curamedix_copyright_bg_color', '#0d6efd');
$copyright_text = get_theme_mod('curamedix_copyright_text', esc_html__('© 2026 CuraMedix. All rights reserved.', 'curamedix'));
$footer_bg_color = get_theme_mod('curamedix_footer_bg_color', '#141a33');

?>
<!-- footer area start -->
<footer class="tr-footer-ptb p-relative white" style="background-color: <?php echo esc_attr($footer_bg_color); ?>;">
    <div class="container">

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

            <div class="tr-footer-widget-border pt-90">
                <div class="row">
                    <div class="col-xl-3 col-lg-3 col-md-6 col-12">
                        <?php dynamic_sidebar('footer-widget-1') ?>
                    </div>
                    <div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-12">
                        <?php dynamic_sidebar('footer-widget-2') ?>
                    </div>
                    <div class="col-xl-3 col-lg-3 col-md-6 col-sm-6 col-12">
                        <?php dynamic_sidebar('footer-widget-3') ?>
                    </div>
                    <div class="col-xl-3 col-lg-3 col-md-6 col-12">
                        <?php dynamic_sidebar('footer-widget-4') ?>
                    </div>
                </div>
            </div>

        <?php endif; ?>
    </div>
    <?php if ($copyright_switch): ?>
                <div style="background-color: <?php echo esc_attr($copyright_bg_color); ?>;" class="text-white py-1" role="banner" aria-label="Site copyright">
            <div class="container">
                <div class="d-flex flex-wrap align-items-center justify-content-center">
                    <p>
                        <?php echo esc_html($copyright_text); ?>
                    </p>
                </div>
            </div>
        </div>
    <?php endif; ?>
</footer>
<!-- footer area end -->