
<div class="rcard" id="productCard" style="<?php echo e($products->isEmpty() ? 'display:none' : ''); ?>">
    <div class="rcard-head">
        <div class="rcard-icon" style="background:#d1fae5;color:#10b981"><i
                class="fas fa-box-open"></i></div>
        <div class="rcard-title" id="productCardTitle">Ürün / Hizmet Seçimi</div>
    </div>
    <div class="rcard-body">
        <div class="search-container-modern" id="productSearchContainer" style="display:none">
            <div class="scm-wrapper">
                <i class="fas fa-search scm-icon"></i>
                <input type="text" class="scm-input" id="productSearchInput" placeholder="Hızlıca ürün veya hizmet ara...">
                <button type="button" class="scm-clear" id="productSearchClear" style="display:none">
                    <i class="fas fa-times-circle"></i>
                </button>
            </div>
        </div>
        
        <input type="hidden" name="product_id" id="productIdInput" value="<?php echo e(old('product_id')); ?>">
        <div id="productList" style="display:flex;flex-direction:column;gap:.5rem;">
            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                    $prodMeta = $p->productable;
                    $duration = $prodMeta->duration_hours ?? ($prodMeta->duration_days ?? null);
                    $city = $prodMeta->departureCity?->name;
                    $locations = is_array($prodMeta->visit_locations) ? implode(' - ', array_slice($prodMeta->visit_locations, 0, 3)) : null;
                ?>
                <div class="prod-item <?php echo e(old('product_id') == $p->id ? 'sel' : ''); ?>" 
                    data-id="<?php echo e($p->id); ?>"
                    data-code="<?php echo e($p->code); ?>"
                    data-price="<?php echo e($p->base_price); ?>" 
                    data-currency="<?php echo e($p->currency); ?>"
                    data-hasdates="<?php echo e($p->productable_type ? '1' : '0'); ?>"
                    data-duration="<?php echo e($duration); ?>"
                    data-city="<?php echo e($city); ?>"
                    data-locations="<?php echo e($locations); ?>"
                    data-meal="<?php echo e($prodMeta->meal_included ?? 0); ?>">
                    <div style="flex:1">
                        <div class="d-flex align-items-center gap-2 mb-1">
                            <?php if($p->code): ?>
                                <span class="badge bg-light text-muted border" style="font-size:10px;padding:2px 6px"><?php echo e($p->code); ?></span>
                            <?php endif; ?>
                            <div style="font-size:.86rem;font-weight:700;color:var(--text)"><?php echo e($p->name); ?></div>
                        </div>
                        <div class="d-flex align-items-center gap-3" style="font-size:.72rem;color:var(--muted)">
                            <?php if($city): ?>
                                <span><i class="fas fa-map-marker-alt me-1 text-primary"></i><?php echo e($city); ?></span>
                            <?php endif; ?>
                            <?php if($duration): ?>
                                <span><i class="fas fa-clock me-1"></i><?php echo e($duration); ?> <?php echo e(isset($prodMeta->duration_hours) ? 'Saat' : 'Gün'); ?></span>
                            <?php endif; ?>
                            <?php if($prodMeta->meal_included ?? false): ?>
                                <span><i class="fas fa-utensils me-1"></i>Yemek Dahil</span>
                            <?php endif; ?>
                        </div>
                        <?php if($locations): ?>
                            <div style="font-size:.68rem;color:#94a3b8;margin-top:2px" class="text-truncate">
                                <i class="fas fa-route me-1"></i><?php echo e($locations); ?>

                            </div>
                        <?php endif; ?>
                    </div>
                    <div class="prod-price"><?php echo e(number_format($p->base_price, 2)); ?> <?php echo e($p->currency); ?></div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <div class="pgn-box" id="productPagination" style="display:none">
            <button type="button" class="pgn-btn" id="prevProduct"><i class="fas fa-chevron-left"></i></button>
            <div class="pgn-info">Sayfa <b id="prodPage">1</b> / <b id="prodTotalPage">1</b></div>
            <button type="button" class="pgn-btn" id="nextProduct"><i class="fas fa-chevron-right"></i></button>
        </div>
    </div>
</div>


<div class="rcard" id="tourDateCard" style="display:none">
    <div class="rcard-head">
        <div class="rcard-icon" style="background:#fef3c7;color:#f59e0b"><i
                class="fas fa-calendar-star"></i></div>
        <div class="rcard-title">Tur Tarihi Seçimi</div>
    </div>
    <div class="rcard-body">
        <div class="search-container-modern" id="dateSearchContainer" style="display:none">
            <div class="scm-wrapper">
                <i class="fas fa-calendar-alt scm-icon"></i>
                <input type="text" class="scm-input" id="dateSearchInput" placeholder="Tarih ara (Örn: 25 haziran)...">
                <button type="button" class="scm-clear" id="dateSearchClear" style="display:none">
                    <i class="fas fa-times-circle"></i>
                </button>
            </div>
        </div>

        <input type="hidden" name="tour_date_id" id="tourDateIdInput">

        <div id="dateLoading"
            style="display:none;text-align:center;padding:1.5rem;color:var(--muted)">
            <i class="fas fa-spinner fa-spin me-2"></i>Tarihler yükleniyor…
        </div>

        <div id="dateGrid" class="date-grid"></div>

        <div class="pgn-box" id="datePagination" style="display:none">
            <button type="button" class="pgn-btn" id="prevDate"><i class="fas fa-chevron-left"></i></button>
            <div class="pgn-info">Sayfa <b id="datePage">1</b> / <b id="dateTotalPage">1</b></div>
            <button type="button" class="pgn-btn" id="nextDate"><i class="fas fa-chevron-right"></i></button>
        </div>

        <div id="noDateMsg"
            style="display:none;padding:.75rem;font-size:.82rem;color:var(--muted);background:#f8fafc;border-radius:10px;text-align:center">
            <i class="fas fa-calendar-times me-2" style="color:#c7d2fe"></i>Bu ürün için yaklaşan
            tarih bulunamadı.
        </div>

        <div class="custom-date-toggle" id="customDateToggle">
            <i class="fas fa-plus"></i> Özel tarih gir
        </div>

        <div id="customDateFields" style="display:none;margin-top:1rem">
            <div class="section-divider"><span>Özel Tarih</span></div>
            <div class="fg3">
                <div class="fl">
                    <label>Başlangıç Tarihi <span class="req">*</span></label>
                    <input type="date" name="start_date" id="startDate" class="fi"
                        value="<?php echo e(old('start_date', today()->format('Y-m-d'))); ?>">
                    <?php $__errorArgs = ['start_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="err"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
                <div class="fl">
                    <label>Bitiş Tarihi</label>
                    <input type="date" name="end_date" id="endDate" class="fi"
                        value="<?php echo e(old('end_date')); ?>">
                </div>
                <div class="fl">
                    <label>Kalkış Saati</label>
                    <input type="time" name="pickup_time" id="pickupTime" class="fi"
                        value="<?php echo e(old('pickup_time')); ?>">
                </div>
            </div>
        </div>
    </div>
</div>
<?php /**PATH C:\xampp\htdocs\acente\resources\views/agency/sales/create/product_selection.blade.php ENDPATH**/ ?>