@extends('layouts.user')

@section('title', 'Detail Buket - Florist dan Self Photo Studio Nganjuk')

@section('content')
    <section class="section-detailbuket">
        <div class="container">

            <div class="row">
                <div class="col-12 mb-2">
                    <a href="{{ route('pesan.buket') }}" class="text-decoration-none text-muted small">
                        <i class="bi bi-arrow-left me-1"></i> Kembali ke Katalog
                    </a>
                </div>
            </div>

            <div class="row g-5 align-items-center">

                <div class="col-lg-5 mb-5 mb-lg-0">
                    <div class="detailbuket-img-frame">
                        <img src="{{ asset($buket->foto) }}" class="img-fluid" alt="{{ $buket->nama }}">
                    </div>
                </div>

                <div class="col-lg-7">
                    <div class="detailbuket-content">

                        <h1 class="detailbuket-title">{{ $buket->nama }}</h1>

                        <h3 class="detailbuket-price">Rp {{ number_format($buket->harga, 0, ',', '.') }}</h3>
                        <div class="detailbuket-specs d-flex align-items-center gap-4 mb-4">

                            <div class="detailbuket-specs d-flex align-items-center">

                                <div class="d-flex align-items-center gap-3">
                                    <div class="icon-box">
                                        <i class="bi bi-flower1"></i>
                                    </div>
                                    <div class="d-flex flex-column gap-1">
                                        <span class="detailbuket-spec-label">Kategori</span>
                                        <span
                                            class="detailbuket-spec-val">{{ ucfirst(str_replace('_', ' ', $buket->kategori)) }}</span>
                                    </div>
                                </div>

                                <div class="detailbuket-vr"></div>

                                <div class="d-flex align-items-center gap-3">
                                    <div class="icon-box">
                                        <i class="bi bi-rulers"></i>
                                    </div>
                                    <div class="d-flex flex-column gap-1">
                                        <span class="detailbuket-spec-label">Ukuran</span>
                                        <span class="detailbuket-spec-val">{{ $buket->ukuran }}</span>
                                    </div>
                                </div>
                            </div>

                        </div>
                        <div class="detailbuket-desc mt-4">
                            <p>
                                {!! nl2br(e($buket->deskripsi)) !!}
                            </p>
                        </div>

                        <p class="detailbuket-note mt-4">
                            <strong>Kustomisasi Tersedia:</strong> Kamu bisa request {{ $buket->request_khusus }} saat
                            melakukan pemesanan.
                        </p>

                        <div class="d-flex gap-3 mt-5">
                            <a href="{{ route('formulir.buket', ['id' => $buket->id_buket]) }}"
                                class="btn btn-detailbuket-primary flex-fill">
                                Pesan Sekarang
                            </a>
                            @php
                                $waText =
                                    'Halo Flo.do, Aku tertarik sama produk *' .
                                    $buket->nama .
                                    '* seharga Rp ' .
                                    number_format($buket->harga, 0, ',', '.') .
                                    '. Bisa diskusi sedikit soal detail dan custom-nya?';
                                $waLink = 'https://wa.me/6289673668516?text=' . urlencode($waText);
                            @endphp
                            <a href="{{ $waLink }}" target="_blank" class="btn btn-detailbuket-secondary flex-fill">
                                Diskusikan di WA
                            </a>
                        </div>

                    </div>
                </div>

            </div>
        </div>
    </section>
@endsection
