2025-12-13 22:59:42 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
2025-12-24 00:13:23 -06:00
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<title>Product Details - Sky Art Shop</title>
|
|
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
|
|
|
<link
|
|
|
|
|
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap"
|
|
|
|
|
rel="stylesheet"
|
|
|
|
|
/>
|
|
|
|
|
<link
|
|
|
|
|
rel="stylesheet"
|
|
|
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"
|
|
|
|
|
/>
|
|
|
|
|
<link rel="stylesheet" href="/assets/css/main.css" />
|
2025-12-13 22:59:42 -06:00
|
|
|
<link rel="stylesheet" href="/assets/css/navbar.css" />
|
|
|
|
|
<link rel="stylesheet" href="/assets/css/shopping.css" />
|
2025-12-24 00:13:23 -06:00
|
|
|
<link rel="stylesheet" href="/assets/css/shopping.css" />
|
|
|
|
|
</head>
|
2025-12-13 22:59:42 -06:00
|
|
|
<body>
|
|
|
|
|
<!-- Modern Navigation -->
|
|
|
|
|
<nav class="modern-navbar">
|
|
|
|
|
<div class="navbar-wrapper">
|
|
|
|
|
<div class="navbar-brand">
|
|
|
|
|
<a href="/home.html" class="brand-link">
|
2025-12-24 00:13:23 -06:00
|
|
|
<img
|
|
|
|
|
src="/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg"
|
|
|
|
|
alt="Sky Art Shop Logo"
|
|
|
|
|
class="brand-logo"
|
|
|
|
|
/>
|
2025-12-13 22:59:42 -06:00
|
|
|
<span class="brand-name">Sky Art Shop</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
|
2025-12-13 22:59:42 -06:00
|
|
|
<div class="navbar-menu">
|
|
|
|
|
<ul class="nav-menu-list">
|
2025-12-24 00:13:23 -06:00
|
|
|
<li class="nav-item">
|
|
|
|
|
<a href="/home.html" class="nav-link">Home</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="nav-item">
|
|
|
|
|
<a href="/shop.html" class="nav-link">Shop</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="nav-item">
|
|
|
|
|
<a href="/portfolio.html" class="nav-link">Portfolio</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="nav-item">
|
|
|
|
|
<a href="/about.html" class="nav-link">About</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="nav-item">
|
|
|
|
|
<a href="/blog.html" class="nav-link">Blog</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="nav-item">
|
|
|
|
|
<a href="/contact.html" class="nav-link">Contact</a>
|
|
|
|
|
</li>
|
2025-12-13 22:59:42 -06:00
|
|
|
</ul>
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
|
2025-12-13 22:59:42 -06:00
|
|
|
<div class="navbar-actions">
|
|
|
|
|
<div class="action-item wishlist-dropdown-wrapper">
|
2025-12-24 00:13:23 -06:00
|
|
|
<button
|
|
|
|
|
class="action-btn"
|
|
|
|
|
id="wishlistToggle"
|
|
|
|
|
aria-label="Wishlist"
|
|
|
|
|
>
|
2025-12-13 22:59:42 -06:00
|
|
|
<i class="bi bi-heart"></i>
|
|
|
|
|
<span class="action-badge" id="wishlistCount">0</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="action-dropdown wishlist-dropdown" id="wishlistPanel">
|
|
|
|
|
<div class="dropdown-head">
|
|
|
|
|
<h3>My Wishlist</h3>
|
2025-12-24 00:13:23 -06:00
|
|
|
<button class="dropdown-close" id="wishlistClose">
|
|
|
|
|
<i class="bi bi-x-lg"></i>
|
|
|
|
|
</button>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-body" id="wishlistContent">
|
|
|
|
|
<p class="empty-state">Your wishlist is empty</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-foot">
|
|
|
|
|
<a href="/shop.html" class="btn-outline">Continue Shopping</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
|
2025-12-13 22:59:42 -06:00
|
|
|
<div class="action-item cart-dropdown-wrapper">
|
2025-12-24 00:13:23 -06:00
|
|
|
<button
|
|
|
|
|
class="action-btn"
|
|
|
|
|
id="cartToggle"
|
|
|
|
|
aria-label="Shopping Cart"
|
|
|
|
|
>
|
2025-12-13 22:59:42 -06:00
|
|
|
<i class="bi bi-cart3"></i>
|
|
|
|
|
<span class="action-badge" id="cartCount">0</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="action-dropdown cart-dropdown" id="cartPanel">
|
|
|
|
|
<div class="dropdown-head">
|
|
|
|
|
<h3>Shopping Cart</h3>
|
2025-12-24 00:13:23 -06:00
|
|
|
<button class="dropdown-close" id="cartClose">
|
|
|
|
|
<i class="bi bi-x-lg"></i>
|
|
|
|
|
</button>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-body" id="cartContent">
|
|
|
|
|
<p class="empty-state">Your cart is empty</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-foot">
|
|
|
|
|
<div class="cart-summary">
|
|
|
|
|
<span class="summary-label">Subtotal:</span>
|
|
|
|
|
<span class="summary-value" id="cartSubtotal">$0.00</span>
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
<a href="/checkout.html" class="btn-primary-full"
|
|
|
|
|
>Proceed to Checkout</a
|
|
|
|
|
>
|
2025-12-13 22:59:42 -06:00
|
|
|
<a href="/shop.html" class="btn-text">Continue Shopping</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
|
2025-12-13 22:59:42 -06:00
|
|
|
<button class="mobile-toggle" id="mobileMenuToggle" aria-label="Menu">
|
|
|
|
|
<span class="toggle-line"></span>
|
|
|
|
|
<span class="toggle-line"></span>
|
|
|
|
|
<span class="toggle-line"></span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
|
2025-12-13 22:59:42 -06:00
|
|
|
<div class="mobile-menu" id="mobileMenu">
|
|
|
|
|
<div class="mobile-menu-header">
|
|
|
|
|
<span class="mobile-brand">Sky Art Shop</span>
|
2025-12-24 00:13:23 -06:00
|
|
|
<button class="mobile-close" id="mobileMenuClose">
|
|
|
|
|
<i class="bi bi-x-lg"></i>
|
|
|
|
|
</button>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
<ul class="mobile-menu-list">
|
|
|
|
|
<li><a href="/home.html" class="mobile-link">Home</a></li>
|
|
|
|
|
<li><a href="/shop.html" class="mobile-link">Shop</a></li>
|
|
|
|
|
<li><a href="/portfolio.html" class="mobile-link">Portfolio</a></li>
|
|
|
|
|
<li><a href="/about.html" class="mobile-link">About</a></li>
|
|
|
|
|
<li><a href="/blog.html" class="mobile-link">Blog</a></li>
|
|
|
|
|
<li><a href="/contact.html" class="mobile-link">Contact</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
2025-12-24 00:13:23 -06:00
|
|
|
<div
|
|
|
|
|
id="loading"
|
|
|
|
|
style="
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 100px 20px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
color: #6b7280;
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<i
|
|
|
|
|
class="bi bi-hourglass-split"
|
|
|
|
|
style="font-size: 48px; display: block; margin-bottom: 20px"
|
|
|
|
|
></i>
|
|
|
|
|
Loading product...
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="productDetail" style="display: none"></div>
|
|
|
|
|
|
|
|
|
|
<script src="/assets/js/page-transitions.js"></script>
|
|
|
|
|
<script src="/assets/js/main.js"></script>
|
|
|
|
|
<script src="/assets/js/navigation.js"></script>
|
|
|
|
|
<script src="/assets/js/cart.js"></script>
|
|
|
|
|
<script src="/assets/js/shopping.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
// Function to change primary image
|
|
|
|
|
function changePrimaryImage(imageUrl) {
|
|
|
|
|
const primaryImg = document.getElementById("primaryImage");
|
|
|
|
|
if (primaryImg) {
|
|
|
|
|
primaryImg.src = imageUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update gallery thumbnails border
|
|
|
|
|
const galleryImages = document.querySelectorAll(
|
|
|
|
|
'[onclick^="changePrimaryImage"]'
|
|
|
|
|
);
|
|
|
|
|
galleryImages.forEach((img) => {
|
|
|
|
|
if (img.src.includes(imageUrl)) {
|
|
|
|
|
img.style.border = "3px solid #6b46c1";
|
|
|
|
|
} else {
|
|
|
|
|
img.style.border = "1px solid #e5e7eb";
|
|
|
|
|
}
|
|
|
|
|
});
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2025-12-24 00:13:23 -06:00
|
|
|
|
|
|
|
|
async function loadProduct() {
|
|
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
|
|
|
const productId = params.get("id");
|
|
|
|
|
|
|
|
|
|
if (!productId) {
|
|
|
|
|
document.getElementById("loading").innerHTML =
|
|
|
|
|
'<p>Product not found</p><a href="/shop.html">Back to Shop</a>';
|
|
|
|
|
return;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2025-12-24 00:13:23 -06:00
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch(`/api/products/${productId}`);
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
|
|
|
|
|
if (!data.success || !data.product) {
|
|
|
|
|
throw new Error("Product not found");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const product = data.product;
|
|
|
|
|
document.title = `${product.name} - Sky Art Shop`;
|
|
|
|
|
|
|
|
|
|
// Get primary image or first image from images array
|
|
|
|
|
let primaryImage = "/assets/images/placeholder.jpg";
|
|
|
|
|
let imageGallery = [];
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
product.images &&
|
|
|
|
|
Array.isArray(product.images) &&
|
|
|
|
|
product.images.length > 0
|
|
|
|
|
) {
|
|
|
|
|
// Find primary image
|
|
|
|
|
const primary = product.images.find((img) => img.is_primary);
|
|
|
|
|
if (primary) {
|
|
|
|
|
primaryImage = primary.image_url;
|
|
|
|
|
} else {
|
|
|
|
|
primaryImage = product.images[0].image_url;
|
|
|
|
|
}
|
|
|
|
|
imageGallery = product.images;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build image gallery HTML
|
|
|
|
|
let galleryHTML = "";
|
|
|
|
|
if (imageGallery.length > 0) {
|
|
|
|
|
galleryHTML = `
|
|
|
|
|
<div style="display: flex; gap: 12px; margin-top: 16px; overflow-x: auto; padding: 8px 0;">
|
|
|
|
|
${imageGallery
|
|
|
|
|
.map(
|
|
|
|
|
(img, idx) => `
|
|
|
|
|
<img src="${img.image_url}"
|
|
|
|
|
alt="${img.alt_text || product.name}"
|
|
|
|
|
onclick="changePrimaryImage('${img.image_url}')"
|
|
|
|
|
style="width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; border: ${
|
|
|
|
|
img.image_url === primaryImage
|
|
|
|
|
? "3px solid #6b46c1"
|
|
|
|
|
: "1px solid #e5e7eb"
|
|
|
|
|
};"
|
|
|
|
|
onerror="this.src='/assets/images/placeholder.jpg'" />
|
|
|
|
|
`
|
|
|
|
|
)
|
|
|
|
|
.join("")}
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build product details HTML
|
|
|
|
|
let detailsHTML = "";
|
|
|
|
|
if (
|
|
|
|
|
product.sku ||
|
|
|
|
|
product.weight ||
|
|
|
|
|
product.dimensions ||
|
|
|
|
|
product.material
|
|
|
|
|
) {
|
|
|
|
|
detailsHTML = `
|
|
|
|
|
<div style="margin-bottom: 24px; padding: 20px; background: #f9fafb; border-radius: 8px;">
|
|
|
|
|
<h3 style="font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 16px;">Product Details</h3>
|
|
|
|
|
${
|
|
|
|
|
product.sku
|
|
|
|
|
? `
|
|
|
|
|
<p style="margin-bottom: 8px; color: #6b7280;">
|
|
|
|
|
<span style="font-weight: 500;">SKU:</span> ${product.sku}
|
|
|
|
|
</p>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
${
|
|
|
|
|
product.weight
|
|
|
|
|
? `
|
|
|
|
|
<p style="margin-bottom: 8px; color: #6b7280;">
|
|
|
|
|
<span style="font-weight: 500;">Weight:</span> ${product.weight}
|
|
|
|
|
</p>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
${
|
|
|
|
|
product.dimensions
|
|
|
|
|
? `
|
|
|
|
|
<p style="margin-bottom: 8px; color: #6b7280;">
|
|
|
|
|
<span style="font-weight: 500;">Dimensions:</span> ${product.dimensions}
|
|
|
|
|
</p>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
${
|
|
|
|
|
product.material
|
|
|
|
|
? `
|
|
|
|
|
<p style="margin-bottom: 8px; color: #6b7280;">
|
|
|
|
|
<span style="font-weight: 500;">Material:</span> ${product.material}
|
|
|
|
|
</p>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Build badges HTML
|
|
|
|
|
let badgesHTML = "";
|
|
|
|
|
if (product.isfeatured || product.isbestseller) {
|
|
|
|
|
badgesHTML = `
|
|
|
|
|
<div style="display: flex; gap: 8px; margin-bottom: 16px;">
|
|
|
|
|
${
|
|
|
|
|
product.isfeatured
|
|
|
|
|
? `
|
|
|
|
|
<span style="display: inline-block; padding: 6px 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 6px; font-size: 12px; font-weight: 600;">
|
|
|
|
|
<i class="bi bi-star-fill"></i> Featured
|
|
|
|
|
</span>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
${
|
|
|
|
|
product.isbestseller
|
|
|
|
|
? `
|
|
|
|
|
<span style="display: inline-block; padding: 6px 12px; background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; border-radius: 6px; font-size: 12px; font-weight: 600;">
|
|
|
|
|
<i class="bi bi-trophy-fill"></i> Best Seller
|
|
|
|
|
</span>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.getElementById("productDetail").innerHTML = `
|
2025-12-13 22:59:42 -06:00
|
|
|
<div style="font-family: 'Roboto', sans-serif;">
|
|
|
|
|
<nav style="background: white; padding: 16px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
|
|
|
|
<div style="max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px;">
|
|
|
|
|
<a href="/home.html" style="font-size: 20px; font-weight: 600; color: #1a1a1a; text-decoration: none;">Sky Art Shop</a>
|
|
|
|
|
<span style="color: #d1d5db;">/</span>
|
|
|
|
|
<a href="/shop.html" style="color: #6b7280; text-decoration: none;">Shop</a>
|
|
|
|
|
<span style="color: #d1d5db;">/</span>
|
2025-12-19 20:44:46 -06:00
|
|
|
<span style="color: #6b7280;">${product.name}</span>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<div style="max-width: 1200px; margin: 40px auto; padding: 0 24px;">
|
|
|
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-bottom: 60px;">
|
|
|
|
|
<div>
|
|
|
|
|
<div style="background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
|
2025-12-24 00:13:23 -06:00
|
|
|
<img id="primaryImage"
|
|
|
|
|
src="${primaryImage}"
|
2025-12-19 20:44:46 -06:00
|
|
|
alt="${product.name}"
|
2025-12-13 22:59:42 -06:00
|
|
|
style="width: 100%; height: auto; display: block;"
|
|
|
|
|
onerror="this.src='/assets/images/placeholder.jpg'" />
|
|
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
${galleryHTML}
|
|
|
|
|
${
|
|
|
|
|
imageGallery.length > 0 &&
|
|
|
|
|
imageGallery.some((img) => img.color_variant)
|
|
|
|
|
? `
|
|
|
|
|
<div style="margin-top: 16px;">
|
|
|
|
|
<p style="font-size: 14px; font-weight: 500; color: #6b7280; margin-bottom: 8px;">Available Colors:</p>
|
|
|
|
|
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
|
|
|
|
${imageGallery
|
|
|
|
|
.filter((img) => img.color_variant)
|
|
|
|
|
.map(
|
|
|
|
|
(img) => `
|
|
|
|
|
<span style="display: inline-block; padding: 6px 12px; background: #f3f4f6; border-radius: 6px; font-size: 13px; color: #1a1a1a;">
|
|
|
|
|
${img.color_variant}
|
|
|
|
|
</span>
|
|
|
|
|
`
|
|
|
|
|
)
|
|
|
|
|
.join("")}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="padding: 20px 0;">
|
2025-12-24 00:13:23 -06:00
|
|
|
${badgesHTML}
|
|
|
|
|
<h1 style="font-size: 36px; font-weight: 700; color: #1a1a1a; margin: 0 0 16px 0; line-height: 1.2;">${
|
|
|
|
|
product.name
|
|
|
|
|
}</h1>
|
2025-12-13 22:59:42 -06:00
|
|
|
|
|
|
|
|
<div style="display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px;">
|
2025-12-24 00:13:23 -06:00
|
|
|
<p style="font-size: 36px; font-weight: 700; color: #6b46c1; margin: 0;">$${parseFloat(
|
|
|
|
|
product.price
|
|
|
|
|
).toFixed(2)}</p>
|
|
|
|
|
${
|
|
|
|
|
product.stockquantity > 0
|
|
|
|
|
? `<span style="color: #10b981; font-weight: 500;">In Stock (${product.stockquantity} available)</span>`
|
|
|
|
|
: `<span style="color: #ef4444; font-weight: 500;">Out of Stock</span>`
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-24 00:13:23 -06:00
|
|
|
${
|
|
|
|
|
product.shortdescription
|
|
|
|
|
? `
|
2025-12-19 20:44:46 -06:00
|
|
|
<p style="font-size: 18px; color: #4b5563; line-height: 1.6; margin-bottom: 24px;">${product.shortdescription}</p>
|
2025-12-24 00:13:23 -06:00
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-24 00:13:23 -06:00
|
|
|
${
|
|
|
|
|
product.description
|
|
|
|
|
? `
|
|
|
|
|
<div style="margin-bottom: 24px;">
|
2025-12-13 22:59:42 -06:00
|
|
|
<h3 style="font-size: 18px; font-weight: 600; color: #1a1a1a; margin-bottom: 12px;">Description</h3>
|
2025-12-24 00:13:23 -06:00
|
|
|
<div style="color: #6b7280; line-height: 1.7;">${product.description}</div>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
2025-12-24 00:13:23 -06:00
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-24 00:13:23 -06:00
|
|
|
${
|
|
|
|
|
product.category
|
|
|
|
|
? `
|
2025-12-13 22:59:42 -06:00
|
|
|
<p style="margin-bottom: 16px;">
|
|
|
|
|
<span style="font-weight: 500; color: #6b7280;">Category:</span>
|
2025-12-19 20:44:46 -06:00
|
|
|
<span style="display: inline-block; margin-left: 8px; padding: 4px 12px; background: #f3f4f6; border-radius: 6px; font-size: 14px;">${product.category}</span>
|
2025-12-13 22:59:42 -06:00
|
|
|
</p>
|
2025-12-24 00:13:23 -06:00
|
|
|
`
|
|
|
|
|
: ""
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-24 00:13:23 -06:00
|
|
|
${detailsHTML}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
|
|
|
|
<div style="display: flex; gap: 12px; margin-top: 32px;">
|
|
|
|
|
<button onclick="addToCart()"
|
2025-12-24 00:13:23 -06:00
|
|
|
${product.stockquantity <= 0 ? "disabled" : ""}
|
|
|
|
|
style="flex: 1; padding: 16px 32px; background: ${
|
|
|
|
|
product.stockquantity <= 0 ? "#9ca3af" : "#6b46c1"
|
|
|
|
|
}; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: ${
|
|
|
|
|
product.stockquantity <= 0 ? "not-allowed" : "pointer"
|
|
|
|
|
}; transition: background 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;"
|
|
|
|
|
onmouseover="if(${
|
|
|
|
|
product.stockquantity > 0
|
|
|
|
|
}) this.style.background='#5936a3'"
|
|
|
|
|
onmouseout="if(${
|
|
|
|
|
product.stockquantity > 0
|
|
|
|
|
}) this.style.background='#6b46c1'">
|
2025-12-13 22:59:42 -06:00
|
|
|
<i class="bi bi-cart-plus" style="font-size: 20px;"></i>
|
2025-12-24 00:13:23 -06:00
|
|
|
${
|
|
|
|
|
product.stockquantity <= 0
|
|
|
|
|
? "Out of Stock"
|
|
|
|
|
: "Add to Cart"
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
</button>
|
|
|
|
|
<button onclick="addToWishlist()"
|
|
|
|
|
style="width: 56px; padding: 16px; background: transparent; color: #6b46c1; border: 2px solid #6b46c1; border-radius: 8px; font-size: 20px; cursor: pointer; transition: all 0.2s;"
|
|
|
|
|
onmouseover="this.style.background='#f3f0ff'"
|
|
|
|
|
onmouseout="this.style.background='transparent'">
|
|
|
|
|
<i class="bi bi-heart"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a href="/shop.html" style="display: inline-block; margin-top: 24px; color: #6b46c1; text-decoration: none; font-weight: 500;">
|
|
|
|
|
<i class="bi bi-arrow-left"></i> Back to Shop
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-19 20:44:46 -06:00
|
|
|
`;
|
2025-12-24 00:13:23 -06:00
|
|
|
|
|
|
|
|
document.getElementById("loading").style.display = "none";
|
|
|
|
|
document.getElementById("productDetail").style.display = "block";
|
|
|
|
|
|
|
|
|
|
// Store product data
|
|
|
|
|
window.currentProduct = product;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("Error loading product:", error);
|
|
|
|
|
document.getElementById("loading").innerHTML =
|
|
|
|
|
'<p style="color: #ef4444;">Error loading product</p><a href="/shop.html" style="color: #6b46c1; text-decoration: none; font-weight: 500;">Back to Shop</a>';
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2025-12-24 00:13:23 -06:00
|
|
|
|
|
|
|
|
function addToCart() {
|
|
|
|
|
if (window.currentProduct && window.shoppingManager) {
|
|
|
|
|
shoppingManager.addToCart(window.currentProduct, 1);
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2025-12-24 00:13:23 -06:00
|
|
|
|
|
|
|
|
function addToWishlist() {
|
|
|
|
|
if (window.currentProduct && window.shoppingManager) {
|
|
|
|
|
shoppingManager.addToWishlist(window.currentProduct);
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2025-12-24 00:13:23 -06:00
|
|
|
|
|
|
|
|
loadProduct();
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
2025-12-13 22:59:42 -06:00
|
|
|
</html>
|