@extends('layouts.buyer') @section('title', $product->name . ' - Detail Produk') @push('styles') @endpush @section('content') {{-- Breadcrumb --}} {{-- Main Detail Card --}}
{{-- KIRI: Gambar --}}
@if($product->category)
{{ $product->category->name }}
@endif @if($product->stock <= 0)
Stok Habis
@elseif($product->stock <= 5)
Stok Terbatas
@endif @if($product->image_url) {{ $product->name }} @else
Foto Produk Belum Tersedia
@endif
ID: #{{ str_pad($product->id, 5, '0', STR_PAD_LEFT) }}
{{ $product->created_at->translatedFormat('d M Y') }}
Aktif
{{-- KANAN: Info --}}
@if($product->category) @endif

{{ $product->name }}

{{-- Harga --}}
Harga Satuan
{{ $product->formatted_price }}
{{-- Stok --}}
@if($product->stock > 5)
Tersedia ({{ $product->stock }} unit) — siap dikirim
@elseif($product->stock > 0)
Stok Terbatas — hanya {{ $product->stock }} unit tersisa!
@else
Stok Habis — produk sedang tidak tersedia
@endif
{{-- Deskripsi --}}
{{ $product->description ?: 'Belum ada deskripsi detail untuk produk ini.' }}

{{-- TOMBOL AKSI --}} @if($product->stock > 0)
@csrf {{-- Qty Selector --}}
Maks. {{ $product->stock }} unit
{{-- Tombol: Tambah ke Keranjang --}}
Kembali ke Katalog
@else @endif {{-- Link ke cart --}} @php $cartCount = \App\Http\Controllers\Buyer\CartController::cartCount(); @endphp @if($cartCount > 0) @endif
{{-- Produk Terkait --}} @if($relatedProducts->count() > 0)

Produk Serupa Lainnya

Dari kategori {{ $product->category->name ?? 'yang sama' }}

@if($product->category) Lihat Semua @endif
@foreach($relatedProducts as $rel)
@endforeach
@endif {{-- Toast Notification --}}
@endsection @push('scripts') @endpush