@extends('layouts.app') @section('title', 'Finalizar Compra - Corpo Agrícola') @section('content')
{{-- HEADER DEL CHECKOUT --}}
arrow_back Volver al Carrito

shopping_cart_checkout Finalizar Compra

{{-- Breadcrumbs / Steps Visual --}}
@csrf {{-- LAYOUT PRINCIPAL GRID --}}
{{-- COLUMNA IZQUIERDA (Proceso de Compra Completo) --}}
{{-- SECCIÓN 1: Método de Entrega --}}

1 ¿Cómo deseas recibir tu pedido?

{{-- OPCIÓN DELIVERY (Bloqueada temporalmente) --}} {{-- OPCIÓN PICKUP (Ahora seleccionada por defecto) --}}
{{-- SECCIÓN 2: Dirección de Envío --}}

2 Dirección de Entrega

add_location_alt Agregar Nueva
@if($direcciones->count() > 0)
@foreach($direcciones->sortByDesc('es_principal')->take(2) as $dir) @endforeach
@if($direcciones->count() > 2) @endif @else
wrong_location

¡No tienes direcciones registradas!

Debes agregar al menos una para procesar envíos.

Ir a mi perfil
@endif @error('direccion_id') error {{ $message }} @enderror
{{-- SECCIÓN 3: Métodos de Pago (AHORA EN LA IZQUIERDA) --}}

3 Forma de Pago

@foreach($metodosPago->where('activo', 1)->take(6) as $metodo) @php $icon = match($metodo->tipo_metodo) { 'pago_movil' => 'phone_iphone', 'zelle' => 'zelle_svg', 'transferencia' => 'account_balance', 'efectivo_usd', 'efectivo_bs' => 'attach_money', 'binance' => 'binance_svg', 'punto_venta', 'biopago' => 'point_of_sale', default => 'payments' }; $iconColor = match($metodo->tipo_metodo) { 'pago_movil', 'transferencia' => 'text-blue-600 bg-blue-50', 'zelle' => 'text-[#5800FD] bg-[#5800FD]/10', 'efectivo_usd', 'efectivo_bs' => 'text-green-600 bg-green-50', 'binance' => 'text-[#F3BA2F] bg-[#F3BA2F]/10', default => 'text-gray-600 bg-gray-100' }; @endphp @endforeach
@if($metodosPago->where('activo', 1)->count() > 6) @endif @error('metodo_pago_id') error Selección requerida @enderror {{-- Área de Datos Bancarios (Estilo Recibo) --}}
{{-- SECCIÓN 4: Notas del Pedido --}}

4 Notas adicionales (Opcional)

{{-- COLUMNA DERECHA (Resumen del Pedido - STICKY) --}}

receipt_long Resumen de Compra

{{-- Mini Items del Carrito --}}
@foreach($carrito as $item)
@if($item->producto && $item->producto->imagen_url) {{ $item->producto->nombre ?? 'Producto' }} @else
image Sin Imagen
@endif

{{ $item->producto->nombre }}

Cant: {{ (int)$item->cantidad }} ${{ number_format($item->producto->precio_venta_usd * $item->cantidad, 2) }}
@endforeach
{{-- Desglose de Totales --}}
Subtotal ${{ number_format($subtotal, 2) }}
Impuestos (IVA 16%) ${{ number_format($montoIva, 2) }}
Delivery Urbano + ${{ number_format($zonas->first()->precio_delivery_usd ?? 0, 2) }}
Total a Pagar
${{ number_format($totalUsd, 2) }} USD
{{-- Conversión VES --}}
Equivalente VES Tasa BCV: {{ number_format($tasaValor, 2) }}
{{ number_format($totalVes, 2) }} Bs
{{-- BOTÓN GIGANTE --}}

lock Tu compra es segura y encriptada.

{{-- ================= MODALES ================= --}} {{-- MODAL: SELECCIONAR OTRAS DIRECCIONES --}} {{-- MODAL: TODOS LOS MÉTODOS DE PAGO --}} @endsection @push('scripts') {{-- Script dedicado para el comportamiento del Checkout --}} @endpush