File size: 36,522 Bytes
1cea404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ShopSphere - Modern E-commerce Store</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* Custom CSS for elements that need more styling than Tailwind provides */
        .product-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .cart-item:hover {
            background-color: #f8fafc;
        }
        .checkout-step.active {
            border-color: #3b82f6;
            color: #3b82f6;
        }
        .checkout-step.completed {
            border-color: #10b981;
            color: #10b981;
        }
        .dropdown:hover .dropdown-menu {
            display: block;
        }
        .product-image {
            transition: transform 0.3s ease;
        }
        .product-image:hover {
            transform: scale(1.05);
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .fade-in {
            animation: fadeIn 0.5s ease-in;
        }
    </style>
</head>
<body class="bg-gray-50 font-sans">
    <!-- Navigation -->
    <nav class="bg-white shadow-md sticky top-0 z-50">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-4">
                <button onclick="showPage('home')" class="text-2xl font-bold text-blue-600 flex items-center">
                    <i class="fas fa-shopping-bag mr-2"></i> ShopSphere
                </button>
                <div class="hidden md:flex space-x-6">
                    <button onclick="showPage('home')" class="text-gray-700 hover:text-blue-600">Home</button>
                    <div class="dropdown relative">
                        <button class="text-gray-700 hover:text-blue-600 flex items-center">
                            Shop <i class="fas fa-chevron-down ml-1 text-xs"></i>
                        </button>
                        <div class="dropdown-menu absolute hidden bg-white shadow-lg rounded-md mt-2 py-2 w-48">
                            <button onclick="showPage('products')" class="block px-4 py-2 text-gray-700 hover:bg-gray-100 w-full text-left">All Products</button>
                            <button onclick="filterProducts('electronics')" class="block px-4 py-2 text-gray-700 hover:bg-gray-100 w-full text-left">Electronics</button>
                            <button onclick="filterProducts('clothing')" class="block px-4 py-2 text-gray-700 hover:bg-gray-100 w-full text-left">Clothing</button>
                            <button onclick="filterProducts('home')" class="block px-4 py-2 text-gray-700 hover:bg-gray-100 w-full text-left">Home & Garden</button>
                        </div>
                    </div>
                    <button onclick="showPage('about')" class="text-gray-700 hover:text-blue-600">About</button>
                    <button onclick="showPage('contact')" class="text-gray-700 hover:text-blue-600">Contact</button>
                </div>
            </div>
            <div class="flex items-center space-x-4">
                <button onclick="showPage('search')" class="text-gray-600 hover:text-blue-600">
                    <i class="fas fa-search"></i>
                </button>
                <button onclick="showPage('account')" class="text-gray-600 hover:text-blue-600">
                    <i class="fas fa-user"></i>
                </button>
                <button onclick="showPage('cart')" class="text-gray-600 hover:text-blue-600 relative">
                    <i class="fas fa-shopping-cart"></i>
                    <span id="cart-count" class="absolute -top-2 -right-2 bg-blue-600 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">0</span>
                </button>
                <button onclick="toggleMobileMenu()" class="md:hidden text-gray-600">
                    <i class="fas fa-bars text-xl"></i>
                </button>
            </div>
        </div>
        <!-- Mobile menu -->
        <div id="mobile-menu" class="hidden md:hidden bg-white border-t">
            <div class="container mx-auto px-4 py-2 flex flex-col space-y-2">
                <button onclick="showPage('home')" class="text-gray-700 hover:text-blue-600 py-2">Home</button>
                <button onclick="showPage('products')" class="text-gray-700 hover:text-blue-600 py-2">Shop</button>
                <button onclick="showPage('about')" class="text-gray-700 hover:text-blue-600 py-2">About</button>
                <button onclick="showPage('contact')" class="text-gray-700 hover:text-blue-600 py-2">Contact</button>
                <button onclick="showPage('account')" class="text-gray-700 hover:text-blue-600 py-2">Account</button>
            </div>
        </div>
    </nav>

    <!-- Page Content -->
    <div id="page-content" class="container mx-auto px-4 py-8 fade-in">
        <!-- Home Page (default) -->
        <div id="home-page">
            <!-- Hero Section -->
            <section class="bg-gradient-to-r from-blue-500 to-purple-600 text-white rounded-xl p-8 mb-12">
                <div class="max-w-2xl mx-auto text-center">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4">Summer Sale is Here!</h1>
                    <p class="text-xl mb-6">Up to 50% off on selected items. Limited time offer.</p>
                    <button onclick="showPage('products')" class="bg-white text-blue-600 font-bold py-3 px-8 rounded-full hover:bg-gray-100 transition duration-300">
                        Shop Now
                    </button>
                </div>
            </section>

            <!-- Featured Categories -->
            <section class="mb-12">
                <h2 class="text-2xl font-bold mb-6">Shop by Category</h2>
                <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                    <button onclick="filterProducts('electronics')" class="bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition duration-300">
                        <div class="bg-blue-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
                            <i class="fas fa-laptop text-blue-600 text-2xl"></i>
                        </div>
                        <h3 class="font-medium">Electronics</h3>
                    </button>
                    <button onclick="filterProducts('clothing')" class="bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition duration-300">
                        <div class="bg-pink-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
                            <i class="fas fa-tshirt text-pink-600 text-2xl"></i>
                        </div>
                        <h3 class="font-medium">Clothing</h3>
                    </button>
                    <button onclick="filterProducts('home')" class="bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition duration-300">
                        <div class="bg-green-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
                            <i class="fas fa-home text-green-600 text-2xl"></i>
                        </div>
                        <h3 class="font-medium">Home & Garden</h3>
                    </button>
                    <button onclick="filterProducts('accessories')" class="bg-white rounded-lg shadow-sm p-4 text-center hover:shadow-md transition duration-300">
                        <div class="bg-yellow-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
                            <i class="fas fa-watch text-yellow-600 text-2xl"></i>
                        </div>
                        <h3 class="font-medium">Accessories</h3>
                    </button>
                </div>
            </section>

            <!-- Featured Products -->
            <section class="mb-12">
                <div class="flex justify-between items-center mb-6">
                    <h2 class="text-2xl font-bold">Featured Products</h2>
                    <button onclick="showPage('products')" class="text-blue-600 hover:underline">View All</button>
                </div>
                <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
                    <!-- Product cards will be dynamically inserted here -->
                </div>
            </section>

            <!-- Promo Banner -->
            <section class="mb-12">
                <div class="bg-gray-900 text-white rounded-xl overflow-hidden">
                    <div class="flex flex-col md:flex-row">
                        <div class="md:w-1/2 p-8 md:p-12 flex flex-col justify-center">
                            <h2 class="text-2xl md:text-3xl font-bold mb-4">New Arrivals</h2>
                            <p class="text-gray-300 mb-6">Discover our latest collection of premium products designed for modern living.</p>
                            <button onclick="showPage('products')" class="bg-white text-gray-900 font-bold py-2 px-6 rounded-full hover:bg-gray-200 transition duration-300 self-start">
                                Explore Now
                            </button>
                        </div>
                        <div class="md:w-1/2">
                            <img src="https://images.unsplash.com/photo-1555529669-e69e7aa0ba9a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1000&q=80" alt="Promo" class="w-full h-full object-cover">
                        </div>
                    </div>
                </div>
            </section>

            <!-- Testimonials -->
            <section class="mb-12">
                <h2 class="text-2xl font-bold mb-8 text-center">What Our Customers Say</h2>
                <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <div class="flex items-center mb-4">
                            <div class="text-yellow-400 mr-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"></i>
                            </div>
                        </div>
                        <p class="text-gray-600 mb-4">"The quality of products is exceptional and the delivery was super fast. Will definitely shop here again!"</p>
                        <div class="flex items-center">
                            <div class="w-10 h-10 rounded-full bg-gray-300 mr-3 overflow-hidden">
                                <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Customer" class="w-full h-full object-cover">
                            </div>
                            <div>
                                <h4 class="font-medium">Sarah Johnson</h4>
                                <p class="text-gray-500 text-sm">Verified Buyer</p>
                            </div>
                        </div>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <div class="flex items-center mb-4">
                            <div class="text-yellow-400 mr-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"></i>
                            </div>
                        </div>
                        <p class="text-gray-600 mb-4">"Excellent customer service! They helped me choose the perfect gift for my wife's birthday."</p>
                        <div class="flex items-center">
                            <div class="w-10 h-10 rounded-full bg-gray-300 mr-3 overflow-hidden">
                                <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Customer" class="w-full h-full object-cover">
                            </div>
                            <div>
                                <h4 class="font-medium">Michael Chen</h4>
                                <p class="text-gray-500 text-sm">Verified Buyer</p>
                            </div>
                        </div>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm">
                        <div class="flex items-center mb-4">
                            <div class="text-yellow-400 mr-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>
                        </div>
                        <p class="text-gray-600 mb-4">"Great selection of products at competitive prices. The mobile app makes shopping so convenient."</p>
                        <div class="flex items-center">
                            <div class="w-10 h-10 rounded-full bg-gray-300 mr-3 overflow-hidden">
                                <img src="https://randomuser.me/api/portraits/women/68.jpg" alt="Customer" class="w-full h-full object-cover">
                            </div>
                            <div>
                                <h4 class="font-medium">Emily Rodriguez</h4>
                                <p class="text-gray-500 text-sm">Verified Buyer</p>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>

        <!-- Products Page -->
        <div id="products-page" class="hidden">
            <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8">
                <h1 class="text-2xl font-bold mb-4 md:mb-0">All Products</h1>
                <div class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-4 w-full md:w-auto">
                    <div class="relative">
                        <select id="category-filter" onchange="filterProducts(this.value)" class="appearance-none bg-white border border-gray-300 rounded-md pl-3 pr-8 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 w-full">
                            <option value="all">All Categories</option>
                            <option value="electronics">Electronics</option>
                            <option value="clothing">Clothing</option>
                            <option value="home">Home & Garden</option>
                            <option value="accessories">Accessories</option>
                        </select>
                        <div class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none">
                            <i class="fas fa-chevron-down text-gray-400"></i>
                        </div>
                    </div>
                    <div class="relative">
                        <select id="sort-by" onchange="sortProducts(this.value)" class="appearance-none bg-white border border-gray-300 rounded-md pl-3 pr-8 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 w-full">
                            <option value="featured">Featured</option>
                            <option value="price-low">Price: Low to High</option>
                            <option value="price-high">Price: High to Low</option>
                            <option value="newest">Newest Arrivals</option>
                            <option value="rating">Highest Rated</option>
                        </select>
                        <div class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none">
                            <i class="fas fa-chevron-down text-gray-400"></i>
                        </div>
                    </div>
                </div>
            </div>

            <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
                <!-- Product cards will be dynamically inserted here -->
            </div>

            <div class="flex justify-center mt-12">
                <nav class="inline-flex rounded-md shadow">
                    <button onclick="changePage('prev')" class="px-3 py-2 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-50">
                        <i class="fas fa-chevron-left"></i>
                    </button>
                    <button onclick="changePage(1)" class="px-4 py-2 border-t border-b border-gray-300 bg-white text-blue-600 font-medium">1</button>
                    <button onclick="changePage(2)" class="px-4 py-2 border-t border-b border-gray-300 bg-white text-gray-500 hover:bg-gray-50">2</button>
                    <button onclick="changePage(3)" class="px-4 py-2 border-t border-b border-gray-300 bg-white text-gray-500 hover:bg-gray-50">3</button>
                    <span class="px-4 py-2 border-t border-b border-gray-300 bg-white text-gray-500">...</span>
                    <button onclick="changePage(8)" class="px-4 py-2 border-t border-b border-gray-300 bg-white text-gray-500 hover:bg-gray-50">8</button>
                    <button onclick="changePage('next')" class="px-3 py-2 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-50">
                        <i class="fas fa-chevron-right"></i>
                    </button>
                </nav>
            </div>
        </div>

        <!-- Product Detail Page -->
        <div id="product-detail-page" class="hidden">
            <button onclick="showPage('products')" class="text-blue-600 hover:underline mb-4 flex items-center">
                <i class="fas fa-arrow-left mr-2"></i> Back to Products
            </button>
            
            <div class="bg-white rounded-lg shadow-sm overflow-hidden">
                <div class="flex flex-col md:flex-row">
                    <div class="md:w-1/2 p-4">
                        <div class="mb-4">
                            <img id="product-main-image" src="" alt="Product" class="w-full h-80 object-contain rounded-lg product-image">
                        </div>
                        <div class="grid grid-cols-4 gap-2">
                            <button onclick="changeProductImage('1')" class="border rounded-md p-1 hover:border-blue-500">
                                <img id="product-thumb-1" src="" alt="Thumbnail" class="w-full h-16 object-contain">
                            </button>
                            <button onclick="changeProductImage('2')" class="border rounded-md p-1 hover:border-blue-500">
                                <img id="product-thumb-2" src="" alt="Thumbnail" class="w-full h-16 object-contain">
                            </button>
                            <button onclick="changeProductImage('3')" class="border rounded-md p-1 hover:border-blue-500">
                                <img id="product-thumb-3" src="" alt="Thumbnail" class="w-full h-16 object-contain">
                            </button>
                            <button onclick="changeProductImage('4')" class="border rounded-md p-1 hover:border-blue-500">
                                <img id="product-thumb-4" src="" alt="Thumbnail" class="w-full h-16 object-contain">
                            </button>
                        </div>
                    </div>
                    <div class="md:w-1/2 p-6">
                        <h1 id="product-title" class="text-2xl font-bold mb-2"></h1>
                        <div class="flex items-center mb-4">
                            <div class="text-yellow-400 mr-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 id="product-rating" class="text-gray-600 text-sm">(42 reviews)</span>
                        </div>
                        <div class="mb-6">
                            <span id="product-price" class="text-2xl font-bold text-gray-900"></span>
                            <span id="product-original-price" class="text-lg text-gray-500 line-through ml-2"></span>
                            <span id="product-discount" class="bg-red-100 text-red-800 text-sm font-medium ml-2 px-2 py-0.5 rounded"></span>
                        </div>
                        <p id="product-description" class="text-gray-700 mb-6"></p>
                        
                        <div class="mb-6">
                            <h3 class="text-sm font-medium text-gray-900 mb-2">Color</h3>
                            <div class="flex space-x-2">
                                <button class="w-8 h-8 rounded-full bg-black border-2 border-gray-300 focus:ring-2 focus:ring-blue-500"></button>
                                <button class="w-8 h-8 rounded-full bg-blue-600 border-2 border-gray-300 focus:ring-2 focus:ring-blue-500"></button>
                                <button class="w-8 h-8 rounded-full bg-gray-200 border-2 border-gray-300 focus:ring-2 focus:ring-blue-500"></button>
                                <button class="w-8 h-8 rounded-full bg-red-600 border-2 border-gray-300 focus:ring-2 focus:ring-blue-500"></button>
                            </div>
                        </div>
                        
                        <div class="mb-6">
                            <h3 class="text-sm font-medium text-gray-900 mb-2">Size</h3>
                            <div class="flex flex-wrap gap-2">
                                <button class="px-3 py-1 border rounded-md text-sm hover:bg-gray-100 focus:bg-gray-100 focus:ring-2 focus:ring-blue-500">XS</button>
                                <button class="px-3 py-1 border rounded-md text-sm hover:bg-gray-100 focus:bg-gray-100 focus:ring-2 focus:ring-blue-500">S</button>
                                <button class="px-3 py-1 border rounded-md text-sm bg-gray-100 font-medium ring-2 ring-blue-500">M</button>
                                <button class="px-3 py-1 border rounded-md text-sm hover:bg-gray-100 focus:bg-gray-100 focus:ring-2 focus:ring-blue-500">L</button>
                                <button class="px-3 py-1 border rounded-md text-sm hover:bg-gray-100 focus:bg-gray-100 focus:ring-2 focus:ring-blue-500">XL</button>
                            </div>
                        </div>
                        
                        <div class="flex items-center mb-8">
                            <div class="flex items-center border rounded-md">
                                <button onclick="decrementQuantity()" class="px-3 py-2 text-gray-600 hover:bg-gray-100">
                                    <i class="fas fa-minus"></i>
                                </button>
                                <span id="product-quantity" class="px-4 py-2 border-x w-12 text-center">1</span>
                                <button onclick="incrementQuantity()" class="px-3 py-2 text-gray-600 hover:bg-gray-100">
                                    <i class="fas fa-plus"></i>
                                </button>
                            </div>
                            <span class="text-sm text-gray-500 ml-3">Only <span id="product-stock" class="font-medium">12</span> left in stock</span>
                        </div>
                        
                        <div class="flex flex-col sm:flex-row gap-3">
                            <button onclick="addToCart(currentProduct)" class="flex-1 bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-md flex items-center justify-center">
                                <i class="fas fa-shopping-cart mr-2"></i> Add to Cart
                            </button>
                            <button onclick="buyNow(currentProduct)" class="flex-1 bg-gray-900 hover:bg-gray-800 text-white font-medium py-3 px-6 rounded-md flex items-center justify-center">
                                Buy Now
                            </button>
                            <button class="w-12 h-12 border rounded-md flex items-center justify-center text-gray-600 hover:bg-gray-100">
                                <i class="far fa-heart text-xl"></i>
                            </button>
                        </div>
                        
                        <div class="mt-6 pt-6 border-t">
                            <div class="flex items-center text-sm text-gray-500 mb-2">
                                <i class="fas fa-truck mr-2"></i>
                                <span>Free shipping on orders over $50</span>
                            </div>
                            <div class="flex items-center text-sm text-gray-500">
                                <i class="fas fa-undo mr-2"></i>
                                <span>30-day return policy</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="border-t mt-8">
                    <div class="p-6">
                        <h2 class="text-xl font-bold mb-4">Product Details</h2>
                        <div id="product-details" class="prose max-w-none text-gray-700">
                            <!-- Details will be inserted here -->
                        </div>
                    </div>
                </div>
                
                <div class="border-t">
                    <div class="p-6">
                        <h2 class="text-xl font-bold mb-6">Customer Reviews</h2>
                        <div class="flex flex-col md:flex-row md:items-center justify-between mb-8">
                            <div>
                                <h3 class="text-2xl font-bold mb-1">4.6 <span class="text-lg font-normal text-gray-600">out of 5</span></h3>
                                <div class="flex items-center mb-2">
                                    <div class="text-yellow-400 mr-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-gray-600 text-sm">Based on 42 reviews</span>
                                </div>
                            </div>
                            <button class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-6 rounded-md">
                                Write a Review
                            </button>
                        </div>
                        
                        <div class="space-y-6">
                            <!-- Review 1 -->
                            <div class="border-b pb-6">
                                <div class="flex items-center mb-3">
                                    <div class="w-10 h-10 rounded-full bg-gray-300 mr-3 overflow-hidden">
                                        <img src="https://randomuser.me/api/portraits/women/12.jpg" alt="Reviewer" class="w-full h-full object-cover">
                                    </div>
                                    <div>
                                        <h4 class="font-medium">Jessica Miller</h4>
                                        <div class="flex items-center">
                                            <div class="text-yellow-400 mr-2 text-sm">
                                                <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"></i>
                                            </div>
                                            <span class="text-gray-500 text-sm">2 days ago</span>
                                        </div>
                                    </div>
                                </div>
                                <h5 class="font-medium mb-1">Perfect fit and comfortable</h5>
                                <p class="text-gray-700">I love this product! It fits perfectly and is very comfortable to wear all day. The quality is excellent and it looks just like the picture. Highly recommend!</p>
                            </div>
                            
                            <!-- Review 2 -->
                            <div class="border-b pb-6">
                                <div class="flex items-center mb-3">
                                    <div class="w-10 h-10 rounded-full bg-gray-300 mr-3 overflow-hidden">
                                        <img src="https://randomuser.me/api/portraits/men/45.jpg" alt="Reviewer" class="w-full h-full object-cover">
                                    </div>
                                    <div>
                                        <h4 class="font-medium">David Wilson</h4>
                                        <div class="flex items-center">
                                            <div class="text-yellow-400 mr-2 text-sm">
                                                <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="far fa-star"></i>
                                            </div>
                                            <span class="text-gray-500 text-sm">1 week ago</span>
                                        </div>
                                    </div>
                                </div>
                                <h5 class="font-medium mb-1">Great product but shipping took longer</h5>
                                <p class="text-gray-700">The product itself is great, exactly as described. My only complaint is that shipping took longer than expected. Otherwise, very satisfied with my purchase.</p>
                            </div>
                        </div>
                        
                        <button class="mt-6 text-blue-600 hover:underline font-medium">
                            See all reviews <i class="fas fa-chevron-down ml-1"></i>
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- Related Products -->
            <div class="mt-12">
                <h2 class="text-xl font-bold mb-6">You May Also Like</h2>
                <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
                    <!-- Related products will be inserted here -->
                </div>
            </div>
        </div>

        <!-- Cart Page -->
        <div id="cart-page" class="hidden">
            <h1 class="text-2xl font-bold mb-6">Your Shopping Cart</h1>
            
            <div class="flex flex-col lg:flex-row gap-8">
                <div class="lg:w-2/3">
                    <div id="cart-items" class="bg-white rounded-lg shadow-sm divide-y divide-gray-200">
                        <!-- Cart items will be inserted here -->
                        <div class="p-6 text-center">
                            <i class="fas fa-shopping-cart text-4xl text-gray-300 mb-4"></i>
                            <h3 class="text-lg font-medium text-gray-900 mb-2">Your cart is empty</h3>
                            <p class="text-gray-500 mb-4">Looks like you haven't added anything to your cart yet</p>
                            <button onclick="showPage('products')" class="bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-6 rounded-md">
                                Continue Shopping
                            </button>
                        </div>
                    </div>
                </div>
                
                <div class="lg:w-1/3">
                    <div class="bg-white rounded-lg shadow-sm p-6 sticky top-4">
                        <h2 class="text-lg font-bold mb-4">Order Summary</h2>
                        
                        <div class="space-y-3 mb-6">
                            <div class="flex justify-between">
                                <span class="text-gray-600">Subtotal</span>
                                <span id="cart-subtotal" class="font-medium">$0.00</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-gray-600">Shipping</span>
                                <span id="cart-shipping" class="font-medium">$0.00</span>
                            </div>
                            <div class="flex justify-between">
                                <span class="text-gray-600">Tax</span>
                                <span id="cart-tax" class="font-medium">$0.00</span>
                            </div>
                            <div class="flex justify-between border-t pt-3">
                                <span class="text-gray-900 font-bold">Total</span>
                                <span id="cart-total" class="text-gray-900 font-bold text-lg">$0.00</span>
                            </div>
                        </div>
                        
                        <button onclick="showPage('checkout')" id="checkout-btn" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-md disabled:opacity-50 disabled:cursor-not-allowed" disabled>
                            Proceed to Checkout
                        </button>
                        
                        <div class="mt-4 text-center text-sm text-gray-500">
                            or <button onclick="showPage('products')" class="text-blue-600 hover:underline">Continue Shopping</button>
                        </div>
                        
                        <div class="mt-6 pt-6 border-t">
                            <h3 class="text-sm font-medium text-gray-900 mb-3">We Accept</h3>
                            <div class="flex space-x-4">
                                <i class="fab fa-cc-visa text-3xl text-gray-400"></i>
                                <i class="fab fa-cc-mastercard text-3xl text-gray-400"></i>
                                <i class="fab fa-cc-amex text-3xl text-gray-400"></i>
                                <i class="fab fa-cc-discover text-3xl text-gray-400"></i>
                                <i class="fab fa-cc-paypal text-3xl text-gray-400"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Checkout Page -->
        <div id="checkout-page" class="hidden">
            <h1 class="text-2xl font-bold mb-6">Checkout</h1>
            
            <div class="flex flex-col lg:flex-row gap-8">
                <div class="lg:w-2/3">
                    <div class="bg-white rounded-lg shadow-sm p-6 mb-6">
                        <div class="flex justify-between items-center mb-6">
                            <h2 class="text-lg font-bold">Contact Information</h2>
                            <div class="text-sm">
                                <
</html>