

<?php $__env->startSection('title', 'My Favorites'); ?>

<?php $__env->startSection('buyer-content'); ?>
    <!-- Page Header -->
    <div class="page-header">
        <div>
            <h3 class="page-title">My Favorites</h3>
            <p class="text-muted mb-0">Products you've saved for later</p>
        </div>
        <span class="badge bg-primary-subtle text-primary rounded-pill px-3 py-2">
            <i class="bi bi-heart-fill me-1"></i> <?php echo e($favorites->total()); ?> Items
        </span>
    </div>

    <?php if($favorites->count() > 0): ?>
        <!-- Favorites Grid -->
        <div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4">
            <?php $__currentLoopData = $favorites; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $favorite): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col">
                    <div class="card h-100 border-0 shadow-sm rounded-4 overflow-hidden group-hover-lift">
                        <div class="position-relative">
                            <img src="<?php echo e($favorite->product->main_image); ?>" 
                                     class="card-img-top" 
                                     alt="<?php echo e($favorite->product->name); ?>" 
                                     style="height: 220px; object-fit: cover;">
                            
                            <!-- Favorite/Remove Badge -->
                            <div class="position-absolute top-0 end-0 m-3 z-2">
                                <form action="<?php echo e(route('buyer.favorites.remove', $favorite->id)); ?>" method="POST" class="d-inline">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="btn btn-light shadow-sm rounded-circle d-flex align-items-center justify-content-center p-0" 
                                            style="width: 36px; height: 36px;" title="Remove from favorites" data-bs-toggle="tooltip">
                                        <i class="bi bi-heart-fill text-danger"></i>
                                    </button>
                                </form>
                            </div>

                            <!-- Seller Badge -->
                            <?php if($favorite->product->seller): ?>
                                <div class="position-absolute bottom-0 start-0 m-3 z-2">
                                    <span class="badge bg-dark bg-opacity-75 text-white shadow-sm backdrop-blur fw-normal border border-white border-opacity-25 px-3 py-2">
                                        <i class="bi bi-shop me-1"></i><?php echo e(Str::limit($favorite->product->seller->company_name, 20)); ?>

                                    </span>
                                </div>
                            <?php endif; ?>
                            
                            <!-- Overlay Gradient -->
                            <div class="position-absolute bottom-0 start-0 w-100 h-25" style="background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);"></div>
                        </div>
                        
                        <div class="card-body p-4">
                            <h5 class="card-title fw-bold text-truncate mb-2">
                                <a href="<?php echo e(route('public.products.show', $favorite->product->slug ?? 'slug')); ?>" class="text-decoration-none text-dark stretched-link">
                                    <?php echo e($favorite->product->name); ?>

                                </a>
                            </h5>
                            
                            <div class="d-flex justify-content-between align-items-center mb-4">
                                <div>
                                    <span class="fw-bold text-success fs-5">
                                        ₹<?php echo e(number_format($favorite->product->price, 0)); ?>

                                    </span>
                                    <small class="text-muted ms-1">/ unit</small>
                                </div>
                                <?php if($favorite->product->moq): ?>
                                    <span class="badge bg-light text-dark border shadow-sm fw-medium px-2 py-1">
                                        MOQ: <?php echo e($favorite->product->moq); ?>

                                    </span>
                                <?php endif; ?>
                            </div>
                            
                            <div class="d-grid gap-2 position-relative z-2">
                                <a href="<?php echo e(route('public.products.show', $favorite->product->slug ?? 'slug')); ?>#inquiry" 
                                   class="btn btn-primary rounded-pill shadow-sm fw-medium">
                                    <i class="bi bi-envelope me-1"></i> Send Inquiry
                                </a>
                            </div>
                        </div>
                        
                        <div class="card-footer bg-white border-top border-light py-3 px-4">
                            <small class="text-muted d-flex align-items-center">
                                <i class="bi bi-clock me-2 text-primary"></i> Added <?php echo e($favorite->created_at->diffForHumans()); ?>

                            </small>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <!-- Pagination -->
        <?php if($favorites->hasPages()): ?>
            <div class="d-flex justify-content-center mt-4">
                <?php echo e($favorites->links()); ?>

            </div>
        <?php endif; ?>
    <?php else: ?>
        <!-- Empty State -->
        <div class="card border-0 shadow-sm rounded-4 overflow-hidden">
            <div class="card-body text-center py-5">
                <div class="rounded-circle bg-danger-subtle d-inline-flex align-items-center justify-content-center mb-4" style="width: 80px; height: 80px;">
                    <i class="bi bi-heart fs-1 text-danger"></i>
                </div>
                <h5 class="fw-bold mb-2">No Favorites Yet</h5>
                <p class="text-muted mb-4 opacity-75">Start browsing products and save your favorites for quick access.</p>
                <a href="<?php echo e(route('public.products.index')); ?>" class="btn btn-primary rounded-pill px-4 shadow-sm hover-lift">
                    <i class="bi bi-search me-2"></i> Browse Products
                </a>
            </div>
        </div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.buyer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u281583269/domains/theminiport.com/public_html/resources/views/buyer/favorites.blade.php ENDPATH**/ ?>