@php /** @var \App\Models\WaProduct $product */ // Self-derive theme tokens — this partial renders in the child theme's // @section scope and does not inherit the base template's @php locals. $theme = $theme ?? []; $settings = $settings ?? []; $brand = $brand ?? ($theme['brand'] ?? ($settings['brand_color'] ?? '#075E54')); $bg = $bg ?? ($theme['bg'] ?? '#FBFAF6'); $surface = $surface ?? ($theme['surface'] ?? '#FFFFFF'); $border = $border ?? ($theme['border'] ?? '#E5DFD0'); $shopName = $shopName ?? ($workspace?->name ?: 'Store'); $onSale = $product->compare_price_minor && $product->compare_price_minor > $product->price_minor; $savings = $onSale ? $product->compare_price_minor - $product->price_minor : 0; $images = collect([$product->image_url]) ->concat(is_array($product->gallery_json) ? $product->gallery_json : []) ->filter() ->unique() ->values(); $sfFallback = ''; @endphp

{{ $product->name }}

{{ $product->price_display }} @if ($onSale) {{ $product->compare_price_display }} Save {{ (int) round(($savings / $product->compare_price_minor) * 100) }}% @endif
@if ($product->in_stock) @if ($product->stock_qty !== null && $product->stock_qty <= 10) Only {{ $product->stock_qty }} left @else In stock · ready to ship @endif @else {{ __('Sold out') }} @endif
@if ($product->description)

{{ $product->description }}

@endif
@if ($waNumber) Ask a question on WhatsApp @endif
@if ($product->sku)
{{ __('SKU') }}
{{ $product->sku }}
@endif @if ($product->category)
{{ __('Category') }}
{{ $product->category }}
@endif @if ($product->weight_grams)
{{ __('Weight') }}
{{ $product->weight_grams }} g
@endif
{{ __('Delivery') }}
2–5 business days
@if (is_array($product->tags_json) && count($product->tags_json))
{{ __('Tags') }}
@foreach ($product->tags_json as $t) {{ $t }} @endforeach
@endif
{!! $product->body_html ?: '

' . e($product->description ?: 'No description available yet — message the seller on WhatsApp to learn more.') . '

' !!}
@php $shipFreeMinor = (int) ($sf->shipping_json['free_threshold'] ?? 99900); $shipFreeText = \App\Support\FormatSettings::formatIn($shipFreeMinor / 100, $sf->currency_code ?? 'USD'); @endphp

{{ __('Shipping.') }} Orders are dispatched within 1–2 business days. Delivery times depend on your location — typically 2–5 business days. Free shipping on orders above {{ $shipFreeText }}.

{{ __('Returns.') }} Unused items can be returned within 7 days of delivery. Message us on WhatsApp to start a return — we'll arrange the pickup.

@if (($ratingCount ?? 0) > 0)
{{ $ratingAvg }} {{ str_repeat('★', (int) round($ratingAvg)) }}{{ str_repeat('★', 5 - (int) round($ratingAvg)) }} {{ trans_choice('{1}:count review|[2,*]:count reviews', $ratingCount, ['count' => $ratingCount]) }}
@foreach ($reviews as $rv)
{{ $rv->customer_name ?: __('Anonymous') }} {{ str_repeat('★', $rv->rating) }}{{ str_repeat('★', 5 - $rv->rating) }}
@if ($rv->body)

{{ $rv->body }}

@endif
@endforeach @else

{{ __('No reviews yet — be the first to review this product.') }}

@endif
{{ __('Write a review') }}
@if (isset($related) && $related->count() > 0) @endif