<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <h2 class="text-xl font-semibold leading-tight text-gray-800">
            جزئیات محصول: <?php echo e($product->name); ?>

        </h2>
     <?php $__env->endSlot(); ?>

    <div class="py-12">
        <div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
            <div class="overflow-hidden bg-white shadow-sm sm:rounded-lg">
                <div class="p-6 bg-white border-b border-gray-200 md:flex md:space-x-8 md:space-x-reverse">

                    <div class="md:w-1/3">
                        <img src="<?php echo e($product->image_path ? asset('storage/' . $product->image_path) : 'https://via.placeholder.com/400?text=No+Image'); ?>"
                             alt="<?php echo e($product->name); ?>"
                             class="object-cover w-full h-auto rounded-lg shadow-md">
                    </div>

                    <div class="mt-6 md:w-2/3 md:mt-0">
                        <h1 class="text-3xl font-bold text-gray-900"><?php echo e($product->name); ?></h1>
                        
                        <p class="mt-2 text-lg text-gray-700">
                            <span class="font-semibold">کد محصول:</span> <?php echo e($product->code); ?>

                        </p>
                        
                        <?php if($product->category): ?>
                        <p class="mt-2 text-lg text-gray-700">
                            <span class="font-semibold">دسته‌بندی:</span> <?php echo e($product->category->name); ?>

                        </p>
                        <?php endif; ?>

                        <div class="mt-4">
                            <?php if($product->discount_price > 0 && $product->discount_price < $product->price): ?>
                                <span class="text-3xl font-bold text-red-600"><?php echo e(number_format($product->getActivePriceAttribute())); ?> ریال</span>
                                <span class="ml-2 text-xl text-gray-500 line-through"><?php echo e(number_format($product->price)); ?> ریال</span>
                            <?php else: ?>
                                <span class="text-3xl font-bold text-gray-800"><?php echo e(number_format($product->price)); ?> ریال</span>
                            <?php endif; ?>
                        </div>
                        
                        <p class="mt-4 text-lg <?php echo e($product->stock > 0 ? 'text-green-600' : 'text-red-600'); ?>">
                            <?php if($product->stock > 0): ?>
                                <span class="font-semibold">موجود در انبار</span> (<?php echo e($product->stock); ?> عدد)
                            <?php else: ?>
                                <span class="font-semibold">ناموجود</span>
                            <?php endif; ?>
                        </p>
                        
                        <?php if(!empty($product->features)): ?>
                            <div class="mt-8">
                                <h3 class="text-xl font-semibold text-gray-800 border-b-2 border-gray-200 pb-2">
                                    مشخصات و ویژگی‌ها
                                </h3>
                                <ul class="mt-4 space-y-3">
                                    
                                    <?php $__currentLoopData = $product->features; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $feature): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if(is_array($feature) && !empty($feature['key']) && !empty($feature['value'])): ?>
                                        <li class="flex text-base">
                                            <span class="w-1/3 font-medium text-gray-700 rtl:pl-4 ltr:pr-4"><?php echo e($feature['key']); ?>:</span>
                                            <span class="w-2/3 text-gray-800"><?php echo e($feature['value']); ?></span>
                                        </li>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            </div>
                        <?php endif; ?>
                        <div class="mt-8">
                            
                            <a href="<?php echo e(url()->previous()); ?>" class="inline-block px-6 py-2 text-white bg-gray-600 rounded-lg hover:bg-gray-700">
                                &rarr; بازگشت
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH D:\laragon\www\installment-app\resources\views/shared/product-details.blade.php ENDPATH**/ ?>