<!-- Footer Section -->
<footer class="bg-gray-900 text-gray-300 mt-auto pb-16 md:pb-0 font-bangla">
    <div class="container mx-auto px-4 py-12">
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-10">
            
            <!-- ১. আমাদের সম্পর্কে (About Us) -->
            <div>
                <h3 class="text-xl font-bold text-secondary mb-4 border-b border-gray-700 pb-2">আমাদের সম্পর্কে</h3>
                <p class="text-sm leading-relaxed text-justify text-gray-400">
                    <span class="logo-font text-white text-lg tracking-wider">Izhaan</span><span class="en-font text-secondary font-bold text-sm">Printers</span> — বাংলাদেশের একটি আধুনিক ও নির্ভরযোগ্য প্রিন্টিং প্রতিষ্ঠান। আমরা দীর্ঘ সময় ধরে সারা দেশে পেশাদার মানের প্রিন্টিং সেবা প্রদান করে আসছি, যেখানে সৃজনশীলতা ও নিখুঁত কারিগরি দক্ষতার সমন্বয়ে প্রতিটি কাজ হয়ে ওঠে আরও আকর্ষণীয়।
                </p>
            </div>

            <!-- ২. গুরুত্বপূর্ণ লিঙ্ক (Important Links) -->
            <div>
                <h3 class="text-xl font-bold text-secondary mb-4 border-b border-gray-700 pb-2">গুরুত্বপূর্ণ লিঙ্ক</h3>
                <ul class="space-y-3 text-sm text-gray-400">
                    <li><a href="index.php" class="hover:text-secondary transition flex items-center gap-3"><i class="fa-solid fa-house text-secondary w-4"></i> হোম পেজ</a></li>
                    <li><a href="category.php" class="hover:text-secondary transition flex items-center gap-3"><i class="fa-solid fa-cart-shopping text-secondary w-4"></i> শপ পেজ</a></li>
                    <li><a href="contact.php" class="hover:text-secondary transition flex items-center gap-3"><i class="fa-solid fa-address-book text-secondary w-4"></i> যোগাযোগ করুন</a></li>
                    <li><a href="#" class="hover:text-secondary transition flex items-center gap-3"><i class="fa-solid fa-truck-fast text-secondary w-4"></i> ডেলিভারি সিস্টেম</a></li>
                </ul>
            </div>

            <!-- ৩. যোগাযোগ করুন ও সোশ্যাল প্রোফাইল (Contact & Social) -->
            <div>
                <h3 class="text-xl font-bold text-secondary mb-4 border-b border-gray-700 pb-2">যোগাযোগ করুন</h3>
                <ul class="space-y-3 text-sm text-gray-400 mb-6">
                    <li class="flex items-start gap-3 hover:text-white transition">
                        <i class="fa-solid fa-phone text-secondary mt-1"></i>
                        <a href="tel:<?= htmlspecialchars($contact_phone ?? '01875198388') ?>" class="en-font"><?= htmlspecialchars($contact_phone ?? '+8801879995834') ?></a>
                    </li>
                    <li class="flex items-start gap-3 hover:text-white transition">
                        <i class="fa-brands fa-whatsapp text-secondary mt-1 text-lg"></i>
                        <a href="https://wa.me/88<?= preg_replace('/[^0-9]/', '', $contact_phone ?? '+8801879995834') ?>" target="_blank" class="en-font"><?= htmlspecialchars($contact_phone ?? '+8801879995834') ?></a>
                    </li>
                    <li class="flex items-start gap-3 hover:text-white transition">
                        <i class="fa-solid fa-envelope text-secondary mt-1"></i>
                        <a href="mailto:<?= htmlspecialchars($contact_email ?? 'izhaanprinters@gmail.com') ?>" class="en-font"><?= htmlspecialchars($contact_email ?? 'izhaanprinters@gmail.com') ?></a>
                    </li>
                    <li class="flex items-start gap-3">
                        <i class="fa-solid fa-location-dot text-secondary mt-1"></i>
                        <span class="leading-relaxed"><?= nl2br(htmlspecialchars($site_address ?? "189, Khabir plaza, Fakirapool, Motijheel, Dhaka-1000.")) ?></span>
                    </li>
                </ul>

                <h3 class="text-lg font-bold text-secondary mb-3">সোশ্যাল প্রোফাইল</h3>
                <div class="flex space-x-3">
                    <a href="#" class="w-9 h-9 rounded bg-gray-800 flex items-center justify-center text-gray-400 hover:bg-[#1877F2] hover:text-white transition shadow-sm"><i class="fa-brands fa-facebook-f"></i></a>
                    <a href="#" class="w-9 h-9 rounded bg-gray-800 flex items-center justify-center text-gray-400 hover:bg-[#FF0000] hover:text-white transition shadow-sm"><i class="fa-brands fa-youtube"></i></a>
                    <a href="#" class="w-9 h-9 rounded bg-gray-800 flex items-center justify-center text-gray-400 hover:bg-[#E4405F] hover:text-white transition shadow-sm"><i class="fa-brands fa-instagram"></i></a>
                    <a href="#" class="w-9 h-9 rounded bg-gray-800 flex items-center justify-center text-gray-400 hover:bg-[#25D366] hover:text-white transition shadow-sm"><i class="fa-brands fa-whatsapp"></i></a>
                </div>
            </div>

            <!-- ৪. পেমেন্ট মেথড (FIXED IMAGE SIZES) -->
            <div>
                <h3 class="text-xl font-bold text-secondary mb-4 border-b border-gray-700 pb-2">পেমেন্ট মেথড</h3>
                <div class="bg-white p-4 rounded-xl shadow-inner grid grid-cols-4 gap-2 place-items-center">
                    <!-- bKash Logo -->
                    <div class="w-full h-10 flex items-center justify-center bg-gray-50 rounded">
                        <img src="https://download.logo.wine/logo/BKash/BKash-Icon-Logo.wine.png" alt="bKash" class="w-full h-full object-contain p-1">
                    </div>
                    <!-- Nagad Logo -->
                    <div class="w-full h-10 flex items-center justify-center bg-gray-50 rounded">
                        <img src="https://download.logo.wine/logo/Nagad/Nagad-Logo.wine.png" alt="Nagad" class="w-full h-full object-contain p-1">
                    </div>
                    <!-- DBBL Logo -->
                    <div class="w-full h-10 flex items-center justify-center bg-gray-50 rounded">
                        <img src="https://www.lawyersnjurists.com/wp-content/uploads/DBBL-logo.jpg" alt="DBBL" class="w-full h-full object-contain p-1">
                    </div>
                    <!-- Visa Logo -->
                    <div class="w-full h-10 flex items-center justify-center bg-gray-50 rounded">
                        <img src="https://i.pinimg.com/736x/3b/38/ef/3b38ef8f2bf7505815dbbe732d838ddc.jpg" alt="Visa" class="w-full h-full object-contain p-1">
                    </div>
                </div>
            </div>

        </div>
    </div>
    
    <!-- Copyright & Designer Info -->
    <div class="bg-secondary relative">
        <div class="container mx-auto px-4 py-4 md:py-5 text-center text-white">
            <p class="font-medium text-sm md:text-base mb-1">
                Copyright &copy; <?= date('Y') ?>-<?= date('Y')+1 ?> 
                <span class="logo-font tracking-wider ml-1 text-lg">Izhaan</span><span class="en-font text-gray-900 font-bold">Printers</span>
            </p>
            <p class="text-xs text-orange-100 en-font font-medium tracking-wide">Design By: Muhammad Raju</p>
        </div>

        <!-- Back To Top Button -->
        <button onclick="window.scrollTo({top: 0, behavior: 'smooth'});" class="absolute right-4 md:right-8 top-1/2 transform -translate-y-1/2 bg-primary text-white w-10 h-10 md:w-12 md:h-12 rounded-lg shadow-xl hover:bg-blue-800 hover:-translate-y-2 transition flex items-center justify-center z-10 border border-blue-400">
            <i class="fa-solid fa-chevron-up text-lg"></i>
        </button>
    </div>
</footer>

<!-- Bottom Navigation Bar (Mobile Only) -->
<div class="fixed bottom-0 left-0 w-full bg-white border-t border-gray-200 shadow-[0_-4px_6px_-1px_rgba(0,0,0,0.1)] md:hidden z-[50] h-16">
    <div class="grid grid-cols-3 h-full">
        
        <!-- Home -->
        <a href="index.php" class="flex flex-col items-center justify-center text-gray-500 hover:text-primary active:text-primary transition group">
            <i class="fa-solid fa-house text-xl mb-1 group-hover:-translate-y-1 transition-transform"></i>
            <span class="text-[10px] font-bangla font-medium">হোম</span>
        </a>
        
        <!-- Cart -->
        <a href="cart.php" class="relative flex flex-col items-center justify-center text-gray-500 hover:text-primary active:text-primary transition group">
            <div class="relative">
                <i class="fa-solid fa-cart-shopping text-xl mb-1 group-hover:-translate-y-1 transition-transform"></i>
                <?php 
                    $cart_count = isset($_SESSION['cart']) ? count($_SESSION['cart']) : 0;
                    if($cart_count > 0): 
                ?>
                <span class="absolute -top-2 -right-3 bg-secondary text-white text-[9px] font-bold px-[5px] py-[1px] rounded-full en-font shadow-sm border border-white">
                    <?= $cart_count ?>
                </span>
                <?php endif; ?>
            </div>
            <span class="text-[10px] font-bangla font-medium">কার্ট</span>
        </a>
        
        <!-- Account (Login / Profile) -->
        <?php $footer_account_link = isset($_SESSION['customer_id']) ? 'profile.php' : 'login.php'; ?>
        <a href="<?= $footer_account_link ?>" class="flex flex-col items-center justify-center text-gray-500 hover:text-primary active:text-primary transition group <?php echo isset($_SESSION['customer_id']) ? 'text-primary font-bold' : ''; ?>">
            <i class="fa-solid fa-user text-xl mb-1 group-hover:-translate-y-1 transition-transform"></i>
            <span class="text-[10px] font-bangla font-medium"><?= isset($_SESSION['customer_id']) ? 'প্রোফাইল' : 'একাউন্ট' ?></span>
        </a>

    </div>
</div>

<!-- JavaScript For Mobile Sidebar Logic -->
<script>
    const menuBtn = document.getElementById('mobileMenuBtn');
    const sidebar = document.getElementById('mobileSidebar');
    const overlay = document.getElementById('sidebarOverlay');
    const closeBtn = document.getElementById('closeSidebarBtn');

    function openSidebar() {
        sidebar.classList.remove('-translate-x-full');
        if(overlay) overlay.classList.remove('hidden');
    }

    function closeSidebar() {
        sidebar.classList.add('-translate-x-full');
        if(overlay) overlay.classList.add('hidden');
    }

    if(menuBtn) menuBtn.addEventListener('click', openSidebar);
    if(closeBtn) closeBtn.addEventListener('click', closeSidebar);
    if(overlay) overlay.addEventListener('click', closeSidebar);
</script>

</body>
</html>