<?php $__env->startSection('title', 'Pilih Varian Desktop'); ?>

<?php $__env->startSection('background'); ?>
    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="container-fluid">
        <div class="row min-vh-100 align-items-center">
            
            <div class="col-md-6 text-start ps-5">
                <div class="text-center mb-3">
                    <img src="<?php echo e(asset('assets/new-asset/title-variant.png')); ?>" alt="Custom Show"
                        style="width:80%; height:auto;">
                </div>
            </div>

            
            <div class="col-md-6 d-flex flex-column align-items-center justify-content-center pe-5">
                
                <div id="productCarousel" class="carousel slide mb-4" data-bs-ride="carousel" style="width: 400px">
                    <div class="carousel-inner">
                        <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="carousel-item <?php echo e($index === 0 ? 'active' : ''); ?>"
                                data-product-id="<?php echo e($product['id']); ?>">
                                <div class="card product-card text-center p-3 shadow"
                                    style="border-radius: 20px; border: 3px solid #ccc;">
                                    <img src="<?php echo e($product['product_image']); ?>" class="img-fluid mx-auto"
                                        style="max-height: 300px; object-fit: contain;">
                                    <p class="mt-3 mb-0 fw-semibold" style="font-size:1.2rem;color:#<?php echo e($product['color']); ?>">
                                        <?php echo e($product['sku_name']); ?>

                                    </p>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>

                    
                    <button class="carousel-control-prev" type="button" data-bs-target="#productCarousel"
                        data-bs-slide="prev">
                        <span class="carousel-control-prev-icon bg-dark rounded-circle" aria-hidden="true"></span>
                    </button>
                    <button class="carousel-control-next" type="button" data-bs-target="#productCarousel"
                        data-bs-slide="next">
                        <span class="carousel-control-next-icon bg-dark rounded-circle" aria-hidden="true"></span>
                    </button>
                </div>

                
                <button class="btn btn-filled-white btn-desktop mt-2 px-5 py-2 fw-bold" id="chooseProductButton">
                    <img src="<?php echo e(asset('assets/new-asset/button-pilih.png')); ?>" alt="Pilih"
                        style="max-width: 150px; height: auto; cursor: pointer;">
                </button>

            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('styles'); ?>
    <style>
        .bg-pattern {
            background: url('<?php echo e(asset('assets/new-asset/bg-desktop.webp')); ?>') no-repeat center top;
            background-size: cover;
        }

        .product-card {
            transition: all 0.5s ease;
        }

        .product-card.active-product {
            border: 10px solid #ffc107 !important;
            box-shadow: 0 0 12px rgba(255, 193, 7, 0.7);
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('scripts'); ?>
    <script>
        document.getElementById("chooseProductButton").addEventListener("click", function() {
            const activeItem = document.querySelector(".carousel-item.active");
            const productId = activeItem.getAttribute("data-product-id");
            if (productId) {
                window.location.href = `/experience/edit-template?product_id=${productId}`;
            } else {
                alert("❌ Gagal mendapatkan ID produk");
            }
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.desktop', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/plossayokesen/public_html/resources/views/select-product-desktop.blade.php ENDPATH**/ ?>