{{-- Server-rendered cart contents. Rendered inline on first page load inside checkout/drawer.blade.php, and re-fetched + swapped into the drawer by bbk-cart-controller after every mutation. $cart / $lines come from the view composer in CheckoutModuleServiceProvider. The data-bbk-cart-* attributes on the root are the module's read API for the host (e.g. the header bag-icon count) — bbk-cart-controller reads them after each swap and re-emits them on the `bbk-cart:updated` window event. --}} @php($count = $lines->sum('quantity')) {{-- @dump($lines) --}}
@if ($lines->isEmpty())

{{ __('checkout.cart.empty') }}

@else
@if ($cart?->coupon_code)
{{ $cart->coupon_code }}
@csrf @method('DELETE')
@else
@csrf
@if ($couponError ?? false) @endif @endif
@if ($cart?->discountTotal?->value > 0)
{{ __('checkout.cart.discount') }} −{{ $cart->discountTotal->formatted() }}
@endif
{{ __('checkout.cart.subtotal') }} {{ $cart?->subTotal?->formatted() }}
{{-- Always shown, even with no discount — equals subtotal then, diverges once one's applied. --}}
{{ __('checkout.cart.total') }} {{ $cart?->total?->formatted() }}
{{ __('checkout.cart.checkout') }}
@endif