@extends('layouts.app')

@section('content')
<div class="container">
    <h2>Nuevo Producto</h2>

    <div class="card p-3">
        <form action="{{ route('productos.store') }}" 
              method="POST" 
              enctype="multipart/form-data">

            @csrf

            <div class="mb-3">
                <label class="form-label">Nombre</label>
                <input type="text" name="nombre" 
                       class="form-control" 
                       value="{{ old('nombre') }}" required>
            </div>

            <div class="mb-3">
                <label class="form-label">Precio</label>
                <input type="number" step="0.01" name="precio"
                       class="form-control"
                       value="{{ old('precio') }}" required>
            </div>

            <div class="mb-3">
                <label class="form-label">Descripción</label>
                <textarea name="descripcion" 
                          class="form-control" rows="3">{{ old('descripcion') }}</textarea>
            </div>

            <div class="mb-3">
                <label class="form-label">Código de Barras</label>
                <input type="text" name="codigo_barras"
                       class="form-control"
                       value="{{ old('codigo_barras') }}">
            </div>

            <div class="mb-3">
                <label class="form-label">Foto del Producto</label>
                <input type="file" name="foto" class="form-control">
            </div>

            <button class="btn btn-primary">Guardar</button>
            <a href="{{ route('productos.index') }}" class="btn btn-secondary">
                Cancelar
            </a>
        </form>
    </div>
</div>
@endsection
