@extends('admin.layouts.app')
@section('title', 'Edit Brand')
@section('content')
<div class="card" style="max-width:700px">
    <div class="card-header">Edit Brand: {{ $brand->name }}</div>
    <form action="{{ route('admin.brands.update', $brand) }}" method="POST" enctype="multipart/form-data">
        @csrf @method('PUT')
        <div class="form-group">
            <label>Name *</label>
            <input type="text" name="name" class="form-control" value="{{ old('name', $brand->name) }}" required>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Slug</label>
                <input type="text" name="slug" class="form-control" value="{{ old('slug', $brand->slug) }}">
            </div>
            <div class="form-group">
                <label>Order</label>
                <input type="number" name="order" class="form-control" value="{{ old('order', $brand->order) }}" min="0">
            </div>
        </div>
        <div class="form-group">
            <label>Description</label>
            <textarea name="description" class="form-control">{{ old('description', $brand->description) }}</textarea>
        </div>
        <div class="form-row">
            <div class="form-group">
                <label>Website</label>
                <input type="text" name="website" class="form-control" value="{{ old('website', $brand->website) }}">
            </div>
            <div class="form-group">
                <label>Logo</label>
                <input type="file" name="logo" class="form-control" accept="image/*">
                @if($brand->logo) <small class="text-muted">Current: {{ $brand->logo }}</small> @endif
            </div>
        </div>
        <div class="form-group">
            <label class="checkbox-label"><input type="checkbox" name="is_active" value="1" {{ $brand->is_active ? 'checked' : '' }}> Active</label>
        </div>
        <button type="submit" class="btn btn-primary">Update Brand</button>
    </form>
</div>
@endsection
