


<div style="font-family: Arial, sans-serif; font-size: 10pt; line-height: 1.5; max-width: 600px; margin: 0 auto;">
    <p><?php echo e($user->full_name ?? $user->name); ?> 様</p>
    <br>
    <p>この度は、「KIREI」をご利用いただき、誠にありがとうございます。</p>
    <br>
    <p>本人確認が完了し、ご注文商品のレンタルが可能となりましたので</p>
    <?php
        $detail = $order->order_detail->first();
        $wearDate = $detail->wear_date ?? '未定';
    ?>
    <p>本メールをもって、正式に【 <?php echo e($wearDate); ?> 】のレンタルを承りました。</p>
    <br>
    <p>つきましては、ご注文内容を再度ご確認いただき、下記内容を参考にお支払いをお願い致します。</p>
    <br>
    <p>その他、ご不明な点がありましたらいつでもお気軽にお問い合わせください。</p>
    <br>

    <p>---------------------------------------------------------------------------------------------------------------------------</p>
    <p><strong>【クレジットカード払い】</strong></p>
    <p style="margin-left: 20px;">ご注文時にご登録いただきましたクレジットカード宛てに</p>
    <p style="margin-left: 20px;">ご着用予定日の【11日前】に当店より引き落としを行います。</p>
    <p style="margin-left: 20px;">お支払いの手続きは必要ありません。</p>
    <p>---------------------------------------------------------------------------------------------------------------------------</p>
    <br>

    <p><strong>■ご注文内容</strong></p>
    <p style="margin-left: 20px;">［受注番号] <?php echo e($order->code); ?></p>
    <p style="margin-left: 20px;">［ご注文者] <?php echo e($user->full_name ?? $user->name); ?> 様</p>
    <br>
    <?php if($detail): ?>
    <p style="margin-left: 20px;">［着用予定日] <?php echo e($detail->wear_date ?? '未定'); ?></p>
    <?php
        $rentalPeriod = '未定';
        if ($detail->wear_date) {
            $wearDateObj = \Carbon\Carbon::parse($detail->wear_date);
            $arrivalDate = $wearDateObj->copy()->subDays(2)->format('Y/m/d');
            $returnDate = $wearDateObj->copy()->addDays(3)->format('Y/m/d');
            $rentalPeriod = $arrivalDate . ' ～ ' . $returnDate;
        }
    ?>
    <p style="margin-left: 20px;">［レンタル期間：5泊6日] <?php echo e($rentalPeriod); ?></p>
    <br>
    <?php
        $kimonoNumber = $detail->product_code ?? $detail->product_name ?? '-';
        // Loại bỏ phần "-product.size.size_" nếu có
        $kimonoNumber = preg_replace('/-product\.size\.size_?/', '', $kimonoNumber);
    ?>
    <p style="margin-left: 20px;">［着物番号] <?php echo e($kimonoNumber); ?></p>
    <?php endif; ?>
    <p style="margin-left: 20px;">［決済方法] クレジットカード</p>
    <?php
        $productPrice = 0;
        $optionPrice = 0;
        $shippingCost = 0;
        if ($order->order_detail) {
            foreach ($order->order_detail as $d) {
                $productPrice += $d->price ?? 0;
                $optionPrice += ($d->safe_pack ?? 0) + ($d->tabi ?? 0) + ($d->towel ?? 0);
                $shippingCost += $d->shipping_cost ?? 0;
            }
        }
    ?>
    <p style="margin-left: 20px;">［商品価格] <?php echo e(number_format($productPrice)); ?>円</p>
    <p style="margin-left: 20px;">［オプション価格] <?php echo e(number_format($optionPrice)); ?>円</p>
    <p style="margin-left: 20px;">［送料] <?php echo e(number_format($shippingCost)); ?>円</p>
    <p style="margin-left: 20px;">［合計金額] <?php echo e(number_format($order->total_price)); ?>円</p>
    <br>
    <p style="margin-left: 40px;">ご注文内容に誤りがございましたら、お手数ですがお問い合わせください。</p>
    <br>
    <br>

    <p><strong>■レンタルの流れ（現在のステータス：【ご注文確定】）</strong></p>
    <br>
    <p style="margin-left: 20px;">ご注文確認</p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">【 ご注文確定 】</p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;"> お支払い</p>
    <p style="margin-left: 50px;">▼</p>
    <?php if($detail && $detail->wear_date): ?>
    <?php
        $wearDateObj = \Carbon\Carbon::parse($detail->wear_date);
        $shippingDate = $wearDateObj->copy()->subDays(3)->format('Y/m/d');
        $arrivalDate = $wearDateObj->copy()->subDays(2)->format('Y/m/d');
        $returnDate = $wearDateObj->copy()->addDays(3)->format('Y/m/d');
        $storeArrivalDate = $wearDateObj->copy()->addDays(4)->format('Y/m/d');
    ?>
    <p style="margin-left: 20px;">当店発送予定日： <?php echo e($shippingDate); ?></p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">着物到着日： <?php echo e($arrivalDate); ?></p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">ご着用予定日： <?php echo e($wearDateObj->format('Y/m/d')); ?></p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">返却期日：<?php echo e($returnDate); ?></p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">当店到着予定日： <?php echo e($storeArrivalDate); ?></p>
    <?php else: ?>
    <p style="margin-left: 20px;">当店発送予定日： 未定</p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">着物到着日： 未定</p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">ご着用予定日： 未定</p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">返却期日：未定</p>
    <p style="margin-left: 40px;">▼</p>
    <p style="margin-left: 20px;">当店到着予定日： 未定</p>
    <?php endif; ?>
    <p style="margin-left: 50px;">▼</p>
    <p style="margin-left: 20px;"> お取引完了</p>
    <br>
    <br>

    <p>--------------------------------------------------------------------------</p>
    <p>【お問い合わせ先】</p>
    <p> 株式会社もろふじ「KIREI」</p>
    <p>（ホームページ URL）<?php echo e(config('app.url')); ?></p>
    <p> メール：kirei@0944724272.com</p>
    <p> 電話：0944-75-1755</p>
    <p> 受付時間：月・火・木・金・土 (10：00 ～ 18:00)</p>
    <p>--------------------------------------------------------------------------</p>
</div>
<?php /**PATH /var/www/html/moro-staging/resources/views/emails/identity-verification/order-confirmed-card-success.blade.php ENDPATH**/ ?>