{{--
Product hero: the gallery on the left; on the right the title, the prices, the two
benefits, the description and the order form, in one vertical line.
The prices are also the cover picker, as on the live page: clicking one marks it,
writes selected_format into the form and shows the delivery note; clicking it
again clears it. Picking is optional — the checkout asks for the cover anyway.
--}}
@php
$gallery = $book->getMedia('presentation');
$video = $book->video_link ?? null;
// The cover first, then the video, then the rest (Alex, 30.10.2026): the video opened
// the page and showed a live-action scene, not the printed book. Each slide's index is
// its place here; app.js follows the thumbnails, so any order works.
$slides = $gallery->map(fn ($media) => ['media' => $media])->values()->all();
if ($video) {
array_splice($slides, min(1, count($slides)), 0, [['video' => $video]]);
}
$customers = $book->getMedia('customers');
$edition = match ((int) $book->gender) {
1 => ['label' => 'За момче', 'class' => 'book-card__edition--boy'],
2 => ['label' => 'За момиче', 'class' => 'book-card__edition--girl'],
default => null,
};
$age = $book->suitableAgeText();
$pages = $book->pages ? $book->pages . ' стр.' : null;
// EUR only, whole prices without ".00" — the same format as the catalogue card.
$eur = fn (float $v) => (fmod($v, 1.0) == 0.0 ? number_format($v, 0) : number_format($v, 2)) . ' EUR';
$formats = [];
foreach ([
'hardcover' => ['Твърди корици', 'Луксозно издание', '
Детето отваря книгата и вижда себе си. Качваш една снимка, а ние го превръщаме в главния герой: с неговото лице и име, на почти всяка страница.
{{ config('site.promo_label') }} · до {{ $promoTo }} вкл. След {{ $promoTo }}: {{ implode(' · ', $promoAfter) }}
Безплатна доставка с куриер Speedy. Заплащате при получаване.
@endif
@empty
@endforelse
{{-- The page count, the same stamp as on the catalogue covers. Bottom left:
the slide count sits bottom right. --}}
@if($book->pages)
@endif
{{-- On a phone a parent swipes the big picture, and nothing told them there was
more than one: arrows and a count say so, the swipe itself is in app.js --}}
@if(count($slides) > 1)
@endif
Персонализирана детска книга:
{{ $book->title }}
@if($edition)
{{ $edition['label'] }}
@endif
@if($book->content)