/* =========================================
   1. إعدادات أساسية وخطوط (Basic Setup)
   ========================================= */
   :root {
    --primary-color: #000000;
    --secondary-color: #F5F5F7;
    --accent-color: #1d1d1f;
    --text-color: #1d1d1f;
    --white: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    margin: 0;
    
    /* 🛡️ كود حماية الـ Notch وشريط الآيفون السفلي */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    
    /* خيار احتياطي للمتصفحات القديمة */
    padding-top: constant(safe-area-inset-top);
    padding-bottom: constant(safe-area-inset-bottom);
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 0;
}

/* =========================================
           1. الأساسيات (Desktop First)
           ========================================= */
           .main-header { 
            display: flex; 
            align-items: center; 
            justify-content: space-between; 
            
            /* ✅ حل مشكلة النوتش (Notch Safe Area) */
            padding-top: max(20px, env(safe-area-inset-top)); 
            padding-bottom: 15px;
            padding-left: max(30px, env(safe-area-inset-left));
            padding-right: max(30px, env(safe-area-inset-right));
            
            background: #fff; 
            border-bottom: 1px solid #eee; 
            position: sticky; 
            top: 0; 
            z-index: 1000; /* رفعنا الطبقة لتكون فوق كل شيء */
        }

       /* =============================================
           1. تنسيق الهيدر الموحد (Universal Header)
           ============================================= */
           .main-header { 
            display: flex; 
            align-items: center; 
            justify-content: space-between; 
            
            /* حماية النوتش + مسافات آمنة */
            padding-top: max(15px, env(safe-area-inset-top)); 
            padding-bottom: 15px;
            padding-left: max(15px, env(safe-area-inset-left));
            padding-right: max(15px, env(safe-area-inset-right));
            
            background: #fff; 
            border-bottom: 1px solid #eee; 
            position: sticky; 
            top: 0; 
            z-index: 1000;
            
            /* ⛔ الحل الجذري: منع النزول لسطر جديد نهائياً */
            flex-wrap: nowrap; 
            gap: 5px; /* مسافة صغيرة جداً بين اللوجو والأيقونات لتوفير مساحة */
        }

        /* =============================================
           2. تنسيق اللوجو الذكي (Responsive Logo)
           ============================================= */
        .logo a { 
            /* ✅ استخدام CLAMP: الخط يكبر ويصغر تلقائياً حسب عرض الشاشة */
            /* الحد الأدنى 0.9rem، المفضل 4% من الشاشة، الحد الأقصى 1.4rem */
            font-size: clamp(0.9rem, 4vw, 1.4rem); 
            
            font-weight: 800; 
            text-decoration: none; 
            color: #000; 
            letter-spacing: -0.5px;
            text-transform: uppercase;
            font-family: 'Inter', sans-serif;
            
            /* ضمان عدم تكسر الكلمة */
            display: flex; 
            align-items: center;
            white-space: nowrap; 
            flex-shrink: 0; /* ⛔ يمنع اللوجو من الانكماش والاختفاء */
        }

        /* تنسيق كلمة BETA */
        .beta-tag {
            /* حجم متغير أيضاً */
            font-size: clamp(0.45rem, 2vw, 0.6rem);
            color: #000;
            background: #fff;
            border: 1px solid #000;
            padding: 2px 5px;
            border-radius: 4px;
            margin-left: 5px;
            font-weight: 700;
            white-space: nowrap;
            display: inline-block;
            line-height: 1;
        }

        /* =============================================
           3. تنسيق الأيقونات (Icons Group)
           ============================================= */
        .header-icons {
            display: flex;
            align-items: center;
            /* مسافة متغيرة بين الأيقونات: تضيق في الشاشات الصغيرة وتوسع في الكبيرة */
            gap: clamp(5px, 2vw, 15px); 
            
            flex-shrink: 1; /* ✅ يسمح للأيقونات بالانضغاط قليلاً لتوسيع اللوجو */
        }

        .header-icons svg {
            /* حجم الأيقونات يصغر قليلاً في الموبايل */
            width: clamp(20px, 5vw, 24px); 
            height: clamp(20px, 5vw, 24px);
        }

        /* زر خاص للمستخدم لضمان عدم اختفائه */
        .icon-link {
            padding: 0;
            display: flex; /* لإزالة أي هوامش مخفية */
        }

.desktop-nav a {
    margin-right: 30px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.desktop-nav a:hover, nav a.active {
    color: var(--primary-color);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-link {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    position: relative;
    padding: 5px;
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s;
}
.icon-link:hover { opacity: 0.7; }

/* سلة المشتريات */
.cart-count {
    position: absolute;
    top: -2px;
    right: -5px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #fff;
}

/* ✅ كلاس إخفاء العربة */
.cart-count.hidden {
    display: none;
}

/* القائمة المنسدلة */
.user-dropdown { position: relative; }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 150%;
    background-color: #fff;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 10px;
    z-index: 10010;
    border: 1px solid #f0f0f0;
    text-align: left;
}

.dropdown-content.show { display: block; animation: fadeIn 0.2s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-link {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: background 0.2s;
    border-bottom: none;
}
.menu-link:hover { background-color: #f5f5f7; }

.mobile-links { display: none; }

/* =========================================
   3. القسم الرئيسي (Hero Section)
   ========================================= */
#hero {
    text-align: center;
    padding: 100px 20px 120px;
    background-color: var(--white);
}

#hero h1 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.1;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

/* الأزرار */
.cta-button {
    background-color: var(--primary-color);
    color: #fff;
    padding: 18px 45px;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.3s ease, background-color 0.3s;
    display: inline-block;
    min-width: 160px;
    text-align: center;
}

.cta-button:hover {
    background-color: #333;
    transform: translateY(-2px);
}

/* ✅ تنسيق مجموعة الأزرار الجديدة */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cta-button.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.cta-button.btn-outline:hover {
    background-color: var(--secondary-color);
    color: #000;
}

/* تحسين ظهور المرآة */
.hero-mirror {
    width: 300px;
    margin: 60px auto 0;
    background-color: #fff;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-mirror p {
    color: #000;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

.hero-black-box {
    width: 100%;
    padding-top: 100%;
    background-color: #000;
    border-radius: 12px;
}

/* =========================================
   4. قسم "كيف تعمل" (How it works)
   ========================================= */
#how-it-works {
    padding: 80px 5%;
    background-color: var(--secondary-color);
    text-align: center;
}

#how-it-works h2 {
    font-size: 2.5rem;
    margin-bottom: 60px;
}

.steps-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.step {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: 280px;
    text-align: left;
}

.step span {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--white);
    background-color: var(--primary-color);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    margin-bottom: 20px;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.step p {
    color: #666;
    font-size: 1rem;
}

/* =========================================
   5. صفحة الإنشاء (Creation Page)
   ========================================= */
.creation-page {
    padding: 60px 5%;
    background-color: var(--white);
}
.creation-page h1 { font-size: 3rem; text-align: center; margin-bottom: 10px; }
.creation-page p { text-align: center; color: #666; margin-bottom: 60px; }

.creation-container {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.design-form {
    flex: 1;
    min-width: 320px;
    background-color: #fff;
    padding: 0;
    box-shadow: none;
    border: none;
}

.design-form h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}
.design-form h3:first-child { margin-top: 0; }

.sentence-input {
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 12px;
}
.sentence-input input[type="text"] {
    font-family: inherit;
    font-size: 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid #ddd;
    padding: 10px 0;
    width: 100%;
}
.sentence-input input[type="text"]:focus {
    border-color: var(--primary-color);
}

.preview-area {
    flex: 0 0 350px;
    position: sticky;
    top: 100px;
}

/* ✅ تحسين قائمة الألوان (Grid) */
.color-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr)); 
    gap: 10px;
    margin-bottom: 20px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
}

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ddd; 
    transition: transform 0.2s;
}
.color-option:hover { transform: scale(1.1); border-color: #999; }
.color-option.selected { border: 3px solid #000; transform: scale(1.1); }

/* ✅ تنسيق خانة الرسالة الشخصية (Scrollable Input) */
textarea#personal-message {
    width: 100%;
    height: 150px;           /* ارتفاع ثابت */
    padding: 15px;
    font-size: 1rem;
    border-radius: 12px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    font-family: inherit;
    line-height: 1.5;
    
    resize: none;            /* منع التغيير اليدوي */
    overflow-y: auto;        /* سكرول داخلي */
    box-sizing: border-box;
}

textarea#personal-message:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
}

textarea#personal-message::-webkit-scrollbar { width: 8px; }
textarea#personal-message::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
textarea#personal-message::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

.options { margin: 20px 0; }

/* =========================================
   6. الأزرار العامة (Buttons)
   ========================================= */
.btn-primary, .btn-secondary, .btn-block {
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary, .btn-block {
    background-color: var(--primary-color);
    color: #fff;
}
.btn-primary:hover { background-color: #333; }

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}
.btn-secondary:hover { background-color: #e0e0e0; }

/* =========================================
   7. الفوتر (Footer)
   ========================================= */
.main-footer {
    background-color: var(--secondary-color);
    color: #333;
    padding: 60px 20px;
    margin-top: 60px;
    text-align: center;
}
.footer-links a {
    color: #333;
    font-weight: 500;
    margin: 0 15px;
}

/* =========================================
   8. الموبايل (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .main-header { padding: 15px 20px; }
    .logo a { font-size: 1.1rem; }
    #hero h1 { font-size: 2.5rem; }
    .desktop-nav { display: none; }
    .creation-container { flex-direction: column-reverse; }
    
    .preview-area { 
        width: 100%; 
        flex: 1; 
        position: static; 
        margin-bottom: 30px;
    }
    
    .dropdown-content {
        width: 260px;
        right: -50px; 
        top: 160%;
    }
    
    .mobile-links {
        display: block;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }
    
    .header-icons { gap: 15px; }
    
    .hero-actions { flex-direction: column; align-items: center; }
    .cta-button { width: 80%; }
    
    /* تعديل ارتفاع التكست اريا للموبايل */
    textarea#personal-message {
        height: 120px;
    }
}

/* =========================================
   تنسيقات اختيار لون النص (Text Color Picker)
   ========================================= */

   .text-color-option {
    width: 30px; /* أصغر قليلاً من الإطار */
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.text-color-option:hover {
    transform: scale(1.1);
}

/* علامة التحديد للون النص */
.text-color-option.selected {
    border: 2px solid #000;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff inset; /* تأثير حلقة مزدوجة */
}

/* =========================================
   تنسيقات صفحة الدفع الجديدة (Checkout New)
   ========================================= */

   .checkout-card-new {
    display: flex;
    gap: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    align-items: flex-start;
}

.preview-side {
    flex: 0 0 100px; /* حجم ثابت للصورة */
}

.preview-side .mini-mirror {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    min-height: 100px; /* منع الانكماش */
}

.preview-side .mini-black-box {
    width: 60px;
    height: 60px;
}

.info-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.info-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.price-tag {
    font-weight: bold;
    font-size: 1rem;
}

.info-row {
    font-size: 0.95rem;
}

.info-row .label {
    color: #888;
    margin-right: 5px;
}

.info-row .value {
    color: #333;
}

.info-row .note {
    font-style: italic;
    color: #666;
    display: block;
    margin-top: 5px;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* زر التعديل */
.btn-edit {
    display: inline-block;
    margin-top: 10px;
    color: #007bff; /* أزرق */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 5px 10px;
    border: 1px solid #007bff;
    border-radius: 20px;
    transition: all 0.2s;
}

.btn-edit:hover {
    background-color: #007bff;
    color: #fff;
}

/* موبايل */
@media (max-width: 600px) {
    .checkout-card-new {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .info-header {
        flex-direction: column;
        gap: 5px;
    }
    .info-row {
        text-align: left;
        width: 100%;
    }
}

/* =========================================
   4. تنسيقات صفحة البروفايل (Profile Page Styles)
   ========================================= */

   .profile-page {
    padding: 40px 5%;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 80vh; /* لضمان عدم صعود الفوتر */
}

/* --- معلومات المستخدم --- */
.user-info {
    text-align: center;
    margin-bottom: 40px;
}

.avatar-large {
    width: 90px;
    height: 90px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 auto 15px;
    border: 4px solid #f0f0f0; /* إطار خفيف حول الصورة */
}

/* --- التبويبات (Tabs) --- */
.profile-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: #000;
}

.tab-btn.active {
    color: #000;
    font-weight: 700;
    border-bottom: 3px solid #000;
}

/* --- شريط الفلتر (Filter Chips) --- */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center; /* توسيط الفلاتر */
}

.filter-chip {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: #555;
}

.filter-chip:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

.filter-chip.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* --- شبكة البطاقات (Grid & Cards) --- */
.mirrors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* إخفاء الأقسام غير النشطة وتفعيل النشطة */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}
.content-section.active {
    display: block;
}

/* تصميم البطاقة */
.mirror-card {
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.mirror-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* منطقة المرآة داخل البطاقة */
.mini-mirror {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #f0f0f0; /* لون افتراضي في حال عدم التحميل */
}

.mini-black-box {
    width: 80px;
    height: 80px;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

.card-details {
    padding: 15px;
    flex: 1; /* لضمان تناسق الطول */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-details h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #000;
    font-weight: 700;
}

/* شارات الحالة (Delivered / Processing) */
.status-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-block;
    margin-top: 5px;
    align-self: flex-start;
}

.status-pill.delivered { background: #e8f5e9; color: #2e7d32; } /* أخضر */
.status-pill.processing { background: #fff3e0; color: #ef6c00; } /* برتقالي */

/* أزرار الإجراءات داخل البطاقة (Edit/Pay) */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    border-top: 1px solid #f5f5f5;
    padding-top: 10px;
}

.btn-xs {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: 0.2s;
    font-weight: 500;
}

.btn-xs:hover { background: #f5f5f5; }

.btn-xs.primary {
    background: #000;
    color: #fff;
    border-color: #000;
}
.btn-xs.primary:hover { background: #333; }

/* رسائل التحميل والفراغ */
.loading-msg { text-align: center; color: #888; font-style: italic; padding: 20px; }
.empty-state { text-align: center; padding: 40px; color: #666; background: #f9f9f9; border-radius: 12px; border: 1px dashed #ddd; width: 100%; }

/* --- نافذة تعديل البروفايل (Edit Profile Modal) --- */
.modal-overlay {
    display: none; /* مخفي افتراضياً */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); /* خلفية معتمة */
    backdrop-filter: blur(3px); /* تأثير ضبابي */
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open {
    display: flex; /* إظهار عند التفعيل */
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-content h3 { margin-top: 0; margin-bottom: 20px; }

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.modal-content input:focus {
    outline: none;
    border-color: #000;
}

/* حركة الظهور */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   تنسيقات السلة المتعددة (Multi-Item Cart)
   ========================================= */

/* حاوية قائمة المنتجات في Checkout */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* بطاقة المنتج داخل السلة */
.cart-item {
    display: flex;
    gap: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    align-items: center;
    position: relative;
    transition: 0.2s;
}

/* تمييز العنصر غير المحدد للدفع (Hold) */
.cart-item.on-hold {
    opacity: 0.6;
    background-color: #f9f9f9;
    border-style: dashed;
}

.cart-item-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-details {
    flex: 1;
}

.cart-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.action-btn {
    font-size: 0.8rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #f0f0f0;
}
.action-btn.edit { color: #007bff; }
.action-btn.delete { color: #ff4757; }

/* Checkbox للتحديد */
.select-item-cb {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 10px;
}

/* ملخص السعر */
.cart-total-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
    border-top: 1px solid #eee;
    margin-top: 20px;
    border-radius: 12px;
}

/* =========================================
   تنسيقات صفحة Checkout الجديدة (Modern)
   ========================================= */

   .checkout-page {
    padding: 40px 5%;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 80vh;
}

.checkout-page h1 { margin-bottom: 30px; font-size: 2rem; }

.checkout-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* القسم الأيمن (المنتجات) */
.cart-section { flex: 2; }

.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkout-item {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s;
}

.checkout-item.item-hold {
    opacity: 0.6;
    background-color: #fafafa;
    border-style: dashed;
}

.item-checkbox { margin-right: 15px; display: flex; align-items: center; }
.select-item-cb { width: 20px; height: 20px; cursor: pointer; accent-color: #000; }

.item-preview { margin-right: 15px; }
.mini-mirror-thumb {
    width: 70px; height: 70px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.thumb-black-box { width: 40px; height: 40px; background: #000; border-radius: 4px; }

.item-info { flex: 1; }
.item-info h4 { margin: 0 0 5px; font-size: 1rem; color: #333; }
.status-text { font-size: 0.8rem; color: #888; margin: 0 0 8px; }

.item-actions { display: flex; gap: 8px; align-items: center; }
.link-btn {
    background: none; border: none; cursor: pointer;
    font-size: 0.85rem; color: #555; text-decoration: underline; padding: 0;
}
.link-btn:hover { color: #000; }
.link-btn.danger { color: #ff4757; }
.divider { color: #ddd; font-size: 0.8rem; }

.item-price { font-weight: 700; font-size: 1.1rem; }

/* القسم الأيسر (الملخص) */
.summary-section {
    flex: 1;
    min-width: 300px;
    position: sticky;
    top: 100px;
}

.summary-box {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #eee;
}

.summary-box h3 { margin-bottom: 20px; font-size: 1.2rem; }

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #555;
}

.summary-row.total {
    font-weight: 800;
    color: #000;
    font-size: 1.2rem;
    border-top: 2px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.guest-alert {
    background-color: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    border: 1px solid #ffeeba;
    text-align: center;
}
.guest-alert a { font-weight: bold; text-decoration: underline; color: #856404; }

.payment-methods {
    display: flex; gap: 15px; margin: 20px 0;
}
.payment-methods label {
    flex: 1;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}

.btn-lg { padding: 15px; font-size: 1rem; width: 100%; }
.secure-note { text-align: center; font-size: 0.8rem; color: #999; margin-top: 10px; }

.empty-cart {
    text-align: center;
    padding: 40px;
    border: 2px dashed #eee;
    border-radius: 12px;
}

/* الموبايل */
@media (max-width: 768px) {
    .checkout-container { flex-direction: column; }
    .summary-section { width: 100%; position: static; }
    .checkout-item { flex-wrap: wrap; text-align: center; justify-content: center; }
    .item-checkbox { margin-right: 0; margin-bottom: 10px; width: 100%; justify-content: center; }
    .item-preview { margin: 0 0 10px; }
    .item-info { width: 100%; margin-bottom: 10px; }
}

/* 🔥 حل نهائي لمشكلة النص الطويل في كل مكان 🔥 */
p, h1, h2, h3, h4, span, div, strong, .card-details, .info-side {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

/* إصلاح تباعد الأزرار في صفحة التصميم */
.options {
    margin-bottom: 20px; /* مسافة أسفل الـ Checkbox */
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 15px; /* مسافة بين الزرين */
    margin-top: 30px; /* مسافة فوق الأزرار */
}

/* تنسيق خيارات الإهداء */
.radio-card {
    flex: 1;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: 0.2s;
    background: #fff;
}

.radio-card.selected {
    border-color: #000;
    background-color: #f0f0f0;
    box-shadow: 0 0 0 1px #000;
}

/* =========================================
   تنسيقات نظام البحث (Search Overlay)
   ========================================= */
   .search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98); z-index: 2000;
    display: none; flex-direction: column; align-items: center; padding-top: 80px;
    animation: fadeIn 0.2s;
}
.search-overlay.active { display: flex; }

.search-header {
    width: 90%; max-width: 600px; position: relative;
}
.search-input {
    width: 100%; padding: 20px 50px 20px 20px; font-size: 1.5rem;
    border: none; border-bottom: 2px solid #000; background: transparent; outline: none;
}
.close-search {
    position: absolute; right: 0; top: 20px; font-size: 2rem; cursor: pointer; color: #666;
}

.search-results {
    width: 90%; max-width: 600px; margin-top: 30px; overflow-y: auto; max-height: 70vh;
}

.result-section h4 { color: #888; font-size: 0.9rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }

.result-item {
    display: flex; align-items: center; gap: 15px; padding: 15px;
    border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s;
}
.result-item:hover { background: #f9f9f9; }

.result-avatar {
    width: 40px; height: 40px; background: #000; color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold;
}
.result-info div { font-weight: 600; }
.result-info span { font-size: 0.85rem; color: #666; }

/* زر البحث في الهيدر */
.search-trigger { margin-right: 15px; cursor: pointer; }

/* =========================================
   تنسيقات أزرار البروفايل الجديدة
   ========================================= */
   .profile-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.btn-profile-action {
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 50px; /* شكل دائري (Pill Shape) */
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-profile-action:hover {
    background-color: #f5f5f5;
    border-color: #000;
}

/* زر Edit يكون مميزاً قليلاً */
.btn-profile-action.edit {
    background-color: #000;
    color: #fff;
    border-color: #000;
}
.btn-profile-action.edit:hover {
    background-color: #333;
}

/* تنسيق النافذة المنبثقة للتحرير */
.edit-section-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* --- Notifications Bell --- */
.notif-container { position: relative; }
.notif-badge {
    position: absolute; top: -5px; right: -5px; background: red; color: #fff;
    font-size: 0.6rem; width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.notif-dropdown {
    display: none; position: absolute; right: 0; top: 140%;
    background: #fff; border: 1px solid #eee; width: 300px;
    border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-height: 300px; overflow-y: auto; z-index: 1002;
}
.notif-dropdown.show { display: block; }
.notif-item {
    padding: 12px; border-bottom: 1px solid #f9f9f9; display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.notif-item:hover { background: #f5f5f5; }
.notif-item.unread { background: #f0f8ff; }
.notif-icon { font-size: 1.2rem; }

/* --- Follow Button in Profile --- */
.stats-bar { display: flex; gap: 20px; justify-content: center; margin: 10px 0; font-size: 0.9rem; }
.stat-box { text-align: center; }
.stat-num { font-weight: bold; font-size: 1.1rem; display: block; }

.btn-follow {
    background: #0095f6; color: #fff; border: none; padding: 8px 25px;
    border-radius: 6px; cursor: pointer; font-weight: 600;
}
.btn-follow.following { background: #fff; color: #333; border: 1px solid #ddd; }

/* =========================================
   🔔 NOTIFICATION SYSTEM (MODERN & SCROLLABLE)
   ========================================= */
   .notif-container { 
    position: relative; 
    display: flex; 
    align-items: center; 
}

.notif-btn {
    background: none; border: none; cursor: pointer; position: relative; padding: 5px;
}

.notif-badge {
    position: absolute; top: 0; right: 0;
    background-color: #ff3b30; color: #fff;
    font-size: 0.65rem; font-weight: bold;
    min-width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* القائمة المنسدلة المحدثة */
.notif-dropdown {
    display: none; 
    position: absolute; 
    top: 100%; 
    right: -10px;
    width: 320px; 
    background: #fff;
    border: 1px solid #eee; 
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    
    /* ✅ إصلاح التمرير والنقر */
    max-height: 450px; 
    overflow-y: auto; 
    overflow-x: hidden;
    
    /* ✅ إصلاح الطبقات */
    z-index: 999999 !important;
    
    /* ✅ إصلاح النقر - الأهم! */
    pointer-events: auto !important;
    
    margin-top: 15px;
    flex-direction: column;
}

/* ✅ تأكيد عند الظهور */
.notif-dropdown.show { 
    display: flex !important; 
    animation: fadeIn 0.2s;
    pointer-events: auto !important;
    z-index: 999999 !important;
}

.notif-dropdown.show { display: flex !important; animation: fadeIn 0.2s; }

.notif-header {
    padding: 15px; border-bottom: 1px solid #f0f0f0;
    font-weight: bold; font-size: 0.95rem; color: #333;
    position: sticky; top: 0; background: #fff; z-index: 10;
}

.notif-item {
    padding: 15px; 
    border-bottom: 1px solid #f9f9f9;
    display: flex; 
    gap: 12px; 
    align-items: start;
    
    /* ✅ إصلاح النقر */
    cursor: pointer !important;
    pointer-events: auto !important;
    
    transition: 0.2s;
    position: relative;
    z-index: 1;
}

.notif-item:hover { 
    background-color: #f9f9f9; 
}

.notif-item * {
    pointer-events: auto !important;
}

.notif-item:hover { background-color: #f9f9f9; }

/* تمييز غير المقروء بلون هادئ */
.notif-item.unread { background-color: #f0f7ff; } 
.notif-item.unread:hover { background-color: #e3f2fd; }

.notif-icon { font-size: 1.2rem; margin-top: 2px; }
.notif-content { font-size: 0.85rem; color: #555; line-height: 1.4; flex: 1; }
.notif-time { font-size: 0.7rem; color: #999; margin-top: 5px; display: block; }

/* زر شاهد الكل الأنيق */
.notif-see-all {
    display: block;
    text-align: center;
    padding: 15px;
    background: #fdfdfd;
    color: #7047EB; /* لون العلامة التجارية */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    border-top: 1px solid #eee;
    transition: 0.2s;
}
.notif-see-all:hover {
    background: #f0f0f0;
    color: #000;
}

/* 🛡️ ستارة الحماية لمنع "النقرات النافذة" */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999998; /* ✅ تحت الـ notification */
    pointer-events: none; /* ✅ لا يمنع النقر */
    -webkit-tap-highlight-color: transparent;
}

/* =========================================
   تنسيقات نافذة المتابعين (Network Modal)
   ========================================= */
   .network-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.network-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f9f9f9;
}

.network-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none; /* لإزالة الخط من الرابط */
    color: inherit;
    flex: 1; /* يأخذ المساحة المتبقية */
}

.net-avatar {
    width: 45px; height: 45px;
    background: #000; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1.1rem;
}

.net-details h4 { margin: 0; font-size: 0.95rem; }
.net-details span { font-size: 0.85rem; color: #666; display: block; }

.btn-follow-small {
    background: #f0f0f0; color: #000;
    border: 1px solid #ddd;
    padding: 6px 16px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.btn-follow-small:hover { background: #e0e0e0; }

/* جعل العدادات قابلة للضغط */
.stat-box { cursor: pointer; transition: 0.2s; padding: 5px 10px; border-radius: 8px; }
.stat-box:hover { background: #f5f5f5; }

/* =========================================
   تعديلات قائمة الموبايل (Mobile Menu)
   ========================================= */

/* الوضع الافتراضي (للكمبيوتر): إخفاء الروابط الإضافية داخل القائمة */
.mobile-only-links {
    display: none;
}

/* وضع الموبايل: إظهار الروابط وإخفاء النافبار العلوية */
@media (max-width: 768px) {
    /* إخفاء القائمة العلوية الأصلية */
    .desktop-nav {
        display: none;
    }

    /* إظهار الروابط داخل القائمة المنسدلة */
    .mobile-only-links {
        display: block;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 10px;
    }
    
    /* تنسيق الروابط لتبدو جميلة */
    .mobile-only-links a {
        display: block;
        padding: 10px 0;
        color: #333;
        font-weight: 500;
        font-size: 0.95rem;
    }
    .mobile-only-links a:hover {
        color: #000;
        padding-left: 5px; /* حركة بسيطة عند الضغط */
    }
}

/* =========================================
   1. Toast Notifications (بديل الـ alert)
   ========================================= */
   .toast-container {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}

.toast {
    background: #333; color: #fff; padding: 12px 24px; border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); font-size: 0.9rem;
    animation: slideUp 0.3s ease-out forwards; opacity: 0;
    display: flex; align-items: center; gap: 10px;
}
.toast.success { background: #000; border: 1px solid #333; }
.toast.error { background: #ff4757; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================
   2. Loading Spinner (بديل النص)
   ========================================= */
.spinner {
    width: 30px; height: 30px; border: 3px solid #f3f3f3;
    border-top: 3px solid #000; border-radius: 50%;
    animation: spin 1s linear infinite; margin: 20px auto; display: block;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   3. Comments Section Styling
   ========================================= */
.comments-section {
    margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee;
    width: 100%; max-width: 800px; /* لتقييد العرض */
}

.comment-form { display: flex; gap: 10px; margin-bottom: 30px; }
.comment-input {
    flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 25px;
    background: #f9f9f9; transition: 0.2s;
}
.comment-input:focus { background: #fff; border-color: #000; outline: none; }

.comment-item { display: flex; gap: 15px; margin-bottom: 20px; }
.comment-avatar {
    width: 40px; height: 40px; background: #eee; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold;
}
.comment-body { background: #f5f5f5; padding: 10px 15px; border-radius: 12px; border-top-left-radius: 2px; }
.comment-user { font-weight: bold; font-size: 0.9rem; display: block; margin-bottom: 2px; }
.comment-text { font-size: 0.95rem; color: #333; }
.comment-time { font-size: 0.7rem; color: #888; margin-top: 5px; display: block; }

.comment-user:hover { text-decoration: underline; color: #007aff; }

/* =========================================
   📱 Mobile Header Strategy (The "Two-Row" Layout)
   ========================================= */

   @media screen and (max-width: 768px) {
    
    /* 1. السماح للهايدر بالالتفاف (ليصبح سطرين) */
    .main-header {
        flex-wrap: wrap;
        padding: 10px 15px; /* تقليل الحواف للموبايل */
        gap: 10px; /* مسافة بسيطة بين العناصر */
    }

    /* 2. اللوجو يأخذ مكانه الطبيعي في اليسار */
    .logo {
        flex: 1; /* يأخذ المساحة المتاحة ليدفع الأيقونات لليمين */
    }

    /* 3. الأيقونات (Search, Cart, User) تظل في اليمين */
    .header-icons {
        flex: 0 0 auto; /* لا تنكمش */
    }

    /* 4. السحر هنا: جعل الروابط تنزل للسطر الثاني */
    .desktop-nav {
        order: 3; /* ترتيبها يصبح الثالث (بعد اللوجو والأيقونات) */
        width: 100%; /* تأخذ عرض الشاشة بالكامل */
        display: flex; /* إجبار الظهور */
        justify-content: space-around; /* توزيع الروابط بالتساوي */
        align-items: center;
        
        border-top: 1px solid #f0f0f0; /* خط فاصل خفيف وجميل */
        padding-top: 10px;
        margin-top: 5px;
        background: #fff; /* خلفية بيضاء لضمان الوضوح */
    }


    /* --- Search Overlay Styles --- */
.search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.98); z-index: 9999; /* رقم كبير لتظهر فوق كل شيء */
    display: none; flex-direction: column; padding-top: 80px;
}

/* الكلاس الذي يضيفه الجافاسكريبت لإظهار الشاشة */
.search-overlay.active {
    display: flex !important;
}

.search-header {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 600px; display: flex; align-items: center;
}

.search-input {
    width: 100%; padding: 15px 20px; font-size: 1.2rem; border: none;
    border-bottom: 2px solid #000; outline: none; background: transparent;
}

.close-search {
    font-size: 2.5rem; cursor: pointer; margin-left: 15px; line-height: 1;
}

.search-results {
    width: 100%; max-width: 600px; margin: 20px auto; 
    overflow-y: auto; max-height: 80vh;
}

    /* 5. تنسيق الروابط لتكون سهلة الضغط بالإصبع */
    .desktop-nav a {
        font-size: 0.95rem; /* حجم خط مناسب */
        padding: 8px 15px; /* مساحة للضغط */
        color: #555;
        font-weight: 600;
        border-radius: 8px; /* حواف ناعمة */
        background-color: #f9f9f9; /* خلفية خفيفة للزر */
    }

    /* تمييز زر Create ليكون واضحاً */
    .desktop-nav a[href="creation.html"] {
        background-color: #f3e8ff; /* خلفية بنفسجية باهتة */
        color: #7047EB !important; /* لون بنفسجي */
    }
}

/* =========================================
   🔔 TOAST NOTIFICATIONS (Alert Replacement)
   ========================================= */
   .toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999; /* فوق كل شيء */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* يسمح بالنقر خلاله */
}

.toast {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(-20px);
    animation: toastSlideIn 0.3s forwards;
    pointer-events: auto;
    min-width: 250px;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* أنواع الإشعارات */
.toast.success { border-bottom: 2px solid #2ecc71; }
.toast.error { border-bottom: 2px solid #e74c3c; }

/* أنيميشن الظهور */
@keyframes toastSlideIn {
    to { opacity: 1; transform: translateY(0); }
}

/* أنيميشن الاختفاء */
@keyframes toastFadeOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* ==========================================================
   🚨 EMERGENCY FIXES (توضع في نهاية ملف style.css)
   هذا الكود يصلح الهيدر والإشعارات دون لمس الكود الأصلي
   ========================================================== */

/* 1. إصلاح الهيدر في الموبايل و Z Fold */
@media screen and (max-width: 768px) {
    .main-header {
        flex-wrap: wrap !important; /* يسمح بنزول العناصر لسطر جديد */
        gap: 10px !important;
        padding: 10px !important;
    }

    .desktop-nav {
        order: 3 !important; /* يجبر الروابط لتكون في السطر الثاني */
        width: 100% !important;
        display: flex !important;
        justify-content: space-around !important;
        margin-top: 10px !important;
        border-top: 1px solid #f0f0f0 !important;
        padding-top: 10px !important;
    }

    /* تصغير الخط في الشاشات الضيقة جداً مثل Z Fold */
    .logo a {
        font-size: clamp(0.9rem, 4vw, 1.2rem) !important;
    }
}


/* ==========================================================
   ✅ إصلاح نهائي: منع الفتح بالمرور + السماح بالاستخدام
   ========================================================== */

/* 1. إلغاء تأثير الـ Hover الافتراضي (لكن بدون استخدام !important القاتلة) */
.notif-container:hover .notif-dropdown,
.user-dropdown:hover .dropdown-content {
    display: none; 
}

/* 2. السماح للقائمة بالظهور فقط عند النقر (عندما يضيف JS كلاس show) */
.notif-dropdown.show,
.dropdown-content.show {
    display: block !important;
    
    /* حيلة ذكية: إضافة مساحة شفافة وهمية لربط الأيقونة بالقائمة */
    /* هذا يمنع الماوس من "السقوط" في الفراغ بين الأيقونة والقائمة */
}

/* 3. إصلاح مشكلة اختفاء القائمة عند محاولة الضغط عليها */
.notif-dropdown.show:hover,
.dropdown-content.show:hover {
    display: block !important;
}

/* ✅ Backdrop للقوائم في الموبايل */
@media screen and (max-width: 768px) {
    /* Backdrop يظهر فقط عند فتح القائمة */
    .notif-dropdown.show::before,
    .dropdown-content.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: -1; /* ✅ تحت القائمة */
        pointer-events: none; /* ✅ لا يمنع النقر */
    }
}

/* تنسيق زر X داخل الإشعارات */
.close-notif-btn {
    font-size: 1.5rem;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: 0.2s;
    display: none; /* يظهر في الموبايل فقط أو حسب رغبتك */
}

.close-notif-btn:hover {
    color: #000;
}

/* جعل الهيدر يحتوي على العنوان وزر X */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

/* إظهار الزر في الشاشات الصغيرة */
@media (max-width: 768px) {
    .close-notif-btn {
        display: block;
    }
}