<?php $__env->startSection('title', 'Listings — iiSHEEG'); ?>

<?php $__env->startSection('content'); ?>
<section class="bg-navy text-white py-4">
    <div class="container">
        <h1 class="h3 mb-3">Business listings</h1>
        <form action="<?php echo e(route('listing')); ?>" method="GET" class="row g-2">
            <div class="col-md-6">
                <input type="text" name="keyword" value="<?php echo e($keyword); ?>" class="form-control" placeholder="Search by name or description">
            </div>
            <div class="col-md-4">
                <select name="city_id" class="form-select">
                    <option value="">All cities</option>
                    <?php $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($city->id); ?>" <?php if($cityId == $city->id): echo 'selected'; endif; ?>><?php echo e($city->name); ?>, <?php echo e($city->country); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
            <div class="col-md-2">
                <button type="submit" class="btn btn-teal w-100">Search</button>
            </div>
        </form>
    </div>
</section>

<section class="container py-5">
    <p class="text-muted mb-4"><?php echo e($businesses->total()); ?> <?php echo e(\Illuminate\Support\Str::plural('business', $businesses->total())); ?> found</p>

    <?php if($businesses->isEmpty()): ?>
        <div class="alert alert-light border text-center py-5">
            <i class="bi bi-search fs-2 text-teal d-block mb-2"></i>
            No businesses matched your search. Try a different keyword or city, or
            <a href="<?php echo e(route('business.create')); ?>">add your business</a> to the directory.
        </div>
    <?php else: ?>
        <div class="row g-4">
            <?php $__currentLoopData = $businesses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $business): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-md-6 col-lg-4">
                    <div class="card business-card">
                        <div class="card-body">
                            <div class="d-flex align-items-start gap-3 mb-3">
                                <img src="<?php echo e($business->logo_url ?? 'https://placehold.co/64x64?text=ii'); ?>" alt="<?php echo e($business->name); ?>" class="business-logo">
                                <div>
                                    <h5 class="card-title mb-1">
                                        <?php echo e($business->name); ?>

                                        <?php if($business->featured): ?>
                                            <span class="badge badge-featured ms-1">Featured</span>
                                        <?php endif; ?>
                                    </h5>
                                    <span class="badge bg-light text-navy border"><?php echo e($business->category->name); ?></span>
                                </div>
                            </div>
                            <p class="text-muted small mb-2"><i class="bi bi-geo-alt text-teal"></i> <?php echo e($business->city->name); ?>, <?php echo e($business->city->country); ?></p>
                            <p class="card-text small text-truncate-3"><?php echo e(\Illuminate\Support\Str::limit($business->description, 110)); ?></p>
                            <a href="<?php echo e(route('business.show', $business)); ?>" class="btn btn-outline-teal btn-sm w-100">View details</a>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <div class="mt-5 d-flex justify-content-center">
            <?php echo e($businesses->links()); ?>

        </div>
    <?php endif; ?>
</section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\MI\iisheeg\resources\views/listing.blade.php ENDPATH**/ ?>