<?php session_start(); include 'db_connection.php'; // Get Product ID or Slug if (isset($_GET['slug'])) { $stmt = $pdo->prepare("SELECT * FROM products WHERE slug = ?"); $stmt->execute([$_GET['slug']]); $product = $stmt->fetch(PDO::FETCH_ASSOC); } elseif (isset($_GET['id'])) { $stmt = $pdo->prepare("SELECT * FROM products WHERE id = ?"); $stmt->execute([$_GET['id']]); $product = $stmt->fetch(PDO::FETCH_ASSOC); } else { header("Location: programs.php"); exit; } if (!$product) { echo "Protocol not found."; exit; } // Infinite Echo Tracking require_once 'helpers/personalization_helper.php'; // Fetch product tags $product_tags = get_product_tags($pdo, $product['id']); if (function_exists('echo_track_product')) { echo_track_product($product['id'], $product['type']); } // --- PSYCHOLOGICAL TRIGGERS (Phase 8) --- // 1. Social Proof: Viewer Simulation (Hybrid) // Seed based on product ID so it remains consistent per user session but varies between products srand($product['id'] + date('d')); $viewers_count = rand(14, 42); // 2. Scarcity Engine: Low Stock for Physical/Limited Items $is_low_stock = false; $stock_left = 0; if ($product['type'] == 'physical' || $product['type'] == 'service') { $stock_left = rand(2, 7); $is_low_stock = true; } // Define beautiful labels for frontend $type_labels = [ 'digital' => 'TRIPLE BUNDLE PROTOCOL', 'field' => 'DIGITAL ENERGY CODE', 'service' => 'SESSION', 'physical' => 'SACRED ITEMS' ]; $display_type = isset($type_labels[$product['type']]) ? $type_labels[$product['type']] : strtoupper($product['type']); // ----------------------------------------- ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo htmlspecialchars($product['name']); ?> | Metaphysical Store</title> <meta name="description" content="<?php echo htmlspecialchars($product['subtitle']); ?>"> <!-- Open Graph --> <meta property="og:title" content="<?php echo htmlspecialchars($product['name']); ?>"> <meta property="og:description" content="<?php echo htmlspecialchars($product['subtitle']); ?>"> <meta property="og:image" content="<?php echo htmlspecialchars($product['image_url']); ?>"> <!-- Schema Markup --> <script type="application/ld+json"> { "@context": "https://schema.org/", "@type": "Product", "name": "<?php echo addslashes($product['name']); ?>", "image": "<?php echo $product['image_url']; ?>", "description": "<?php echo addslashes($product['subtitle']); ?>", "brand": { "@type": "Brand", "name": "Healing Higher Self" }, "offers": { "@type": "Offer", "priceCurrency": "USD", "price": "<?php echo $product['price']; ?>", "availability": "https://schema.org/InStock" } } </script> <link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Inter:wght@300;400;600&display=swap" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <link rel="stylesheet" href="brand.css"> <style> .desc-container { position: relative; max-height: 250px; overflow: hidden; transition: max-height 0.5s ease; } .desc-container.expanded { max-height: none; } .desc-fade { position: absolute; bottom: 0; left: 0; width: 100%; height: 100px; background: linear-gradient(to bottom, transparent, var(--brand-white)); pointer-events: none; transition: opacity 0.3s ease; } .desc-container.expanded .desc-fade { opacity: 0; } .read-more-btn { display: inline-block; margin-top: 2rem; color: var(--royal-gold); font-family: 'Cinzel', serif; font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; border: 1px solid var(--border-light); padding: 10px 25px; border-radius: 4px; transition: all 0.3s ease; background: rgba(212, 175, 55, 0.05); } .read-more-btn:hover { background: rgba(212, 175, 55, 0.15); border-color: var(--royal-gold); transform: translateY(-2px); } .service-details-box { background: var(--brand-white); backdrop-filter: blur(20px); border: 1px solid var(--border-light); padding: 30px; border-radius: 20px; margin: 20px 0; text-align: left; box-shadow: 0 10px 30px rgba(0,0,0,0.05), inset 0 0 20px rgba(212, 175, 55, 0.05); } .svc-section-cap { font-family: 'Cinzel', serif; font-size: 0.75rem; color: var(--royal-gold); margin-bottom: 12px; margin-top: 18px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 1px; } .service-details-box label:not(.svc-photo-label) { display: none; } /* Using section caps and placeholders instead */ .service-input { width: 100%; padding: 12px 15px; background: var(--brand-stone); border: 1px solid var(--border-light); color: var(--text-primary); border-radius: 12px; margin-bottom: 10px; font-size: 0.9rem; transition: all 0.3s ease; font-family: 'Inter', sans-serif; } .service-input:focus { border-color: var(--royal-gold); background: var(--brand-white); outline: none; box-shadow: 0 0 15px rgba(212, 175, 55, 0.1); } .svc-photo-label { display: flex; align-items: center; gap: 12px; padding: 15px; background: rgba(212, 175, 55, 0.05); border: 1px dashed rgba(212, 175, 55, 0.4); border-radius: 12px; cursor: pointer; color: var(--royal-gold); margin-bottom: 10px; transition: all 0.3s; justify-content: center; } .svc-photo-label:hover { background: rgba(212, 175, 55, 0.12); } /* Premium Toast Notification */ .hhs-toast { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); background: rgba(10, 5, 20, 0.95); backdrop-filter: blur(16px); border: 1px solid rgba(212, 175, 55, 0.5); color: var(--text-primary); padding: 1rem 2rem; border-radius: 50px; font-family: var(--font-primary); font-size: 0.95rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.1); z-index: 10000; display: flex; align-items: center; gap: 12px; opacity: 0; transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); pointer-events: none; } .hhs-toast.show { bottom: 40px; opacity: 1; } .hhs-toast i { color: var(--brand-amber); font-size: 1.2rem; } </style> </head> <body> <?php include 'header.php'; ?> <div class="sacred-grid" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at center, rgba(157, 80, 187, 0.03), transparent 70%); pointer-events: none; z-index: -1;"></div> <section class="protocol-container" style="padding: 16rem 0 100px 0;"> <div class="container"> <!-- Breadcrumb --> <div style="margin-bottom: 40px; font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase;"> <a href="programs.php" style="color: var(--brand-amber); text-decoration: none;">METAPHYSICAL STORE</a> / <a href="programs.php?type=<?php echo $product['type']; ?>" style="color: var(--brand-purple); text-decoration: none;"><?php echo $display_type; ?></a> / <span style="opacity: 0.6;"><?php echo htmlspecialchars($product['name']); ?></span> </div> <?php // Define specs based on type $type = $product['type']; $specs_data = [ 'Architecture' => ($type == 'service' ? '1-on-1 Session' : ($type == 'physical' ? 'Sacred Geometry' : 'Binaural / Scalar')), 'Target Field' => ($type == 'service' ? 'Akashic / Etheric' : ($type == 'physical' ? 'Physical Space' : 'Bio-Magnetic Aura')), 'Format' => ($type == 'service' ? 'Live Zoom Call' : ($type == 'physical' ? 'Tangible Artifact' : 'High-Res Audio (WAV)')) ]; ?> <div class="protocol-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 5rem; align-items: start;"> <!-- Left: Visualizer --> <div class="glass-panel visualizer-panel" style="padding: 2rem;"> <!-- SCARCITY & SOCIAL PROOF BADGES --> <div style="position: absolute; top: 20px; left: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 2;"> <!-- Viewer Count --> <div class="glass-badge" style="background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); padding: 5px 12px; border-radius: 20px; border: 1px solid var(--glass-border); font-size: 0.75rem; color: var(--text-primary); display: flex; align-items: center; gap: 8px;"> <span style="position: relative; display: flex; h-3 w-3;"> <span style="animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite; position: absolute; display: inline-flex; height: 100%; width: 100%; border-radius: 50%; background-color: #ef4444; opacity: 0.75;"></span> <span style="position: relative; display: inline-flex; height: 8px; width: 8px; border-radius: 50%; background-color: #ef4444;"></span> </span> <?php echo $viewers_count; ?> People Viewing </div> <!-- Low Stock Warning --> <?php if ($is_low_stock): ?> <div class="glass-badge" style="background: rgba(239, 68, 68, 0.1); backdrop-filter: blur(5px); padding: 5px 12px; border-radius: 20px; border: 1px solid rgba(239, 68, 68, 0.3); font-size: 0.75rem; color: #fca5a5; display: flex; align-items: center; gap: 8px;"> <i class="fas fa-exclamation-triangle"></i> Only <?php echo $stock_left; ?> Remaining </div> <?php endif; ?> <!-- Cosmic Alignment Resonance (Phase 9) --> <?php // Generate a "Resonance" score that feels scientific and urgent // Seed it with product ID and user session for consistency $seed = $product['id'] . (isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 'guest'); srand(crc32($seed)); $resonance = 94 + (rand(0, 5) + (rand(0, 99) / 100)); // 94.00% to 99.99% ?> <div class="glass-badge" style="background: rgba(212, 175, 55, 0.1); backdrop-filter: blur(5px); padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border-light); font-size: 0.75rem; color: var(--brand-amber); display: flex; align-items: center; gap: 8px;"> <i class="fas fa-project-diagram" style="animation: spin 3s linear infinite;"></i> Match Score: <?php echo number_format($resonance, 2); ?>% </div> </div> <img class="visual-float" src="<?php echo !empty($product['image_url']) ? $product['image_url'] : 'assets/Healing-Higherself-Logo-1.webp'; ?>" alt="Frequency Visual" onerror="this.onerror=null;this.src='assets/Healing-Higherself-Logo-1.webp';" style="width: 100%; border-radius: 8px;"> <div style="position: absolute; bottom: 20px; left: 20px; font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 2px; color: var(--brand-purple); text-transform: uppercase; font-weight: 700;"> <?php echo ($type == 'digital' ? 'FREQ: 432Hz - 963Hz' : ($type == 'physical' ? 'MATERIAL: CHARGED' : 'STATUS: ACTIVE')); ?> </div> </div> <!-- Right: Specs & Access --> <div> <h1 style="color: var(--text-primary); text-transform: uppercase; letter-spacing: 2px;" style="margin-bottom: 1rem;"><?php echo htmlspecialchars($product['name']); ?></h1> <p style="color: var(--brand-amber); font-size: 1.1rem; letter-spacing: 3px; font-family: var(--font-heading); margin-bottom: 2.5rem; text-transform: uppercase;"> <?php echo htmlspecialchars($product['subtitle'] ?? 'Your Path to Healing'); ?> </p> <div class="spec-sheet"> <div class="spec-row"> <span class="spec-label">Format</span> <span><?php echo $specs_data['Architecture']; ?></span> </div> <div class="spec-row"> <span class="spec-label">Focus Area</span> <span><?php echo $specs_data['Target Field']; ?></span> </div> <div class="spec-row"> <span class="spec-label">Delivery</span> <span><?php echo $specs_data['Format']; ?></span> </div> <div class="spec-row" style="border-bottom: none;"> <span class="spec-label">Access Level</span> <span> <?php if($product['type'] == 'service') echo 'Remote Session'; elseif($product['type'] == 'physical') echo 'Shipped to Door'; else echo 'Instant Digital Download'; ?> </span> </div> </div> </div> </div> </div> <!-- Buy Panel (Centered) --> <div class="white-card" style="margin-top: 5rem; text-align: center; max-width: 500px; margin-left: auto; margin-right: auto; position: relative; z-index: 10; border-color: rgba(212, 175, 55, 0.2); box-shadow: 0 20px 50px rgba(0,0,0,0.5);"> <?php if (!$product['is_coming_soon']): ?> <div style="font-size: 3.5rem; color: var(--text-primary); font-family: var(--font-heading); margin-bottom: 2rem; letter-spacing: -1px;"> <?php echo format_price($product['price'], $product['price_inr']); ?> </div> <?php endif; ?> <?php if ($product['is_coming_soon']): ?> <button class="btn-luxury w-100" style="background: rgba(255,255,255,0.05); color: var(--text-muted); border-color: var(--text-secondary),0.1); cursor: not-allowed;" disabled> <i class="fas fa-clock" style="margin-right: 10px;"></i> Calibrating... </button> <?php else: ?> <?php if ($product['price'] == 0 && !empty($product['file_url'])): ?> <?php if (isset($_SESSION['user_id'])): ?> <a id="btn-direct-download" href="<?php echo htmlspecialchars($product['file_url']); ?>" target="_blank" class="btn-luxury w-100" style="background: var(--brand-amber); color: #000; font-weight: 800; border-color: var(--brand-amber); display: flex; justify-content: center; align-items: center; text-decoration: none;"> <i class="fas fa-download" style="margin-right: 10px;"></i> GET IT NOW </a> <?php else: ?> <a id="btn-login-to-download" href="javascript:void(0)" onclick="showAuthModal(); switchTab('login');" class="btn-luxury w-100" style="background: transparent; color: var(--brand-amber); font-weight: 800; border-color: var(--brand-amber); display: flex; justify-content: center; align-items: center; text-decoration: none;"> <i class="fas fa-lock" style="margin-right: 10px;"></i> LOGIN TO ACCESS </a> <?php endif; ?> <?php endif; ?> <form action="cart.php" method="POST" id="add-to-cart-form" style="<?php echo ($product['price'] == 0 && !empty($product['file_url'])) ? 'display:none;' : ''; ?>"> <?php if ($product['type'] == 'service'): ?> <div class="service-details-box"> <h4 style="color: var(--text-primary); margin-bottom: 25px; font-family: 'Cinzel', serif; font-size: 0.9rem; text-align: center; letter-spacing: 3px; text-transform: uppercase;"> <i class="fas fa-magic" style="color: var(--royal-gold); margin-right: 10px;"></i> Aura Scan Details </h4> <div class="svc-section-cap"><i class="fas fa-user-circle"></i> Identity Profile</div> <input type="text" id="svc_full_name" class="service-input" placeholder="Full Name (for frequency matching)" required> <input type="date" id="svc_dob" class="service-input" required title="Date of Birth"> <div class="svc-section-cap"><i class="fas fa-at"></i> Digital Frequency</div> <input type="email" id="svc_email" class="service-input" placeholder="Email for the detailed report" required> <div class="svc-section-cap"><i class="fas fa-phone-alt"></i> Cellular Connection</div> <div style="display: flex; gap: 10px;"> <select id="svc_phone_code" class="service-input" style="width: 100px;"> <option value="+91">+91 (IN)</option> <option value="+1">+1 (US)</option> <option value="+44">+44 (UK)</option> <option value="+971">+971 (UAE)</option> <option value="+61">+61 (AU)</option> </select> <input type="tel" id="svc_phone_number" class="service-input" style="flex-grow: 1;" placeholder="Mobile Number" required> </div> <div class="svc-section-cap"><i class="fas fa-map-marker-alt"></i> Vibrational Anchor</div> <textarea id="svc_address" class="service-input" style="height: 70px; resize: none;" placeholder="Current Residential Address" required></textarea> <div class="svc-section-cap"><i class="fas fa-camera"></i> Bio-Field Scan</div> <label for="svc_photo" class="svc-photo-label"> <i class="fas fa-upload"></i> <span id="photo-file-name">Upload Head-to-Toe Photo</span> </label> <input type="file" id="svc_photo" style="display: none;" accept="image/*" required onchange="document.getElementById('photo-file-name').textContent = this.files[0].name;"> <div style="font-size: 0.65rem; color: var(--text-secondary); margin-top: 5px; font-style: italic; text-align: center;">Full body scan ensures complete energy mapping</div> </div> <?php endif; ?> <input type="hidden" name="product_id" value="<?php echo $product['id']; ?>"> <input type="hidden" name="tier" id="selected-tier" value="standard"> <button type="submit" class="btn-luxury w-100" style="background: var(--brand-amber); color: #000; font-weight: 800; border-color: var(--brand-amber); padding: 1.5rem;"> <?php if($product['type'] == 'service') echo '<i class="fas fa-calendar-alt"></i> BOOK SESSION'; elseif($product['type'] == 'physical') echo '<i class="fas fa-box"></i> ORDER ARTIFACT'; else echo '<i class="fas fa-bolt"></i> DOWNLOAD NOW'; ?> </button> </form> <?php endif; ?> <?php if (isset($_SESSION['user_id'])): ?> <?php $share_url = "https://healinghigherself.org/product/" . $product['slug']; $rStmt = $pdo->prepare("SELECT referral_code FROM users WHERE id = ?"); $rStmt->execute([$_SESSION['user_id']]); $uRef = $rStmt->fetchColumn(); if ($uRef) { $share_url .= "?ref=" . urlencode($uRef); } ?> <button onclick="shareAffiliateLink('<?php echo htmlspecialchars($share_url, ENT_QUOTES); ?>', '<?php echo htmlspecialchars(addslashes($product['name']), ENT_QUOTES); ?>')" class="btn-luxury w-100" style="background: #10b981; color: var(--text-primary); font-weight: 800; border-color: #10b981; padding: 1.5rem; margin-top: 15px;"> <i class="fas fa-share-alt" style="margin-right: 10px;"></i> SHARE & EARN (10% COM) </button> <?php endif; ?> <p style="font-size: 0.75rem; color: var(--text-muted); margin-top: 2rem; letter-spacing: 1px; text-transform: uppercase;"> <i class="fas fa-shield-alt" style="color: var(--brand-purple);"></i> Standard Security Active </p> </div> <!-- Description --> <div style="max-width: 800px; margin: 100px auto 0 auto; text-align: center;"> <h2 style="margin-bottom: 1.5rem;">Program Overview</h2> <div id="desc-wrapper" class="desc-container"> <div id="desc-content" style="color: var(--text-secondary); font-size: 1.15rem; line-height: 1.5; font-weight: 300;"> <?php echo nl2br(htmlspecialchars($product['description'])); ?> </div> <div id="desc-fade-overlay" class="desc-fade"></div> </div> <div id="read-more-trigger" class="read-more-btn" onclick="toggleOverview()" style="display: none;">Read More</div> <?php include_once 'includes/product_templates.php'; $defaults = get_product_defaults($product['type']); ?> <!-- Shadow Mirror: Pain Killer Logic (Phase 9) --> <?php if (!empty($defaults['shadow_mirror'])): ?> <div style="margin-top: 80px; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; position: relative; overflow: hidden; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05);"> <!-- The Shadow Side --> <div style="padding: 40px; background: rgba(5, 2, 10, 0.4); border-right: 1px solid rgba(255,255,255,0.05);"> <div style="font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 3px; color: #666; margin-bottom: 25px; text-transform: uppercase;"> <?php echo $defaults['shadow_mirror']['shadow']['label']; ?> </div> <ul style="list-style: none; padding: 0; text-align: left;"> <?php foreach($defaults['shadow_mirror']['shadow']['pains'] as $pain): ?> <li style="color: var(--text-secondary); margin-bottom: 12px; font-size: 0.95rem; display: flex; align-items: center; gap: 15px;"> <i class="fas fa-times-circle" style="color: #444; font-size: 0.8rem;"></i> <?php echo $pain; ?> </li> <?php endforeach; ?> </ul> </div> <!-- The Illumination Side --> <div style="padding: 40px; background: rgba(212, 175, 55, 0.03);"> <div style="font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 3px; color: var(--brand-amber); margin-bottom: 25px; text-transform: uppercase;"> <?php echo $defaults['shadow_mirror']['illumination']['label']; ?> </div> <ul style="list-style: none; padding: 0; text-align: left;"> <?php foreach($defaults['shadow_mirror']['illumination']['gains'] as $gain): ?> <li style="color: var(--text-primary); margin-bottom: 12px; font-size: 0.95rem; display: flex; align-items: center; gap: 15px;"> <i class="fas fa-check-circle" style="color: var(--brand-amber); font-size: 0.8rem;"></i> <?php echo $gain; ?> </li> <?php endforeach; ?> </ul> </div> </div> <?php endif; ?> <div style="margin-top: 80px; padding-top: 60px; border-top: 1px solid rgba(255,255,255,0.05);"> <h3 style="margin-bottom: 4rem; color: var(--brand-amber);">What to Expect</h3> <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4rem;"> <?php foreach($defaults['expectations'] as $item): ?> <div> <div style="font-size: 2.5rem; color: var(--brand-purple); margin-bottom: 1.5rem; opacity: 0.8;"> <i class="fas <?php echo $item['icon']; ?>"></i> </div> <strong style="display: block; color: var(--text-primary); margin-bottom: 1rem; font-family: var(--font-heading); font-size: 0.9rem; letter-spacing: 1px;"><?php echo $item['title']; ?></strong> <p style="font-size: 0.9rem; color: var(--text-secondary);"><?php echo $item['text']; ?></p> </div> <?php endforeach; ?> </div> </div> </div> <!-- FAQ Section --> <div style="max-width: 800px; margin: 100px auto 0 auto; padding-top: 60px; border-top: 1px solid rgba(255,255,255,0.05);"> <h2 style="text-align: center; margin-bottom: 3rem;">Common Questions (FAQ)</h2> <?php foreach($defaults['faqs'] as $faq): ?> <details class="glass-panel-subtle faq-details" style="margin-bottom: 1.5rem; transition: 0.3s;"> <summary style="cursor: pointer; font-family: var(--font-heading); color: var(--text-primary); font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center;"> <?php echo $faq['q']; ?> <i class="fas fa-chevron-down" style="font-size: 0.8rem; color: var(--brand-amber);"></i> </summary> <p style="margin-top: 1.5rem; font-size: 0.95rem; color: var(--text-secondary); line-height: 1.7;"><?php echo $faq['a']; ?></p> </details> <?php endforeach; ?> </div> <!-- REVIEWS --> <?php $review_type = 'product'; $review_target_id = $product['id']; include 'includes/review_section.php'; ?> <!-- Cross-Sell: Harmonizing Protocols --> <?php $cross_sells = get_cross_sell_suggestions($pdo, $product['id'], $product['type'], 8); if (!empty($cross_sells)): ?> <!-- Related Products Carousel --> <div style="margin-top: 120px; text-align: center;"> <div style="font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 3px; color: var(--brand-purple); margin-bottom: 10px; text-transform: uppercase;">You May Also Resonate With</div> <h2 style="margin-bottom: 2.5rem;">Recommended for You</h2> <div style="position: relative; max-width: 1100px; margin: 0 auto;"> <!-- Prev Button --> <button onclick="scrollRelated(-1)" style="position: absolute; left: -22px; top: 50%; transform: translateY(-50%); z-index: 10; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(212,175,55,0.4); background: rgba(10,5,20,0.9); backdrop-filter: blur(10px); color: #D4AF37; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; box-shadow: 0 0 20px rgba(212,175,55,0.15);" onmouseenter="this.style.background='rgba(212,175,55,0.15)'" onmouseleave="this.style.background='rgba(10,5,20,0.9)'"> <i class="fas fa-chevron-left"></i> </button> <!-- Carousel Track --> <div id="relatedCarousel" style="display: flex; gap: 1.5rem; overflow-x: hidden; scroll-behavior: smooth; padding: 10px 4px 20px;"> <?php foreach($cross_sells as $cs): ?> <a href="product/<?php echo $cs['slug']; ?>" style="flex: 0 0 260px; text-decoration: none; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 1.5rem; text-align: left; display: block; transition: transform 0.3s ease, box-shadow 0.3s ease;" onmouseenter="this.style.transform='translateY(-6px)';this.style.boxShadow='0 12px 40px rgba(212,175,55,0.15)'" onmouseleave="this.style.transform='';this.style.boxShadow=''"> <img src="<?php echo !empty($cs['image_url']) ? htmlspecialchars($cs['image_url']) : 'assets/product-placeholder.jpg'; ?>" alt="<?php echo htmlspecialchars($cs['name']); ?>" style="width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; margin-bottom: 1.2rem;" onerror="this.src='assets/Healing-Higherself-Logo-1.webp'"> <h4 style="color: var(--text-primary); margin-bottom: 10px; font-family: var(--font-heading); font-size: 0.95rem; line-height: 1.4;"> <?php echo htmlspecialchars($cs['name']); ?> </h4> <div style="color: var(--royal-gold); font-weight: bold; font-size: 0.9rem;"> <?php echo format_price($cs['price'], $cs['price_inr']); ?> </div> </a> <?php endforeach; ?> </div> <!-- Next Button --> <button onclick="scrollRelated(1)" style="position: absolute; right: -22px; top: 50%; transform: translateY(-50%); z-index: 10; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(212,175,55,0.4); background: rgba(10,5,20,0.9); backdrop-filter: blur(10px); color: #D4AF37; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; box-shadow: 0 0 20px rgba(212,175,55,0.15);" onmouseenter="this.style.background='rgba(212,175,55,0.15)'" onmouseleave="this.style.background='rgba(10,5,20,0.9)'"> <i class="fas fa-chevron-right"></i> </button> </div> </div> <script> function scrollRelated(dir) { var c = document.getElementById('relatedCarousel'); c.scrollBy({ left: dir * 290, behavior: 'smooth' }); } </script> <?php endif; ?> </div> </section> <script> function showToast(message) { let toast = document.getElementById('hhs-toast'); if (!toast) { toast = document.createElement('div'); toast.id = 'hhs-toast'; toast.className = 'hhs-toast'; toast.innerHTML = '<i class="fas fa-link"></i> <span></span>'; document.body.appendChild(toast); } toast.querySelector('span').innerText = message; // Reset animation toast.classList.remove('show'); void toast.offsetWidth; // Trigger reflow toast.classList.add('show'); setTimeout(() => { toast.classList.remove('show'); }, 4000); } function shareAffiliateLink(url, title) { if (navigator.share) { navigator.share({ title: title + ' | Healing Higher Self', text: 'I discovered this profound resource on Healing Higher Self. Use my link to explore.', url: url }).catch(err => { // If the user didn't just cancel the sheet, or if the API is restricted, fall back to copy if (err.name !== 'AbortError') { fallbackCopy(url); } }); } else { fallbackCopy(url); } } function fallbackCopy(url) { if (navigator.clipboard) { navigator.clipboard.writeText(url).then(function() { showToast('Sacred Link Copied to Clipboard'); }).catch(function(err) { console.error('Could not copy', err); }); } else { // Very old browser fallback const textArea = document.createElement("textarea"); textArea.value = url; document.body.appendChild(textArea); textArea.select(); try { document.execCommand('copy'); showToast('Sacred Link Copied to Clipboard'); } catch (err) { console.error('Fallback copy failed', err); } document.body.removeChild(textArea); } } </script> <?php include 'footer.php'; ?> <script src="script.js"></script> <style> .faq-details[open] { border-color: var(--brand-amber); background: rgba(212, 175, 55, 0.05); } .faq-details[open] summary i { transform: rotate(180deg); } </style> <script> function toggleOverview() { const wrapper = document.getElementById('desc-wrapper'); const btn = document.getElementById('read-more-trigger'); if (wrapper.classList.contains('expanded')) { wrapper.classList.remove('expanded'); btn.innerHTML = 'Read More'; // Scroll back to top of overview if collapsed document.getElementById('desc-wrapper').scrollIntoView({ behavior: 'smooth', block: 'center' }); } else { wrapper.classList.add('expanded'); btn.innerHTML = 'Read Less'; } } // Auto-check on load if content is long enough to need "Read More" window.addEventListener('scroll', function initReadMore() { const wrapper = document.getElementById('desc-wrapper'); const content = document.getElementById('desc-content'); const btn = document.getElementById('read-more-trigger'); const fade = document.getElementById('desc-fade-overlay'); if (content && wrapper) { if (content.scrollHeight > 260) { btn.style.display = 'inline-block'; } else { fade.style.display = 'none'; wrapper.style.maxHeight = 'none'; } } window.removeEventListener('scroll', initReadMore); }, { passive: true }); </script> <script> document.getElementById("add-to-cart-form").addEventListener("submit", function(e) { <?php if ($product['type'] == 'service'): ?> e.preventDefault(); const fullName = document.getElementById("svc_full_name").value; const email = document.getElementById("svc_email").value; const phoneCode = document.getElementById("svc_phone_code").value; const phoneNumber = document.getElementById("svc_phone_number").value; const address = document.getElementById("svc_address").value; const dob = document.getElementById("svc_dob").value; const photoFile = document.getElementById("svc_photo").files[0]; const btn = this.querySelector('button[type="submit"]'); if (!fullName || !email || !phoneNumber || !address || !dob || !photoFile) { alert("Please fill in all details and upload your head-to-toe photo."); return; } const originalBtnText = btn.innerHTML; btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> CALIBRATING FREQUENCIES...'; btn.disabled = true; const formData = new FormData(); formData.append("product_id", <?php echo $product['id']; ?>); formData.append("full_name", fullName); formData.append("email", email); formData.append("phone_code", phoneCode); formData.append("phone_number", phoneNumber); formData.append("current_address", address); formData.append("dob", dob); formData.append("photo", photoFile); fetch("/api/submit_service_data.php", { method: "POST", body: formData }) .then(response => response.json()) .then(data => { if (data.success) { // Now proceed with normal add to cart this.submit(); } else { alert("Energy transfer failed: " + data.message); btn.innerHTML = originalBtnText; btn.disabled = false; } }) .catch(error => { console.error("Error:", error); alert("Dimensional error occurred. Please try again."); btn.innerHTML = originalBtnText; btn.disabled = false; }); <?php endif; ?> }); </script> </body> </html>