<?php if($orderdata && $orderdata->count() > 0): ?>
    <div class="orders-grid">
        <?php $__currentLoopData = $orderdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php
                $productData = DB::table('product')
                    ->join('product_color', 'product.id', '=', 'product_color.product_id')
                    ->select(
                        'product.id',
                        'product.product_name',
                        'product.product_image',
                        'product.product_price',
                        'product_color.color_image'
                    )
                    ->where('product.id', $item->product_id)
                    ->where('product.status', 1)
                    ->where('product_color.product_color', $item->color)
                    ->first();
                $totalAmount = $item->total + $item->service_fee;
            ?>

            <div class="order-card-modern">
                <div class="order-card-header">
                    <div class="order-id-badge">
                        <i class="fas fa-hashtag me-1"></i> <?php echo e($item->order_id ?? 'N/A'); ?>

                    </div>
                    <div class="order-date-badge">
                        <i class="far fa-calendar-alt me-1"></i> <?php echo e(\Carbon\Carbon::parse($item->created_at)->format('M j, Y')); ?>

                    </div>
                </div>
                <div class="order-card-body">
                    <div class="product-thumb">
                        <?php if($productData && $productData->color_image): ?>
                            <img src="<?php echo e(asset('admin/assets/img/product/' . $productData->color_image)); ?>" alt="<?php echo e($productData->product_name ?? 'Product'); ?>">
                        <?php else: ?>
                            <img src="https://images.macrumors.com/article-new/2019/04/guest-user-250x250.jpg" alt="Default Product">
                        <?php endif; ?>
                    </div>
                    <div class="order-summary-details">
                        <h4 class="product-name-title"><?php echo e($productData->product_name ?? 'Product'); ?></h4>
                        <div class="product-meta-row mt-2">
                            <span class="meta-item"><strong class="text-dark">Qty:</strong> <?php echo e($item->quantity ?? '1'); ?></span>
                            <span class="meta-separator">•</span>
                            <span class="meta-item"><strong class="text-dark">Color:</strong> <?php echo e($item->color ?? 'Default'); ?></span>
                        </div>
                        <div class="order-price-val mt-3">
                            Rs. <?php echo e(number_format($totalAmount, 2)); ?>

                        </div>
                    </div>
                </div>
                <div class="order-card-footer">
                    <a href="<?php echo e(route('american.plastic.view.order', ['id' => $item->id])); ?>" class="order-action-btn">
                        <span>View Details</span> <i class="fas fa-chevron-right ms-2"></i>
                    </a>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    <!-- Pagination Links -->
    <div class="pagination-wrapper mt-4">
        <?php echo e($orderdata->links()); ?>

    </div>
<?php else: ?>
    <div class="no-orders-state text-center py-5">
        <div class="empty-icon-box mb-3">
            <i class="fas fa-file-invoice"></i>
        </div>
        <h4>No Orders Found</h4>
        <p class="text-muted">
            <?php if(request()->has('search') && !empty(request()->input('search'))): ?>
                We couldn't find any orders matching "<?php echo e(request()->input('search')); ?>".
            <?php else: ?>
                You haven't placed any orders yet.
            <?php endif; ?>
        </p>
    </div>
<?php endif; ?>
<?php /**PATH /home/amerbofz/public_html/resources/views/web/home/partials/orders_list.blade.php ENDPATH**/ ?>