@extends('layouts.app') @section('content')

Mis Pedidos

@if($orders->isEmpty())

Aún no tienes pedidos

Tus compras realizadas en Glow & Style aparecerán en este historial.

Ir a la Tienda
@else
@foreach($orders as $order)

Pedido #{{ $order->id }}

Realizado el {{ $order->created_at->format('d/m/Y H:i') }}
Monto Total ${{ number_format($order->total_amount, 2) }}
@if($order->status === 'pending_pickup') ⏳ Pendiente de Retiro y Pago @elseif($order->status === 'completed') ✅ Venta Efectiva (Confirmado) @elseif($order->status === 'cancelled') ❌ Cancelado / Producto Liberado @endif
@if($order->status === 'pending_pickup' && $order->expires_at) @php $now = now(); $isExpired = $now->greaterThan($order->expires_at); $diffHours = $now->diffInHours($order->expires_at, false); $diffMinutes = $now->diffInMinutes($order->expires_at, false) % 60; @endphp
Plazo Máximo para Retiro y Pago en Boutique: {{ $order->expires_at->format('d/m/Y H:i') }} @if(!$isExpired) Quedan {{ $diffHours }}h {{ max(0, $diffMinutes) }}m @else Plazo Vencido @endif
@endif
@foreach($order->items as $item)
{{ $item->product->name ?? 'Producto Eliminado' }}

{{ $item->product->name ?? 'Producto Eliminado' }}

Cantidad: {{ $item->quantity }} x ${{ number_format($item->price, 2) }}
Subtotal: ${{ number_format($item->price * $item->quantity, 2) }}
@endforeach
@endforeach
@endif @endsection