{{-- ===================== HEADER ===================== --}}
{{ __('Back to products') }}

{{ $productId ? __('Edit product') : __('New product') }}

@if ($productId) @endif @if ($mode !== '') {{ $mode === 'full' ? __('Full costing') : __('Quick price') }} @endif
@if ($returnToQuote)

{{ __('Finishing a quote') }}

{{ __('Create this product, then we’ll take you straight back to the quote with it added, ready to keep going or send.') }}

@endif {{-- ===================== PROGRESS BAR ===================== --}} @php $steps = [ 1 => ['label' => __('Pricing format'), 'icon' => 'swatch'], 2 => ['label' => __('Product details'), 'icon' => 'cube'], 3 => ['label' => __('Pricing'), 'icon' => 'currency-dollar'], ]; @endphp
@foreach ($steps as $n => $s) @php $state = $step > $n ? 'done' : ($step === $n ? 'current' : 'todo'); @endphp @if (! $loop->last)
@endif @endforeach
{{-- ===================== STEP 1 · PRICING FORMAT ===================== --}} @if ($step === 1)

{{ __('How do you want to price this?') }}

{{ __('Pick a costing format to get started, you can switch later.') }}

@endif {{-- ===================== STEP 2 · PRODUCT DETAILS ===================== --}} @if ($step === 2) @php $sel = 'mt-1 block w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500'; @endphp

{{ __('Product details') }}

{{-- Name · SKU · Type, wide name, small SKU/Type. Field titles live in placeholders. --}}
{{-- Category · Unit · Tax, small unit/tax stay small --}}
@if ($categorySelection === 'new') @endif
{{-- Description --}}
{{-- Options, compact toggle pills --}}
{{ __('Options') }} @php $toggles = [ ['is_active', __('Active'), __('Available on quotes & invoices')], ['track_stock', __('Track stock'), __('Deducts inventory when sold')], ['is_outsourced', __('Outsourced'), __('Produced by a partner')], ['is_bespoke', __('Bespoke'), __('Custom-made for one client, not resold as-is')], ]; @endphp @foreach ($toggles as [$field, $lbl, $hint]) @endforeach
@endif {{-- ===================== STEP 3 · PRICING ===================== --}} @if ($step === 3) {{-- Modern model switch --}}

{{ __('Pricing') }}

{{ $mode === 'full' ? __('Build the recipe, cost and price compute live.') : __('Set the price and margin.') }}

{{-- ---- QUICK ---- --}} @if ($mode === 'quick') @php $qp = is_numeric($default_price) ? (float) $default_price : 0.0; $qc = is_numeric($cost) ? (float) $cost : 0.0; $qm = $qp > 0 ? (($qp - $qc) / $qp) * 100 : null; $smallInput = 'block w-full h-9 text-sm py-1.5'; @endphp
@if ($quick_basis === 'margin')

{{ __('The sell price is calculated for you.') }}

@else

{{ __('The margin is calculated for you.') }}

@endif
{{-- Live readout --}}

{{ __('Cost') }}

{{ $baseCode }} {{ number_format($qc, 2) }}

{{ __('Sell price') }}

{{ $baseCode }} {{ number_format($qp, 2) }}

{{ __('Margin') }}

{{ $qm === null ? '—' : number_format($qm, 1) . '%' }}

{{-- Optional stock link: deduct inventory when the job is produced, without building a full recipe. --}} @if ($quick_uses_stock)
@endif
@endif {{-- ---- FULL ---- --}} @if ($mode === 'full') @include('livewire.products.partials.recipe-builder') @endif @endif {{-- ===================== NAV FOOTER (sticky) ===================== --}} {{-- Sticks to the bottom of the viewport so the primary action is always in view without scrolling to the end of a long form. --}}
@if ($step > 1) {{ __('Back') }} @endif
{{ __('Cancel') }} @if ($step === 2) {{ __('Continue to pricing') }} @elseif ($step === 3) @if (! $returnToQuote) {{ __('Save & add to quote') }} {{ __('Saving…') }} @endif {{ $returnToQuote ? __('Save & return to quote') : ($productId ? __('Save changes') : __('Create product')) }} {{ __('Saving…') }} @endif