/* =========================================
   1. المتغيرات الأساسية (Global Variables)
   ========================================= */
:root {
    /* الألوان الأساسية: تدرجات الوردي والأحمر */
    --primary-red: #e63946;
    --primary-pink: #f72585;
    --gradient-brand: linear-gradient(135deg, var(--primary-pink), var(--primary-red));
    
    /* ألوان الخلفية والنصوص */
    --bg-main: #fffcfd; /* أوف وايت مائل للوردي الفاتح جداً يبرز الصور */
    --text-dark: #2b2d42;
    --text-light: #ffffff;
    
    /* إعدادات الهيكل والتصميم البيضاوي */
    --header-height: 70px;
    --border-radius-oval: 35px; /* قيمة كافية لإعطاء شكل بيضاوي واضح */
}

/* =========================================
   2. الإعدادات العامة (Reset & Globals)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif; /* تطبيق الخط على كل العناصر */
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    /* ترك مساحة علوية لكي لا يختفي المحتوى تحت الشريط العلوي العائم */
    padding-top: calc(var(--header-height) + 30px); 
    padding-bottom: 100px; /* مساحة للشريط السفلي لاحقاً */
}

/* =========================================
   3. تنسيق الشريط العلوي البيضاوي (Top Header)
   ========================================= */
.top-header {
    position: fixed;
    top: 15px; /* إبعاد الشريط عن الحافة العلوية قليلاً لجمالية التطبيق */
    left: 50%;
    transform: translateX(-50%);
    width: 92%; /* ليس 100% لكي يظهر الشكل البيضاوي المنفصل */
    height: var(--header-height);
    background: var(--gradient-brand);
    border-radius: var(--border-radius-oval);
    box-shadow: 0 5px 15px rgba(247, 37, 133, 0.3); /* ظل وردي خفيف */
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.2rem;
}

.logo img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #fff; /* خلفية بيضاء مؤقتة للشعار */
    object-fit: contain;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px 10px;
    outline: none;
    transition: transform 0.3s ease;
}

.menu-btn:active {
    transform: scale(0.9);
}






/* =========================================
   4. تنسيق القائمة الجانبية (Side Menu)
   ========================================= */

/* الغطاء المظلم خلف القائمة */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1001; /* يجب أن يكون أعلى من الشريط العلوي */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* حاوية القائمة الجانبية */
.side-menu {
    position: fixed;
    top: 0;
    right: -280px; /* مخفية خارج الشاشة من جهة اليمين */
    width: 260px;
    height: 100%;
    background-color: var(--bg-main);
    z-index: 1002; /* أعلى من الغطاء المظلم */
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    right: 0; /* عند التفعيل تنزلق للداخل */
}

/* رأس القائمة الجانبية */
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--gradient-brand);
    color: var(--text-light);
}

.menu-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

/* روابط القائمة وتأثيرات التمرير (Hover) */
.menu-links {
    list-style: none;
    padding: 15px 0;
}

.menu-links li a {
    display: block;
    padding: 15px 25px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(230, 57, 70, 0.08); /* خط فاصل خفيف بلون المتجر */
    transition: background 0.3s ease, padding-right 0.3s ease, color 0.3s ease;
}

.menu-links li a:hover {
    background-color: rgba(247, 37, 133, 0.05); /* خلفية وردية خفيفة جداً */
    padding-right: 35px; /* حركة انسيابية للنص لليسار عند التمرير */
    color: var(--primary-red);
}









/* =========================================
   5. تنسيق قسم الترحيب والسلايدر (Hero Slider)
   ========================================= */
.hero-section {
    padding: 0 20px;
    margin-top: 10px; /* مسافة بسيطة تحت الهيدر */
}

.slider-container {
    position: relative;
    width: 100%;
    height: 220px; /* ارتفاع مناسب لشاشات الجوال */
    border-radius: 20px; /* حواف دائرية تتناسب مع التصميم العام */
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); /* ظل ناعم */
}

/* تنسيق الشرائح وتأثير الانتقال الناعم */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out; /* انتقال ناعم بين الصور */
}

.slide.active {
    opacity: 1; /* إظهار الشريحة النشطة */
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* لضمان تغطية الصورة للمساحة بدون تشويه */
    filter: brightness(0.5); /* تعتيم الصورة بنسبة 50% ليبرز النص بوضوح */
}

/* تنسيق النص الترحيبي */
.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-light);
    width: 90%;
    z-index: 10; /* لضمان بقاء النص فوق الصور دائماً */
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* ظل لإبراز النص */
}

.hero-content p {
    font-size: 1rem;
    line-height: 1.5;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
















/* =========================================
   6. تنسيق بانر العروض الجديدة (Offers CTA Banner)
   ========================================= */
.offers-banner-section {
    padding: 20px;
    margin-top: 10px;
}

/* نجعل الرابط يغطي البانر بالكامل */
.offers-banner-link {
    text-decoration: none;
    display: block;
    -webkit-tap-highlight-color: transparent; /* إزالة المربع الأزرق عند الضغط في الجوال */
}

/* تصميم البانر باستخدام التدرج اللوني للمتجر */
.offers-banner-content {
    background: var(--gradient-brand);
    border-radius: 20px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 6px 15px rgba(247, 37, 133, 0.25); /* ظل وردي ناعم */
    transition: transform 0.2s ease;
}

/* حركة بسيطة عند الضغط على البانر ليعطي إحساس التطبيق */
.offers-banner-content:active {
    transform: scale(0.97);
}

.banner-text h3 {
    color: var(--text-light);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.banner-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

/* تصميم الزر الداخلي ليكون بارزاً */
.banner-btn {
    background-color: var(--bg-main);
    color: var(--primary-pink);
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: inline-block;
}












/* =========================================
   7. تنسيق الأقسام الرئيسية (Categories Grid)
   ========================================= */
.categories-section {
    padding: 20px;
    margin-top: 10px;
}

/* تنسيق عنوان القسم مع خط جمالي تحته */
.section-title {
    margin-bottom: 20px;
    text-align: right; /* محاذاة لليمين تناسب اللغة العربية */
}

.section-title h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-title h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 60%;
    height: 3px;
    background: var(--gradient-brand); /* استخدام تدرج ألوان المتجر */
    border-radius: 2px;
}

/* شبكة الأقسام (CSS Grid) المكونة من عمودين */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* توزيع المساحة بالتساوي على عمودين */
    gap: 15px; /* المسافة بين المربعات */
}

/* تنسيق المربع الفردي ليصبح قابلاً للضغط */
.category-card {
    position: relative;
    display: block;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* هذه الخاصية السحرية تجعل العنصر مربعاً تماماً */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* تأثير النقر ليعطي إحساس التطبيق الفعلي */
.category-card:active {
    transform: scale(0.96);
}

/* تنسيق الصورة داخل المربع */
.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* لضمان عدم تشوه الصورة مهما كان حجمها */
}

/* الغطاء المظلم المتدرج أسفل المربع ليوضح النص */
.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%; /* يغطي النصف السفلي فقط */
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 15px;
}

.category-overlay h4 {
    color: var(--text-light);
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    text-align: center;
}





/* =========================================
   8. تنسيق قسم ارفع منتجك (Upload Product)
   ========================================= */
.upload-product-section {
    padding: 20px;
}

.upload-box {
    background-color: #fff0f3; /* لون وردي فاتح جداً يتماشى مع هوية المتجر */
    border: 2px dashed var(--primary-pink); /* إطار متقطع مميز */
    border-radius: 20px;
    padding: 25px 20px;
    text-align: center;
}

.upload-info h3 {
    color: var(--primary-red);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-info p {
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.upload-btn {
    display: inline-block;
    background: var(--gradient-brand);
    color: var(--text-light);
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(247, 37, 133, 0.3);
    transition: transform 0.2s ease;
}

.upload-btn:active {
    transform: scale(0.95); /* تأثير الضغط */
}

/* =========================================
   9. تنسيق عن المتجر والتواصل (About & Contact)
   ========================================= */
.about-contact-section {
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* المسافة بين صندوق من نحن وصندوق التواصل */
}

.info-box {
    background-color: #ffffff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    text-align: right;
}

.info-box h3 {
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

/* خط جمالي قصير تحت العناوين */
.info-box h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--gradient-brand);
    border-radius: 2px;
}

.info-box p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 10px;
}

/* أزرار التواصل السريع */
.contact-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap; /* للسماح بنزول الأزرار لسطر جديد إن لزم الأمر */
}

.contact-item {
    background-color: #f8f9fa;
    color: var(--text-dark);
    padding: 8px 15px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #eee;
    transition: background 0.2s ease;
}

.contact-item:active {
    background-color: #e9ecef;
}







/* =========================================
   10. تنسيق تذييل الصفحة (Footer)
   ========================================= */
.site-footer {
    text-align: center;
    padding: 20px 20px 40px 20px; /* مسافة سفلية أكبر لكي لا يغطيه الشريط السفلي العائم */
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 80px; /* مساحة أمان إضافية للشريط السفلي */
}

/* =========================================
   11. تنسيق الشريط السفلي البيضاوي (Bottom Nav)
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 15px; /* ارتفاع بسيط عن الحافة السفلية لجمالية التطبيق */
    left: 50%;
    transform: translateX(-50%);
    width: 92%; /* نفس عرض الشريط العلوي للحفاظ على التناسق */
    height: 65px;
    background: var(--gradient-brand); /* التدرج الوردي والأحمر */
    border-radius: var(--border-radius-oval); /* شكل بيضاوي متطابق */
    box-shadow: 0 -5px 15px rgba(247, 37, 133, 0.3); /* ظل علوي خفيف */
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

/* تنسيق خانات الشريط السفلي */
.nav-item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6); /* لون أبيض شفاف للخانات غير النشطة */
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-item .icon {
    font-size: 1.3rem;
    margin-bottom: 3px;
    transition: transform 0.3s ease;
}

/* التأثير عند تفعيل الخانة أو الضغط عليها */
.nav-item.active,
.nav-item:active {
    color: var(--text-light); /* أبيض ناصع للخانة النشطة */
}

.nav-item.active .icon,
.nav-item:active .icon {
    transform: translateY(-4px); /* حركة لطيفة للأيقونة للأعلى */
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}






/* =========================================
   12. تنسيقات صفحة الكتالوج الشاملة (store.html)
   ========================================= */

/* تفعيل الانزلاق الناعم عند الضغط على الروابط التشعبية */
html {
    scroll-behavior: smooth;
}

/* تنسيق زر الرجوع في الشريط العلوي */
.back-btn {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    transition: background 0.3s ease;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.4);
}

/* تنسيق أقسام المنتجات */
.product-category-section {
    padding: 20px;
    /* مساحة علوية لكي لا يغطي الشريط العلوي عنوان القسم عند الانزلاق إليه */
    scroll-margin-top: calc(var(--header-height) + 25px); 
    border-bottom: 1px solid rgba(0,0,0,0.05); /* خط فاصل خفيف بين الأقسام */
}

.category-title {
    font-size: 1.4rem;
    color: var(--primary-red);
    margin-bottom: 15px;
    font-weight: 700;
}

/* شبكة المنتجات (منتجين في كل صف للجوال) */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* تصميم بطاقة المنتج */
.product-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-details {
    padding: 12px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* لملء المساحة المتبقية إذا اختلف طول الاسم */
    justify-content: space-between;
}

.product-details h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-details .price {
    color: var(--primary-pink);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

/* زر الشراء داخل البطاقة */
.add-to-cart-btn {
    background: var(--bg-main);
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
    padding: 6px 0;
    border-radius: 10px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-to-cart-btn:active {
    background: var(--gradient-brand);
    color: var(--text-light);
    border-color: transparent;
}




/* تنسيق الشرح التوضيحي للمنتج */
.product-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* يحدد النص بسطرين فقط لكي لا يطول الكارت، ويضع نقاط إذا زاد */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ضمان أن يبدو الرابط (زر الواتساب) كزر حقيقي */
.add-to-cart-btn {
    display: block; /* لجعله يأخذ العرض كامل */
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}





/* =========================================
   13. إشعار تثبيت التطبيق (PWA Install Prompt)
   ========================================= */
.install-prompt {
    position: fixed;
    bottom: -100px; /* مخفي أسفل الشاشة في البداية */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    background: var(--gradient-brand);
    color: var(--text-light);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 2000; /* يظهر فوق كل شيء */
    display: flex;
    transition: bottom 0.5s ease;
}

.install-prompt.show {
    bottom: 85px; /* يرتفع ليظهر فوق الشريط السفلي */
}

.install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.install-content p {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    flex-grow: 1;
}

#installBtn {
    background: var(--bg-main);
    color: var(--primary-pink);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
}

#closeInstallBtn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}






/* =========================================
   تعديل القائمة الجانبية (Side Menu Update)
   ========================================= */
.side-menu {
    /* تم تغيير الارتفاع ليكون بحجم المحتوى فقط وليس بطول الصفحة */
    height: auto !important; 
    min-height: fit-content;
    top: 95px !important; /* إنزالها تحت الشريط العلوي البيضاوي بقليل */
    border-bottom-left-radius: 20px;
    border-top-left-radius: 20px;
    padding-bottom: 15px;
}

/* =========================================
   14. تنسيق قسم طلب منتج خاص (Special Request)
   ========================================= */
.special-request-section {
    padding: 20px;
}

.special-box {
    background: linear-gradient(135deg, #ffffff, #fff0f3);
    border-right: 4px solid var(--primary-pink); /* خط جمالي على اليمين */
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.special-info h3 {
    color: var(--text-dark);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.special-info p {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* تنسيق أزرار الطلب الخاص */
.special-actions {
    display: flex;
    gap: 10px;
}

.special-btn {
    flex: 1; /* لجعل الأزرار متساوية العرض */
    text-align: center;
    padding: 10px 5px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.special-btn:active {
    transform: scale(0.95);
}

/* ألوان مخصصة للواتساب والانستقرام */
.wa-btn {
    background-color: #25D366;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.ig-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(220, 39, 67, 0.3);
}



