<?php $__env->startSection('title', 'Choose Your Product - Lindsay\'s Leather'); ?>

<?php $__env->startSection('head'); ?>
<style>
            body.with-order-header {
                font-family: 'Montserrat', sans-serif;
                background-color: #f8f9fa;
                margin: 0;
                padding: 0;
                min-height: 100vh;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .landing-container {
                max-width: 600px;
                width: 100%;
                margin: 0 auto; /* Center the container */
            }
            
            .lindsay-card {
                background: white;
                border-radius: 16px;
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
                padding: 2rem;
                border: 1px solid rgba(181, 112, 47, 0.1);
            }
            
            .flex {
                display: flex;
            }
            
            .justify-between {
                justify-content: space-between;
            }
            
            .items-center {
                align-items: center;
            }
            
            .mb-6 {
                margin-bottom: 1.5rem;
            }
            
            
            .body-text {
                font-family: 'Montserrat', sans-serif;
                font-weight: 400;
            }
            
            .progress-bar {
                height: 4px;
                background: #e5e7eb;
                border-radius: 2px;
                overflow: hidden;
                margin-bottom: 2rem;
            }
            
            .progress-fill {
                height: 100%;
                background: #B5702F;
                border-radius: 2px;
                transition: width 0.5s ease;
            }
            
            .landing-title {
                font-family: 'Lato', sans-serif;
                font-weight: 700;
                font-size: 2.5rem;
                color: #371C16;
                margin-bottom: 2rem;
                line-height: 1.2;
                text-align: center;
            }
            
            .product-option {
                font-family: 'Lato', sans-serif;
                font-weight: 600;
                border-radius: 12px;
                padding: 16px 24px;
                min-height: 52px;
                background: #f8f9fa;
                color: #371C16;
                border: 2px solid #e5e7eb;
                cursor: pointer;
                transition: all 0.3s ease;
                display: flex;
                align-items: center;
                justify-content: flex-start;
                width: 100%;
                margin-bottom: 1rem;
                text-transform: capitalize;
                font-size: 16px;
            }
            
            .product-option:hover {
                border-color: #B5702F;
                background: rgba(181, 112, 47, 0.05);
            }
            
            .product-option.selected {
                background: #B5702F;
                color: white;
                border-color: #B5702F;
            }
            
            .size-selection {
                margin-bottom: 2rem;
                display: none;
            }
            
            .size-selection h3 {
                font-weight: 600;
                color: #371C16;
                margin-bottom: 1rem;
            }
            
            .size-options-detailed {
                display: flex;
                gap: 1rem;
                flex-wrap: wrap;
            }
            
            .size-option-detailed {
                font-family: 'Lato', sans-serif;
                border-radius: 12px;
                padding: 16px 20px;
                background: #f8f9fa;
                color: #371C16;
                border: 2px solid #e5e7eb;
                cursor: pointer;
                transition: all 0.3s ease;
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                min-width: 140px;
                flex: 1;
            }
            
            .size-option-detailed:hover {
                border-color: #B5702F;
                background: rgba(181, 112, 47, 0.05);
            }
            
            .size-option-detailed.selected {
                background: #B5702F;
                color: white;
                border-color: #B5702F;
            }
            
            .size-label {
                font-weight: 700;
                font-size: 16px;
                margin-bottom: 8px;
            }
            
            .size-dimensions {
                font-weight: 400;
                font-size: 12px;
                line-height: 1.3;
                opacity: 0.8;
            }
            
            .size-note {
                font-family: 'Montserrat', sans-serif;
                font-size: 14px;
                color: #6b7280;
                font-style: italic;
                text-align: center;
                margin-top: 1rem;
                margin-bottom: 0;
            }
            
            .lindsay-btn {
                font-family: 'Lato', sans-serif;
                font-weight: 600;
                border-radius: 12px;
                padding: 16px 32px;
                min-height: 52px;
                transition: all 0.3s ease;
                border: none;
                cursor: pointer;
                text-decoration: none;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                font-size: 16px;
                background: #B5702F;
                color: white;
                width: 100%;
            }
            
            .lindsay-btn:hover:not(:disabled) {
                background: #371C16;
                transform: translateY(-1px);
                box-shadow: 0 6px 20px rgba(181, 112, 47, 0.3);
            }
            
            .lindsay-btn:disabled {
                opacity: 0.5;
                cursor: not-allowed;
                transform: none;
                box-shadow: none;
            }
            
            /* Mobile Optimization - Tablets and Large Phones */
            @media (max-width: 768px) {
                * {
                    -webkit-tap-highlight-color: rgba(181, 112, 47, 0.1);
                }
                
                .lindsay-btn-back {
                    min-height: 48px;
                    padding: 12px 18px;
                    font-size: 15px;
                    touch-action: manipulation;
                }
                
                .landing-container {
                    padding: 1rem;
                    max-width: 100vw;
                }
                
                .lindsay-card {
                    padding: 1.5rem 1rem;
                    margin: 0;
                    border-radius: 12px;
                }
                
                .product-grid {
                    grid-template-columns: 1fr;
                    gap: 1rem;
                }
                
                .product-option {
                    min-height: 64px;
                    padding: 18px 20px;
                    font-size: 17px;
                    font-weight: 600;
                    touch-action: manipulation;
                    -webkit-touch-callout: none;
                }
                
                .size-options-detailed {
                    flex-direction: column;
                    gap: 1rem;
                }
                
                .size-option-detailed {
                    min-width: auto;
                    padding: 18px 20px;
                    min-height: 64px;
                    touch-action: manipulation;
                }
                
                .size-label {
                    font-size: 17px;
                    margin-bottom: 8px;
                }
                
                .size-dimensions {
                    font-size: 14px;
                    line-height: 1.4;
                }
                
                .size-note {
                    font-size: 15px;
                    margin-top: 1.5rem;
                    padding: 0.5rem;
                }
                
                .lindsay-btn {
                    min-height: 56px;
                    padding: 16px 24px;
                    font-size: 17px;
                    width: 100%;
                    touch-action: manipulation;
                    margin-top: 2rem;
                }
                
                .progress-bar {
                    height: 6px;
                    border-radius: 3px;
                }
                
                .landing-title {
                    font-size: 2rem;
                    margin-bottom: 1.5rem;
                }
                
                .body-text {
                    font-size: 15px;
                }
            }
            
            /* Mobile Phones - Enhanced Touch Experience */
            @media (max-width: 480px) {
                .landing-container {
                    padding: 0.75rem 0.5rem;
                    max-width: 100vw;
                }
                
                .lindsay-card {
                    padding: 1.25rem 1rem;
                    margin: 0;
                    border-radius: 10px;
                }
                
                .product-option {
                    min-height: 60px;
                    padding: 16px 18px;
                    font-size: 16px;
                    border-radius: 10px;
                }
                
                .size-option-detailed {
                    padding: 16px 18px;
                    min-height: 68px;
                }
                
                .size-label {
                    font-size: 16px;
                }
                
                .size-dimensions {
                    font-size: 13px;
                }
                
                .lindsay-btn {
                    min-height: 56px;
                    font-size: 16px;
                    font-weight: 600;
                    padding: 16px 20px;
                }
                
                .landing-title {
                    font-size: 1.75rem;
                }
                
                .body-text {
                    font-size: 14px;
                }
                
                .progress-bar {
                    height: 5px;
                }
            }
            
            /* Extra Small Mobile - Maximum Touch Optimization (320px screens) */
            @media (max-width: 375px) {
                .landing-container {
                    padding: 0.5rem 0.25rem;
                }
                
                .lindsay-card {
                    padding: 1rem 0.75rem;
                    margin: 0;
                }
                
                .product-option {
                    min-height: 56px;
                    font-size: 15px;
                    padding: 14px 16px;
                }
                
                .size-option-detailed {
                    min-height: 64px;
                    padding: 14px 16px;
                }
                
                .lindsay-btn {
                    min-height: 52px;
                    font-size: 15px;
                    padding: 14px 18px;
                }
                
                .landing-title {
                    font-size: 1.5rem;
                    margin-bottom: 1rem;
                }
                
                .size-note {
                    font-size: 13px;
                }
                
                .size-label {
                    font-size: 15px;
                }
                
                .size-dimensions {
                    font-size: 12px;
                }
            }
        </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="landing-container">
            <!-- Back Button and Step Indicator -->
            <div class="lindsay-card">
                <div class="flex justify-between items-center mb-6">
                    <!-- <?php if (isset($component)) { $__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.back-button','data' => ['href' => ''.e(url('/')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('back-button'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['href' => ''.e(url('/')).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687)): ?>
<?php $attributes = $__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687; ?>
<?php unset($__attributesOriginal5c84f04e4e4c3f6b2afa5416a6776687); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687)): ?>
<?php $component = $__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687; ?>
<?php unset($__componentOriginal5c84f04e4e4c3f6b2afa5416a6776687); ?>
<?php endif; ?> -->
                    <span class="body-text" style="color: #6b7280;">Step 1 of 4</span>
    </div>

                <!-- Progress Bar -->
                <div class="progress-bar">
                    <div class="progress-fill" style="width: 25%;"></div>
    </div>

                <!-- Page Title -->
                <h1 class="landing-title">Choose Your Product</h1>

    <!-- Product Selection -->
                <div style="margin-bottom: 2rem;">
        <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <button type="button" 
                                class="product-option" 
                                data-product-id="<?php echo e($product->id); ?>"
                                data-product-name="<?php echo e($product->name); ?>">
                            <?php echo e($product->name); ?>

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

                <!-- Size Selection (only shown for bracelet) -->
                <div id="sizeSelection" class="size-selection">
                    <h3 class="body-text">Select Size:</h3>
                    <div class="size-options-detailed">
                        <button type="button" class="size-option-detailed" data-size="small">
                            <span class="size-label">Small</span>
                            <span class="size-dimensions">¾" (19mm) wide<br>6–7" (152–178mm) long</span>
                        </button>
                        <button type="button" class="size-option-detailed" data-size="medium">
                            <span class="size-label">Medium</span>
                            <span class="size-dimensions">¾" (19mm) wide<br>7½–8½" (191–216mm) long</span>
                        </button>
                        <button type="button" class="size-option-detailed" data-size="large">
                            <span class="size-label">Large</span>
                            <span class="size-dimensions">1" (25mm) wide<br>7½–8½" (191–216mm) long</span>
                        </button>
                </div>
            </div>

                <!-- Continue Button -->
                <button id="continueBtn" 
                        class="lindsay-btn" 
                        disabled>
                    Continue →
                </button>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
            document.addEventListener('DOMContentLoaded', function() {
                let selectedProduct = null;
                let selectedSize = null;
                
                const productOptions = document.querySelectorAll('.product-option');
                const sizeSelection = document.getElementById('sizeSelection');
                const sizeOptions = document.querySelectorAll('.size-option-detailed');
                const continueBtn = document.getElementById('continueBtn');

                // Product selection
                productOptions.forEach(option => {
                    option.addEventListener('click', function() {
                        // Remove selected class from all
                        productOptions.forEach(opt => opt.classList.remove('selected'));
                        
                        // Add selected class to clicked option
                        this.classList.add('selected');
                        
                        selectedProduct = {
                            id: this.dataset.productId,
                            name: this.dataset.productName
                        };

                        // Show size selection only for bracelet
                        if (selectedProduct.name === 'bracelet') {
                            sizeSelection.style.display = 'block';
                            selectedSize = null; // Reset size selection
                            sizeOptions.forEach(opt => opt.classList.remove('selected'));
                        } else {
                            sizeSelection.style.display = 'none';
                            selectedSize = 'standard'; // Default size for non-bracelets
                        }
                        
                        updateContinueButton();
                    });
                });

                // Size selection
                sizeOptions.forEach(option => {
                    option.addEventListener('click', function() {
                        // Remove selected class from all
                        sizeOptions.forEach(opt => opt.classList.remove('selected'));
                        
                        // Add selected class to clicked option
                        this.classList.add('selected');
                        
                        selectedSize = this.dataset.size;
                        updateContinueButton();
                    });
                });

                function updateContinueButton() {
                    const isValid = selectedProduct && 
                        (selectedProduct.name !== 'bracelet' || selectedSize);
                    
                    if (isValid) {
                        continueBtn.style.opacity = '1';
                        continueBtn.style.cursor = 'pointer';
                        continueBtn.disabled = false;
                    } else {
                        continueBtn.style.opacity = '0.5';
                        continueBtn.style.cursor = 'not-allowed';
                        continueBtn.disabled = true;
                    }
                }

                // Continue button click
                continueBtn.addEventListener('click', function() {
                    if (!selectedProduct) {
                        console.error('No product selected');
                        return;
                    }
                    
                    console.log('Navigating to order form for product:', selectedProduct);
                    
                    // Store selection in session storage as backup
                    sessionStorage.setItem('selectedProduct', JSON.stringify(selectedProduct));
                    sessionStorage.setItem('selectedSize', selectedSize);
                    
                    // For bracelets, pass size as query parameter to order form
                    // The controller will handle redirecting to the unified customization
                    if (selectedProduct.name === 'bracelet') {
                        window.location.href = `/order/${selectedProduct.id}?size=${selectedSize}`;
                    } else {
                        window.location.href = `/order/${selectedProduct.id}`;
                    }
                });
            });
        </script>
<?php $__env->stopSection(); ?>

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

<?php echo $__env->make('layouts.student', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/tqxferau/lindsay-boswell.com/resources/views/student/index.blade.php ENDPATH**/ ?>