@extends('layouts.user')

@section('title', 'Menu Pizza')

@section('content')
<div class="container mt-4">

    <h2 class="mb-3">🍕 Menu Pizza</h2>

    <div class="row">
        @foreach($pizzas as $pizza)
        <div class="col-md-4 mb-4">
            <div class="card shadow-sm">
                <img src="{{ asset('storage/'.$pizza->gambar) }}" class="card-img-top">

                <div class="card-body">
                    <h5 class="card-title">{{ $pizza->nama }}</h5>
                    <p class="text-muted">{{ $pizza->deskripsi }}</p>
                    <h5 class="text-danger">Rp {{ number_format($pizza->harga,0,',','.') }}</h5>

                    <form action="{{ route('user.cart.add', $pizza->id) }}" method="POST">
                      @csrf
                       <!-- Input jumlah -->
                    <input 
                        type="number" 
                        name="quantity" 
                        min="1" 
                        value="1" 
                        class="form-control mb-2" 
                        style="width: 80px;"
                    >
                     <button class="btn btn-primary btn-block">Tambah ke Keranjang 🛒</button>
                    </form>

                </div>
            </div>
        </div>
        @endforeach
    </div>

</div>
@endsection
