/* =========================================
   متغيرات الألوان والتصميم الأساسية
========================================= */
:root {
    --primary: #e01b84;
    --primary-hover: #b8126b;
    --dark-text: #1a1a24;
    --light-text: #6b6b7b;
    --bg-color: #f4f6f9;
    --white: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 25px rgba(224, 27, 132, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Tajawal', sans-serif; background-color: var(--bg-color); color: var(--dark-text); line-height: 1.6; scroll-behavior: smooth; overflow-x: hidden; }
.section-padding { padding: 40px 5%; }

/* =========================================
   البريلودر (Preloader)
========================================= */
.preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); display: flex; justify-content: center; align-items: center; z-index: 99999; transition: opacity 0.6s ease, visibility 0.6s; }
.preloader.fade-out { opacity: 0; visibility: hidden; }
.loader-content { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.loader-icon-wrapper { width: 80px; height: 80px; background: var(--white); border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 10px 25px rgba(224, 27, 132, 0.15); animation: floatIcon 2s ease-in-out infinite; }
.loader-icon { font-size: 2rem; color: var(--primary); }
.loader-text { font-size: 1.2rem; font-weight: 800; color: var(--dark-text); letter-spacing: 1px; }
.loader-bar { width: 120px; height: 4px; background: rgba(224, 27, 132, 0.1); border-radius: 10px; position: relative; overflow: hidden; }
.loader-bar::after { content: ''; position: absolute; top: 0; left: -50%; width: 50%; height: 100%; background: var(--primary); border-radius: 10px; animation: loadingBar 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes loadingBar { 0% { left: -50%; } 100% { left: 100%; } }

/* =========================================
   إشعار الإضافة (Toast) 
========================================= */
.toast-notification { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px); background: var(--primary); color: #fff; padding: 12px 25px; border-radius: 30px; box-shadow: 0 5px 15px rgba(224, 27, 132, 0.4); font-weight: bold; font-size: 15px; z-index: 9999; opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.toast-notification.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* =========================================
   الأنيميشن الإنسيابي (Fade-Up)
========================================= */
.fade-up-element { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1); }
.fade-up-element.visible { opacity: 1; transform: translateY(0); }

/* =========================================
   الهيدر (Header)
========================================= */
.glass-header { position: sticky; top: 0; z-index: 1000; background: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: var(--transition); }
.header-container { display: flex; justify-content: space-between; align-items: center; padding: 10px 5%; width: 100%; }
.menu-toggle { font-size: 24px; cursor: pointer; color: var(--dark-text); transition: var(--transition); }
.menu-toggle:hover { color: var(--primary); }
.logo img { height: 55px; object-fit: contain; transition: var(--transition); }
.desktop-search { position: relative; flex: 0.6; margin: 0 20px; }
.desktop-search input { width: 100%; padding: 12px 20px 12px 45px; border-radius: 30px; border: 1px solid #eaeaea; background: var(--bg-color); font-family: inherit; font-size: 15px; transition: var(--transition); outline: none; }
.desktop-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(224, 27, 132, 0.1); background: var(--white); }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--light-text); }
.cart-icon { position: relative; font-size: 24px; color: var(--dark-text); cursor: pointer; transition: var(--transition); }
.cart-icon:hover { color: var(--primary); }
.cart-badge { position: absolute; top: -8px; right: -8px; background: var(--primary); color: var(--white); font-size: 12px; font-weight: bold; width: 20px; height: 20px; display: flex; justify-content: center; align-items: center; border-radius: 50%; border: 2px solid var(--white); }

/* =========================================
   المنيو الجانبي (Sidebar)
========================================= */
.sidebar { position: fixed; top: 0; right: -300px; width: 280px; height: 100vh; background: var(--white); z-index: 2000; transition: var(--transition); box-shadow: -5px 0 15px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
.sidebar.active { right: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid #eee; }
.close-sidebar { font-size: 24px; cursor: pointer; color: #aaa; transition: var(--transition); }
.close-sidebar:hover { color: var(--primary); }
.sidebar-links { list-style: none; padding: 20px 0; flex: 1; }
.sidebar-links li a { display: block; padding: 15px 25px; color: var(--dark-text); text-decoration: none; font-size: 18px; border-bottom: 1px solid #f9f9f9; transition: var(--transition); }
.sidebar-links li a:hover { color: var(--primary); background: #fff5f9; padding-right: 35px; }
.sidebar-social { padding: 20px; display: flex; gap: 15px; justify-content: center; background: #fafafa; }
.sidebar-social a { color: var(--light-text); font-size: 24px; transition: var(--transition); }
.sidebar-social a:hover { color: var(--primary); }
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1999; display: none; }
.sidebar-overlay.active { display: block; }

/* =========================================
   السليدر وقسم الفيديو
========================================= */
.hero-slider-section { width: 100%; position: relative; background: var(--bg-color); }
.heroSwiper { width: 100%; height: auto; }
.hero-img { width: 100%; height: auto; max-height: 500px; object-fit: cover; display: block; } 
.hero-content { position: absolute; top:0; left:0; width:100%; height:100%; display: flex; align-items: center; justify-content: center; text-align: center; background: linear-gradient(135deg, rgba(255,235,245,1) 0%, rgba(248,249,250,1) 100%); z-index: -1; }
.hero-content h1 { font-size: 3rem; font-weight: 800; color: var(--dark-text); }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.video-container iframe, .video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* =========================================
   الفلاتر (التمرير الأفقي والمتقدم)
========================================= */
.categories-filter { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.categories-filter::-webkit-scrollbar { display: none; }
.cat-btn { flex-shrink: 0; white-space: nowrap; padding: 8px 20px; border-radius: 8px; background: var(--white); color: var(--dark-text); text-decoration: none; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.02); border: 1px solid #f0f0f0; transition: var(--transition); font-size: 14px; }
.cat-btn:hover, .cat-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.advanced-filters-wrapper { padding: 0; margin-bottom: 20px; }
.filter-toggle-btn { width: 100%; background: var(--white); border: 1px solid #eaeaea; padding: 12px; border-radius: 8px; font-family: inherit; font-size: 15px; font-weight: bold; color: var(--dark-text); cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; box-shadow: var(--card-shadow); transition: var(--transition); }
.filter-toggle-btn:hover { background: #f9f9f9; border-color: #ddd; }
.advanced-filters-form { display: none; background: var(--white); padding: 15px; border-radius: 8px; border: 1px solid #eaeaea; margin-top: 10px; box-shadow: var(--card-shadow); }
.advanced-filters-form.active { display: block; animation: fadeIn 0.3s ease; }
.filter-group { margin-bottom: 15px; }
.filter-group label { display: block; margin-bottom: 8px; font-weight: bold; font-size: 14px; }
.price-inputs { display: flex; gap: 10px; }
.price-inputs input, .filter-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; outline: none; }
.price-inputs input:focus, .filter-group select:focus { border-color: var(--primary); }
.btn-apply-filter { background: var(--primary); color: #fff; border: none; padding: 12px; width: 100%; border-radius: 6px; font-weight: bold; cursor: pointer; margin-bottom: 8px; font-family: inherit; font-size: 15px; transition: var(--transition); }
.btn-apply-filter:hover { background: var(--primary-hover); }
.btn-clear-filter { display: block; background: #f0f0f0; color: var(--dark-text); text-align: center; padding: 12px; border-radius: 6px; text-decoration: none; font-weight: bold; transition: var(--transition); }
.btn-clear-filter:hover { background: #e0e0e0; }

/* =========================================
   البطاقات المربعة (متطابقة مع الصورة)
========================================= */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; align-items: stretch; }
.product-card { background: var(--white); border-radius: var(--radius); padding: 12px; position: relative; box-shadow: var(--card-shadow); border: 1px solid #f0f0f0; transition: var(--transition); display: flex; flex-direction: column; height: 100%; justify-content: space-between; }
.product-card:hover { transform: translateY(-5px); box-shadow: var(--hover-shadow); }

.product-img-wrapper { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 5; background: #f9f9f9; margin-bottom: 12px; }
.product-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .product-img-wrapper img { transform: scale(1.05); }

/* خصم و مفضلة */
.discount-badge { position: absolute; top: 10px; right: 10px; background: #ff3b30; color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; z-index: 10; }
.wishlist-wrapper { position: absolute; top: 10px; left: 10px; z-index: 10; background: var(--white); width: 30px; height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: pointer; }
.wishlist-icon { color: #ccc; transition: var(--transition); font-size: 14px; }
.wishlist-icon.active { color: #ff3b30; font-weight: 900; }

/* معلومات المنتج */
.product-info { display: flex; flex-direction: column; flex-grow: 1; }
.truncate { text-align: right; font-size: 15px; line-height: 1.4; color: var(--dark-text); font-weight: bold; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-container { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-bottom: 12px; }
.new-price { color: var(--primary); font-weight: 800; font-size: 16px; }
.old-price { text-decoration: line-through; color: var(--light-text); font-size: 13px; }

/* المقاس والألوان */
.options-container { margin: 0 0 10px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex-grow: 1; }
.chips-wrapper { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.size-chip { padding: 4px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 12px; cursor: pointer; transition: var(--transition); background: var(--white); color: var(--dark-text); }
.size-chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.color-dot { width: 18px; height: 18px; border-radius: 50%; border: 1px solid #ccc; cursor: pointer; transition: var(--transition); display: inline-block; }
.color-dot.selected { border: 2px solid var(--primary); transform: scale(1.2); box-shadow: 0 0 4px rgba(224,27,132,0.4); }

/* أزرار الشراء (متطابقة تماماً مع الصورة) */
.action-buttons { display: flex; gap: 8px; margin-top: auto; }
.btn-buy { background: var(--primary); flex: 1; height: 38px; color: #fff; font-weight: bold; font-size: 14px; gap: 5px; border: none; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; font-family: inherit; transition: var(--transition); }
.btn-buy:hover { background: var(--primary-hover); }
.btn-add { background: var(--dark-text); flex: 0 0 38px; height: 38px; color: #fff; border: none; border-radius: 8px; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: var(--transition); } 
.btn-add i { font-size: 16px; margin: 0; }
.btn-add:hover { background: #000; }

/* =========================================
   سلة المشتريات (Modal)
========================================= */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 3000; }
.modal-content { background: var(--white); margin: 5% auto; padding: 25px; width: 95%; max-width: 500px; border-radius: var(--radius); position: relative; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.2); animation: fadeInUp 0.4s ease forwards; }
.close { position: absolute; top: 15px; left: 15px; font-size: 26px; cursor: pointer; color: #aaa; transition: var(--transition); }
.close:hover { color: var(--primary); }

.cart-item { display: flex; gap: 15px; border-bottom: 1px solid #eee; padding: 15px 0; align-items: center; }
.cart-item-img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; }
.cart-item-details { flex: 1; }
.cart-item-title { font-weight: bold; font-size: 14px; margin-bottom: 5px; color: var(--dark-text); }
.cart-item-opts { font-size: 12px; color: #666; margin-bottom: 5px; }
.cart-item-price { font-size: 14px; font-weight: bold; color: var(--primary); }
.qty-controls { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.qty-btn { background: #f0f0f0; border: none; width: 25px; height: 25px; border-radius: 4px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.qty-val { font-size: 14px; font-weight: bold; width: 20px; text-align: center; }

.cart-total-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; font-size: 18px; font-weight: bold; border-top: 2px solid #eee; margin-top: 10px; color: var(--dark-text); }
.checkout-form input, .checkout-form textarea { width: 100%; padding: 12px 15px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 8px; font-family: inherit; font-size: 14px; transition: var(--transition); outline: none; }
.checkout-form input:focus, .checkout-form textarea:focus { border-color: var(--primary); }
button:disabled { background: #ccc !important; cursor: not-allowed; box-shadow: none; }
.btn-checkout { background: var(--primary); color: #fff; width: 100%; height: 45px; border: none; border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; font-family: inherit; }

/* =========================================
   الفوتر والبحث العائم
========================================= */
.site-footer { background: var(--white); padding: 40px 5%; text-align: center; border-top: 1px solid #eee; margin-top: 40px; }
.footer-logo img { height: 60px; margin-bottom: 20px; }
.footer-social { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }
.footer-social a { display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; background: var(--bg-color); color: var(--dark-text); border-radius: 50%; font-size: 18px; transition: var(--transition); text-decoration: none;}
.footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-5px); }
.footer-text { color: var(--light-text); font-size: 14px; }

.floating-whatsapp { position: fixed; bottom: 30px; left: 30px; background: #25D366; color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 35px; text-decoration: none; box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4); z-index: 1000; transition: var(--transition); }
.floating-whatsapp:hover { transform: scale(1.1) rotate(-10deg); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); } 70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }
.pulse-animation { animation: pulse 2s infinite; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.mobile-search-container { display: none; padding: 15px 5% 5px; position: relative; background: transparent; }
.mobile-search-container input { width: 100%; padding: 12px 40px 12px 15px; border-radius: 8px; border: 1px solid #ddd; outline: none; font-family: inherit; font-size: 14px; box-shadow: var(--card-shadow); }
.mobile-search-container .search-icon { position: absolute; right: 8%; top: 50%; color: #999; }

/* =========================================
   التجاوب مع الموبايل (Responsive & Image Match)
========================================= */
@media (max-width: 768px) {
    .header-container { padding: 10px 5%; }
    .desktop-search { display: none; }
    .mobile-search-container { display: block; }
    .logo img { height: 48px; } /* شعار أكبر قليلاً */
    .hero-img { max-height: 250px; }
    
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card { padding: 10px; border-radius: 12px; }
    .product-img-wrapper { margin-bottom: 10px; }
    
    .discount-badge { font-size: 11px; padding: 3px 8px; top: 8px; right: 8px; }
    .wishlist-wrapper { top: 8px; left: 8px; width: 26px; height: 26px; }
    .wishlist-icon { font-size: 13px; }
    
    .truncate { font-size: 13px; margin-bottom: 6px; }
    .price-container { margin-bottom: 8px; }
    .new-price { font-size: 14px; }
    .old-price { font-size: 12px; }
    
    .chips-wrapper { gap: 4px; margin-bottom: 5px; }
    .size-chip { padding: 3px 6px; font-size: 11px; }
    .color-dot { width: 14px; height: 14px; }
    
    .btn-buy { font-size: 12px; height: 34px; border-radius: 6px; }
    .btn-add { flex: 0 0 34px; height: 34px; border-radius: 6px; }
    .btn-add i { font-size: 14px; }

    .floating-whatsapp { width: 50px; height: 50px; font-size: 26px; bottom: 15px; left: 15px; }
}

/* =========================================
   صفحات الإضافات (Contact & Wishlist)
========================================= */
.contact-hero { text-align: center; padding: 60px 20px; background: linear-gradient(135deg, rgba(255,235,245,1) 0%, rgba(248,249,250,1) 100%); margin-bottom: 40px; border-radius: 0 0 30px 30px; }
.contact-hero h1 { font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.contact-hero p { color: var(--light-text); font-size: 1.1rem; }

.contact-container { display: flex; flex-wrap: wrap; gap: 30px; margin-bottom: 20px; }
.contact-info, .contact-form-wrapper { flex: 1; min-width: 300px; background: var(--white); padding: 30px; border-radius: var(--radius); box-shadow: var(--card-shadow); border: 1px solid #f0f0f0; }
.contact-info h3, .contact-form-wrapper h3 { margin-bottom: 25px; color: var(--dark-text); font-size: 1.4rem; border-bottom: 2px dashed #eee; padding-bottom: 10px; }

.social-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 15px; margin-top: 10px; }
.social-contact-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; background: var(--bg-color); border-radius: 12px; color: var(--dark-text); text-decoration: none; font-weight: bold; transition: var(--transition); border: 1px solid #eee; }
.social-contact-btn i { font-size: 2rem; transition: var(--transition); }
.social-contact-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); transform: translateY(-5px); box-shadow: var(--hover-shadow); }
.social-contact-btn:hover i { color: var(--white) !important; }

/* =========================================
   صفحة المنتج المنفرد (Professional Design)
========================================= */
.single-product-container { display: flex; flex-direction: column; gap: 30px; padding: 20px 5%; background: var(--white); min-height: 70vh; }
.sp-gallery { width: 100%; overflow: hidden; }
.spMainSwiper img { width: 100%; border-radius: 12px; aspect-ratio: 4/5; object-fit: cover; box-shadow: var(--card-shadow); border: 1px solid #eee; }
.spThumbSwiper { box-sizing: border-box; padding: 10px 0; }
.spThumbSwiper .swiper-slide { opacity: 0.5; cursor: pointer; border-radius: 8px; overflow: hidden; transition: 0.3s; }
.spThumbSwiper .swiper-slide-thumb-active { opacity: 1; border: 2px solid var(--primary); }
.spThumbSwiper img { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; }

.sp-details { display: flex; flex-direction: column; }
.sp-breadcrumbs { font-size: 13px; color: #999; margin-bottom: 15px; }
.sp-breadcrumbs a { color: var(--primary); text-decoration: none; }
.sp-title { font-size: 2rem; color: var(--dark-text); margin-bottom: 5px; }
.sp-code { font-size: 14px; color: #666; margin-bottom: 15px; }
.sp-price-box { margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
.sp-new-price { font-size: 2rem; font-weight: 900; color: var(--primary); }
.sp-old-price { font-size: 1.2rem; text-decoration: line-through; color: #999; }
.sp-desc { font-size: 1rem; color: var(--light-text); line-height: 1.8; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px dashed #eee; }
.sp-chip { padding: 8px 20px; font-size: 15px; }
.sp-color-dot { width: 35px; height: 35px; }
.sp-action-area { display: flex; gap: 15px; margin-top: 30px; margin-bottom: 15px; }
.sp-buy-btn, .sp-add-btn { height: 55px; font-size: 18px; border-radius: 12px; flex: 1; display:flex; justify-content:center; align-items:center; }
.sp-add-btn { background: var(--dark-text); color: #fff; }
.sp-add-btn:hover { background: #000; }
.sp-wish-btn { background: none; border: none; color: var(--light-text); font-size: 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; margin-top: 10px; font-family: inherit; }
.sp-wish-btn:hover, .sp-wish-btn i { color: #ff3b30; }

@media (min-width: 992px) {
    .contact-container { max-width: 1000px; margin: 0 auto; justify-content: center; }
    #wishlist-container { max-width: 1200px; margin: 0 auto; }
    .single-product-container { flex-direction: row; align-items: flex-start; max-width: 1200px; margin: 40px auto; padding: 0; box-shadow: var(--card-shadow); border-radius: 20px; }
    .sp-gallery { flex: 1; padding: 30px; position: sticky; top: 100px; }
    .sp-details { flex: 1; padding: 40px 30px 40px 0; border-right: 1px solid #f9f9f9; }
}