<?php
/**
 * The template for displaying the footer.
 */

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}
?>

    </div> <!-- .site-content -->

    <!-- Custom Footer -->
    <footer class="footer site-footer">
        <div class="container">
            <!-- Footer Widgets -->
            <div class="footer-widgets">
                <div class="pixel-grid-4">
                    <!-- Widget Area 1 - About -->
                    <div class="footer-widget">
                        <?php if (is_active_sidebar('footer-widget-1')) : ?>
                            <?php dynamic_sidebar('footer-widget-1'); ?>
                        <?php else : ?>
                            <h3>About <?php bloginfo('name'); ?></h3>
                            <p><?php bloginfo('description'); ?></p>
                            <div class="footer-contact">
                                <p><strong>Phone:</strong> <?php echo revd_get_option('revd_phone', '+44 7450 414597'); ?></p>
                                <p><strong>Email:</strong> <?php echo revd_get_option('revd_email', 'support@revddigital.co.uk'); ?></p>
                            </div>
                        <?php endif; ?>
                    </div>

                    <!-- Widget Area 2 - Services -->
                    <div class="footer-widget">
                        <?php if (is_active_sidebar('footer-widget-2')) : ?>
                            <?php dynamic_sidebar('footer-widget-2'); ?>
                        <?php else : ?>
                            <h3>Our Services</h3>
                            <ul class="footer-links">
                                <li><a href="<?php echo home_url('/services/seo-services/'); ?>">SEO Services</a></li>
                                <li><a href="<?php echo home_url('/services/local-seo/'); ?>">Local SEO</a></li>
                                <li><a href="<?php echo home_url('/services/orm/'); ?>">Reputation Management</a></li>
                                <li><a href="<?php echo home_url('/seo-australia/'); ?>">SEO Australia</a></li>
                            </ul>
                        <?php endif; ?>
                    </div>

                    <!-- Widget Area 3 - Quick Links -->
                    <div class="footer-widget">
                        <?php if (is_active_sidebar('footer-widget-3')) : ?>
                            <?php dynamic_sidebar('footer-widget-3'); ?>
                        <?php else : ?>
                            <h3>Quick Links</h3>
                            <ul class="footer-links">
                                <li><a href="<?php echo home_url('/about-us/'); ?>">About Us</a></li>
                                <li><a href="<?php echo home_url('/contact-us/'); ?>">Contact</a></li>
                                <li><a href="<?php echo home_url('/case-studies/'); ?>">Case Studies</a></li>
                                <li><a href="<?php echo home_url('/privacy-policy/'); ?>">Privacy Policy</a></li>
                                <li><a href="<?php echo home_url('/terms-of-service/'); ?>">Terms of Service</a></li>
                            </ul>
                        <?php endif; ?>
                    </div>

                    <!-- Widget Area 4 - Newsletter/CTA -->
                    <div class="footer-widget">
                        <?php if (is_active_sidebar('footer-widget-4')) : ?>
                            <?php dynamic_sidebar('footer-widget-4'); ?>
                        <?php else : ?>
                            <h3>Get Free SEO Audit</h3>
                            <p>Ready to grow your business online? Get a free SEO audit of your website.</p>
                            <div class="footer-cta">
                                <a href="<?php echo home_url('/contact-us/'); ?>" class="pixel-button primary">Get Free Audit</a>
                                <a href="tel:+447450414597" class="pixel-button">Call Now</a>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            <!-- Footer Bottom -->
            <div class="footer-bottom">
                <div class="footer-bottom-content">
                    <div class="footer-info">
                        <p>&copy; <?php echo date('Y'); ?> <?php bloginfo('name'); ?>. All rights reserved.</p>
                        <p class="company-details">
                            Company Registration: England & Wales | 
                            <a href="<?php echo home_url('/privacy-policy/'); ?>">Privacy Policy</a> | 
                            <a href="<?php echo home_url('/terms-of-service/'); ?>">Terms of Service</a>
                            <a href="<?php echo home_url('/disclaimer/'); ?>">Disclaimer</a>
                            <a href="<?php echo home_url('/refund-policy/'); ?>">Refund Policy</a>                            
                        </p>
                    </div>
                    <div class="footer-badges">
                        <div class="trust-badges">
                            <span class="badge">UK Based</span>
                            <span class="badge">GDPR Compliant</span>
                            <span class="badge">Google Partner</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>

</div> <!-- .site -->

<?php wp_footer(); ?>
</body>
</html>