

<?php $__env->startSection('frontend_app'); ?>
<!----Page Banner-->
<section>
    <div class="relative bg-cover bg-center h-48" style="background-image: url('<?php echo e(asset('assets/images/pages/bg_contact_us.webp')); ?>');">
        <div class="absolute inset-0 bg-black bg-opacity-60"></div>
            <div class="relative z-10 max-w-4xl mx-auto h-full flex flex-col justify-center items-center px-4">
                <h2 class="text-3xl font-semibold mb-4 text-center text-white capitalize">Properties for <?php echo e($category); ?></h2>
                <div class="text-white text-sm flex items-center space-x-2">
                <i class="fas fa-home text-white"></i>
                <a href="<?php echo e(url('/')); ?>" class="hover:underline">Home</a>
                <span class="text-gray-300">/</span>
                <span class="font-semibold capitalize">Properties for <?php echo e($category); ?></span>
            </div>
        </div>
    </div>
</section>
<section class="py-10">
    <div class="container mx-auto px-4 sm:px-6 lg:px-8">
        <!-- <h2 class="text-2xl font-bold mb-6 capitalize">Properties for <?php echo e($category); ?></h2> -->
        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
            <?php $__currentLoopData = $properties; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $property): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="bg-white rounded-md shadow-sm overflow-hidden group">
                    <a href="#" class="block relative">
                        <img 
                            src="<?php echo e(asset('/' . $property['banner_img'])); ?>"
                            alt="<?php echo e($property['property_name']); ?>"
                            class="w-full h-52 object-cover transition-transform duration-700 group-hover:scale-110"
                        >
                        <span class="absolute top-2 right-2 bg-[var(--primary-color)] text-white text-xs px-3 py-1 rounded-full">
                            For <?php echo e(ucfirst($property['category_name'])); ?>

                        </span>
                    </a>

                    <div class="p-4 space-y-2">
                        <h3 class="text-lg font-semibold line-clamp-2">
                            <?php echo e($property['property_name']); ?>

                        </h3>

                        
                            <?php
                                $addr = $property['address'] ?? [];
                                $addressParts = collect([
                                    $addr['area'] ?? null,
                                    $addr['city'] ?? null,
                                    $addr['state'] ?? null,
                                    $addr['country'] ?? null,
                                ])->filter(fn($val) => $val && $val !== '0')->join(', ');
                            ?>

                            <?php if($addressParts): ?>
                                <p class="text-sm text-gray-500 flex items-center gap-2 mt-2">
                                    <i class="fas fa-location-dot text-[var(--primary-color)]"></i>
                                    <?php echo e($addressParts); ?>

                                </p>
                            <?php endif; ?>

                            
                            <?php $detail = $property['detail'] ?? []; ?>

                            <div class="flex flex-wrap gap-4 text-sm text-gray-700 mt-3">
                                <?php if(!empty($detail['bedrooms']) && $detail['bedrooms'] != 0): ?>
                                    <div class="flex items-center gap-1">
                                        <i class="fas fa-bed text-[var(--primary-color)]"></i>
                                        <span><strong><?php echo e($detail['bedrooms']); ?></strong> Bed</span>
                                    </div>
                                <?php endif; ?>

                                <?php if(!empty($detail['bathroom']) && $detail['bathroom'] != 0): ?>
                                    <div class="flex items-center gap-1">
                                        <i class="fas fa-bath text-[var(--primary-color)]"></i>
                                        <span><strong><?php echo e($detail['bathroom']); ?></strong> Bath</span>
                                    </div>
                                <?php endif; ?>

                                <?php if(!empty($detail['kitchen']) && $detail['kitchen'] != 0): ?>
                                    <div class="flex items-center gap-1">
                                        <i class="fas fa-utensils text-[var(--primary-color)]"></i>
                                        <span><strong><?php echo e($detail['kitchen']); ?></strong> Kitchen</span>
                                    </div>
                                <?php endif; ?>

                                <?php if(!empty($detail['property_size']) && $detail['property_size'] != 0): ?>
                                    <div class="flex items-center gap-1">
                                        <i class="fas fa-ruler-combined text-[var(--primary-color)]"></i>
                                        <span><strong><?php echo e($detail['property_size']); ?></strong> Sqft</span>
                                    </div>
                                <?php endif; ?>
                            </div>


                        
                        <div class="flex justify-between items-center mt-4">
                            <span class="text-[var(--primary-color)] font-semibold text-lg">
                                ₹<?php echo e(number_format($property['price'])); ?>

                            </span>

                            
                            <a href="<?php echo e(route('property.details', ['category' => $property['category_name'], 'slug' => $property['slug']])); ?>"
                               class="text-sm bg-[var(--primary-color)] text-white px-4 py-2 rounded-md">
                                View Details
                            </a>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
    </div>
</section>

<div class="mt-8">
    <?php echo e($properties->links('vendor.pagination.tailwind')); ?>

</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('frontend.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\laravel\realStateNew\resources\views/frontend/page/category.blade.php ENDPATH**/ ?>