/** * Product Page Mobile UX Enhancements * تحسينات UX لصفحة المنتج - محسّنة للموبايل */ /* ============================================ 1. Sticky Bottom Bar - زر ثابت في الأسفل ============================================ */ .sticky-bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; background: linear-gradient(135deg, #E57393 0%, #D1537A 100%); padding: 12px 20px; box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); z-index: 1000; display: none; /* سيظهر على الموبايل فقط */ transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .sticky-bottom-bar.visible { transform: translateY(0); } .sticky-bottom-bar-content { display: flex; align-items: center; justify-content: space-between; gap: 15px; max-width: 600px; margin: 0 auto; } .sticky-price { color: white; font-size: 20px; font-weight: 700; display: flex; flex-direction: column; gap: 2px; } .sticky-price-old { font-size: 14px; text-decoration: line-through; opacity: 0.7; } .sticky-add-to-cart { background: white; color: #E57393; border: none; padding: 14px 28px; border-radius: 50px; font-weight: 700; font-size: 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.3s; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); flex-shrink: 0; } .sticky-add-to-cart:active { transform: scale(0.95); } .sticky-add-to-cart svg { width: 20px; height: 20px; } /* ============================================ 2. Swipeable Image Gallery - معرض صور بالسحب ============================================ */ .product-image-gallery { position: relative; width: 100%; overflow: hidden; border-radius: 16px; background: #f5f5f5; } .gallery-container { display: flex; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); touch-action: pan-y pinch-zoom; } .gallery-slide { min-width: 100%; position: relative; } .gallery-slide img { width: 100%; height: auto; display: block; object-fit: cover; } .gallery-indicators { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; } .gallery-indicator { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transition: all 0.3s; cursor: pointer; } .gallery-indicator.active { background: white; width: 24px; border-radius: 4px; } .gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.9); border: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } .gallery-nav:active { transform: translateY(-50%) scale(0.9); } .gallery-nav.prev { right: 10px; } .gallery-nav.next { left: 10px; } .gallery-nav svg { width: 20px; height: 20px; color: #333; } /* ============================================ 3. Quantity Counter - عداد الكمية بأزرار كبيرة ============================================ */ .quantity-selector { display: flex; align-items: center; gap: 12px; background: #f5f5f5; padding: 8px; border-radius: 50px; width: fit-content; } .quantity-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: white; color: #E57393; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); user-select: none; -webkit-tap-highlight-color: transparent; } .quantity-btn:active { transform: scale(0.9); background: #E57393; color: white; } .quantity-btn:disabled { opacity: 0.4; cursor: not-allowed; } .quantity-value { min-width: 50px; text-align: center; font-size: 20px; font-weight: 700; color: #333; user-select: none; } /* ============================================ Responsive - Mobile First ============================================ */ @media (max-width: 768px) { .sticky-bottom-bar { display: block; } /* إخفاء زر الإضافة الأصلي على الموبايل */ .original-add-to-cart { display: none !important; } .gallery-nav { display: none; /* إخفاء الأسهم على الموبايل، السحب أفضل */ } } @media (min-width: 769px) { /* على الشاشات الكبيرة، نخفي الزر الثابت */ .sticky-bottom-bar { display: none !important; } .gallery-nav { display: flex; } } /* ============================================ Animations ============================================ */ @keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } } .pulse-animation { animation: pulse 0.3s ease-in-out; } /* ============================================ Touch Feedback ============================================ */ .touch-feedback { position: relative; overflow: hidden; } .touch-feedback::after { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transform: translate(-50%, -50%); transition: width 0.6s, height 0.6s; } .touch-feedback:active::after { width: 200px; height: 200px; } /* ============================================ 4. Floating Heart Button - زر المفضلة عائم ============================================ */ .floating-wishlist-btn { position: fixed; top: 80px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: white; border: none; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 999; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .floating-wishlist-btn:active { transform: scale(0.9); } .floating-wishlist-btn.active { background: linear-gradient(135deg, #E57393 0%, #D1537A 100%); } .floating-wishlist-btn svg { width: 28px; height: 28px; color: #E57393; transition: all 0.3s; } .floating-wishlist-btn.active svg { color: white; } /* ============================================ 5. Accordion Sections - أكورديون للوصف ============================================ */ .accordion-section { border-bottom: 1px solid #e5e5e5; } .accordion-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; } .accordion-title { font-size: 16px; font-weight: 600; color: #333; display: flex; align-items: center; gap: 10px; } .accordion-icon { width: 20px; height: 20px; transition: transform 0.3s; color: #666; } .accordion-section.active .accordion-icon { transform: rotate(180deg); } .accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .accordion-section.active .accordion-content { max-height: 1000px; } .accordion-body { padding-bottom: 18px; color: #666; line-height: 1.7; font-size: 14px; } /* ============================================ 6. Stock Indicator - مؤشر التوفر ============================================ */ .stock-indicator { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; } .stock-indicator.in-stock { background: #d4edda; color: #155724; } .stock-indicator.low-stock { background: #fff3cd; color: #856404; } .stock-indicator.out-of-stock { background: #f8d7da; color: #721c24; } .stock-dot { width: 8px; height: 8px; border-radius: 50%; } .stock-indicator.in-stock .stock-dot { background: #28a745; } .stock-indicator.low-stock .stock-dot { background: #ffc107; } .stock-indicator.out-of-stock .stock-dot { background: #dc3545; } /* ============================================ 7. Related Products Carousel - منتجات مشابهة ============================================ */ .related-products-section { margin: 40px 0; } .related-products-header { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: #333; } .related-products-carousel { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; } .related-products-carousel::-webkit-scrollbar { display: none; } .related-products-container { display: flex; gap: 15px; padding: 10px 0; } .related-product-card { min-width: 160px; flex-shrink: 0; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); cursor: pointer; transition: transform 0.3s; } .related-product-card:active { transform: scale(0.95); } .related-product-image { width: 100%; height: 160px; object-fit: cover; } .related-product-info { padding: 12px; } .related-product-name { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .related-product-price { font-size: 16px; font-weight: 700; color: #E57393; } /* ============================================ 8. Share Button - زر المشاركة ============================================ */ .share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; background: #f5f5f5; border: none; border-radius: 50px; font-size: 14px; font-weight: 600; color: #333; cursor: pointer; transition: all 0.3s; } .share-btn:active { transform: scale(0.95); background: #e5e5e5; } .share-btn svg { width: 18px; height: 18px; } /* ============================================ 9. Sticky Price Bar - سعر متحرك ============================================ */ .sticky-price-bar { position: fixed; top: 0; left: 0; right: 0; background: white; padding: 12px 20px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); z-index: 998; display: flex; align-items: center; justify-content: space-between; transform: translateY(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); } .sticky-price-bar.visible { transform: translateY(0); } .sticky-price-info { display: flex; align-items: center; gap: 12px; } .sticky-product-image { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; } .sticky-product-details { display: flex; flex-direction: column; } .sticky-product-name { font-size: 14px; font-weight: 600; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; } .sticky-product-price { font-size: 16px; font-weight: 700; color: #E57393; } .sticky-cart-btn { background: linear-gradient(135deg, #E57393 0%, #D1537A 100%); color: white; border: none; padding: 10px 20px; border-radius: 50px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.3s; } .sticky-cart-btn:active { transform: scale(0.95); } /* ============================================ 10. Interactive Rating - تقييم تفاعلي ============================================ */ .interactive-rating { margin: 20px 0; } .rating-header { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #333; } .rating-stars { display: flex; gap: 8px; margin-bottom: 8px; } .rating-star { width: 40px; height: 40px; cursor: pointer; transition: all 0.2s; color: #ddd; } .rating-star:active { transform: scale(1.2); } .rating-star.filled { color: #ffc107; } .rating-star.hover { color: #ffeb3b; } .rating-count { font-size: 14px; color: #666; margin-top: 8px; } .rating-summary { display: flex; align-items: center; gap: 12px; margin-top: 12px; } .rating-average { font-size: 32px; font-weight: 700; color: #333; } .rating-details { flex: 1; } .rating-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; } .rating-bar-label { font-size: 12px; color: #666; min-width: 30px; } .rating-bar-fill { flex: 1; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; } .rating-bar-progress { height: 100%; background: linear-gradient(135deg, #E57393 0%, #D1537A 100%); transition: width 0.3s; } .rating-bar-count { font-size: 12px; color: #999; min-width: 30px; text-align: right; } /* ============================================ Mobile Optimizations ============================================ */ @media (max-width: 768px) { .floating-wishlist-btn { top: 70px; right: 15px; width: 50px; height: 50px; } .sticky-price-bar { padding: 10px 15px; } .related-product-card { min-width: 140px; } }