
/* ==========================================================================
   1. ROOT & GENERAL STYLES
   ========================================================================== */
:root {
    --pink: #e5a9b4;
    --blue: #a9d4e5;
    --beige: #e5dcd2;
    --off-white: #fff9f7;
    --text-color: #5d5d5d;
    --heading-color: #5d5d5d;
    --price-color: #e74c3c;
    --border-color: #EAE0D7;
    --z-back: -1;           /* للعناصر الخلفية */
    --z-normal: 1;          /* للعناصر العادية */
    --z-badge: 10;          /* للشارات والأيقونات الصغيرة */
    --z-sticky: 900;        /* للهيدر والأشرطة الثابتة */
    --z-dropdown: 1000;     /* للقوائم المنسدلة */
    
    /* عناصر التحكم الثابتة */
    --z-fixed-nav: 9999;    /* شريط الموبايل السفلي وزر الدردشة */
    
    /* الطبقات العليا (Overlays & Modals) */
    --z-overlay: 10000;     /* الخلفية المعتمة */
    --z-drawer: 10001;      /* السلة الجانبية وقوائم الفلتر */
    --z-modal: 10002;       /* نافذة المنتج وتسجيل الدخول */
    --z-modal-close: 10003; /* أزرار الإغلاق */
    
    /* الطبقات القصوى (Topmost) */
    --z-modal-top: 20000;   /* نافذة القياسات (تظهر فوق نافذة المنتج) */
    --z-fancybox: 1000000;  /* تكبير الصور (يجب أن يكون عالياً جداً) */
    --z-toast: 2147483647;  /* رسائل التنبيه (دائماً في القمة) */
}

/* --- Global reset for tap highlight --- */
a,
button,
.product-card,
.modal-thumbnails img {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* --- Animation Keyframes --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--off-white);
    color: var(--text-color);
    text-align: center;
    margin: 0;
    width: 100%;
    overflow-x: hidden;
}

body.modal-is-open,
body.offcanvas-is-open {
    overflow: hidden;
}

/* ==========================================================================
   2. NEW HEADER STYLES
   ========================================================================== */
.site-header-new {
    background-color: var(--off-white);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
  
}
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    
    /* ✨ الكود الجديد لجعل هذا السطر لزجاً (للموبايل) ✨ */
    position: sticky;
    top: var(--top-strip-height, 0px);
   z-index: var(--z-sticky);
    
    /* ✨ إضافة حركة ناعمة عند تغير الموقع (هذا السطر الجديد) ✨ */
    transition: top 0.3s ease-out; 

    /* ✨ يجب إضافة خلفية وإطار سفلي ليفصل عن المحتوى ✨ */
    background-color: var(--off-white);
    border-bottom: 1px solid var(--border-color);
    
    padding: 10px 15px;
    margin: -10px -15px 0 -15px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.header-right {
    justify-content: flex-end;

}

.header-left, .header-right {
    /* هذه الخاصية تمنع حاوية الأيقونات من الانكماش والتقلص */
    flex-shrink: 0;
}

.header-center {
    flex: 2;
    text-align: center;
}

.logo-link {
    display: inline-block;
}

.logo-img {
    max-height: 35vw;
    /* Control the logo size */
    width: auto;
}

.header-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-color);
    position: relative;
}

.header-icon-btn svg {
    width: 24px;
    height: 24px;
}

/* We need to reset the position of the cart container for the new layout */
.cart-container {
    position: static;
    transform: none;
}

/* ▼▼▼ الكود الجديد والمحسن لرقم السلة ▼▼▼ */
.cart-count {
    position: absolute;
    top: -5px;   /* غيرنا القيمة لتحريك الدائرة للأعلى */
    right: -5px;  /* غيرنا القيمة لتحريك الدائرة لليمين */
    background-color: var(--price-color);
    color: white;
    width: 18px;    /* قمنا بتصغير حجم الدائرة قليلاً */
    height: 18px;   /* قمنا بتصغير حجم الدائرة قليلاً */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem; /* صغرنا حجم الخط ليتناسب */
    font-weight: 700;
    border: 1px solid var(--off-white); /* قللنا سماكة الإطار */
}



.header-bottom-row {
    padding-top: 10px;
}

/* SEARCH BAR (already exists, minor changes) */
.search-container {
    margin: 0;
    max-width: none;
    padding: 0;
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    color: var(--text-color);
    background-color: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-sizing: border-box;
    margin-bottom: 0;
}

#search-input:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 6px 22px rgba(229, 169, 180, 0.4);
}

/* This main-nav is now just a container, hidden on mobile */
.main-nav {
    display: none;
}

/* ==========================================================================
   3. NEW NAVIGATION OFF-CANVAS MENU
   ========================================================================== */
.offcanvas-nav {
    position: fixed;
    top: 0;
    right: -100%;
    /* Start hidden */
    width: 100%;
    max-width: 320px;
    height: 100%;
    background-color: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}



.offcanvas-nav.is-open {
    right: 0;
}



.offcanvas-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.offcanvas-nav-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.offcanvas-nav-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Re-style the nav for INSIDE the offcanvas */
.offcanvas-nav-body .main-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 0;
    margin-bottom: 0;
}

.offcanvas-nav-body .nav-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.offcanvas-nav-body .main-category-button {
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: #A08C7D;
    padding: 12px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    box-sizing: border-box;
}

html[dir="rtl"] .offcanvas-nav-body .main-category-button {
    flex-direction: row-reverse;
}

.offcanvas-nav-body .main-category-button.active {
    background-color: var(--pink);
    color: #ffffff;
    border-color: var(--pink);
}

/* ▼▼▼ الكود الأساسي للحركة (مهم جداً لإخفاء القائمة) ▼▼▼ */
.offcanvas-nav-body .subcategory-list {
    max-height: 0;
    overflow: hidden;
    padding: 0 15px;
    margin: 0;
    list-style: none;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, margin-top 0.4s ease-in-out;
}

/* =========================================================
   ✨ التصميم الجديد والمحسن لمربع الفئات الفرعية عند الفتح ✨
   ========================================================= */
.offcanvas-nav-body .subcategory-list.is-open {
    max-height: 800px; /* لضمان استيعاب كل الفئات */
    padding: 12px; /* مسافة داخلية مريحة */
    margin-top: 8px; /* مسافة فاصلة عن الزر الرئيسي */
    background-color: #f8f9fa; /* لون خلفية رمادي فاتح جداً وجميل */
    border-radius: 16px; /* حواف دائرية ناعمة للمربع */
    border: 1px solid #eef0f2; /* إطار خارجي خفيف يحدد المربع */
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.02); /* ظل داخلي يعطي إحساس بالعمق */
}

/* تحسين شكل الروابط (الفئات) داخل هذا المربع */
.offcanvas-nav-body .subcategory-list a {
    display: block;
    font-size: 1rem !important; 
    padding: 10px 15px !important; /* تقليل الحشوة لتتناسب مع المربع الجديد */
    margin-bottom: 4px; /* مسافة بين كل فئة وأخرى */
    border-radius: 10px; /* حواف دائرية لكل زر فئة فرعية */
    background-color: #ffffff; /* خلفية بيضاء لكل فئة فرعية لتبرز فوق المربع الرمادي */
    border: 1px solid #f0f0f0;
    text-align: right;
    text-decoration: none;
    color: #555;
    transition: all 0.2s ease;
}

.offcanvas-nav-body .subcategory-list a:hover {
    background-color: #f5f5f5;
    transform: translateX(-3px); /* حركة بسيطة عند تمرير الماوس */
}

.offcanvas-nav-body .subcategory-list a.active {
    background-color: var(--blue) !important;
    color: white !important;
    border-color: var(--blue) !important;
}

.offcanvas-nav-body .subcategory-list a:last-child {
    margin-bottom: 0; /* إلغاء المسافة للزر الأخير لترتيب المربع */
}

/* ==========================================================================
   4. DESKTOP STYLES (MEDIA QUERIES)
   ========================================================================== */
@media (min-width: 992px) {
    .site-header-new {
        padding: 0 30px;
    }

  .header-top-row {
        display: grid;
        grid-template-columns: auto 1fr auto;
        /* Logo | Nav | Search+Icons */
        gap: 20px;
        height: 70px;
        
        /* ✨ إلغاء الكود اللزج الخاص بالموبايل ✨ */
        position: static;
        z-index: auto;
        background-color: transparent;
        border-bottom: none;
        padding: 0;
        margin: 0;
    }

    #menu-toggle-btn,
    .header-bottom-row {
        display: none;
        /* Hide hamburger and mobile search bar */
    }

    .header-left {
        justify-content: flex-start;
    }

    .header-center {
        text-align: left;
    }

    .header-right {
        justify-content: flex-end;
    }

    .logo-img {
        max-height: 45px;
    }

    /* Show and style main nav for desktop */
    .main-nav {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 0;
        gap: 10px;
        height: 100%;
    }

    .nav-row {
        display: flex;
        justify-content: center;
        gap: 10px;
        width: auto;
        max-width: none;
    }

    .main-category,
    .nav-row>.main-category-button {
        flex: 0 1 auto;
        position: relative;
    }

    .main-category-button {
        width: 100%;
        background-color: #fff;
        border: 1px solid var(--border-color);
        color: #A08C7D;
        padding: 8px 15px;
        border-radius: 12px;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        white-space: nowrap;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
        transition: all 0.25s ease-out;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        box-sizing: border-box;
    }

    .main-category-button:hover {
        border-color: #D6C6B9;
        color: #333;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
    }

    .main-category-button.active {
        background-color: var(--pink);
        color: #ffffff;
        border-color: var(--pink);
        box-shadow: 0 3px 12px rgba(229, 169, 180, 0.5);
        transform: translateY(0);
    }

    .subcategory-list {
        position: absolute;
        top: 115%;
        right: 0;
        background-color: white;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        padding: 8px;
        min-width: 100%;
        z-index: 100;
        border: 1px solid #f0f0f0;
        box-sizing: border-box;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        display: block !important;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    }

    .main-category:last-child .subcategory-list {
        right: auto;
        left: 0;
    }

    .subcategory-list.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
    }

    .subcategory-list a {
        display: block;
        padding: 10px 15px;
        text-decoration: none;
        color: #555;
        border-radius: 8px;
        text-align: right;
        font-size: 0.9rem;
        white-space: nowrap;
        transition: background-color 0.2s ease;
    }

    .subcategory-list a:hover {
        background-color: #f5f5f5;
    }

    .subcategory-list a.active {
        background-color: var(--blue);
        color: white;
    }

    .header-right {
        display: flex;
        align-items: center;
    }

    .search-container {
        display: block;
        width: 200px;
        margin: 0 15px 0 0;
    }

    html[dir="rtl"] .search-container {
        margin: 0 0 0 15px;
    }

    #search-input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}


/* ==========================================================================
   5. PRODUCT GRID & CARDS
   ========================================================================== */
/* ▼▼▼ الكود الجديد ▼▼▼ */
/* ✅ استبدله بهذا الكود الجديد */
.toolbar {
    max-width: 1200px;
    margin: 20px auto 25px auto;
    padding: 0 20px;
    display: flex; /* <-- يجعل العناصر متجاورة */
    gap: 10px; /* <-- يضيف مسافة بين العناصر */
    align-items: center; /* <-- يضمن محاذاة عمودية متناسقة */
}

/* هذا السطر الإضافي يجعل الزر والقائمة يأخذان نفس العرض */
.toolbar > * {
    flex: 1;
}

html[dir="rtl"] .toolbar {
    justify-content: flex-end;
}

#sort-select {
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s;
}

#sort-select:focus {
    outline: none;
    border-color: var(--pink);
}

#loading-indicator {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #999;
    width: 100%;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60vh;
}
.product-grid.is-empty {
    display: flex;
    justify-content: center; /* للتوسيط الأفقي */
    align-items: center;    /* للتوسيط العمودي */

    /* قم بإلغاء إعدادات الـ grid حتى لا تتعارض */
    grid-template-columns: none;
    gap: 0;
}

/* تصميم الرسالة نفسها (بدون الحاجة لـ padding) */
.no-products-message {
    color: #888;
    font-size: 1.1rem;
}


/* ==========================================================================
   6. MODAL STYLES
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.offcanvas .close-btn {
    z-index: 10002;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    overflow: hidden;
    position: relative;
}

.modal-body {
    width: 100%;
    display: flex;
    gap: 30px;
    padding: 30px;
    padding-top: 60px;
    box-sizing: border-box;
    overflow-y: auto;
    position: relative;
}

.modal-close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    text-shadow: 0px 1px 3px rgba(255, 255, 255, 0.9), 0px 0px 5px rgba(255, 255, 255, 0.9);
}

.modal-close-button:hover {
    background: transparent;
    color: #000;
    transform: scale(1.1);
}

.modal-gallery {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.swiper-container.modal-swiper {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 5px;
}

.modal-thumbnails img {
    width: 70px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.modal-thumbnails img:hover {
    opacity: 1;
    border-color: var(--beige);
}

.modal-thumbnails img.active {
    opacity: 1;
    border-color: var(--pink);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.modal-details h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: var(--heading-color);
}

#modal-product-code {
    font-size: 1rem;
    color: #777;
    margin: 0 0 10px 0;
}

/* هذا هو الكود الجديد الصحيح */
#modal-product-price {
    /* تم نقل خصائص اللون والحجم إلى التصميم الجديد في نهاية الملف */
    margin: 0 0 20px 0;
}

.modal-details h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #34495e;
    margin: 15px 0 8px 0;
    padding-bottom: 5px;
   
}

.modal-details p {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin: 0 0 10px 0;
}

.modal-buttons-container {
    margin-top: auto;
    /* Pushes button to the bottom */
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.secondary-back-button {
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    transition: background-color 0.2s ease;
}

.secondary-back-button:hover {
    background-color: #e0e0e0;
}

/* ==========================================================================
   7. THEME COLORS
   ========================================================================== */
body.newborn-theme {
    --pink: #d1e7dd;
    --heading-color: #5E7C5A;
}

body.girls-theme {
    --pink: #e5a9b4;
    --heading-color: #C97B8B;
}

body.boys-theme {
    --pink: #a9d4e5;
    --heading-color: #5D8A9E;
}

body.accessories-theme {
    --pink: #d1c4e9;
    --heading-color: #673ab7;
}

body.shoes-theme {
    --pink: #d3d3d3;
    --heading-color: #5a5a5a;
}

body.seasonal-theme {
    --pink: #c8e6c9;
    --heading-color: #4A7A4C;
}

body.sales-theme {
    --pink: #f8cbad;
    --heading-color: #b5651d;
}

/* ==========================================================================
   8. RESPONSIVE DESIGN (FOR MODAL)
   ========================================================================== */
@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
        padding: 15px;
        padding-top: 50px;
    }

    .modal-close-button {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .modal-details h2 {
        font-size: 24px;
    }

    #modal-product-price {
        font-size: 1.8rem;
    }

    .modal-thumbnails {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.site-footer {
     position: relative; /* <-- أضف هذا السطر */
    z-index: 500;       /* <-- أضف هذا السطر */
    background-color: #F9F9F9;
    color: #555;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    padding: 2rem 1rem 0.01rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: #000;
    text-decoration: underline;
}

.footer-copyright p {
    margin: 0;
    text-align: center;
    direction: ltr;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* ==========================================================================
   10. SHOPPING CART & MODAL ACTIONS
   ========================================================================== */

.modal-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.options-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: flex-start;
    text-align: right;
    flex-wrap: wrap;
    align-items: flex-end;
}

.option-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
    flex-basis: 120px;
    min-width: 120px;
}

.option-group label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.size-select,
.quantity-input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fcfcfc;
    transition: border-color 0.2s ease;
}

.size-select:focus,
.quantity-input:focus {
    outline: none;
    border-color: var(--pink);
}

#add-to-cart-button {
    background-color: #f08e9a;
    color: white;
    padding: 14px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.7);
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
}

#add-to-cart-button:hover {
    background-color: #e07a89;
    box-shadow: 0 7px 20px rgba(229, 169, 180, 0.9);
    transform: translateY(-3px);
}

#add-to-cart-button:active {
    background-color: #d16a78;
    box-shadow: 0 3px 10px rgba(229, 169, 180, 0.6);
    transform: translateY(-1px);
}

/* --- Off-Canvas Cart Panel --- */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.offcanvas-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.offcanvas {
    position: fixed;
    top: 0;
    right: -100%; /* أو left حسب التوجيه */
    width: 100%;
    max-width: 380px;
    height: 100%;
    background-color: white;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    padding-bottom: 0 !important;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* ✨ التعديلات الجديدة للسكرول ✨ */
    display: block;       /* إلغاء flex */
    overflow-y: auto;     /* السماح بالسكرول للقائمة كاملة */
    -webkit-overflow-scrolling: touch; /* سكرول ناعم للايفون */
}

html[dir="rtl"] .offcanvas {
    right: auto;
    left: -100%;
    transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.offcanvas.is-open {
    right: 0;
}

html[dir="rtl"] .offcanvas.is-open {
    left: 0;
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    
    /* ✨ تثبيت الرأس ✨ */
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
}

.offcanvas-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--heading-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

.offcanvas-body {
    padding: 20px;
    /* ✨ إلغاء السكرول الداخلي ✨ */
    overflow-y: visible; 
    height: auto;
    flex-grow: 0;
}

.empty-cart-message {
    text-align: center;
    margin-top: 50px;
    color: #888;
}



.cart-item:last-child {
    border-bottom: none;
}





.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.cart-item-details .price {
    color: var(--price-color);
    font-weight: 700;
    margin: 5px 0;
}

.cart-item-info {
    font-size: 0.9rem;
    color: #777;
}





.offcanvas-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
    /* لا نحتاج لتثبيته، سيظهر عند النزول لأسفل */
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1rem;
}

.cart-total span:first-child {
    color: #555;
}

.cart-total span:last-child {
    font-weight: 700;
}

.final-total {
    font-size: 1.2rem;
    font-weight: bold;
}

.checkout-button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background-color: #f08e9a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.7);
}

.checkout-button:hover:not(:disabled) {
    background-color: #e07a89;
    box-shadow: 0 7px 20px rgba(229, 169, 180, 0.9);
    transform: translateY(-2px);
}

.checkout-button:active:not(:disabled) {
    background-color: #d16a78;
    box-shadow: 0 3px 10px rgba(229, 169, 180, 0.6);
    transform: translateY(-1px);
}

.checkout-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   11. TOAST NOTIFICATION STYLES
   ========================================================================== */

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 16px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    z-index: 3000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: bottom 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.toast.show {
    bottom: 30px;
}

/* ==========================================================================
   12. GOVERNORATE SELECTOR STYLES
   ========================================================================== */
#governorate-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    background-color: #fff;
    margin-top: 15px;
}

/* ==========================================================================
   13. QUANTITY STEPPER
   ========================================================================== */
.quantity-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    width: 130px;
    background-color: #fff;
}

.quantity-stepper .quantity-input {
    width: 100%;
    text-align: center;
    border: none;
    background: transparent;
    font-weight: 700;
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-stepper .quantity-input::-webkit-outer-spin-button,
.quantity-stepper .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-btn {
    background-color: #f9f9f9;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    padding: 5px 15px;
    transition: background-color 0.2s ease;
}

.quantity-btn:hover {
    background-color: #f1f1f1;
}

/* ==========================================================================
   14. CUSTOM SCROLLBAR FOR CART
   ========================================================================== */

.offcanvas-body::-webkit-scrollbar {
    width: 8px;
}

.offcanvas-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.offcanvas-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.offcanvas-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}



/* ==========================================================================
   TOGGLE LANGUAGE SWITCHER STYLES
   ========================================================================== */
.lang-switcher-new {
    margin-right: 5px;
}

#lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #f0f0f0;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 6px 12px;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

#lang-toggle-btn:hover {
    background-color: #e9e9e9;
    border-color: #ddd;
}

#lang-toggle-btn .flag-icon {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    object-fit: cover;
}

/* نقل أيقونة القائمة لليمين في اللغات العربية والكردية */
html[dir="rtl"] .site-header-new .header-top-row {
    flex-direction: row-reverse;
}



/* ==========================================================================
   16. WISHLIST STYLES
   ========================================================================== */

/* --- Wishlist Button on Product Card --- */


.wishlist-btn:hover {
    transform: scale(1.1);
}

.wishlist-btn svg {
    width: 20px;
    height: 20px;
    stroke: #555;
    stroke-width: 2;
    fill: none;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

/* Style for when the item is in the wishlist */
.wishlist-btn.is-active svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* --- Wishlist Off-canvas --- */
/* We can reuse many styles from the cart offcanvas */
#wishlist-items .cart-item {
    position: relative;
    padding-right: 40px; /* Space for the remove button */
}

#wishlist-items .remove-item-btn {
    position: absolute;
    top: 20px;
    right: 0;
    text-decoration: none;
    font-size: 1.5rem;
    padding: 0 10px;
}

#wishlist-items .cart-item-actions {
    margin-top: 10px;
    justify-content: flex-end;
}

.view-product-btn {
    background-color: var(--pink);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.view-product-btn:hover {
    background-color: #d698a4;
}

.checkout-button.secondary {
    background-color: #f0f0f0;
    color: #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.checkout-button.secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   17. ADVANCED FILTERS & MAIN CONTENT LAYOUT
   ========================================================================== */

/* --- التنسيق الأساسي (للموبايل) --- */

.main-content-wrapper {
    padding: 0 20px;
}

.filters-sidebar {
    background-color: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 320px;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    right: -100%;
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
}

.filters-sidebar.is-open {
    right: 0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.filters-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.filters-header .close-btn {
    position: static;
    font-size: 2rem;
    padding: 0;
}

.filter-group {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.filter-group:last-of-type {
    border-bottom: none;
}

.filter-group h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    text-align: right;
}

#price-filter-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

#price-filter-inputs input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    -moz-appearance: textfield;
}
#price-filter-inputs input::-webkit-outer-spin-button,
#price-filter-inputs input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filter-options span {
    display: block;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: #fff;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.filter-options label:hover span {
    border-color: var(--blue);
    background-color: #eef7ff;
}

.filter-options input[type="checkbox"]:checked + span {
    background-color: var(--pink);
    color: white;
    border-color: var(--pink);
}

.filter-options input[type="checkbox"] {
    display: none;
}

.filter-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.apply-filters-btn, .clear-filters-btn {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.apply-filters-btn {
    background-color: #f08e9a;
    color: white;
}
.apply-filters-btn:hover {
    background-color: #e07a89;
}

.clear-filters-btn {
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
}
.clear-filters-btn:hover {
    background-color: #e0e0e0;
}


/* --- تنسيق شاشات الحاسوب والأجهزة اللوحية --- */
@media (min-width: 768px) {
    .main-content-wrapper {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        max-width: 1200px;
        margin: 0 auto;
        gap: 20px;
    }

    .filters-sidebar {
        position: sticky;
        top: 90px;
        width: 250px;
        height: auto;
        max-width: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
        border-radius: 15px;
        z-index: 1;
        transition: none;
    }

    .product-grid {
        flex: 1;
    }
}

/* ==========================================================================
   18. MOBILE FILTERS BUTTON & BEHAVIOR
   ========================================================================== */

.open-filters-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    background-color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
    display: block; /* يظهر على الموبايل */
}
.open-filters-btn:hover {
    background-color: #f5f5f5;
    border-color: var(--pink);
}




/* ==========================================================================
   19. PRODUCT REVIEWS STYLES (Mobile Fixed & Pro)
   ========================================================================== */

/* 1. الحاوية الرئيسية للقسم */
.reviews-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    text-align: right;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
}

/* زر العنوان (Accordion) */
.reviews-accordion-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 10px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f9f9f9;
    margin-bottom: 5px;
}

.reviews-header-info h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--heading-color);
}

/* الملخص (النجوم) */
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* يسمح بالالتفاف للموبايل */
}

/* القائمة المخفية للتقييمات (مع إصلاح السكرول) */
.reviews-list-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.reviews-list-container.is-open {
    max-height: 400px; /* ارتفاع مناسب */
    overflow-y: auto;  /* تفعيل السكرول العمودي */
    padding-bottom: 15px;
    
    /* تنسيق السكرول */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* تنسيق السكرول لمتصفح كروم */
.reviews-list-container::-webkit-scrollbar {
    width: 6px;
}
.reviews-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.reviews-list-container::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 10px;
}

/* 2. كارت التقييم الواحد */
.review-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
    overflow: hidden; /* يمنع أي تمدد خارجي */
}

.review-item:last-child {
    border-bottom: none;
}

/* --- أ) صورة الزبون --- */
.review-user-avatar {
    flex-shrink: 0; /* يمنع الصورة من الانكماش */
}

.review-user-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* --- ب) المحتوى --- */
.review-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* 👈👈 هام جداً: يمنع النص من دفع الحاوية خارج الشاشة */
}

/* الهيدر: الاسم والنجوم */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 👈 يسمح للعناصر بالنزول سطر جديد في الشاشات الصغيرة */
    gap: 5px;
    margin-bottom: 6px;
}

.review-author {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3436;
    margin: 0;
    /* التعامل مع الأسماء الطويلة جداً */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* النجوم */
.review-header .stars-wrapper {
    display: flex;
    gap: 2px;
}

/* التاريخ */
.review-date {
    font-size: 0.75rem;
    color: #aaa;
    font-weight: 500;
    white-space: nowrap;
}

/* --- ج) نص التقييم --- */
.review-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    margin: 5px 0 10px 0;
    white-space: pre-wrap; /* يحافظ على الأسطر الجديدة */
    word-wrap: break-word; /* 👈 يكسر الكلمات الطويلة جداً */
    background-color: #fcfcfc;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f5f5f5;
}

/* --- د) الصور المرفقة --- */
.review-images-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.review-images-gallery a {
    display: block;
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.review-images-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- هـ) تحسينات خاصة للموبايل --- */
@media (max-width: 480px) {
    .reviews-section {
        padding: 15px;
    }
    
    .review-item {
        gap: 10px;
        padding: 15px 0;
    }
    
    .review-user-avatar img {
        width: 40px; /* تصغير الصورة قليلاً */
        height: 40px;
    }
    
    .review-header {
        align-items: flex-start; /* محاذاة للأعلى */
    }
    
    .review-images-gallery a {
        width: 60px;
        height: 60px;
    }
}
/* ==========================================================================
   20. RELATED PRODUCTS STYLES
   ========================================================================== */

.related-products-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
     overflow: hidden;
}

.related-products-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #34495e;
}



/* بطاقة المنتج المصغرة */
.related-product-card {
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.related-product-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.related-product-card img {
    width: 100%;
    height: 120px; /* ارتفاع ثابت للصورة */
    object-fit: cover;
    display: block;
}

.related-product-info {
    padding: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-product-info h5 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-product-info p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--price-color);
}



/* ==========================================================================
   21. COUPON CODE STYLES
   ========================================================================== */

.coupon-section {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

#coupon-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
}

#apply-coupon-btn {
    border: none;
    background-color: #5d5d5d;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

#apply-coupon-btn:hover {
    background-color: #333;
}

#discount-total-container {
    color: #27ae60; /* Green color for discount */
    font-weight: bold;
}

.coupon-feedback {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: -10px;
    margin-bottom: 10px;
    text-align: right;
}

.coupon-feedback.success {
    color: #27ae60;
}

.coupon-feedback.error {
    color: #e74c3c;
}

/* --- أنماط حالة المخزون --- */
.stock-status {
    font-size: 1rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
    margin-top: 10px;
    display: inline-block; /* لجعل الخلفية تلتف حول النص فقط */
}

.stock-status.in-stock {
    color: #27ae60;
    background-color: #eaf8f0;
}

.stock-status.low-stock {
    color: #d35400;
    background-color: #fff4e6;
}

.stock-status.out-of-stock {
    color: #c0392b;
    background-color: #fbebed;
}

/* تغيير شكل زر الإضافة للسلة عند تعطيله */
#add-to-cart-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   22. MODAL BUTTONS STYLING
   ========================================================================== */

.modal-buttons-container {
  display: flex; /* أهم خاصية: لجعل العناصر مرنة ومتجاوبة */
  gap: 10px; /* مسافة جميلة بين الأزرار */
  margin-top: 25px;
}

/* تصميم موحد لكل الأزرار داخل الحاوية */
.modal-buttons-container .order-button,
.modal-buttons-container .notify-btn,
.modal-buttons-container .back-button {
  flex: 1; /* ✨ السر هنا: يجعل كل الأزرار تأخذ نفس العرض */
  padding: 14px 10px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin: 0; /* إلغاء أي هوامش قديمة */
}

/* تصميم زر "أضف للسلة" */
.modal-buttons-container .order-button {
  background-color: #f08e9a;
  color: white;
  box-shadow: 0 5px 15px rgba(229, 169, 180, 0.6);
}
.modal-buttons-container .order-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(229, 169, 180, 0.8);
}

/* تصميم زر "أعلمني عند التوفر" */
.modal-buttons-container .notify-btn {
  background-color: #3498db;
  color: white;
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.5);
}
.modal-buttons-container .notify-btn:hover {
  background-color: #2980b9;
  box-shadow: 0 7px 20px rgba(52, 152, 219, 0.7);
}

/* تصميم زر "رجوع" */
.modal-buttons-container .back-button {
  background-color: #f0f0f0;
  color: #555;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.modal-buttons-container .back-button:hover {
    background-color: #e0e0e0;
}

/* --- أنماط نافذة "أعلمني عند التوفر" --- */
#notify-modal {
    z-index: 2010; /* للتأكد من أنها تظهر في الطبقة العليا */
}

.form-error-message {
    color: #e74c3c; /* لون أحمر للخطأ */
    font-size: 0.9rem;
    text-align: right;
    margin-top: 5px;
    display: none; /* تكون مخفية بشكل افتراضي */
}

/* ==========================================================================
   23. IMPROVED NOTIFY ME MODAL STYLING
   ========================================================================== */

/* نستهدف النافذة الجديدة باستخدام الـ ID الخاص بها لضمان تطبيق التصميم */
#notify-modal .auth-modal-content {
    background-color: white; /* ✨ خلفية بيضاء صلبة */
    border-radius: 16px; /* حواف دائرية أكثر نعومة */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); /* ظل لإعطاء عمق */
    padding: 25px 30px; /* مساحة داخلية مريحة */
    width: 100%;
    max-width: 380px; /* تحديد عرض مناسب للنافذة */
    text-align: center; /* توسيط كل النصوص والأزرار */
    border: 1px solid #f0f0f0; /* إطار خفيف جداً */
}

/* تحسين شكل العنوان (اسم المنتج) */
#notify-modal h3 {
    font-size: 1.3rem;
    color: #333; /* لون أغمق للوضوح */
    margin-top: 0;
    margin-bottom: 8px;
}

/* تحسين النص التوضيحي */
#notify-modal p {
    color: #666;
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* توسيط النص داخل حقل الإدخال */
#notify-modal .form-group input {
    text-align: center;
    font-size: 1.1rem;
    padding: 12px;
}

/* التأكد من أن الزر يأخذ كامل العرض */
#notify-modal .auth-submit-btn {
    width: 100%;
    margin-top: 10px;
}

/* ✨ لإزالة الإطار الملون الذي يظهر حول الزر عند الضغط عليه */
#notify-modal .auth-submit-btn:focus,
#notify-modal .auth-submit-btn:active {
    outline: none;
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.7);

}

    /* ==========================================================================
   24. ADD REVIEW FORM STYLING
   ========================================================================== */

.review-form-stars {
    text-align: right;
    margin-bottom: 15px;
}

.review-form-stars span {
    font-size: 2.2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0 2px;
}

/* تغيير لون النجوم عند مرور الماوس عليها */
.review-form-stars:hover span {
    color: #f8b825;
}
.review-form-stars span:hover ~ span {
    color: #ccc;
}

/* لون النجوم التي تم اختيارها */
.review-form-stars.selected span {
    color: #f8b825;
}
.review-form-stars.selected span.unselected {
    color: #ccc;
}

#review-comment-textarea {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: #fcfcfc;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    text-align: right;
    margin-top: 5px;
}

#review-comment-textarea:focus {
    outline: none;
    border-color: var(--pink);
}



/* --- تصميم الأسعار والخصم (تحديث أفقي) --- */
.new-price-wrapper {
    display: flex;
    flex-direction: row; /* ✅ جعل العناصر أفقية (جنباً إلى جنب) */
    align-items: center; /* توسيط العناصر عمودياً */
    gap: 12px; /* مسافة مريحة بين السعر والشارة */
    margin-bottom: 20px; /* مسافة أسفل القسم بالكامل */
    flex-wrap: wrap; /* لضمان عدم تداخل العناصر في الشاشات الضيقة جداً */
}

.discount-badge-new {
    background-color: #e74c3c;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0; /* ✅ إلغاء الهامش السفلي لأنه لم يعد ضرورياً */
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.2);
    
    /* ✨ حيلة ترتيب (اختياري): إذا أردت الشارة على يسار السعر */
    order: 2; 
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 8px;
    
    /* ✨ حيلة ترتيب: لضمان أن السعر يظهر أولاً على اليمين */
    order: 1; 
}

.sale-price {
    font-size: 2.2rem; /* تكبير السعر قليلاً للوضوح */
    font-weight: 800;
    color: #c0392b;
    line-height: 1;
}

.old-price {
    font-size: 1.4rem;
    color: #95a5a6;
    font-weight: 400;
    text-decoration: line-through;
}


/* --- كود نهائي ونظيف لتصميم بطاقة المنتج في السلة --- */


.cart-item:last-child {
    border-bottom: none;
}

/* صورة المنتج */
.cart-item-img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* لمنع الصورة من الانكماش */
}

/* حاوية التفاصيل (الاسم، السعر، الأزرار) */

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}
.cart-item-info {
    font-size: 0.9rem;
    color: #777;
}




/**********************************************/
/* --- الكود الحاسم لحل مشكلة ترتيب الأزرار --- */
/**********************************************/


.cart-quantity .quantity-input {
    text-align: center;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0;
    flex-grow: 1;
}



/* =============================================== */
/* ✨ تعديلات على شاشة التحقق من الرقم ✨ */
/* =============================================== */



/* =============================================== */
/* ✨ التنسيق النهائي لشاشة التحقق من الرقم ✨ */
/* =============================================== */

/* النص الإرشادي (أدخل الرمز...) */
#verify-form .verify-instructions {
    font-size: 1.1rem !important; /* حجم خط مناسب للنص */
    line-height: 1.6 !important;
    text-align: center !important;
    margin-bottom: 5px !important; /* لتقريبه من الرقم */
    color: #666 !important;
}

/* رقم الهاتف نفسه */
#verify-phone-number-display {
    display: block;
    font-size: 1.7rem; /* حجم خط كبير وواضح للرقم */
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* ================================================= */
/* ✨ الحل النهائي لمسافة شاشة التحقق ✨ */
/* ================================================= */

/* 1. إلغاء المسافة السفلية للنص الإرشادي تماماً */
#verify-form .verify-instructions {
    margin-bottom: 0 !important;
}

/* 2. التحكم بالمسافة العلوية للرقم مباشرةً */
#verify-phone-number-display {
    margin-top: 8px !important; /* يمكنك تغيير هذه القيمة إلى 5px لتقريبها أكثر */
}

/* ================================== */
/* ✨ تصميم مربعات إدخال رمز التحقق ✨ */
/* ================================== */
#otp-inputs-container {
    display: flex;
    justify-content: center;
    gap: 10px; /* المسافة بين المربعات */
    margin-top: 10px;
}

.otp-digit-input {
    width: 45px;
    height: 55px;
    font-size: 1.8rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f7f7f7;
    transition: all 0.2s ease;
    caret-color: #c0392b; /* لون مؤشر الكتابة */
}

/* تغيير شكل المربع عند التركيز عليه */
.otp-digit-input:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.2);
}

/* ================================== */
/* ✨ تصميم زر إظهار/إخفاء كلمة المرور ✨ */
/* ================================== */

/* حاوية كلمة المرور لتحديد موقع الأيقونة */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* تنسيق حقل الإدخال داخل الحاوية */
.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    width: 100%;
    padding-left: 40px; /* إضافة مساحة لليسار لوضع الأيقونة */
}

/* تنسيق زر العين نفسه */
.toggle-password {
    position: absolute;
    left: 10px; /* تحديد موقع الأيقونة على اليسار */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #888;
    padding: 0;
}

.toggle-password svg {
    display: block; /* يضمن توسط الأيقونة بشكل صحيح */
}

.coupon-code-display {
    color: #27ae60;
    font-weight: bold;
    margin-right: 5px;
}

/* Style for logout link in the main footer */
.footer-logout-link {
    color: #e74c3c !important; /* لون أحمر مميز */
    font-weight: 700;
}

.footer-logout-link:hover {
    color: #c0392b !important; /* لون أحمر أغمق عند مرور الماوس */
}

/* ================================================= */
/* ✨✨✨ التنسيق النهائي والموحد للمسافات ✨✨✨ */
/* ================================================= */

/* تطبيق المسافة المتناسقة بين كل الفئات */
.offcanvas-nav-body {
    display: flex;
    flex-direction: column;
    gap: 10px; /* <-- ✨ هذه الخاصية الآن تتحكم بالمسافة بين كل الأزرار */
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.offcanvas-nav-body .main-category-button {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 16px 20px;
}

.offcanvas-nav-body .main-category-button span {
    flex-grow: 1;
    text-align: right;
}

.offcanvas-nav-body .main-category-button.is-expanded {
    background-color: var(--pink);
    color: white;
    border-color: var(--pink);
}

.offcanvas-nav-body .subcategory-list a.active {
    background-color: var(--blue);
    color: white;
}

.offcanvas-nav-body .subcategory-list a {
    font-size: 1.05rem;
    padding-top: 12px;
    padding-bottom: 12px;
    padding-right: 35px;
}

.offcanvas-nav-body .main-category-button:not([data-category="all"])::after {
    content: '◀';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.offcanvas-nav-body .main-category-button.is-expanded::after {
   transform: rotate(-90deg);
}

/* =================================================== */
/* ✨✨ التصميم الجديد لنافذة اختيار القياس (وسط الشاشة) ✨✨ */
/* =================================================== */

/* حاوية زر اختيار القياس داخل نافذة المنتج (تبقى كما هي) */
#modal-size-selector-container {
    margin-top: 15px;
}
.size-selector-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: right;
    transition: background-color 0.2s ease;
}
.size-selector-button:hover {
    background-color: #f0f0f0;
}
.size-selector-button span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}
.size-selector-button svg {
    color: #999;
}



.size-options-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* =================================================== */
/* ✨ إصلاح وتحسين نافذة اختيار القياس لجميع الشاشات ✨ */
/* =================================================== */

/* 1. تعديل الحاوية الخارجية (Overlay) */
.size-options-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* ✨ تم حذف padding من هنا لضمان المرونة الكاملة */
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.size-options-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* 2. تعديل محتوى النافذة (Content) */
.size-options-modal-content {
    background-color: white;
    width: 100%;
    max-width: 420px;
    
    /* ✨ إضافة margin لإعطاء مسافة من حواف الشاشة الصغيرة */
    margin: 20px;
    
    padding: 20px 25px;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    
    /* ✨ إضافة مهمة: السماح بالتمرير العمودي إذا كانت القياسات كثيرة */
    max-height: 85vh; /* تحديد أقصى ارتفاع */
    overflow-y: auto;   /* إضافة شريط تمرير عند الحاجة */
    
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.size-options-modal-overlay.is-open .size-options-modal-content {
    transform: scale(1);
}

.size-options-modal-overlay.is-open .size-options-modal-content {
    transform: scale(1); /* تأثير دخول: تعود لحجمها الطبيعي */
}

.size-options-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}
.size-options-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}


/* =================================================== */
/* ✨ التصميم الجديد والمحسّن لنافذة اختيار القياس ✨ */
/* =================================================== */

/* 1. تغيير الشبكة إلى Flexbox لتكون عمودية وأكثر مرونة */
.size-options-grid {
    display: flex;
    flex-direction: column; /* جعل البطاقات تترتب فوق بعضها */
    gap: 12px;
    padding-bottom: 10px;
}

/* 2. إعادة تصميم الزر ليبدو كبطاقة معلومات */
.size-option-btn {
    display: flex;
    flex-direction: column; /* ترتيب المحتوى داخل البطاقة بشكل عمودي */
    align-items: flex-start; /* محاذاة النص لليمين (في RTL) */
    padding: 12px 15px;
    text-align: right;
    border-radius: 12px; /* حواف أكثر نعومة */
    line-height: 1.5; /* تباعد أفضل بين الأسطر */
    border: 1px solid var(--border-color);
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.size-option-btn:hover:not(:disabled):not(.selected) {
    border-color: var(--pink);
    background-color: #fffafb;
}

.size-option-btn .size-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 5px;
    pointer-events: none; /* ✨ تمت إضافة هذا السطر */
}

.size-option-btn .size-measurements {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.85rem;
    color: #555; /* ✅ لون رمادي داكن وواضح */
    opacity: 1;  /* ✅ إزالة الشفافية */
    pointer-events: none; 
}

.size-option-btn .size-measurements span {
    display: block;
}

/* 5. تحديث شكل البطاقة عند اختيارها أو عندما تكون غير متاحة */
.size-option-btn.selected {
    background-color: var(--pink);
    color: white;
    border-color: var(--pink);
    border-width: 2px;
    padding: 11px 14px;
    box-shadow: 0 4px 12px rgba(229, 169, 180, 0.3);
}

.size-option-btn.selected .size-name,
.size-option-btn.selected .size-measurements {
    color: white; /* جعل النص أبيض عند الاختيار */
    opacity: 1;
}

.size-option-btn:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.size-option-btn:disabled .size-name {
    text-decoration: line-through; /* إضافة خط على اسم القياس غير المتوفر */
}

/* =========================================== */
/* ✨ تنسيقات القياس والكمية الموحدة ✨ */
/* =========================================== */


/* كل قسم (القياس أو الكمية) يأخذ نصف المساحة */
.modal-option-item {
    flex: 1; /* ✨ السر هنا: يجعل العنصرين بنفس العرض */
    display: flex;
    flex-direction: column;
}

/* عنوان كل قسم (كلمة "القياس" و "الكمية") */
.modal-section-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 8px;
    text-align: right;
}

/* تنسيق موحد لزر القياس وحاوية الكمية */
.size-selector-button,
.quantity-stepper {
    height: 48px; /* ✨ تحديد ارتفاع موحد للعنصرين */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
}

/* تنسيقات خاصة بزر القياس */
.size-selector-button {
    justify-content: space-between;
    padding: 0 15px;
    background-color: #f9f9f9;
    cursor: pointer;
}

/* تنسيقات خاصة بحاوية الكمية */
.quantity-stepper {
    overflow: hidden; /* لإخفاء الزوايا الحادة للأزرار الداخلية */
}
.quantity-stepper .quantity-input {
    height: 100%;
    border: none;
    text-align: center;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 5px;
    background: transparent;
}
.quantity-stepper .quantity-btn {
    height: 100%;
    border: none;
    background-color: #f1f1f1;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0 15px;
    flex-shrink: 0;
    color: #555;
}

/* style.css */

/* --- تنسيقات فلاتر الفئات الجديدة --- */
#category-filter-container h4 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    text-align: right;
}

.category-filter-item {
    margin-bottom: 10px;
}

.category-filter-link,
.subcategory-filter-link {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
    text-align: right;
    font-weight: 500;
}

.category-filter-link:hover,
.subcategory-filter-link:hover {
    background-color: #f5f5f5;
}

.category-filter-link.main-cat {
    font-weight: 700;
}

.subcategory-filter-list {
    padding-right: 15px;
    margin-top: 5px;
}

.subcategory-filter-link {
    font-size: 0.9rem;
    color: #777;
}

/* تنسيق الفئة النشطة */
.category-filter-link.active,
.subcategory-filter-link.active {
    background-color: var(--pink);
    color: white;
    font-weight: 700;
}

/* ✨✨ أضف هذا الكود في نهاية ملف style.css ✨✨ */

.filter-options-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: right;
}


.filter-options-vertical .category-group-label:first-of-type {
    margin-top: 0;
}



.filter-options-vertical label:hover {
    background-color: #f5f5f5;
}

/* ✨✨ أضف هذا الكود الجديد في نهاية ملف style.css ✨✨ */
.filter-accordion {
    border-bottom: 1px solid #f0f0f0;
}
.filter-accordion:last-child {
    border-bottom: none;
}

.filter-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 15px 5px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-accordion-toggle .icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.filter-accordion-toggle.is-open .icon {
    transform: rotate(90deg);
}

.filter-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 10px;
}

.filter-accordion-content.is-open {
    max-height: 500px; /* رقم كبير لاحتواء كل العناصر */
    padding-bottom: 15px;
}

/* تنسيق مربعات الاختيار داخل الأكورديون */
.filter-accordion-content label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
}
.filter-accordion-content label:hover {
    background-color: #f5f5f5;
}
/* =========================================== */
/* ✨ تنسيقات زر التقييمات القابل للطي (Accordion) ✨ */
/* =========================================== */

/* تصميم الزر الرئيسي القابل للضغط */
.reviews-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 5px;
    margin: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.reviews-header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    gap: 5px;
}

.reviews-header-info h4 {
    margin: 0;
}

.reviews-accordion-toggle .reviews-summary {
    margin: 0;
}

/* تصميم أيقونة السهم */
.reviews-accordion-toggle .accordion-icon {
    font-size: 1.2rem;
    color: #888;
    transition: transform 0.3s ease;
}

/* تدوير السهم عند فتح القائمة */
.reviews-accordion-toggle.is-open .accordion-icon {
    transform: rotate(180deg);
}

/* حاوية قائمة التقييمات (مخفية افتراضياً) */
.reviews-list-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

/* عند فتح القائمة */
.reviews-list-container.is-open {
    max-height: 350px; /* 👈 هذا هو التغيير المهم: قللنا الرقم ليظهر السكرول */
    overflow-y: auto;
    padding-bottom: 15px;
    
    /* تنسيق السكرول ليكون ناعم */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* تنسيق شكل السكرول (لمتصفحات كروم والكمبيوتر) */
.reviews-list-container::-webkit-scrollbar {
    width: 6px;
}
.reviews-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.reviews-list-container::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 10px;
}

/* ✨✨ تأثير الاهتزاز لتنبيه المستخدم ✨✨ */
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.shake-error {
  animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
  border-color: #e74c3c !important; /* لون أحمر لتوضيح الخطأ */
}

/* ✨✨✨ الكود النهائي والحاسم لتنسيق ومحاذاة النجوم ✨✨✨ */

/* 1. الحاوية الرئيسية للتقييم الإجمالي (للتوسيط والمحاذاة) */
.reviews-summary {
    width: 100%;
    display: flex;
    justify-content: flex-start; /* يبدأ من اليسار افتراضياً */
    align-items: center;
}
html[dir="rtl"] .reviews-summary {
    justify-content: flex-end; /* يُدفع لليمين في اللغة العربية */
}

/* 2. حاوية الرقم والنجوم (لترتيبها الداخلي) */
.star-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 3. حاوية النجوم الخمسة (لعكس ترتيبها) */
.stars-wrapper {
    display: flex;
}


/* 4. إصلاح التقييمات الفردية (الأهم) */
.review-header {
    width: 100%;
    display: flex;
    justify-content: space-between; /* يباعد بين الاسم والتقييم */
    align-items: center;
    gap: 15px;
}


/* --- (تنسيقات شكل النجوم - تبقى كما هي) --- */
.star {
    width: 1.2em;
    height: 1.2em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.star.full {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffc107"><path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}
.star.empty {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e0e0e0"><path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}
.star.half {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="50%" style="stop-color:%23ffc107;stop-opacity:1" /><stop offset="50%" style="stop-color:%23e0e0e0;stop-opacity:1" /></linearGradient><path fill="url(%23grad)" d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}

/* ✨✨✨ التنسيق النهائي لشكل النجوم ✨✨✨ */

.star-rating-display {
    display: flex;
    align-items: center;
    gap: 8px; /* مسافة بين الرقم والنجوم */
}

.stars-wrapper {
    display: flex;
    gap: 2px;
}

.star {
    width: 1.2em;
    height: 1.2em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.star.full {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffc107"><path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}
.star.empty {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e0e0e0"><path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}
.star.half {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="50%" style="stop-color:%23ffc107;stop-opacity:1" /><stop offset="50%" style="stop-color:%23e0e0e0;stop-opacity:1" /></linearGradient><path fill="url(%23grad)" d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"/></svg>');
}

/* تنسيق نصف النجمة ليعمل في كل الاتجاهات */
html[dir="ltr"] .star.half {
    transform: scaleX(1); /* الاتجاه العادي */
}
html[dir="rtl"] .star.half {
    transform: scaleX(-1); /* عكس الاتجاه في العربية والكردية */
}

/* ✨ إصلاح لمشكلة محاذاة القائمة المنسدلة على الموبايل ✨ */
@media (max-width: 991px) {
    html[dir="rtl"] .account-dropdown {
        left: auto;
        right: 0;
    }
}

/* ✨✨ تحسينات على تصميم السلايد شو الترويجي ✨✨ */

/* 1. إصلاح مشكلة تحديد الموضع (الأهم) */
.promo-swiper {
    position: relative;
    border-radius: 15px;
    overflow: hidden; /* ضروري لضمان بقاء كل شيء داخل الحواف الدائرية */
}

/* 2. إخفاء الأسهم على شاشات الموبايل (لأن السحب كافٍ) */
.promo-swiper .swiper-button-next,
.promo-swiper .swiper-button-prev {
    display: none;
}

/* 3. تعديل مكان النقاط لتكون داخل الصورة وأجمل */
.promo-swiper .swiper-pagination {
    bottom: 15px; /* رفع النقاط قليلاً للأعلى */
}

.promo-swiper .swiper-pagination-bullet {
    background-color: rgba(255, 255, 255, 0.7); /* لون أبيض نصف شفاف ليظهر فوق أي صورة */
    opacity: 1; /* إلغاء التعتيم الافتراضي */
    transition: background-color 0.2s ease;
}

.promo-swiper .swiper-pagination-bullet-active {
    background-color: var(--pink); /* استخدام اللون الرئيسي للمتجر للنقطة الفعالة */
}

/* 4. إظهار وتجميل شكل الأسهم على الشاشات الأكبر */
@media (min-width: 768px) {
    .promo-swiper .swiper-button-next,
    .promo-swiper .swiper-button-prev {
        display: flex; /* إظهار الأسهم على الحاسوب */
        width: 40px;
        height: 40px;
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.15);
        transition: background-color 0.2s ease;
    }

    .promo-swiper .swiper-button-next:hover,
    .promo-swiper .swiper-button-prev:hover {
        background-color: white;
    }

    /* تغيير شكل أيقونة السهم ولونها */
    .promo-swiper .swiper-button-next::after,
    .promo-swiper .swiper-button-prev::after {
        font-size: 18px; /* تصغير حجم الأيقونة */
        font-weight: 900;
        color: var(--pink);
    }
}

/* =================================================== */
/* ✨ كود تفعيل إعدادات البانر الترويجي ✨ */
/* =================================================== */

.promo-image-banner {
  display: block;
  /* استخدام المتغيرات القادمة من لوحة التحكم مع قيمة افتراضية */
  max-width: var(--max-width, 1200px);
  aspect-ratio: var(--aspect-ratio, auto);
  margin: 0 auto; /* لتوسيط البانر */
  overflow: hidden;
}

.promo-image-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ✨ تنسيق شريط الترويج النصي الجديد ✨ */
.promo-text-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background-color: var(--pink); /* استخدام اللون الرئيسي للمتجر */
    color: white;
    min-height: 120px; /* ارتفاع بسيط ليكون الشريط واضحاً */
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 15px;
}

.promo-text-banner p {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

/* =================================================== */
/* ✨ تنسيق البانر الترويجي النصي الجديد ✨ */
/* =================================================== */

.promo-text-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: #e5a9b4; /* استخدام اللون الوردي الرئيسي للمتجر */
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  min-height: 80px; /* يضمن وجود ارتفاع بسيط للبانر */
  box-sizing: border-box;
}

/* للشاشات الأكبر حجماً */
@media (min-width: 768px) {
    .promo-text-banner {
        font-size: 1.8rem;
        min-height: 100px;
    }
}

/* ============================================= */
/* ✨ تنسيقات إشعارات الزبائن ✨ */
/* ============================================= */
.notifications-container-user {
    position: relative;
}

.notifications-dropdown-user {
    position: absolute;
    top: 130%;
    right: 0;
    left: auto;
    width: 300px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    z-index: 1000;

    /* --- الخصائص الجديدة للحركة (مأخوذة من قائمة الحساب) --- */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px); /* تبدأ من الأعلى قليلاً */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}

.notifications-dropdown-user.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* تعود لمكانها الطبيعي */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
}

html[dir="rtl"] .notifications-dropdown-user {
    left: auto;
    right: 0;
}

.notifications-dropdown-user.is-open {
    display: block;
}

.notifications-header-user {
    padding: 12px 15px;
    font-weight: 700;
    border-bottom: 1px solid #f0f0f0;
    text-align: right;
}

.notifications-list-user {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item-user {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: var(--text-color);
    text-align: right;
    transition: background-color 0.2s ease;
}

.notification-item-user:last-child {
    border-bottom: none;
}

.notification-item-user:hover {
    background-color: #f5f5f5;
}

.notification-item-user .status {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 5px;
}

.notifications-footer-user {
    padding: 12px 15px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background-color: #f9fafb;
}

.notifications-footer-user a {
    text-decoration: none;
    color: var(--pink);
    font-weight: 700;
}


/* ✨✨ تنسيق زر مسح الإشعارات ✨✨ */
.clear-notifications-btn {
    background: none;
    border: none;
    color: #e74c3c; /* لون أحمر للدلالة على الحذف */
    font-weight: 700;
    cursor: pointer;
    padding: 5px;
    font-size: 0.9rem;
    margin-right: 15px; /* لإضافة مسافة بينه وبين الرابط الآخر */
}
.clear-notifications-btn:hover {
    text-decoration: underline;
}

.clear-notifications-btn {
    background: none;
    border: none;
    color: var(--price-color); /* لون أحمر خفيف */
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    padding: 5px;
    font-size: 0.9rem;
}





/* ============================================= */
/* ✨ تنسيقات سلايدر المنتجات المقترحة الجديدة ✨ */
/* ============================================= */

.related-products-swiper {
    width: 100%;
    padding: 10px 0; /* إضافة مساحة بسيطة */
    position: relative;
}

/* بطاقة المنتج داخل السلايد (لا تحتاج لتغييرات كثيرة) */
.related-products-swiper .swiper-slide {
    height: auto; /* السماح للبطاقة بتحديد ارتفاعها */
}

.related-product-card {
    width: 100%; /* جعل البطاقة تملأ عرض السلايد */
}

/* تصميم أزرار التنقل (الأسهم) */
.related-products-swiper .swiper-button-next,
.related-products-swiper .swiper-button-prev {
    color: var(--pink);
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    top: 45%; /* تعديل الموضع العمودي */
}

.related-products-swiper .swiper-button-next::after,
.related-products-swiper .swiper-button-prev::after {
    font-size: 16px; /* تصغير حجم أيقونة السهم */
    font-weight: 900;
}

/* إخفاء الأزرار على الموبايل لأن السحب باللمس كافٍ */
@media (max-width: 767px) {
    .related-products-swiper .swiper-button-next,
    .related-products-swiper .swiper-button-prev {
        display: none;
    }
}

/* ✅ Add this code to the end of style.css */
#measurement-filter-inputs {
    display: flex;
    gap: 10px;
}
#measurement-key-select {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
}
#measurement-value-input {
    flex: 1;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}





/* ✅ أضف هذا الكود في نهاية ملف style.css */

.modal-options-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 15px;
}

/* =================================================== */
/* ✨ تنسيقات زر عرض صورة القياسات الجديد ✨ */
/* =================================================== */

/* 1. تعديل رأس النافذة لاستيعاب الزر الجديد */
.size-options-modal-header {
    display: flex;
    align-items: center;
    gap: 15px; /* إضافة مسافة بين العناصر */
}

.size-options-modal-header h3 {
    flex-grow: 1; /* جعل العنوان يأخذ المساحة المتاحة ويدفع البقية جانباً */
    margin: 0;
}

.size-options-modal-header .close-btn {
    flex-shrink: 0; /* منع زر الإغلاق من الانكماش */
}

/* 2. تصميم الزر الجديد نفسه */
.view-measurement-image-btn {
    display: flex; /* سيتم تفعيله عبر الجافاسكريبت */
    align-items: center;
    gap: 8px;
    background-color: #f0f6ff; /* أزرق فاتح يوحي بالمعلومات */
    color: #3498db;
    border: 1px solid #cce0ff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap; /* لمنع النص من النزول لسطر جديد */
    flex-shrink: 0;
}

.view-measurement-image-btn:hover {
    background-color: #e2f0ff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.view-measurement-image-btn svg {
    flex-shrink: 0; /* منع الأيقونة من الانكماش */
}

/* 3. تحسين العرض على الشاشات الصغيرة جداً (اختياري) */
@media (max-width: 420px) {
    .view-measurement-image-btn span {
        display: none; /* إخفاء النص وإبقاء الأيقونة فقط */
    }
    .view-measurement-image-btn {
        width: 34px;
        height: 34px;
        justify-content: center;
        padding: 0;
    }
}
/* ============================================= */
/* ✨ تنسيقات أزرار المشاركة (نسخة مصغرة) ✨ */
/* ============================================= */

.social-share-section {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
    display: flex;
    align-items: center; /* لمحاذاة العنوان مع الأزرار أفقياً (اختياري) */
    gap: 10px;
    flex-wrap: wrap;
}

/* تصغير العنوان وجعله رمادياً باهتاً */
.social-share-section h4 {
    margin: 0;
    font-size: 0.85rem; /* حجم صغير */
    font-weight: 500;
    color: #999; /* لون باهت لتقليل البروز */
    flex-shrink: 0;
}

/* تنسيق حاوية الأزرار */
.social-share-buttons {
    display: flex;
    gap: 8px; /* تقليل المسافة بين الأزرار */
    flex-wrap: wrap;
}

/* تصغير الزر نفسه */
.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px; /* ✅ حشوة أقل (padding) */
    border-radius: 20px;
    border: 1px solid transparent;
    font-size: 0.75rem; /* ✅ حجم خط أصغر */
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 28px; /* ارتفاع ثابت وصغير */
}

/* تصغير الأيقونات داخل الزر */
.social-btn svg {
    width: 14px; /* ✅ أيقونة أصغر */
    height: 14px;
}

/* --- (الألوان تبقى كما هي) --- */
.social-btn.whatsapp {
    background-color: #e7f8ee;
    color: #25d366;
    border-color: #b7e9c9;
}
.social-btn.whatsapp:hover {
    background-color: #d1f3e0;
}

.social-btn.messenger {
    background-color: #e6f6ff;
    color: #0084ff;
    border-color: #b3dfff;
}
.social-btn.messenger:hover {
    background-color: #d1ecff;
}

.social-btn.copy-link {
    background-color: #f9f9f9;
    color: #777;
    border-color: #eee;
}
.social-btn.copy-link:hover {
    background-color: #eee;
}


/* ============================================= */
/* ✨ تنسيقات تحسينات واجهة التسجيل ✨ */
/* ============================================= */

/* 1. تنسيق رسائل الخطأ تحت الحقول */
.form-error-message {
  color: #e74c3c;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 5px;
  text-align: right;
  min-height: 1em; /* لمنع اهتزاز التصميم عند ظهور الرسالة */
  display: none; /* تكون مخفية افتراضياً */
  transition: all 0.2s ease;
}
.form-error-message.show {
  display: block;
}

/* 2. تنسيق مؤشر قوة كلمة المرور */
.password-strength-meter {
  height: 6px;
  width: 100%;
  background-color: #f0f0f0;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden; /* مهم لجعل الشريط الداخلي يظهر بشكل صحيح */
}
.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
/* ألوان مؤشر قوة كلمة المرور */
.strength-bar.weak {
  width: 33%;
  background-color: #e74c3c; /* أحمر: ضعيف */
}
.strength-bar.medium {
  width: 66%;
  background-color: #f39c12; /* برتقالي: متوسط */
}
.strength-bar.strong {
  width: 100%;
  background-color: #2ecc71; /* أخضر: قوي */
}

/* تنسيق حاوية reCAPTCHA */
.form-group-recaptcha {
    display: flex;
    flex-direction: column;
    align-items: center; /* لتوسيط الصندوق */
    margin-top: 10px;
}

.social-login-container { margin-bottom: 15px; }
.social-login-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
}
.social-login-btn:hover { background-color: #f5f5f5; }
.social-login-btn svg { width: 20px; height: 20px; }
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    margin-bottom: 15px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}
.auth-divider:not(:empty)::before { margin-left: .5em; }
.auth-divider:not(:empty)::after { margin-right: .5em; }

/* ================================================= */
/* ✨ تحديث تصميم السكرول ليناسب الحواف الدائرية ✨ */
/* ================================================= */

#auth-modal .auth-modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

/* تعديل عرض السكرول قليلاً */
#auth-modal .auth-modal-content::-webkit-scrollbar {
    width: 14px;
}

/* الخطوة 1: جعل خلفية السكرول شفافة تماماً */
#auth-modal .auth-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

/* الخطوة 2: إضافة "هامش داخلي" للجزء المتحرك ليبدو عائماً */
#auth-modal .auth-modal-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
    /* هذا الكود السحري يضيف مسافة 4px شفافة حول الشريط المتحرك */
    border: 4px solid transparent;
    background-clip: content-box;
}

#auth-modal .auth-modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

/* ============================================= */
/* ✨ تنسيقات المقاس المقترح ✨ */
/* ============================================= */
#recommended-size-container {
    background-color: #eaf5fb; /* أزرق فاتح */
    border: 1px solid #a9d4e5; /* أزرق */
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: right;
    animation: fadeIn 0.3s ease-out; /* حركة ظهور ناعمة */
}
#recommended-size-container h4 {
    margin: 0 0 10px 0;
    color: #3498db; /* أزرق أغمق */
    font-size: 1.1rem;
    font-weight: 700;
}
#recommended-size-text p {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}
#recommended-size-text p:last-child {
    margin-bottom: 0;
}
#recommended-size-text p strong {
    color: var(--pink); /* لون وردي مميز للقياس */
    font-weight: 700;
    font-size: 1.1rem;
}

/* تنسيق سطر "السبب" لجعله أصغر */
#recommended-size-text .recommendation-reason {
    font-size: 0.85rem;
    font-weight: 400;
    color: #555;
    margin-top: -4px;
    margin-bottom: 10px;
}

/* تنسيق لتمييز القياس الذكي (يناسب طفل بطول) */
.size-option-btn .size-measurements .smart-measurement {
    color: var(--heading-color); /* ✅ لون أحمر بارز جداً */
    font-weight: 700;   
    font-size: 0.9rem;  
}

/* ============================================= */
/* ✨ إصلاح: منع تمدد نافذة المنتج على الحاسبة ✨ */
/* ============================================= */
.modal-details {
    min-width: 0;
}

/* ============================================= */
/* ✨ تنسيقات الفلترة الذكية (أطفالي) ✨ */
/* ============================================= */

/* تنسيق حاوية الأزرار (نفس تنسيق الفئات) */
.filter-options-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px; /* مسافة بين الأزرار */
}

/* تنسيق زر الطفل */
.kid-filter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kid-filter-btn .icon {
    font-size: 1.2rem;
}

.kid-filter-btn:hover {
    background-color: #f9f9f9;
    border-color: var(--blue);
}

/* تنسيق الزر عند الضغط عليه (نشط) */
.kid-filter-btn.active {
    background-color: var(--blue);
    color: white;
    font-weight: 700;
    border-color: var(--blue);
}

/* رسالة في حال عدم وجود أطفال */
.no-kids-filter-placeholder {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

/* تصميم زر القياس غير المتوفر (لجعله باهتاً وعليه خط) */
.size-option-btn.out-of-stock {
    background-color: #f5f5f5;
    color: #ccc;
    opacity: 0.7;
}

.size-option-btn.out-of-stock .size-name {
    text-decoration: line-through; /* إضافة خط على اسم القياس */
}

/* عند مرور الماوس فوق الزر غير المتوفر */
.size-option-btn.out-of-stock:hover {
    background-color: #f0f0f0; 
    border-color: var(--border-color); /* إبقاء الإطار عادياً */
}

/* إلغاء أي تأثيرات لونية عند اختيار قياس غير متوفر */
.size-option-btn.out-of-stock.selected {
    background-color: #f5f5f5;
    color: #ccc;
    border-color: var(--pink); /* يمكننا تمييز الإطار عند الاختيار */
}
.size-option-btn.out-of-stock.selected .size-name {
    color: #ccc;
}
.size-option-btn.out-of-stock.selected .size-measurements {
    color: #ccc;
}

/* =================================================== */
/* ✨ تنسيق زر التنبيه داخل نافذة القياسات ✨ */
/* =================================================== */

/* 1. جعل حاوية الزر الرئيسية مرنة (Flex) */
.size-option-btn {
    display: flex;
    justify-content: space-between; /* لوضع المحتوى يميناً والزر يساراً */
    align-items: center;
}

/* 2. حاوية المعلومات (الاسم والقياسات) */
.size-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
    pointer-events: none; /* لمنع تداخل الأحداث */
}

/* 3. تصميم زر "أعلمني" الداخلي */
.inline-notify-btn {
    background-color: var(--blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap; /* لمنع التفاف النص */
    flex-shrink: 0; /* لمنع الزر من الانكماش */
}

.inline-notify-btn:hover {
    background-color: #8bc4d9; /* لون أغمق عند المرور */
}

/* 4. تنسيق الزر الأب عندما يكون القياس غير متوفر */
.size-option-btn.out-of-stock {
    background-color: #f5f5f5;
    opacity: 0.9;
    cursor: not-allowed; /* الزر الأب لا يمكن الضغط عليه */
}

.size-option-btn.out-of-stock .size-name {
    color: #aaa;
    text-decoration: line-through;
}

.size-option-btn.out-of-stock .size-measurements {
    color: #ccc;
}

/* =================================================== */
/* ✨ تنسيق جديد: حاوية "غير متوفر" داخل زر القياس ✨ */
/* =================================================== */

/* 1. الحاوية الجديدة التي تجمع النص والزر */
.unavailable-size-wrapper {
    display: flex;
    justify-content: space-between; /* يضع النص يميناً والزر يساراً */
    align-items: center;
    gap: 10px;
    width: 100%; /* تأخذ كامل عرض الزر الأب */
    margin-top: 10px; /* مسافة من المعلومات العلوية */
    padding-top: 10px; /* خط فاصل علوي */
    border-top: 1px dashed #ddd;
    pointer-events: all; /* السماح بالتفاعل مع هذه الحاوية */
}

/* 2. النص الجانبي (هذا القياس غير متوفر...) */
.unavailable-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555; /* لون داكن وواضح */
    text-align: right;
    line-height: 1.4;
    flex-grow: 1; /* يأخذ المساحة المتبقية */
}

/* 3. تصغير حجم زر "أعلمني" (كما طلبت) */
.inline-notify-btn {
    background-color: var(--blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 10px; /* ✨ تصغير الحجم */
    font-size: 0.8rem; /* ✨ تصغير الخط */
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap; 
    flex-shrink: 0; /* يمنع الزر من الانكماش */
}

.inline-notify-btn:hover {
    background-color: #8bc4d9; 
}

/* 4. تعديل تنسيق الزر الأب (الحاوية الرمادية) */
.size-option-btn.out-of-stock {
    background-color: #f9f9f9; /* لون رمادي فاتح جداً */
    opacity: 1; /* إزالة التعتيم */
    cursor: not-allowed; 
    border-color: var(--pink); /* إطار وردي لتمييزه */
    justify-content: center; /* توسيط المحتوى العلوي */
    flex-direction: column; /* جعل المحتوى عمودياً */
}

/* 5. إبقاء النصوص العلوية (3-6 شهور) باهتة */
.size-option-btn.out-of-stock .size-name {
    color: #aaa;
    text-decoration: line-through;
}
.size-option-btn.out-of-stock .size-measurements {
    color: #ccc;
}

/* 6. تعديل حاوية المعلومات العلوية لتوسيطها */
.size-info-wrapper {
    width: 100%; /* جعلها تأخذ كامل العرض */
    align-items: center; /* توسيط المحتوى */
    text-align: center;
    pointer-events: none; /* لمنع تداخل الأحداث */
}

/* 7. تعديل الزر الأب ليصبح عمودياً */
.size-option-btn {
    display: flex;
    flex-direction: column; /* ✨ جعل المحتوى عمودياً */
    justify-content: center; 
    align-items: center;
}

/* ============================================= */
/* ✨ تنسيقات معرض صور التقييمات ✨ */
/* ============================================= */
.review-images-gallery {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.review-images-gallery a {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.review-images-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.review-images-gallery a:hover img {
    transform: scale(1.1);
}

/* =================================================== */
/* ✨ تنسيقات أشرطة الترويج النصية (العلوية والسفلية) ✨ */
/* =================================================== */

/* --- 1. الشريط العلوي (فوق الهيدر) --- */
#top-strip-container {
    position: sticky;
    top: 0;
    z-index: 901; /* يجب أن يكون أعلى من الهيدر */
    width: 100%;
    /* سنقوم بتعيين الارتفاع باستخدام جافاسكريبت */
}

/* تنسيق الشريط العلوي (الهيكل) */
#top-strip-container .promo-strip {
    min-height: 40px;
    padding: 8px;
}

#top-strip-container .promo-strip p {
    font-size: 0.9rem; /* هذا هو الحجم الافتراضي إذا لم يتم تحديد حجم */
}

/* --- 2. الشريط السفلي (تحت الهيدر) --- */
#below-header-strip-container {
    width: 100%;
}

/* تنسيق الشريط السفلي (الهيكل) */
#below-header-strip-container .promo-strip {
    min-height: 45px;
    padding: 10px;
}

#below-header-strip-container .promo-strip p {
    font-size: 1rem; /* هذا هو الحجم الافتراضي إذا لم يتم تحديد حجم */
}


/* --- 3. التنسيقات المشتركة (لكلا الشريطين) --- */
.promo-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    /* ✨ تم نقل الألوان إلى جافاسكريبت (inline style) ✨ */
}

/* --- 4. حركات النصوص (مشتركة) --- */
@keyframes marquee-rtl {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.promo-strip.marquee-rtl p {
    position: absolute;
    transform: translateX(100%);
    animation: marquee-rtl 20s linear infinite;
}

@keyframes marquee-ltr {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.promo-strip.marquee-ltr p {
    position: absolute;
    transform: translateX(-100%);
    animation: marquee-ltr 20s linear infinite;
}

.promo-strip.static p {
    position: relative;
}

/* --- حركة من اليمين لليسار (للعربية) --- */
@keyframes marquee-rtl {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.promo-strip.marquee-rtl p {
    /* وضع النص خارج الشاشة من اليمين */
    position: absolute;
    transform: translateX(100%);
    animation: marquee-rtl 20s linear infinite;
    /* يمكنك تغيير 20s للتحكم بسرعة الحركة */
}

/* --- حركة من اليسار لليمين (للكردية أو الإنجليزية) --- */
@keyframes marquee-ltr {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.promo-strip.marquee-ltr p {
    position: absolute;
    transform: translateX(-100%);
    animation: marquee-ltr 20s linear infinite;
}

/* --- حالة النص الثابت (الافتراضي) --- */
.promo-strip.static p {
    position: relative;
}

/* ==========================================================================
   25. QUICK ADD TO CART BUTTON
   ========================================================================== */

.quick-add-btn {
    position: absolute;
    top: 10px;
    left: 56px; /* بجانب زر المفضلة (10px + 36px + 10px) */
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.2s ease, background-color 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: #555;
}

html[dir="rtl"] .quick-add-btn {
    left: auto;
    right: 56px; /* بجانب زر المفضلة في العربية */
}

.quick-add-btn:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 1);
    color: var(--pink);
}

.quick-add-btn svg {
    width: 20px;
    height: 20px;
}

/* ==================================================
   ✨ [NEW] تنسيقات شريط الشحن المجاني الذكي ✨
   ================================================== */

.free-shipping-container {
    padding: 15px 20px;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* النص التوجيهي */
.free-shipping-text {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
    line-height: 1.4;
}

.free-shipping-text span {
    color: var(--price-color); /* تلوين المبلغ المتبقي بالأحمر */
    font-weight: 700;
}

/* خلفية الشريط (المسار) */
.shipping-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* الجزء الممتلئ من الشريط */
.shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%); /* تدرج وردي لطيف */
    width: 0%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* حركة ناعمة جداً */
    position: relative;
}

/* تأثير اللمعان المتحرك على الشريط */
.shipping-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
    opacity: 0.6;
}

@keyframes moveStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* أيقونة الاحتفال (تظهر عند الاكتمال) */
.free-shipping-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 3rem;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

/* --- حالة النجاح (عندما يمتلئ الشريط) --- */
.free-shipping-container.success {
    background-color: #e8f5e9; /* خلفية خضراء فاتحة جداً */
    border-bottom-color: #c8e6c9;
}

.free-shipping-container.success .free-shipping-text {
    color: #27ae60;
    font-weight: 700;
}

.free-shipping-container.success .shipping-progress-fill {
    background: #2ecc71; /* لون أخضر */
}

.free-shipping-container.success .free-shipping-icon {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.2; /* تظهر كخلفية شفافة */
    animation: popIn 0.5s forwards;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(2); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.1; }
}

/* ==================================================
   ✨ [NEW] تصميم شريط خصم العروض التفاعلي ✨
   ================================================== */

.discount-progress-container {
    padding: 15px;
    background: linear-gradient(to bottom, #fff5f5, #fff); /* خلفية وردية فاتحة جداً */
    border-bottom: 1px dashed #ffcccc;
    text-align: center;
    position: relative;
    z-index: 10; /* ✨ أضفنا هذا لضمان بقائه فوق المنتجات عند التمرير */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* ظل خفيف ليفصله عن المنتجات */
    width: 100%; /* لضمان ملء العرض */
    margin: 0; /* إلغاء الهوامش لأننا خارج القائمة */
 
}

.discount-progress-text {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #c0392b; /* لون أحمر داكن */
    font-weight: 600;
}

.discount-progress-text span {
    font-weight: 800;
    font-size: 1rem;
    color: #e74c3c;
}

/* حاوية الشريط */
.discount-bar-track {
    width: 100%;
    height: 10px;
    background-color: #ffe6e6;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}

/* الشريط الممتلئ */
.discount-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9966, #ff5e62); /* تدرج برتقالي لأحمر */
    width: 0%;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* تأثير اللمعان المتحرك */
.discount-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

/* أيقونة النجاح */
.discount-success-icon {
    font-size: 1.2rem;
    margin-right: 5px;
    animation: bounce 1s infinite;
    display: inline-block;
}

/* حالة النجاح (عند اكتمال العرض) */
.discount-progress-container.unlocked {
    background: #f0fff4; /* خلفية خضراء فاتحة */
    border-bottom: 1px solid #c3e6cb;
}

.discount-progress-container.unlocked .discount-progress-text {
    color: #27ae60; /* نص أخضر */
}

.discount-progress-container.unlocked .discount-bar-fill {
    background: linear-gradient(90deg, #2ecc71, #27ae60); /* شريط أخضر */
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ==================================================
   ✨ منع السكرول الخلفي عند فتح السلة أو القائمة ✨
   ================================================== */

body.offcanvas-is-open {
    overflow: hidden !important; /* يخفي شريط تمرير الصفحة الرئيسية */
    height: 100vh !important;    /* يثبت الارتفاع */
   
}

.btn-text-link {
    background: none;
    border: none;
    color: #555;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    font-family: 'Tajawal', sans-serif;
    transition: color 0.2s;
}

.btn-text-link:hover {
    color: var(--pink);
}

.btn-text-link.restore {
    color: var(--price-color);
    font-weight: bold;
}

/* ==================================================
   ✨ تثبيت شريط العرض في أعلى السلة ✨
   ================================================== */

/* تعديل: جعل شريط العرض يتحرك مع السكرول ولا يثبت */
/* ==================================================
   ✨ إصلاح شريط العرض (ثابت + بدون زيادات جانبية) ✨
   ================================================== */

.discount-progress-container {
    /* 1. التثبيت */
    position: sticky !important;
    top: 57px !important;  /* يلتصق أسفل الهيدر مباشرة */
    z-index: 100;          /* طبقة عالية ليبقى فوق المنتجات */
    
    /* 2. الأبعاد ومنع الزيادة */
    width: 100% !important;
    box-sizing: border-box !important; /* ✅ هذا السطر هو الحل لمشكلة الزيادة */
    margin: 0 0 15px 0 !important;     /* إلغاء الهوامش الجانبية */
    
    /* 3. التصميم */
    background: linear-gradient(to bottom, #fff5f5, #fff);
    border-radius: 0 0 8px 8px; /* تدوير الحواف السفلية فقط لدمجه مع الهيدر */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 15px;
}

/* لون الخلفية عند اكتمال العرض */
.discount-progress-container.unlocked {
    background: #f0fff4;
    border-bottom: 1px solid #c3e6cb;
}

/* 2. التأكد من أن هيدر السلة فوق كل شيء */
.offcanvas-header {
    position: sticky;
    top: 0;
    z-index: 10; /* رقم أعلى من الشريط */
    background-color: white; /* ضروري لكي لا يظهر المحتوى خلفه */
}

/* =========================================
   ✨ تحسين حركة نافذة التأكيد ✨
   ========================================= */

/* =========================================
   ✨ تحسين حركة نافذة التأكيد ✨
   ========================================= */

/* الحالة الافتراضية (مخفية) */
#confirmation-summary-modal.modal-overlay {
    display: flex; /* اجعلها دائماً flex لتوسط المحتوى */
    opacity: 0;    /* لكن مخفية بالشفافية */
    visibility: hidden; /* ومخفية بالرؤية */
    transition: opacity 0.3s ease, visibility 0s 0.3s; /* حركة ناعمة */
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px); /* تغبيش الخلفية */
}

/* حالة الظهور */
#confirmation-summary-modal.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s; /* إزالة التأخير عند الظهور */
}

/* حركة المربع الأبيض */
#confirmation-summary-modal .modal-content {
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* تأثير قفزة بسيط */
}

#confirmation-summary-modal.modal-overlay.is-open .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* =========================================
   ✨ تنسيق نافذة تنبيه تسجيل الدخول ✨
   ========================================= */

/* تنسيق المحتوى الداخلي */
.login-warning-content {
    display: flex !important;          /* تفعيل فليكس */
    flex-direction: column !important; /* ترتيب العناصر عمودياً (فوق بعض) */
    align-items: center !important;    /* توسيط العناصر أفقياً */
    justify-content: center !important;
    text-align: center !important;
    
    max-width: 380px;
    width: 90%; /* لضمان عدم التصاقه بالحواف في الموبايل */
    padding: 30px 25px !important;
    border-radius: 20px !important;
    background-color: #fff; /* ضمان خلفية بيضاء */
}

/* أيقونة القفل */
.warning-icon-container {
    font-size: 3.5rem;
    margin-bottom: 15px;
    background-color: #fff0f3; /* خلفية وردية فاتحة جداً */
    color: var(--pink); /* تلوين القفل */
    width: 80px;
    height: 80px;
    line-height: 80px; /* لتوسيط الإيموجي عمودياً */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto; /* توسيط الحاوية نفسها */
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.2);
}

/* العنوان */
.login-warning-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 800;
}

/* الوصف */
.login-warning-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    width: 100%; /* التأكد من أن النص يأخذ راحته */
}

/* حاوية الأزرار */
.warning-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%; /* الأزرار تأخذ كامل العرض */
}

/* الأزرار */
.action-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Tajawal', sans-serif;
}

.action-btn:active {
    transform: scale(0.97);
}

/* زر الإنشاء (الرئيسي) */
.action-btn.primary {
    background-color: var(--pink);
    color: white;
    box-shadow: 0 4px 10px rgba(229, 169, 180, 0.4);
}
.action-btn.primary:hover {
    background-color: #d698a4;
}

/* زر الدخول (الثانوي) */
.action-btn.secondary {
    background-color: transparent;
    color: #555;
    border: 1px solid #eee;
}
.action-btn.secondary:hover {
    background-color: #f9f9f9;
    border-color: #ddd;
    color: #333;
}

/* ابحث عن هذا الجزء في البداية */
body {
    /* font-family: 'Tajawal', sans-serif;  <-- القديم */
    font-family: 'Noto Sans Arabic', sans-serif; /* <-- ✅ الجديد */
    /* ... بقية الخصائص ... */
}

/* وأيضاً في حقول الإدخال والأزرار لضمان توحيد الخط */
input, button, select, textarea, .main-category-button, .subcategory-list a {
    font-family: 'Noto Sans Arabic', sans-serif !important;
}

/* ============================================= */
/* ✨ 1. تنسيقات شاشات التحميل (Skeletons) ✨ */
/* ============================================= */
/* حاوية الهيكل العظمي */
.skeleton {
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px; /* مسافة أسفل كل كارت */
}

/* تأثير اللمعان المتحرك */
.skeleton::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* مكان الصورة */
.skeleton-img {
    width: 100%;
    aspect-ratio: 4 / 5;
    background-color: #e0e0e0;
}

/* مكان النصوص */
.skeleton-info {
    padding: 15px;
}

.skeleton-text {
    height: 15px;
    margin-bottom: 10px;
    background-color: #e0e0e0;
    border-radius: 4px;
}

/* تحديد عرض وهمي للنصوص */
.skeleton-text.title { width: 70%; margin-left: auto; } /* محاذاة لليمين */
.skeleton-text.price { width: 40%; margin-left: auto; }

/* ============================================= */
/* ✨ 2. تنسيقات تكبير الصورة (Zoom) ✨ */
/* ============================================= */
/* جعل الصورة داخل المودال قابلة للتكبير */
.modal-swiper .swiper-slide {
    overflow: hidden; /* لضمان عدم خروج الصورة عن الحدود */
    cursor: crosshair; /* شكل الماوس يتغير لعدسة */
}

.modal-swiper .swiper-slide img {
    transition: transform 0.1s ease-out; /* حركة ناعمة جداً عند تحريك الماوس */
    transform-origin: center center;
    will-change: transform;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================= */
/* ✨ تنسيقات عداد المبيعات (Social Proof) ✨ */
/* ============================================= */
.sales-notification {
    background-color: #fff0f3; /* خلفية وردية فاتحة جداً */
    border: 1px solid #ffccd5;
    color: #c0392b;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px; /* مسافة تحت السعر */
    width: fit-content;
    animation: fadeIn 0.5s ease-in-out;
}

.sales-notification .fire-icon {
    font-size: 1.2rem;
    animation: pulse-fire 1.5s infinite;
}

@keyframes pulse-fire {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================= */
/* ✨ إصلاح قسم "شاهدتها مؤخراً" ✨ */
/* ============================================= */

/* ضمان عدم خروج القسم عن الشاشة */
#recently-viewed-section {
    overflow: hidden; /* يقص أي شيء خارج الحدود */
    width: 100%;
    box-sizing: border-box;
    padding: 15px 10px !important; /* تقليل الحشوة للموبايل */
}

/* ضبط حاوية السلايدر */
#recently-viewed-section .swiper-container {
    width: 100%;
    overflow: hidden; /* ضروري جداً للسلايدر */
    padding-bottom: 10px;
}

/* ضبط الكروت داخل السلايدر */
#recently-viewed-section .related-product-card {
    width: 100%;
    margin: 0; /* إلغاء الهوامش لأن السلايدر يضبط المسافات */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#recently-viewed-section .swiper-slide {
    height: auto; /* لضمان تساوي الأطوال */
    width: auto;  /* للسماح للسلايدر بتحديد العرض */
}

/* ==================================================
   ✨ تنسيقات نقاط الولاء داخل السلة الجانبية ✨
   ================================================== */
.cart-loyalty-box {
    background-color: #fffbf0;
    border: 1px dashed #f1c40f;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-loyalty-info {
    font-size: 0.9rem;
    color: #d35400;
    font-weight: 600;
}

.cart-loyalty-info small {
    display: block;
    color: #7f8c8d;
    font-weight: normal;
    font-size: 0.8rem;
}

#cart-use-points-btn {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

#cart-use-points-btn.active {
    background-color: #e74c3c; /* لون أحمر للإلغاء */
}
/* ============================================= */
/* ✨ تحسين تصميم كارت السلة (لمنع التخريب) ✨ */
/* ============================================= */

.cart-item {
    position: relative; /* ضروري لكي نثبت زر الحذف بداخله */
    display: flex;
    align-items: center; /* محاذاة الصورة مع النص */
    gap: 15px;
    padding: 15px 10px; /* مساحة داخلية مريحة */
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    min-height: 100px; /* ضمان ارتفاع مناسب */
}

/* تنسيق زر الحذف (العلامة X في الزاوية) */
/* تنسيق زر الحذف (العلامة X في الزاوية) */
.remove-item-btn {
    position: absolute;
    top: 5px;
    left: 5px; /* في اليسار لأن الموقع عربي */
    background: #fff; /* خلفية بيضاء ليكون واضحاً */
    border: 1px solid #eee;
    border-radius: 50%; /* شكل دائري */
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    color: #e74c3c; /* ✨ لون أحمر دائم */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background-color: #e74c3c;
    color: #fff; /* ينقلب أبيض عند اللمس */
    transform: scale(1.1);
}

/* حاوية التفاصيل */
.cart-item-details {
    flex: 1; /* تأخذ باقي المساحة */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 25px; /* ✨ مسافة فارغة لزر الحذف حتى لا يغطي النص */
}

/* السطر السفلي (السعر والكمية) */
.cart-item-actions {
    display: flex;
    justify-content: space-between; /* يباعد بينهم */
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

/* ضمان عدم نزول السعر لسطر ثاني */
.cart-item-actions .price {
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 800;
    color: var(--price-color);
}

/* تصغير وتنسيق عداد الكمية */
.cart-quantity {
    height: 32px;
    width: 100px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin: 0; /* إلغاء أي هوامش خارجية */
}

.cart-quantity .quantity-btn {
    width: 30px;
    font-size: 1.2rem;
    padding: 0;
    line-height: 30px;
    color: #555;
}

.cart-quantity .quantity-input {
    font-size: 1rem;
    color: #333;
}

/* ============================================= */
/* ✨ شريط التنبيه عند انقطاع الإنترنت ✨ */
/* ============================================= */
#offline-banner {
    position: fixed;
    bottom: -50px; /* مخفي في الأسفل */
    left: 0;
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    z-index: 9999;
    transition: bottom 0.3s ease-in-out;
}
#offline-banner.show {
    bottom: 0; /* يظهر عند الانقطاع */
}

/* ✨ تنسيقات حاوية البحث وزر المسح ✨ */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

/* تنسيق زر المسح (X) */
.clear-search-btn {
    position: absolute;
    top: 50%;
    left: 15px; /* يظهر على اليسار لأن الموقع عربي */
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

html[dir="ltr"] .clear-search-btn {
    left: auto;
    right: 15px; /* في الإنجليزية يظهر على اليمين */
}

.clear-search-btn:hover {
    color: var(--pink);
}

/* تعديل حشوة حقل البحث لكي لا يغطي النص الزر */
#search-input {
    padding-left: 40px !important; /* مسافة لزر المسح */
}

html[dir="ltr"] #search-input {
    padding-left: 20px !important;
    padding-right: 40px !important;
}

/* ==================================================
   ✨ تنسيقات شريط التنقل الاحترافي (bb4kido Style) ✨
   ================================================== */

/* إخفاء الشريط على الشاشات الكبيرة */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    /* إضافة مساحة سفلية للصفحة */
    body { padding-bottom: 80px; }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px; /* ارتفاع مريح للأصابع */
        background-color: #ffffff;
        
        /* ظل ناعم جداً من الأعلى ليعطيه بروزاً */
        box-shadow: 0 -5px 20px rgba(0,0,0,0.05); 
        
        z-index: 9999;
        justify-content: space-around;
        align-items: center;
        
        /* تدوير الحواف العلوية قليلاً لجمالية أكثر */
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        
        padding-bottom: env(safe-area-inset-bottom); /* لهواتف آيفون الحديثة */
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #9e9e9e; /* لون رمادي فاتح للعناصر غير النشطة */
        font-size: 0.75rem;
        font-weight: 500;
        flex: 1;
        height: 100%;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    /* حاوية الأيقونة */
    .icon-container {
        position: relative;
        margin-bottom: 4px;
        transition: transform 0.2s;
    }

    .nav-item svg {
        width: 24px;
        height: 24px;
        stroke-width: 2px;
        transition: stroke 0.3s;
    }

    /* --- ✨ الحالة النشطة (عند الضغط) ✨ --- */
    .nav-item.active {
        color: var(--pink); /* استخدام اللون الوردي الخاص بموقعك */
        font-weight: 700;
    }

    .nav-item.active svg {
        stroke: var(--pink); /* تلوين الأيقونة */
        fill: rgba(229, 169, 180, 0.15); /* تعبئة خفيفة جداً بالوردي */
    }

    .nav-item.active .icon-container {
        transform: translateY(-2px); /* حركة بسيطة للأعلى */
    }

    /* --- شارة عداد السلة --- */
    .mobile-badge {
        position: absolute;
        top: -5px;
        right: -8px;
        background-color: #e74c3c; /* لون أحمر */
        color: white;
        font-size: 0.65rem;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        border: 2px solid #ffffff; /* إطار أبيض لفصله عن الأيقونة */
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
}

/* ==================================================
   ✨ إصلاح تداخل القوائم مع الشريط السفلي ✨
   ================================================== */

/* جعل الخلفية المعتمة فوق الشريط السفلي */
.offcanvas-overlay, 
.modal-overlay,
#nav-overlay {
    z-index: var(--z-overlay) !important; 
}

/* جعل السلة والقوائم فوق كل شيء */
.offcanvas,          
.offcanvas-nav,      
.filters-sidebar {   
    z-index: var(--z-drawer) !important;
    padding-bottom: 0 !important; 
}
/* 3. رفع طبقة النوافذ المنبثقة (مثل تفاصيل المنتج) */
.modal-content,
.auth-modal-content {
    z-index: var(--z-modal) !important;
}

/* 4. التأكد من أن زر الإغلاق قابل للنقر */
.close-btn,
.modal-close-button {
    z-index: 10003 !important;
}

/* ==================================================
   ✨ إصلاح مكان وحجم نافذة الدردشة للموبايلات الصغيرة ✨
   ================================================== */

@media (max-width: 768px) {
    
    /* 1. تثبيت مكان زر الدردشة (فوق الشريط السفلي) */
    .chat-bubble-container,
    .chat-bubble {
        bottom: 85px !important; 
        z-index: 10001 !important;
    }

/* 2. تعديل النافذة لتناسب كل الشاشات وتلغي الفراغ العلوي */
    .chat-window {
        bottom: 155px !important; 
        left: 15px !important;   
        right: 15px !important;  
        width: auto !important;  
        
        /* ✨ المعادلة الذكية: تأخذ طول الشاشة بالكامل ناقص (155 من الأسفل + 20 من الأعلى) ✨ */
        height: calc(100vh - 175px) !important; 
        
        /* ✨ الحل الجذري: إلغاء الحد الأقصى الثابت لتتمدد النافذة براحتها في الشاشات الطويلة ✨ */
        max-height: none !important; 
        
        min-height: 300px !important; 
        
        z-index: 10002 !important;
        transform-origin: bottom right;
    }
    
    /* ضبط اتجاه الانبثاق للغة العربية (لأن الزر يكون على اليسار) */
    html[dir="rtl"] .chat-window {
        transform-origin: bottom left;
    }
}



/* 2. جعل الزر تفاعلياً (حركة النبض الاحترافية) */
/* هذه الحركة تجعل الزر يرسل موجات خفيفة لجذب الانتباه */
@keyframes pulse-pink {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 169, 180, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(229, 169, 180, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(229, 169, 180, 0);
    }
}

.chat-bubble {
    /* تطبيق الحركة */
    animation: pulse-pink 2s infinite;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* حركة عند الضغط أو التمرير */
.chat-bubble:active,
.chat-bubble:hover {
    transform: scale(1.1) rotate(5deg); /* تكبير بسيط وميلان */
    animation: none; /* إيقاف النبض عند التفاعل */
}

/* 3. إضافة شارة "1" صغيرة (كأنما هناك رسالة انتظار) لزيادة الفضول */
/* يمكنك إزالة هذا الجزء إذا لم ترغب به */
.chat-bubble::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #2ecc71; /* لون أخضر (متصل) */
    border: 2px solid #fff;
    border-radius: 50%;
}

/* ==================================================
   ✨ إخفاء زر الدردشة بالقوة القصوى ✨
   ================================================== */

body.modal-is-open #chat-bubble,      /* عند فتح تفاصيل المنتج */
body.fancybox-active #chat-bubble,    /* عند تكبير الصورة */
body.offcanvas-is-open #chat-bubble { /* عند فتح القوائم الجانبية */
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: -9999 !important; /* إرساله إلى الخلف تماماً */
    pointer-events: none !important;
}


/* ==================================================
   ✨ تصميم هيدر الموبايل (لوجو كبير + ترتيب مخصص) ✨
   ================================================== */

@media (max-width: 768px) {
    /* 1. إخفاء العناصر غير المطلوبة */
    #cart-icon,
   
    #menu-toggle-btn {
        display: none !important;
    }

    /* 2. تكبير الهيدر قليلاً لاستيعاب اللوجو الأكبر */
    .header-top-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 15px !important;
        position: relative !important;
        height: 70px !important; /* ✨ زدنا الارتفاع من 55px إلى 70px */
    }

    /* 3. (اليسار): زر المفضلة */
    .header-left {
        order: 1;
        flex: 0 0 auto !important;
        margin-left: 0;
    }

    /* 4. (الوسط): اللوجو الكبير */
    .header-center {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 5;
        height: 100%; /* ليأخذ راحتة في التمركز */
        display: flex;
        align-items: center;
    }

    /* ✨ تكبير اللوجو ✨ */
    .logo-img {
        max-height: 30vw !important; /* ✨ زدنا الحجم من 42px إلى 58px */
        width: auto;
        object-fit: contain; /* لضمان عدم تشوه الصورة */
    }

    /* 5. (اليمين): الحاوية التي تضم اللغة والإشعارات */
    .header-right {
        order: 3;
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        position: static !important;
    }

    /* 6. زر اللغة */
    .lang-switcher-new {
        display: block !important;
    }
    
    #lang-toggle-btn {
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
        height: 32px;
    }

    /* 7. زر الإشعارات (الجرس) بجانب المفضلة */
    .notifications-container-user {
        position: absolute !important;
        left: 55px; /* المسافة من اليسار */
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    /* ضبط قائمة الإشعارات */
    .notifications-dropdown-user {
        left: 0 !important;
        right: auto !important;
        width: 280px !important;
        top: 55px !important; /* نزلناها قليلاً لتناسب الهيدر الجديد */
    }
}

/* =============================================
   ✨ تنسيقات شريط الستوريز (الفئات) ✨
   ============================================= */

.stories-container-wrapper {
    background-color: #fff;
    padding: 15px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
    /* يمكنك تفعيل هذا السطر إذا أردت الشريط يثبت عند النزول */
    /* position: sticky; top: 70px; z-index: 800; */
}

.categories-stories-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 0 15px;
    scrollbar-width: none; /* إخفاء شريط التمرير */
    -webkit-overflow-scrolling: touch;
}

/* إخفاء شريط التمرير لكروم */
.categories-stories-wrapper::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 72px; /* عرض مناسب للإصبع */
    cursor: pointer;
    transition: transform 0.2s ease;
}

.story-item:active {
    transform: scale(0.95);
}

/* الدائرة الملونة */
.story-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    /* تدرج لوني يشبه انستغرام */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); 
    padding: 3px; /* سماكة الإطار الملون */
    margin-bottom: 6px;
    position: relative;
}

/* لون خاص للفئة النشطة */
.story-circle.active {
    background: #e74c3c; /* أحمر عند الاختيار */
    transform: scale(1.05);
}

/* الصورة داخل الدائرة */
.story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff; /* فاصل أبيض بين الصورة والإطار */
    background-color: #f0f0f0;
}

.story-label {
    font-size: 0.8rem;
    color: #333;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================================================
   ✨ إصلاح ظهور الصور المكبرة فوق نافذة المنتج ✨
   ================================================== */

.fancybox__container {
    z-index: 30000 !important; /* رقم عالي جداً لضمان ظهورها فوق كل النوافذ */
}

/* ==================================================
   ✨ إصلاح الطبقات (Z-Index Fix) ✨
   ================================================== */

/* جعل الخلفية المعتمة فوق الشريط السفلي */
.offcanvas-overlay, 
.modal-overlay,
#nav-overlay {
    z-index: 10000 !important; 
}

/* جعل السلة والقوائم فوق كل شيء */
.offcanvas,          
.offcanvas-nav,      
.filters-sidebar {   
    z-index: 10001 !important;
    padding-bottom: 0 !important; 
}

/* جعل الشريط السفلي في طبقة أقل منهم */
.mobile-bottom-nav {
    z-index: var(--z-fixed-nav) !important;
}

/* ==================================================
   ✨ رفع رسالة التنبيه لتظهر فوق الشريط السفلي ✨
   ================================================== */

@media (max-width: 768px) {
    .toast {
        /* جعل الرسالة في أعلى طبقة ممكنة */
        z-index: 20000 !important; 
    }

    .toast.show {
        /* رفع الرسالة للأعلى بمقدار 90 بكسل */
        /* (70 بكسل ارتفاع الشريط + 20 بكسل مسافة أمان) */
        bottom: 90px !important; 
    }
}

/* ==================================================
   ✨ تصميم بطاقة المنتج الاحترافي (Modern Product Card) ✨
   ================================================== */

/* 1. الحاوية الرئيسية للكارت */
.product-card {
    background-color: #ffffff;
    border-radius: 16px; /* حواف دائرية ناعمة */
    border: none; /* إزالة الحدود القاسية */
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05); /* ظل ناعم جداً */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
   height: auto; /* لتوحيد الأطوال */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 2. حاوية الصورة */
.product-image {
    width: 100%;
    aspect-ratio: 3 / 4; /* نسبة أبعاد مثالية للملابس */
    position: relative; /* ضروري لتموضع الأزرار فوقها */
    background-color: #f7f7f7;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* تكبير الصورة قليلاً عند المرور */
.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* 3. زر "إضافة للسلة" السريع (العائم) */
.quick-add-btn {
    position: absolute;
    bottom: 12px; /* مسافة من الأسفل */
    left: 12px;   /* يظهر على اليسار (بسبب RTL) */
    width: 42px;
    height: 42px;
    background-color: #ffffff;
    color: #333;
    border-radius: 50%; /* شكل دائري */
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
    opacity: 1; /* ظاهر دائماً على الموبايل */
}

/* في اللغة العربية، نجعل الزر على اليسار ليكون في متناول الإبهام */
html[dir="rtl"] .quick-add-btn {
    left: 12px;
    right: auto;
}

.quick-add-btn:hover {
    background-color: var(--pink); /* يتلون بلون الموقع عند الضغط */
    color: white;
    transform: scale(1.1);
}

.quick-add-btn svg {
    width: 22px;
    height: 22px;
}



/* 5. معلومات المنتج والأسعار */
.product-info {
    padding: 12px 15px;
    background-color: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ✅ التغيير هنا: يجعل العناصر تبدأ من الأعلى */
    gap: 10px; /* ✅ إضافة مسافة ثابتة وصغيرة بين الاسم والسعر */
}

.product-name {
    font-size: 0.95rem;
    font-weight: 500; /* خط متوسط السماكة (أنيق) */
    color: #2d3436;
    margin: 0 0 8px 0;
    line-height: 1.4;
    
    /* قص النص الطويل */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* حاوية الأسعار */
.price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px; /* ✅ مسافة صغيرة وثابتة بدلاً من auto */
}

/* السعر الجديد (الأحمر) */
.current-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #e74c3c; /* أحمر واضح */
    letter-spacing: -0.5px;
}

/* السعر القديم (الرمادي) */
.old-price-small {
    font-size: 0.85rem;
    color: #b2bec3; /* رمادي فاتح جداً */
    text-decoration: line-through;
    font-weight: 400;
}

/* شارة الخصم (Sale Badge) */
.sales-badge {
    top: 12px;
    right: 12px;
    border-radius: 8px; /* تدوير خفيف */
    font-size: 0.75rem;
    padding: 4px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ==================================================
   ✨ إصلاح تصميم المودال على الحاسبة (Desktop Fixes) ✨
   ================================================== */

@media (min-width: 992px) {
    
    /* 1. إصلاح الحاوية الرئيسية للنافذة */
    .modal-content {
        width: 900px !important;      /* عرض ثابت ومناسب */
        max-width: 90% !important;
        height: auto !important;
        max-height: 85vh !important;  /* لا تغطي كامل الشاشة طولياً */
        border-radius: 20px !important;
        margin: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* لمنع خروج العناصر */
    }

    /* 2. ترتيب المحتوى (صورة يمين - تفاصيل يسار) */
    .modal-body {
        display: flex !important;
        flex-direction: row !important; /* ✨ أهم سطر: يجعل العناصر جنباً إلى جنب */
        padding: 40px !important;
        gap: 40px !important; /* مسافة كبيرة بين الصورة والتفاصيل */
        overflow-y: auto !important; /* تفعيل السكرول الداخلي */
    }

    /* 3. التحكم بحجم قسم الصور */
    .modal-gallery {
        flex: 1.3 !important; /* تأخذ مساحة أكبر قليلاً من النصوص */
        min-width: 0 !important; /* إصلاح مشكلة تمدد الفليكس */
        position: sticky !important; /* تثبيت الصور عند التمرير */
        top: 0;
        height: fit-content;
    }

    /* إصلاح ارتفاع الصورة الكبيرة */
    .swiper-container.modal-swiper {
        height: auto !important;
        aspect-ratio: 1 / 1.2 !important; /* نسبة أبعاد جميلة */
        border-radius: 12px;
    }

    /* 4. التحكم بحجم قسم التفاصيل */
    .modal-details {
        flex: 1 !important; /* تأخذ باقي المساحة */
        text-align: right;
        display: flex;
        flex-direction: column;
    }

    /* 5. إصلاح الأزرار (إلغاء التثبيت السفلي الخاص بالموبايل) */
    .modal-actions {
        position: static !important; /* إلغاء التثبيت */
        width: 100% !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-top: 30px !important;
        border-top: none !important;
    }

    /* 6. إصلاح مشكلة تداخل القائمة الجانبية (الفلاتر) */
    .modal-overlay {
       z-index: var(--z-modal) !important; /* جعل النافذة فوق كل شيء حرفياً */
        padding: 0 !important; /* إزالة الحواف الزائدة */
        align-items: center !important; /* توسيط عمودي */
        display: flex !important;
    }
}

/* ==================================================
   ✨ إصلاح وتجميل الدردشة على الحاسبة (Desktop Chat) ✨
   ================================================== */

@media (min-width: 992px) {
    
    /* 1. إعادة زر الدردشة لمكانه الطبيعي في الزاوية */
    .chat-bubble {
        bottom: 30px !important; /* مسافة طبيعية من الأسفل */
        width: 60px;
        height: 60px;
        /* إلغاء الرفع الخاص بالموبايل */
        transform: none !important; 
    }

    /* 2. ضبط مكان وحجم نافذة المحادثة */
    .chat-window {
        bottom: 100px !important; /* تظهر فوق الزر مباشرة */
        width: 360px !important;  /* عرض ثابت وأنيق */
        height: 500px !important; /* ارتفاع ثابت */
        max-height: 80vh;         /* لضمان عدم خروجها من الشاشة */
        border-radius: 12px;
        box-shadow: 0 5px 30px rgba(0,0,0,0.15); /* ظل ناعم */
    }

    /* 3. ضبط الاتجاه (للمواقع العربية RTL) */
    /* الزر والنافذة يكونان على اليسار */
    html[dir="rtl"] .chat-bubble {
        left: 30px !important;
        right: auto !important;
    }

    html[dir="rtl"] .chat-window {
        left: 30px !important;
        right: auto !important;
    }

    /* 4. تأثير جمالي عند مرور الماوس على الزر */
    .chat-bubble:hover {
        transform: scale(1.1) !important; /* تكبير بسيط */
        box-shadow: 0 8px 20px rgba(229, 169, 180, 0.4);
    }
    
    /* 5. إظهار الزر دائماً حتى عند فتح النوافذ في الحاسبة (اختياري) */
    /* لأن الشاشة كبيرة ولا يغطي المحتوى */
    body.modal-is-open .chat-bubble {
        opacity: 1 !important;
        pointer-events: all !important;
    }
}

/* ==========================================================================
   ✨ PROFESSIONAL PRODUCT CARD DESIGN (REDESIGNED)
   ========================================================================== */

.product-card {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid transparent; /* حدود شفافة للتحضير للـ hover */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%; /* لضمان تساوي الأطوال */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03); /* ظل خفيف جداً وأنيق */
}

/* تأثير عند مرور الماوس على الكارت بالكامل */
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(0,0,0,0.05);
}

/* --- حاوية الصورة --- */
.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; /* نسبة مثالية لصور الملابس */
    overflow: hidden;
    background-color: #f4f4f4;
}

/* الصورة نفسها */
.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* ✨ أضفنا opacity هنا لتكون الحركة أنعم قليلاً إذا أردت مستقبلاً عمل تأثير تلاشي */
    transition: transform 0.6s ease, opacity 0.3s ease; 
    will-change: transform;
}

/* تكبير الصورة عند الهوفر */
.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

/* --- الشارات (Badges) --- */
.card-badges {
    position: absolute;
    top: 10px;
    right: 10px; /* تظهر في اليمين */
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.badge.sale {
    background-color: #e74c3c;
    color: white;
}

.badge.new {
    background-color: var(--blue);
    color: white;
}

/* --- أزرار الإجراءات العائمة (توزيع جديد) --- */

/* 1. إلغاء تأثير الحاوية لتتحرك الأزرار بحرية */
.card-actions {
    position: static !important;
    display: block !important;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 2. التنسيق الأساسي للأزرار الدائرية (الأمنيات والسلة) */
.action-btn-card {
    position: absolute !important;
    z-index: 6;
    pointer-events: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: #333;
    padding: 0;
    margin: 0 !important;
}

/* 3. زر الأمنيات (القلب) -> فوق يسار */
.action-btn-card.wishlist-btn {
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
}

/* 4. زر الإضافة للسلة -> أسفل يمين */
.action-btn-card.quick-add-btn {
    bottom: 10px !important;
    right: 10px !important; /* على اليمين */
    left: auto !important;
    top: auto !important;
    
    background-color: var(--pink); /* تمييز زر السلة بلون وردي */
    color: white;
}

/* 5. زر التفاصيل الجديد (نصي) -> أسفل يسار */
.details-btn-card {
    position: absolute !important;
    bottom: 10px !important;
    left: 10px !important;
    right: auto !important;
    top: auto !important;
    z-index: 6;
    pointer-events: auto;
    
    background-color: rgba(255, 255, 255, 0.9);
    color: #555;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 15px; /* حواف بيضوية */
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Noto Sans Arabic', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.details-btn-card:hover {
    background-color: #333;
    color: white;
}

/* تأثير عند المرور للأزرار الدائرية */
.action-btn-card:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .action-btn-card {
        width: 36px;
        height: 36px;
    }
    .action-btn-card svg {
        width: 18px;
        height: 18px;
    }
}

/* حالة التفعيل لزر المفضلة */
.action-btn-card.wishlist-btn.is-active {
    background-color: #fff0f3;
    color: #e74c3c;
}
.action-btn-card.wishlist-btn.is-active svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* --- معلومات المنتج (النص) --- */
.product-details {
    padding: 12px 15px;
    background-color: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    
    /* ✅ التغيير 1: جعل العناصر تبدأ من الأعلى بدلاً من توزيعها */
    justify-content: flex-start; 
    
    /* ✅ التغيير 2: تحديد مسافة ثابتة وصغيرة بين الاسم والسعر */
    gap: 5px; 
}

.product-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--heading-color);
    margin: 0 0 8px 0;
    line-height: 1.4;
    
    /* قص النص الطويل بسطرين */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* استبدل كود .product-price-row والأسعار بهذا الكود */

.product-price-row {
    display: flex;
    flex-direction: column-reverse; /* السعر الجديد بالأعلى، القديم بالأسفل */
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 5px;
}

/* السعر الجديد (الأحمر) */
.price-current {
    font-size: 1.2rem;
    font-weight: 900;
    color: #e74c3c;
    line-height: 1;
    white-space: nowrap; /* يمنع نزول العملة لسطر جديد */
}

/* السعر القديم (الرمادي) */
.price-old {
    font-size: 0.9rem; /* حجم أصغر قليلاً للتمييز */
    color: #95a5a6;
    text-decoration: line-through; /* خط في المنتصف */
    font-weight: 400;
    white-space: nowrap; /* يمنع نزول العملة لسطر جديد */
    opacity: 0.8;
}
/* --- تحسينات الموبايل --- */
@media (max-width: 768px) {
    .product-card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    
    .action-btn-card {
        width: 36px;
        height: 36px; /* تصغير الأزرار قليلاً للموبايل */
    }
    
  
    
    .product-title {
        font-size: 0.85rem;
    }
    
  
}

/* تنسيق زر وتصميم الوصف القابل للطي */
.accordion-wrapper {
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin: 15px 0;
}

.accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Noto Sans Arabic', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--heading-color);
    cursor: pointer;
    transition: color 0.2s;
}

.accordion-toggle:hover {
    color: var(--pink);
}

.accordion-content {
    max-height: 0; /* مخفي افتراضياً */
    overflow: hidden;
    transition: max-height 0.4s ease-out; /* حركة ناعمة */
}

.accordion-content p {
    padding-bottom: 15px;
    margin: 0;
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* عند الفتح */
.accordion-toggle.active .icon {
    transform: rotate(45deg); /* تحويل علامة + إلى x */
    color: var(--pink);
}

.accordion-content.is-open {
    max-height: 500px; /* ارتفاع كافٍ ليظهر النص */
}

/* --- تنسيقات زر المقاس المقترح الجديد (Accordion) --- */

/* الحاوية الرئيسية */
#recommended-size-container {
    background-color: #eaf5fb;
    border: 1px solid #a9d4e5;
    border-radius: 12px;
    padding: 0; /* إلغاء الحشوة الخارجية ليكون الزر ملتصقاً */
    margin-bottom: 20px;
    margin-top: 30px; /* ✨ هذه هي المسافة بينه وبين المشاركة */
    overflow: hidden;
    cursor: pointer; /* شكل اليد عند المرور */
    transition: all 0.3s ease;
}

/* رأس الزر (الجزء الظاهر دائماً) */
.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #eaf5fb;
}

.recommendation-header h4 {
    margin: 0;
    color: #3498db;
    font-size: 1.1rem;
    font-weight: 700;
    
}

/* أيقونة السهم */
.rec-arrow {
    font-size: 0.9rem;
    color: #3498db;
    transition: transform 0.3s ease;
}

/* المحتوى المخفي (التفاصيل) */
#recommended-size-text {
    max-height: 0; /* مخفي افتراضياً */
    overflow: hidden;
    padding: 0 15px;
    opacity: 0;
    transition: all 0.3s ease-out;
    background-color: #fff; /* خلفية بيضاء للنص */
}

/* --- حالة الفتح (عند الضغط) --- */
#recommended-size-container.is-open .rec-arrow {
    transform: rotate(180deg); /* تدوير السهم */
}

#recommended-size-container.is-open #recommended-size-text {
    max-height: 500px; /* السماح بظهور المحتوى */
    opacity: 1;
    padding: 15px;
    border-top: 1px solid rgba(169, 212, 229, 0.3);
}


/* 2. إلغاء تمدد قسم التفاصيل */
.product-details {
    padding-bottom: 15px !important; /* حشوة سفلية بسيطة ومناسبة */
}

/* 3. تقليل المسافة أسفل السعر (كانت 20px) */
.new-price-wrapper {
    margin-bottom: 5px !important;
}

/* 4. تعديل محاذاة السعر ليكون متناسقاً */
.product-price-row {
    margin-top: 5px !important;
}

/* ==========================================================
   ✨ Modern Chat UI (WhatsApp/Messenger Style) ✨
   ========================================================== */

/* 1. زر الدردشة العائم */
.chat-bubble {
    position: fixed;
    bottom: 25px;
    left: 25px; /* أو right: 25px حسب اللغة */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink), #d68a96);
    border: none;
    box-shadow: 0 4px 15px rgba(229, 169, 180, 0.5);
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

html[dir="rtl"] .chat-bubble {
    left: auto;
    right: 25px;
}

.chat-bubble:hover {
    transform: scale(1.1);
}

.chat-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* 2. نافذة الدردشة الرئيسية */
.chat-window {
    position: fixed;
    bottom: 95px; /* فوق الزر مباشرة */
    left: 25px;
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom left;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

html[dir="rtl"] .chat-window {
    left: auto;
    right: 25px;
    transform-origin: bottom right;
}

.chat-window.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 3. الهيدر (رأس النافذة) */
.chat-header {
    background: linear-gradient(135deg, var(--pink), #edaeb9);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
}


.admin-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.admin-info .status-text {
    font-size: 0.75rem;
    opacity: 0.9;
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.icon-btn:hover { opacity: 1; }

/* 4. منطقة الرسائل */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f0f2f5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 5. الرسائل (الفقاعات) */
.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    word-wrap: break-word;
}

/* ✨ رسالة المدير (الأدمن) - تظهر على يسار الشاشة */
.message.received {
    align-self: flex-end; /* في العربية تعني اليسار */
    background-color: #ffffff;
    color: #333;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 18px;
    border-top-left-radius: 4px; /* الذيل من اليسار */
}

/* ✨ رسالة المستخدم (الزبون) - تظهر على يمين الشاشة */
.message.sent {
    align-self: flex-start; /* في العربية تعني اليمين */
    background: linear-gradient(135deg, var(--pink), #d68a96);
    color: white;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    border-top-right-radius: 4px; /* الذيل من اليمين */
}

/* ================================================= */
/* توافق الاتجاهات إذا قام المستخدم بتبديل اللغة للإنجليزية (LTR) */
/* ================================================= */
html[dir="ltr"] .message.received {
    align-self: flex-start; /* في الإنجليزية تعني اليسار */
    border-top-right-radius: 18px;
    border-top-left-radius: 4px;
}

html[dir="ltr"] .message.sent {
    align-self: flex-end; /* في الإنجليزية تعني اليمين */
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
}

.message small {
    display: block;
    font-size: 0.65rem;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}
.message.sent small { color: rgba(255,255,255,0.9); }

/* 6. حالة الفراغ (Empty State) */
.empty-state {
    text-align: center;
    margin-top: 60px;
    opacity: 0.6;
}
.empty-icon { font-size: 3rem; margin-bottom: 10px; animation: wave 2s infinite; }
@keyframes wave { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(20deg); } }

/* 7. منطقة الإدخال */
.chat-input-area {
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background-color: #f0f2f5;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.chat-input-area input:focus {
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 2px var(--pink);
}

.send-btn {
    background-color: var(--pink);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1);
    background-color: #d68a96;
}

/* ================================================= */
/* ✨ إصلاح تداخل الفلاتر مع نافذة المنتج (Desktop) ✨ */
/* ================================================= */

/* 1. رفع طبقة نافذة المنتج لتكون فوق كل شيء */
.modal-overlay {
    z-index: var(--z-modal) !important;
}

/* 2. خفض طبقة الفلاتر الجانبية في الشاشات الكبيرة */
@media (min-width: 768px) {
    .filters-sidebar {
        z-index: 90 !important; /* قيمة أقل من المودال */
    }
}

/* 3. حل جذري: عندما تكون النافذة مفتوحة، اجعل الفلاتر في الخلفية تماماً */
body.modal-is-open .filters-sidebar {
    z-index: 0 !important;
}

/* ================================================= */
/* ✨ إصلاح نهائي لكل الطبقات والنوافذ (Z-Index) ✨ */
/* ================================================= */

/* 1. نافذة تكبير الصور (Fancybox): يجب أن تكون فوق كل شيء في الكون */
.fancybox__container {
    z-index: 1000000 !important; /* رقم عالي جداً */
}

.size-options-modal-overlay {
    z-index: var(--z-modal-top) !important;
}

/* 3. القائمة الجانبية (الفلاتر): إجبارها على الرجوع للخلف عند فتح أي نافذة أو صورة */
body.modal-is-open .filters-sidebar,
body.fancybox-active .filters-sidebar {
    z-index: 0 !important;
}

/* ==========================================================================
   15. PROFESSIONAL AUTHENTICATION STYLES
   ========================================================================== */

/* --- Account Icon & Dropdown --- */
.account-container { position: relative; }

.account-dropdown {
    position: absolute;
    top: 130%;
    left: 0;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 160px;
    z-index: 1000;
    border: 1px solid #f0f0f0;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}

.account-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
}

html[dir="rtl"] .account-dropdown { left: auto; right: 0; }

.account-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    text-decoration: none;
    color: #555;
    border-radius: 8px;
    text-align: right;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    font-family: 'Noto Sans Arabic', sans-serif;
}

html[dir="ltr"] .account-dropdown .dropdown-item { text-align: left; }
.account-dropdown .dropdown-item:hover { background-color: #f5f5f5; }

/* --- Modern Auth Modal Styles --- */
#auth-modal .auth-modal-content.modern-auth {
    background-color: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 0; /* Important: Padding is handled by inner containers */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.auth-header {
    background: linear-gradient(135deg, #fff0f3 0%, #fff 100%);
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #f5f5f5;
    flex-shrink: 0;
}

.auth-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.2);
    object-fit: cover;
}

.auth-header h3 {
    margin: 5px 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 800;
}

.auth-header p {
    margin: 0;
    color: #888;
    font-size: 0.9rem;
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 15px;
    left: 15px; /* RTL Default */
    background: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #aaa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    z-index: 10;
}
html[dir="ltr"] .auth-modal-close { left: auto; right: 15px; }

.auth-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

/* Scrollable Container */
.auth-forms-container {
    padding: 25px 30px 35px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Tabs */
.auth-tabs {
    display: flex;
    background-color: #f9f9f9;
    padding: 5px;
    border-radius: 12px;
    margin: 20px 30px 0;
    flex-shrink: 0;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.auth-tab-btn.active {
    background-color: #fff;
    color: var(--pink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Auth Forms Visibility */
.auth-form {
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.auth-form.active {
    display: flex;
    opacity: 1;
}

/* Input Fields with Icons */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input,
.select-wrapper select {
    width: 100%;
    padding: 14px 15px;
    padding-right: 45px; /* RTL space for icon */
    padding-left: 15px;
    border: 1px solid #eee;
    background-color: #fcfcfc;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Noto Sans Arabic', sans-serif;
    transition: all 0.2s ease;
    color: #333;
    box-sizing: border-box;
}

html[dir="ltr"] .input-with-icon input {
    padding-left: 45px;
    padding-right: 15px;
}

.input-with-icon input:focus,
.select-wrapper select:focus {
    background-color: #fff;
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(229, 169, 180, 0.1);
    outline: none;
}

/* Icons Positioning */
.field-icon {
    position: absolute;
    right: 15px;
    font-size: 1.1rem;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    height: 100%;
}
html[dir="ltr"] .field-icon { right: auto; left: 15px; }

.field-icon.whatsapp-color { color: #25d366; }

/* Password Toggle Btn */
.toggle-password {
    position: absolute;
    left: 10px;
    right: auto;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
}
html[dir="ltr"] .toggle-password { left: auto; right: 10px; }

/* Form Layout */
.form-group { margin-bottom: 18px; text-align: right; }
html[dir="ltr"] .form-group { text-align: left; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #555;
}

/* Row for Gender/Year */
.form-row {
    display: flex;
    gap: 15px;
}
.form-group.half { flex: 1; }

.select-wrapper { position: relative; }
.select-wrapper select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaaaaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 16px;
}
html[dir="ltr"] .select-wrapper select { background-position: right 10px center; }

/* Google Button */
.social-login-btn.google {
    width: 100%;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.social-login-btn.google:hover {
    background-color: #fcfcfc;
    border-color: #ddd;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.social-login-btn .icon-wrapper { width: 24px; height: 24px; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    margin-bottom: 25px;
    font-size: 0.9rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}
.auth-divider span { padding: 0 10px; }

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--pink) 0%, #e07a89 100%);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    border: none;
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229, 169, 180, 0.6);
}

.auth-submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

/* Verify & Reset Styles */
.verify-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

#verify-form h3, #reset-password-form h3 {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.verify-instructions {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.resend-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.change-phone-link { color: #555; text-decoration: underline; }
.resend-otp { color: var(--pink); font-weight: 700; text-decoration: none; border: none; background: none; cursor: pointer; }
.resend-otp.disabled { color: #ccc; cursor: default; }

/* OTP Inputs */
#otp-inputs-container, #reset-otp-inputs-container {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.otp-digit-input {
    width: 45px;
    height: 55px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 1.5rem;
    text-align: center;
    background-color: #fff;
    transition: all 0.2s;
    font-family: monospace;
}

.otp-digit-input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(229, 169, 180, 0.1);
    transform: translateY(-2px);
    outline: none;
}

/* Links */
.forgot-password {
    display: block;
    margin-bottom: 20px;
    text-align: left;
    color: #777;
    font-size: 0.9rem;
    text-decoration: none;
}
html[dir="ltr"] .forgot-password { text-align: right; }

.back-to-login-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

/* Error Messages */
.form-error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}
.form-error-message.show { display: block; }

/* Scrollbar for Modal */
.auth-forms-container::-webkit-scrollbar { width: 6px; }
.auth-forms-container::-webkit-scrollbar-track { background: #f1f1f1; }
.auth-forms-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.auth-forms-container::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ==================================================
   ✨ إصلاح وتجميل نافذة إكمال تسجيل جوجل (Google Modal Fix) ✨
   ================================================== */

/* 1. إصلاح الخلفية (Overlay) */
#google-complete-modal.modal-overlay {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* إضافة حشوة لضمان عدم التصاق النافذة بالحواف */
}

/* 2. تحسين تصميم النافذة نفسها (Content) */
#google-complete-modal .auth-modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    border: 1px solid #f0f0f0;
    margin: auto;
    
    /* ✨ الإضافات المهمة لحل المشكلة ✨ */
    display: flex;              /* تفعيل نظام المرونة */
    flex-direction: column;     /* ترتيب العناصر عمودياً */
    max-height: 85vh;           /* أقصى ارتفاع هو 85% من الشاشة */
    overflow: hidden;           /* إخفاء الزوائد الخارجية */
    position: relative;
}

/* 3. منطقة الهيدر (الشعار والعنوان) - تبقى ثابتة */
#google-complete-modal .auth-header {
    flex-shrink: 0; /* منع الهيدر من الانكماش */
    padding-top: 25px;
    padding-bottom: 10px;
    background-color: #fff;
    border-bottom: 1px solid #f9f9f9;
}

/* 4. منطقة الفورم (Scrollable Area) - هي التي تتحرك */
#google-complete-modal .auth-forms-container {
    padding: 20px 30px 25px; /* مسافات داخلية مريحة */
    
    /* ✨ تفعيل السكرول ✨ */
    overflow-y: auto;           /* السماح بالتمرير العمودي */
    flex-grow: 1;               /* تأخذ المساحة المتبقية */
    -webkit-overflow-scrolling: touch; /* تمرير ناعم للآيفون */
}

/* تكبير الشعار قليلاً */
#google-complete-modal .auth-logo {
    width: 80px;
    height: 80px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.3);
    margin-bottom: 10px;
    border-radius: 50%;
}

/* تحسين زر الإرسال */
#google-send-otp-btn {
    background: linear-gradient(135deg, #e5a9b4 0%, #d68a96 100%);
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.4);
    margin-top: 15px; /* تقليل المسافة قليلاً */
    font-size: 1.1rem;
    padding: 14px;
    width: 100%;
}

/* تحسين زر الإلغاء */
#google-cancel-btn {
    margin-top: 10px;
    padding-bottom: 10px; /* مسافة إضافية في الأسفل */
}
/* ==================================================
   ✨ إصلاح ظهور رسائل التنبيه فوق النوافذ ✨
   ================================================== */

/* 1. رفع مستوى شريط التنبيهات (Toast) ليكون فوق كل شيء */
.toast {
    z-index: var(--z-toast) !important;
}

/* 2. التأكد من ظهور رسائل الخطأ داخل النافذة نفسها (إن وجدت) */
#google-complete-modal .form-error-message {
    z-index: 20001; /* أعلى من النافذة (20000) */
    position: relative;
    color: #e74c3c;
    text-align: right;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==================================================
   ✨ تنسيقات نافذة إكمال بيانات جوجل الجديدة ✨
   ================================================== */

/* تحسين السكرول داخل المودال */
.auth-forms-container {
    padding: 25px 30px 35px;
    overflow-y: auto;
    flex-grow: 1;
    /* هذا السطر يضمن ظهور السكرول إذا كان المحتوى طويلاً جداً على الموبايل */
    max-height: 65vh; 
    -webkit-overflow-scrolling: touch; /* سكرول ناعم للايفون */
}

/* رفع طبقة مودال الرمز لتظهر فوق المودال الأول إذا لزم الأمر */
#google-otp-modal {
    z-index: 20005; /* أعلى من المودال العادي */
}

/* ==================================================
   ✨ إصلاح محاذاة مربعات الرمز (OTP Fix) ✨
   ================================================== */

/* تحسين الحاوية لضمان التوسط وعدم الخروج عن الشاشة */
#google-otp-inputs {
    gap: 6px !important; /* تقليل المسافة بين المربعات (يلغي ستايل HTML) */
    justify-content: center !important;
    flex-wrap: nowrap !important; /* منع نزول المربعات لسطر ثاني */
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
}

/* تنسيق خاص لحقول الرمز في مودال جوجل - نسخة محسنة للموبايل */
#google-otp-inputs .otp-digit-input {
    width: 40px !important; /* عرض مثالي لمعظم الشاشات */
    height: 50px !important;
    font-size: 1.3rem !important;
    margin: 0 !important; /* إزالة الهوامش الجانبية والاعتماد على gap فقط */
    padding: 0 !important;
    border-radius: 8px;
}

/* للشاشات الصغيرة جداً (مثل iPhone SE) */
@media (max-width: 360px) {
    #google-otp-inputs {
        gap: 4px !important;
    }
    #google-otp-inputs .otp-digit-input {
        width: 35px !important;
        font-size: 1.1rem !important;
    }
}

/* زر الرجوع النصي */
.btn-text-link {
    background: none;
    border: none;
    color: #777;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Noto Sans Arabic', sans-serif;
}

/* ==================================================
   ✨ إصلاح خلفية نافذة رمز جوجل (White Background Fix) ✨
   ================================================== */

/* تحديد خلفية بيضاء وتصميم الكارت للنافذة */
#google-otp-modal .auth-modal-content {
    background-color: #ffffff !important; /* لون أبيض إجباري */
    border-radius: 20px; /* حواف دائرية */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); /* ظل لإبراز النافذة */
    width: 90%; /* عرض مناسب للموبايل */
    max-width: 400px;
    margin: auto; /* توسيط النافذة */
    overflow: hidden; /* لضمان عدم خروج المحتوى عن الحواف */
    border: 1px solid #f0f0f0;
}

/* التأكد من أن حاوية الحقول تأخذ الخلفية البيضاء أيضاً */
#google-otp-modal .auth-forms-container {
    background-color: #ffffff !important;
}

/* --- زر المعلومات داخل الحقل --- */
.field-info-btn {
    position: absolute;
    left: 10px; /* يظهر على اليسار */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--blue); /* لون أزرق مميز */
    cursor: pointer;
    padding: 5px;
    z-index: 5;
    transition: transform 0.2s;
}

.field-info-btn:hover {
    transform: translateY(-50%) scale(1.1);
    color: var(--pink);
}

/* توسيع الحقل لكي لا يغطي النص الزر */
.input-with-icon input {
    padding-left: 45px !important; /* مساحة للزر */
}

/* --- تصميم نافذة المعلومات الصغيرة --- */
.info-modal-small {
    max-width: 350px !important; /* نافذة صغيرة وأنيقة */
    text-align: center;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    padding: 0 !important;
    display: block !important; /* إلغاء flex القديم */
}

.info-modal-header {
    background-color: #f9f9f9;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.info-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.info-modal-body {
    padding: 25px;
}

.gift-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.rewards-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: right;
    background: #f0f8ff;
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed #a9d4e5;
}

.rewards-list li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}

.rewards-list li:last-child {
    margin-bottom: 0;
}

/* ============================================= */
/* ✨ تنسيقات العداد التنازلي المتقدمة (محدث) ✨ */
/* ============================================= */

/* التنسيق الأساسي للعداد */
.promo-timer-badge {
    background: rgba(229, 9, 20, 0.9); /* أحمر جذاب */
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    direction: ltr;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    z-index: 20;
}

/* تنسيقات الأحجام */
.promo-timer-badge.timer-small {
    padding: 2px 8px;
    font-size: 0.75rem;
}
.promo-timer-badge.timer-medium {
    padding: 5px 15px;
    font-size: 0.95rem;
}
.promo-timer-badge.timer-large {
    padding: 10px 25px;
    font-size: 1.3rem;
    border-width: 3px;
}

/* تنسيقات الأرقام */
.timer-unit b {
    color: inherit; /* ✨ يرث اللون من الأب (الذي نحدده في لوحة التحكم) */
}

/* --- التحكم بالموقع داخل البانر الصوري --- */
/* (ملاحظة: هذا يطبق عندما يكون العداد داخل .banner-timer-overlay أو مباشرة) */

/* نستخدم Absolute Positioning للتحكم بالمكان */
.swiper-slide .promo-timer-badge {
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* توسيط أفقي */
}

/* المواقع */
.swiper-slide .promo-timer-badge.timer-pos-top {
    top: 20px;
    bottom: auto;
}

.swiper-slide .promo-timer-badge.timer-pos-center {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%); /* توسيط كامل */
}

.swiper-slide .promo-timer-badge.timer-pos-bottom {
    bottom: 25px;
    top: auto;
}

/* إذا كان العداد في شريط نصي، نلغي الـ Absolute */
.promo-strip .promo-timer-badge {
    position: static;
    transform: none;
    margin-top: 5px;
    background: rgba(0,0,0,0.5); /* خلفية أهدأ للشريط النصي */
    border: 1px solid rgba(255,255,255,0.3);
}

/* ============================================= */
/* ✨ تحسينات الخطوط التفاعلية (Interactive Typography) ✨ */
/* ============================================= */

/* تحسين شكل العناوين */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}

/* تفاعل العناوين عند المرور */
.product-title:hover, 
.cart-item-details h4:hover {
    color: var(--pink);
}

/* تحسين حقول الإدخال */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select, 
textarea {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* تأثير "التركيز" الجميل */
input:focus, select:focus, textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 169, 180, 0.15);
    border-color: var(--pink);
}

/* تحسين الأزرار */
button, .btn {
    letter-spacing: 0.5px;
    transition: all 0.2s ease !important;
}

/* تأثير الضغط الحقيقي */
button:active, .btn:active {
    transform: scale(0.96) !important;
}

/* تحسين أرقام الأسعار */
.price, .price-current, .old-price, .final-total {
    font-variant-numeric: tabular-nums; /* محاذاة الأرقام */
    letter-spacing: -0.5px;
}

/* 1. الحاوية الأب هي التي ستثبت في الأعلى */
#sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000; /* طبقة عالية جداً */
    width: 100%;
    background-color: var(--off-white); /* نفس لون خلفية الهيدر */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* ظل خفيف للكل */
}

/* 2. إلغاء التثبيت من العناصر الداخلية لتجنب التضارب */
#top-strip-container {
    position: relative; /* ليس sticky */
    z-index: 2;
}

.site-header-new {
    /* إلغاء الـ sticky القديم */
    position: relative; 
    top: auto !important; /* إلغاء الاعتماد على الجافاسكريبت */
    border-bottom: none; /* نقل الإطار للحاوية الكبيرة إذا أردت */
}

.header-top-row {
    position: relative !important;
    top: auto !important;
}

.trust-features-bar {
    display: flex;
    justify-content: space-around;
    background: #fff;
    padding: 15px 10px;
    margin: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    overflow-x: auto;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px; /* لضمان عدم انكماشها في الموبايل */
}

.trust-item .icon {
    font-size: 1.8rem;
    background: #f9f9f9;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.trust-item .text {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.trust-item strong { font-size: 0.85rem; color: var(--heading-color); }
.trust-item small { font-size: 0.7rem; color: #888; }

/* ==================================================
   ✨ تنسيقات ويدجت تتبع الطلب في الصفحة الرئيسية ✨
   ================================================== */

.recent-order-card {
    background: white;
    border: 1px solid #a9d4e5; /* إطار أزرق */
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto; /* توسيط ومسافة */
    max-width: 800px; /* لا يأخذ عرض الشاشة بالكامل */
    box-shadow: 0 4px 15px rgba(169, 212, 229, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.recent-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
}

.recent-order-title {
    font-weight: 800;
    color: var(--heading-color);
    font-size: 1rem;
}

/* شريط التقدم */
.mini-progress-track {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-top: 10px;
}

/* الخط الرمادي الخلفي */
.mini-progress-track::before {
    content: '';
    position: absolute;
    top: 50%; /* في منتصف الأيقونات */
    left: 0;
    right: 0;
    height: 3px;
    background: #eee;
    z-index: 0;
    transform: translateY(-50%);
}

.mini-step {
    width: 30px;
    height: 30px;
    background: white;
    border: 2px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* فوق الخط */
    font-size: 0.8rem;
    position: relative; /* مهم للعلامة الحمراء */
}

/* الخطوة النشطة */
.mini-step.active {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

/* العلامة الحمراء (النقطة) */
.mini-step span[style*="background:red"] {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #e74c3c !important;
    border-radius: 50%;
    border: 2px solid white;
}

/* ==================================================
   ✨ تحسين نصوص شريط التتبع (Labels) ✨
   ================================================== */

.mini-step {
    position: relative; /* ضروري لتموضع النص */
    overflow: visible !important; /* للسماح للنص بالظهور خارج حدود الدائرة */
}

/* تنسيق النص تحت الأيقونة */
.step-label {
    position: absolute;
    top: 35px; /* المسافة من أعلى الأيقونة */
    left: 50%;
    transform: translateX(-50%);
    width: 80px; /* عرض كافٍ للنص */
    text-align: center;
    font-size: 0.65rem;
    color: #aaa;
    line-height: 1.2;
    font-weight: 500;
    white-space: normal;
}

/* تمييز نص المرحلة الحالية والسابقة */
.mini-step.active .step-label {
    color: #333;
    font-weight: 700;
}

/* زيادة المسافة السفلية للكارت لاستيعاب النصوص */
.recent-order-card {
    padding-bottom: 30px !important;
}

/* ==================================================
   ✨ Professional Fly-to-Cart Animation ✨
   ================================================== */

.flyer-img {
    position: fixed;
    background-color: #fff;
    z-index: 100000;
    /* الحجم نحدده بالجافاسكريبت، لكن هنا نضع خصائص الصورة */
    object-fit: cover; /* مهم جداً: يمنع تمطيط الصورة داخل الدائرة */
   border-radius: 12px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    pointer-events: none;
    
    /* سر الحركة الناعمة */
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.8s ease;
    
    /* بداية الشفافية */
    opacity: 1;
}

/* 2. حركة "نبض" السلة عند الاستلام (أفضل من الهز العشوائي) */
@keyframes cart-bump {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); color: var(--pink); } /* تكبر */
    50% { transform: scale(0.9); } /* تصغر قليلاً */
    100% { transform: scale(1); color: inherit; }
}

.bump-animation {
    animation: cart-bump 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================
   تصميم نظام الخطوات (Wizard Style)
   ========================================= */

/* شريط التقدم (الدوائر والأرقام) */
.wizard-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    direction: ltr; /* نخلي الأرقام من اليسار لليمين حتى لو الموقع عربي لجمالية الترتيب */
}

.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0; /* لون رمادي للخطوة غير المفعلة */
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    z-index: 2;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

/* الخطوة الحالية والمكتملة */
.step-indicator.active {
    background-color: var(--primary-color, #ff4081); /* يستخدم لون الموقع الرئيسي أو وردي */
    color: #fff;
    box-shadow: 0 4px 10px rgba(255, 64, 129, 0.3);
    transform: scale(1.1);
}

.step-indicator.completed {
    background-color: var(--secondary-color, #4CAF50); /* أخضر عند الإكمال */
    color: #fff;
}

/* الخط الموصل بين الدوائر */
.step-line {
    flex: 1;
    height: 3px;
    background-color: #e0e0e0;
    margin: 0 10px;
    max-width: 60px; /* طول الخط */
    border-radius: 2px;
}

.step-line.active {
    background-color: var(--primary-color, #ff4081);
}

/* حاوية الخطوات */
.wizard-step {
    display: none; /* إخفاء الجميع افتراضياً */
    animation: fadeIn 0.5s ease-in-out;
}

.wizard-step.active {
    display: block; /* إظهار الخطوة الحالية فقط */
}

/* تأثير الظهور */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* نصوص وعناوين الخطوات */
.wizard-header {
    text-align: center;
    margin-bottom: 25px;
}

.wizard-header h3 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    color: #333;
}

.wizard-header p {
    color: #777;
    font-size: 0.95rem;
    margin: 0;
}

/* ترتيب الحقول بجانب بعض (للجنس والمواليد) */
.form-row-split {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

/* أزرار التنقل */
.wizard-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

/* زر الرجوع (ستايل مختلف قليلاً) */
.action-btn.secondary {
    background-color: #f5f5f5;
    color: #555;
    border: 1px solid #ddd;
}

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

/* مؤشر قوة الباسورد */
.password-strength-meter {
    height: 4px;
    background-color: #eee;
    margin-top: 8px;
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* =========================================
   تصميم Skeleton Loading (شاشة التحميل)
   ========================================= */

/* جعل حاوية التحميل شبكة مطابقة لشبكة المنتجات */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* نفس قياسات المنتجات */
    gap: 15px;
    width: 100%;
    grid-column: 1 / -1; /* لضمان أخذ العرض الكامل */
}

/* شكل الكارت الوهمي */
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* العناصر الرمادية داخل الكارت */
.skeleton-image {
    width: 100%;
    height: 180px; /* ارتفاع تقريبي لصورة المنتج */
    background-color: #e0e0e0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton-line {
    background-color: #e0e0e0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-line.title {
    height: 14px;
    width: 80%;
}

.skeleton-line.price {
    height: 14px;
    width: 40%;
}

/* حركة اللمعان (Shimmer Effect) */
.skeleton-image::after,
.skeleton-line::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* تدرج لوني شفاف يمر فوق الرمادي */
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.5), 
        transparent
    );
    transform: translateX(-100%);
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    100% {
        transform: translateX(100%);
    }
}

/* تعديل للموبايل لضمان ظهور كارتين بجانب بعض */
@media (max-width: 480px) {
    .skeleton-grid {
        grid-template-columns: repeat(2, 1fr); /* عمودين اجباري في الموبايل */
        gap: 10px;
    }
    .skeleton-image {
        height: 150px; /* تصغير الصورة قليلاً في الموبايل */
    }
}

/* =========================================
   تصميم الفوتر الجديد الاحترافي
   ========================================= */

.site-footer-modern {
    background-color: #2c3e50; /* لون غامق للاحترافية */
    color: #ecf0f1;
    padding: 60px 0 20px;
    margin-top: 50px;
    font-size: 0.95rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.footer-col h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
    font-weight: 900;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #ff4081; /* لون وردي لكسر الجمود */
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: #ff4081;
}

.footer-desc {
    line-height: 1.6;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.footer-links, .contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li, .contact-info li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease, padding-right 0.3s ease;
    display: block;
}

.footer-links a:hover {
    color: #fff;
    padding-right: 8px; /* حركة بسيطة عند الماوس */
}

.footer-socials {
    display: flex;
    gap: 15px;
}

.social-link {
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.social-link:hover {
    background: #ff4081;
}

/* القسم السفلي */
.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.payment-icons span {
    background: #fff;
    color: #333;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
}

/* موبايل */
@media (max-width: 768px) {
    .site-footer-modern {
        padding: 40px 0 80px; /* مسافة من الأسفل عشان المنيو السفلي */
        text-align: center;
    }

    .footer-col h4::after {
        right: 50%;
        transform: translateX(50%);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-socials {
        justify-content: center;
    }
}


/* =========================================
   📱 تحسين الفوتر للموبايل (Mobile Footer Accordion)
   ========================================= */

@media (max-width: 768px) {
    /* تنسيق الحاوية */
    .site-footer-modern {
        text-align: right; /* محاذاة لليمين وليس الوسط لسهولة القراءة */
        padding-bottom: 100px; /* مسافة إضافية في الأسفل عشان المنيو العائم */
    }

    .footer-content {
        gap: 0; /* إلغاء المسافات الكبيرة بين الأعمدة */
        display: block; /* إلغاء نظام الشبكة ليصبح بلوكات تحت بعض */
    }

    .footer-col {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* خط خفيف بين الأقسام */
        margin-bottom: 0;
    }

    /* تحويل العناوين إلى أزرار تفاعلية */
    .footer-col h4 {
        margin: 0;
        padding: 15px 0;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none; /* منع تحديد النص */
    }

    /* إضافة علامة (+) بجانب العنوان */
    .footer-col h4::after {
        content: '+';
        font-size: 1.5rem;
        font-weight: 300;
        transition: transform 0.3s ease;
        color: #ff4081;
    }

    /* إخفاء الخط المتحرك القديم لأنه لا يناسب هذا التصميم */
    .footer-col h4::before,
    .footer-col h4::after {
        /* نلغي تأثير الخط السفلي القديم إذا كان موجوداً */
        bottom: auto; 
        background: none;
        height: auto;
        width: auto;
    }

    /* عند فتح القائمة، تتحول (+) إلى (x) بالدوران */
    .footer-col.active h4::after {
        transform: rotate(45deg); 
    }

    /* القوائم مخفية افتراضياً */
    .footer-links, 
    .contact-info {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out, opacity 0.3s ease;
        opacity: 0;
        padding-right: 10px; /* إزاحة بسيطة للداخل */
    }

    /* عند التفعيل (الفتح) */
    .footer-col.active .footer-links,
    .footer-col.active .contact-info {
        max-height: 500px; /* رقم كبير ليسمح بظهور المحتوى */
        opacity: 1;
        padding-bottom: 15px;
    }

    /* استثناء للعمود الأول (اللوجو والوصف) يظهر دائماً */
    .footer-col:first-child {
        border-bottom: none;
        text-align: center;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .footer-col:first-child h4 {
        pointer-events: none; /* منع الضغط عليه */
    }
    
    .footer-col:first-child h4::after {
        display: none; /* إخفاء علامة الزائد */
    }
}

/* تنسيق خاص لزر المشاركة الأصلي ليطابق الأزرار الأخرى */
.social-btn.native-share {
    background-color: #333; /* لون أسود رمادي أنيق */
    color: #fff;
    border: 1px solid #333; /* حدود بنفس اللون */
    cursor: pointer;
    font-family: inherit; /* نفس الخط */
    display: inline-flex; /* لضمان نفس سلوك الأزرار المجاورة */
    align-items: center;
    justify-content: center;
    /* الخصائص التالية موروثة من social-btn لكن نعيد تأكيدها للزر */
    box-sizing: border-box;
    margin: 0;
}

.social-btn.native-share:hover {
    background-color: #555;
    border-color: #555;
}

/* تعديل بسيط للتأكد من أن جميع الأزرار بنفس الارتفاع */
.social-share-buttons {
    align-items: center; /* محاذاة عمودية */
}

/* --- تنسيق إشعار الشراء (Social Proof) --- */
#social-proof-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    max-width: 320px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
    border-left: 4px solid var(--pink);
    font-size: 0.9rem;
    pointer-events: none;
    direction: rtl; 
}

.social-proof-hide {
    opacity: 0;
    transform: translateY(100px) scale(0.9);
    pointer-events: none;
}

.social-proof-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    cursor: pointer;
}

.sp-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.sp-content {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.sp-text { color: #333; font-weight: 600; line-height: 1.3; font-size: 0.85rem; }
.sp-time { color: #888; font-size: 0.75rem; margin-top: 2px; }
.sp-verified { color: #27ae60; font-size: 0.7rem; display: flex; align-items: center; gap: 3px; margin-top: 2px; }

/* ==========================================================================
   ✨ BREADCRUMBS STYLES (مسارات التنقل)
   ========================================================================== */
.breadcrumbs-container {
    max-width: 1200px;
    margin: 10px auto 0 auto; /* مسافة من الأعلى */
    padding: 10px 20px;
    font-size: 0.9rem;
    font-family: 'Tajawal', sans-serif;
    color: #777;
    white-space: nowrap; /* منع نزول النص لسطر ثاني */
    overflow-x: auto; /* تفعيل السكرول الأفقي للموبايل */
    -webkit-overflow-scrolling: touch; /* سكرول ناعم */
    display: flex;
    align-items: center;
    background-color: #fff; /* خلفية بيضاء لنظافة التصميم */
    border-bottom: 1px solid #f0f0f0; /* خط فاصل خفيف */
}

/* إخفاء شريط السكرول المزعج */
.breadcrumbs-container::-webkit-scrollbar {
    display: none;
}

.breadcrumbs-container a {
    text-decoration: none;
    color: #555;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.breadcrumbs-container a:hover {
    color: var(--pink); /* يتلون عند المرور */
    font-weight: 700;
}

.breadcrumbs-container .separator {
    margin: 0 8px;
    color: #ccc;
    font-size: 0.8rem;
    display: inline-block;
}

/* عكس اتجاه السهم في اللغة العربية ليكون منطقياً */
html[dir="rtl"] .breadcrumbs-container .separator {
    transform: rotate(180deg);
}

.breadcrumbs-container .current {
    font-weight: 700;
    color: var(--heading-color);
}

/* تحسين للموبايل */
@media (max-width: 768px) {
    .breadcrumbs-container {
        font-size: 0.85rem;
        padding: 10px 15px;
        margin-top: 5px;
    }
}

.bogo-alert {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}
.bogo-alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    animation: pulse 2s infinite;
}
.bogo-alert.info {
    background-color: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ==========================================================
   ✨ تصميم بطاقة الكوبون والأزرار الجديدة (New Coupon UI) ✨
   ========================================================== */

/* حاوية الأزرار لتكون بجانب بعضها */
.coupon-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

/* تنسيق عام للأزرار */
.coupon-action-btn {
    flex: 1; /* يجعل الأزرار تأخذ نفس العرض */
    padding: 10px 5px;
    border: none;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 1. تصميم زر النسخ (رمادي هادئ) */
.btn-copy-code {
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.btn-copy-code:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.btn-copy-code:active {
    transform: scale(0.96);
}

/* 2. تصميم زر التفعيل (لون مميز - متوهج) */
.btn-activate-code {
    background-color: var(--pink); /* يستخدم لون المتجر الرئيسي */
    color: white;
    box-shadow: 0 4px 12px rgba(229, 169, 180, 0.4); /* ظل ناعم */
    position: relative;
    overflow: hidden;
}

.btn-activate-code:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(229, 169, 180, 0.6);
}

.btn-activate-code:active {
    transform: translateY(0);
}

/* تأثير لمعان خفيف على زر التفعيل */
.btn-activate-code::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.btn-activate-code:hover::after {
    left: 100%;
}

/* ==========================================================
   ✨ تحسين شكل الـ Toast ليصبح احترافياً ✨
   ========================================================== */
.toast-professional {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    color: #333 !important;
    border-left: 5px solid var(--pink); /* خط ملون على الجانب */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    padding: 15px 20px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600 !important;
    min-width: 300px;
    border-radius: 12px !important;
}

/* أيقونة داخل التوست */
.toast-icon-large {
    font-size: 1.5rem;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

/* تمييز الكوبون النشط */
.wallet-coupon-card.active-card-glow {
    border: 2px solid var(--primary-color) !important;
    background-color: #fff0f5; /* لون وردي فاتح جداً */
    box-shadow: 0 0 15px rgba(233, 30, 99, 0.2);
}

.btn-deactivate-code {
    background-color: #e74c3c !important; /* لون أحمر للإلغاء */
    color: white;
}

/* 1. اجبار الشبكة على جعل جميع الخلايا بنفس الارتفاع */
.product-grid {
    align-items: stretch !important; /* مهم جداً: تمديد الكروت لتتساوى */
}

/* 2. تنسيق الكارت ليأخذ الطول الكامل */
.product-card {
    height: 100% !important; /* اجباري ليأخذ طول الخلية */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* توزيع المساحة */
}

/* 3. تثبيت حجم الصورة (أنت تملك هذا بالفعل لكن للتأكيد) */
.product-image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4; /* نسبة ثابتة للملابس */
    flex-shrink: 0; /* منع الصورة من الانكماش */
    position: relative;
    background-color: #f7f7f7;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 4. تنسيق التفاصيل لتملأ الفراغ المتبقي */
.product-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1 !important; /* مهم: يجعل هذا الجزء يتمدد ليملأ الفراغ */
    padding: 10px;
    justify-content: space-between; /* يجعل السعر والأزرار في الأسفل دائماً */
}

/* 5. توحيد ارتفاع العنوان (لحل مشكلة اختلاف طول الأسماء) */
.product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* سطرين كحد أقصى */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em; /* ارتفاع ثابت للعنوان */
    line-height: 1.4;
    margin-bottom: 8px;
}

/* =========================================================
   ✨ تصميم شريط القصص (Instagram Style Stories) ✨
   ========================================================= */

/* 1. الحاوية الخارجية للشريط */
.stories-container-wrapper {
    padding: 15px 0 10px 0;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
    overflow: hidden; /* لمنع تمدد الصفحة */
}

/* 2. شريط السكرول الأفقي */
.categories-stories-wrapper {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 0 15px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* سكرول ناعم للايفون */
    scrollbar-width: none; /* إخفاء شريط السكرول لمتصفح فايرفوكس */
}

/* إخفاء شريط السكرول لمتصفحات كروم وسفاري */
.categories-stories-wrapper::-webkit-scrollbar {
    display: none;
}

/* 3. عنصر الستوري الواحد */
.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 75px; /* عرض ثابت لكل عنصر */
    flex-shrink: 0; /* منع الانكماش */
    transition: transform 0.2s ease;
}

.story-item:active {
    transform: scale(0.95); /* تصغير بسيط عند النقر */
}

/* 4. الدائرة الملونة (الإطار) */
.story-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    /* تدرج لوني يشبه انستغرام ممزوج بألوان متجرك */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #e5a9b4 100%);
    padding: 3px; /* سماكة الإطار الملون */
    position: relative;
    margin-bottom: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* حالة "تمت المشاهدة" أو غير نشط (اختياري - لون رمادي) */
.story-circle.seen {
    background: #e0e0e0;
}

/* 5. الصورة داخل الدائرة */
.story-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff; /* فاصل أبيض بين الصورة والإطار الملون */
    object-fit: cover;
    background-color: #fff;
    display: block;
}

/* 6. اسم الفئة أسفل الدائرة */
.story-name {
    font-size: 0.8rem;
    color: #333;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-family: 'Tajawal', sans-serif;
}

/* تحسين للموبايل */
@media (max-width: 480px) {
    .story-circle {
        width: 62px;
        height: 62px;
    }
    .story-name {
        font-size: 0.75rem;
    }
}

/* =========================================
   🎨 Color Swatches (خيارات الألوان)
   ========================================= */
.color-options-container {
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.color-options-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
    color: #333;
}

.color-swatches-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.color-swatch-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* التنسيق عند اختيار لون معين */
.color-swatch-btn.active {
    border: 2px solid #333; /* إطار داكن للتمييز */
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333; /* تأثير حلقة مزدوجة */
}

/* Tooltip لاسم اللون عند تمرير الماوس */
.color-swatch-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.color-swatch-btn:hover::after {
    opacity: 1;
}

/* ================================================= */
/* ✨ تنسيقات الدردشة الجديدة (Typing & Read) ✨ */
/* ================================================= */

/* 1. تنسيق علامات القراءة (الصحين) */
.tick {
    display: inline-block;
    margin-right: 5px; /* مسافة عن الوقت */
    font-size: 0.8rem;
    color: #aaa; /* لون رمادي (غير مقروء) */
    transition: color 0.3s ease;
}

.tick.read {
    color: #3498db; /* لون أزرق (مقروء) */
}

/* مؤشر "جاري الكتابة" - النسخة الثابتة */
.typing-indicator {
    background-color: transparent; /* خلفية شفافة لدمجها */
    padding: 5px 15px;
    border-radius: 20px;
    display: none; /* مخفي افتراضياً */
    align-items: center;
    width: fit-content;
    
    /* ✨ التثبيت في الأسفل */
    position: absolute;
    bottom: 70px; /* الارتفاع فوق حقل الإدخال (عدل الرقم حسب ارتفاع الفورم عندك) */
    left: 20px; /* المسافة من اليسار */
    z-index: 10; /* لضمان ظهوره فوق الرسائل */
}

/* النقاط المتحركة */
.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #888; /* لون النقاط */
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ========================================================= */
/* ✨ مؤشر الكتابة الثابت (فوق حقل الإدخال مباشرة) ✨ */
/* ========================================================= */
.typing-indicator-bar {
    width: 100%;
    padding: 4px 15px;       /* مسافة صغيرة ومناسبة */
    background-color: #fff;  /* خلفية بيضاء لتندمج مع الإدخال */
    border-top: 1px solid #f9f9f9; /* خط خفيف جداً من الأعلى */
    
    display: none;           /* مخفي افتراضياً */
    align-items: center;
    gap: 8px;
    
    /* لضمان ظهوره بشكل ناعم */
    animation: fadeInUp 0.2s ease-out;
}

.typing-indicator-bar .typing-text {
    font-size: 0.75rem;      /* خط صغير */
    color: #999;             /* لون رمادي هادئ */
    font-weight: 500;
}

/* تنسيق النقاط المتحركة */
.typing-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- تصميم زر المايكروفون --- */
#voice-record-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 5px;
    padding: 5px;
    transition: transform 0.2s;
}

#voice-record-btn:active {
    transform: scale(0.9);
    color: red;
}

/* --- تصميم واجهة التسجيل (تظهر فوق حقل الكتابة) --- */
#voice-record-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex; /* hidden by default */
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 10;
    border-radius: 20px;
}

#chat-input-form.is-recording input {
    visibility: hidden; /* إخفاء حقل النص أثناء التسجيل */
}

#record-timer {
    font-weight: bold;
    color: #e74c3c;
    min-width: 50px;
}

/* --- أنيميشن الموجات الصوتية --- */
.record-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}
.record-wave span {
    display: block;
    width: 3px;
    background: #e74c3c;
    animation: wave 1s infinite ease-in-out;
}
.record-wave span:nth-child(1) { height: 10px; animation-delay: 0.1s; }
.record-wave span:nth-child(2) { height: 15px; animation-delay: 0.2s; }
.record-wave span:nth-child(3) { height: 20px; animation-delay: 0.3s; }
.record-wave span:nth-child(4) { height: 10px; animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

/* --- أزرار التحكم في التسجيل --- */
#cancel-record-btn, #send-record-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
}
#cancel-record-btn { color: #777; }
#send-record-btn { color: #2ecc71; font-size: 1.5rem; }

/* --- تصميم مشغل الصوت داخل المحادثة --- */
.chat-audio-wrapper audio {
    max-width: 200px;
    height: 40px;
    border-radius: 20px;
}
/* إزالة الخلفية البيضاء الافتراضية للمشغل في كروم ليتناسب مع الفقاعات */
.chat-audio-wrapper audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.8);
}
.message.sent .chat-audio-wrapper audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.4); /* لون مختلف للمرسل */
}

/* =========================================
   تحديث واجهة الدردشة (Messenger Style)
   ========================================= */

/* 1. الحاوية السفلية */
.chat-input-container {
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

/* 2. تخطيط النموذج (Flex Layout) */
.chat-bar-layout {
    display: flex;
    align-items: center;
    gap: 8px; /* مسافة بين العناصر */
    padding: 8px;
    position: relative;
    background: transparent;
}

/* 3. الأزرار الجانبية (صورة، مايك، إرسال) */
.chat-action-btn, 
.chat-file-label {
    background: none;
    border: none;
    cursor: pointer;
    color: #8e8e8e; /* لون رمادي للأيقونات */
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 !important; /* إلغاء أي مارجن قديم */
}

.chat-action-btn:hover, 
.chat-file-label:hover {
    background-color: #f5f5f5;
    color: #555;
}

/* لون خاص لزر الإرسال */
.send-btn {
    color: #0084ff; /* أزرق ماسنجر */
}
.send-btn:hover {
    background-color: #e6f2ff;
}

/* 4. حقل الكتابة (Pill Shape) */
#chat-message-input {
    flex: 1; /* يأخذ المساحة المتبقية */
    background-color: #f0f2f5; /* خلفية رمادية فاتحة */
    border: none;
    border-radius: 20px; /* تدوير الحواف */
    padding: 10px 15px;
    font-size: 15px;
    color: #050505;
    outline: none;
    transition: background-color 0.2s;
    height: 40px;
}

#chat-message-input:focus {
    background-color: #e4e6eb;
}

#chat-message-input::placeholder {
    color: #b0b3b8;
}

/* 5. واجهة التسجيل (Recording Overlay) */
#voice-record-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    border-radius: 20px; /* ليتناسب مع الحاوية */
    z-index: 20;
    animation: slideIn 0.2s ease-out;
}

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

/* عناصر داخل واجهة التسجيل */
.record-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ea4335; /* لون أحمر */
    font-weight: 600;
    font-size: 14px;
    padding-right: 10px;
}

.record-dot {
    width: 10px;
    height: 10px;
    background-color: #ea4335;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* أمواج الصوت */
.record-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.record-wave span {
    display: block;
    width: 3px;
    background: #ea4335;
    border-radius: 2px;
    animation: wave 1s infinite ease-in-out;
}
.record-wave span:nth-child(1) { height: 10px; animation-delay: 0.0s; }
.record-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.record-wave span:nth-child(3) { height: 20px; animation-delay: 0.2s; }
.record-wave span:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.record-wave span:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.8); }
}

/* أزرار الحذف والإرسال للتسجيل */
.record-actions {
    display: flex;
    gap: 10px;
}

#cancel-record-btn {
    color: #65676b;
    padding: 8px;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
}
#cancel-record-btn:hover { background-color: #f2f2f2; color: #ea4335; }

#send-record-btn {
    background-color: #0084ff;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#send-record-btn:hover { background-color: #0073e6; transform: scale(1.05); }

/* 6. تحسين شكل فقاعات الرسائل (للمشغل) */
.chat-audio-wrapper {
    min-width: 220px;
    margin: 5px 0;
}

.chat-audio-wrapper audio {
    width: 100%;
    height: 36px;
    border-radius: 18px;
}

/* تصحيح ألوان المشغل داخل الفقاعات */
.message.sent .chat-audio-wrapper audio {
    filter: invert(1) brightness(2); /* جعل المشغل أبيض ليناسب الخلفية الداكنة */
    opacity: 0.9;
}

/* =========================================
   تنسيق صور الدردشة (تظهر مصغرة)
   ========================================= */
.chat-image-wrapper {
    width: 200px;          /* عرض ثابت للصورة المصغرة */
    height: 150px;         /* ارتفاع ثابت */
    overflow: hidden;      /* إخفاء الزوائد */
    border-radius: 12px;   /* تدوير الحواف */
    margin: 5px 0;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
    background-color: #f0f0f0;
}

.chat-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;     /* قص الصورة لتملأ المربع بانتظام */
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-image-wrapper img:hover {
    transform: scale(1.05); /* تأثير تكبير بسيط عند وضع الماوس */
}

/* تنسيق خاص للموبايل لجعلها أصغر قليلاً */
@media (max-width: 768px) {
    .chat-image-wrapper {
        width: 160px;
        height: 120px;
    }
}

/* =========================================
   ✨ شريط التنبيه داخل الدردشة (Auto-Delete)
   ========================================= */
.chat-info-banner {
    background-color: #fff9c4; /* لون أصفر فاتح ومريح */
    color: #856404; /* لون نص بني متناسق */
    font-size: 0.75rem;
    text-align: center;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid #ffeeba;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    z-index: 2;
}

.chat-info-banner svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* =========================================
   1. الخلفية الضبابية (تظهر خلف الدردشة فقط)
   ========================================= */
#chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* لون أسود خفيف */
    
    /* هذا هو السطر السحري: يغبش ما "خلف" هذه الطبقة فقط */
    backdrop-filter: blur(5px);         
    -webkit-backdrop-filter: blur(5px); 
    
    z-index: 9998; /* تحت الدردشة مباشرة */
    display: none; /* مخفي افتراضياً */
    opacity: 0;
    transition: opacity 0.3s ease;
}

#chat-backdrop.is-visible {
    display: block;
    opacity: 1;
}

/* =========================================
   2. نافذة الدردشة (واضحة وصافية)
   ========================================= */
#chat-window {
    z-index: 9999 !important; /* أعلى من الخلفية */
    background-color: #ffffff; /* لون أبيض صلب لمنع الشفافية */
    
    /* ضمان عدم وجود شفافية */
    box-shadow: 0 5px 20px rgba(0,0,0,0.15); 
}
/* تنسيق زر المايكروفون */
.chat-action-btn.mic-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn.mic-btn:hover {
    background-color: #f0f0f0;
    color: var(--pink);
}

/* حالة التسجيل النشط */
.chat-action-btn.mic-btn.recording-active {
    color: white;
    background-color: #e74c3c;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* واجهة التسجيل (العداد والموجة) */
#voice-record-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border-top: 1px solid #eee;
}

.record-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e74c3c;
    font-weight: bold;
}

.record-dot {
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.record-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}

#cancel-record-btn { color: #999; }
#cancel-record-btn:hover { color: #e74c3c; background: #fee; }

#send-record-btn { color: var(--blue); }
#send-record-btn:hover { color: white; background: var(--blue); }
/* ========================================= */
/* ✨ تنسيقات الحذف بالضغط المطول (Messenger Style) ✨ */
/* ========================================= */

/* 1. تأثير الضغط على الفقاعة */
.msg-bubble {
    user-select: none; /* منع تحديد النص أثناء الضغط */
    -webkit-user-select: none;
    transition: transform 0.1s ease, opacity 0.2s;
    cursor: pointer; /* إظهار أن العنصر قابل للتفاعل */
    position: relative;
    /* تأكد من أن الفقاعة لا تملك زر حذف داخلي قديم يضايق التصميم */
}

/* كلاس سيتم إضافته بالجافاسكربت عند الضغط */
.msg-bubble.pressing {
    transform: scale(0.95);
    opacity: 0.8;
}

/* 2. خلفية القائمة المنبثقة (Overlay) */
.long-press-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* خلفية معتمة */
    z-index: 99999; /* فوق كل شيء */
    display: none;
    align-items: flex-end; /* القائمة تظهر من الأسفل للموبايل */
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.long-press-menu-overlay.active {
    display: flex;
    opacity: 1;
}

/* 3. القائمة نفسها */
.long-press-menu {
    background-color: #fff;
    width: 100%;
    max-width: 400px; /* عرض مناسب للحاسوب */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    text-align: center;
}

/* في الشاشات الكبيرة، نجعلها في الوسط */
@media (min-width: 768px) {
    .long-press-menu-overlay {
        align-items: center;
    }
    .long-press-menu {
        border-radius: 15px;
        width: 300px;
    }
}

.long-press-menu-overlay.active .long-press-menu {
    transform: translateY(0);
}

/* 4. أزرار القائمة */
.lp-menu-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
}

/* زر الحذف */
.lp-menu-btn.delete {
    background-color: #ffebee;
    color: #d32f2f;
}
.lp-menu-btn.delete:hover {
    background-color: #ffcdd2;
}

/* زر الإلغاء */
.lp-menu-btn.cancel {
    background-color: #f5f5f5;
    color: #333;
    margin-bottom: 0;
}
.lp-menu-btn.cancel:hover {
    background-color: #e0e0e0;
}

/* ================================================= */
/* ✨ تنسيقات الرد على الرسائل (Reply System) ✨ */
/* ================================================= */

/* 1. فقاعة الرد داخل الرسالة */
.reply-snippet {
    background: rgba(0, 0, 0, 0.05);
    padding: 6px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    border-right: 3px solid transparent; /* للرسائل المستقبلة */
    border-left: 3px solid transparent; /* للرسائل المرسلة */
}

/* تنسيق الرد داخل رسائل الزبون (المرسلة) */
.message.sent .reply-snippet {
    background: rgba(255, 255, 255, 0.2); /* خلفية شفافة بيضاء */
    border-right: 3px solid rgba(255, 255, 255, 0.8);
    border-left: none;
    color: #fff;
}
.message.sent .reply-snippet span {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* تنسيق الرد داخل رسائل الأدمن (المستقبلة) */
.message.received .reply-snippet {
    background: rgba(0, 0, 0, 0.04);
    border-left: 3px solid var(--pink); /* لون المتجر */
    border-right: none;
}

/* 2. شريط المعاينة فوق حقل الكتابة */
#reply-preview-bar {
    background: #f9f9f9;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    animation: slideUp 0.2s ease-out;
}

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

.reply-preview-content {
    border-right: 3px solid var(--pink);
    padding-right: 8px;
    max-width: 85%;
}

.reply-preview-sender {
    color: var(--pink);
    font-weight: bold;
    font-size: 0.8rem;
    display: block;
}

.reply-preview-text {
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

#cancel-reply-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0 10px;
}

/* 3. زر الرد في القائمة المنبثقة */
.lp-menu-btn.reply {
    color: #3498db; /* لون أزرق مميز */
    border-bottom: 1px solid #f0f0f0;
}

/* ========================================= */
/* ✨ تأثير السحب للرد (Swipe to Reply) ✨ */
/* ========================================= */

/* جعل الرسالة قابلة للتحريك */
.msg-bubble, .message {
    position: relative;
    touch-action: pan-y; /* السماح بالسكرول العمودي ومنع الأفقي الافتراضي */
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

/* أيقونة الرد التي تظهر عند السحب */
.reply-icon-overlay {
    position: absolute;
    top: 50%;
    /* للأدمن والزبون (العربية RTL) */
    right: -50px; 
    transform: translateY(-50%) scale(0);
    
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3498db; /* اللون الأزرق */
    font-size: 16px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
    pointer-events: none;
}

/* تنسيق خاص للرسائل الإنجليزية أو LTR إن وجد */
[dir="ltr"] .reply-icon-overlay {
    right: auto;
    left: -50px;
}

/* عند تفعيل السحب */
.swiping .reply-icon-overlay {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* =========================================
   ✨ تنسيق رسائل النظام (System Messages)
   ========================================= */
.message.system-msg {
    align-self: center !important; /* إجبارها تكون بالوسط */
    background: transparent !important; /* بدون خلفية ملونة */
    box-shadow: none !important; /* بدون ظل */
    margin: 15px 0; /* مسافة مريحة من فوق وتحت */
    width: 100%;
    text-align: center;
    border: none !important;
    padding: 0 !important;
}

.system-text {
    display: inline-block;
    background-color: #f0f2f5; /* خلفية رمادية فاتحة جداً ومريحة للعين */
    color: #65676b; /* لون نص رمادي داكن للقراءة */
    padding: 6px 14px;
    border-radius: 20px; /* حواف دائرية */
    font-size: 0.75rem; /* خط صغير */
    font-weight: 600;
    border: 1px solid #e4e6eb;
    direction: rtl; /* لضمان ظهور النص العربي بشكل صحيح */
}

/* في الوضع الليلي (Dark Mode) - اختياري إذا كان موقعك يدعمه */
@media (prefers-color-scheme: dark) {
    .system-text {
        background-color: #3a3b3c;
        color: #b0b3b8;
        border-color: #3e4042;
    }
}

/* تنسيق فواصل التواريخ */
.date-separator {
    text-align: center;
    margin: 15px 0;
    position: relative;
    font-size: 0.8rem;
    color: #999;
    font-weight: bold;
    clear: both;
    width: 100%;
}
.date-separator span {
    background: #f4f6f9; /* نفس لون خلفية الشات */
    padding: 4px 12px;
    border-radius: 12px;
}

/* ========================================= */
/* 🎵 تصميم مشغل الموجات الصوتية الجديد 🎵 */
/* ========================================= */

.audio-player-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 9px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.5); /* خلفية شفافة قليلاً */
    min-width: 240px;
    max-width: 100%;
    position: relative;
    direction: ltr; /* الحفاظ على اتجاه المشغل من اليسار لليمين */
}

/* زر التشغيل */
.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: var(--pink); /* لون المتجر الأساسي */
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s, background-color 0.2s;
    z-index: 2;
}

.audio-play-btn:hover {
    transform: scale(1.05);
    background-color: #d698a4;
}

.audio-play-btn.playing {
    background-color: #e74c3c; /* لون أحمر عند الإيقاف */
}

/* حاوية الموجات */
.waveform-container {
    flex-grow: 1;
    height: 30px;
    position: relative;
    cursor: pointer;
    opacity: 0.8;
}

/* توقيت الصوت */
.audio-duration {
    font-size: 11px;
    color: #555;
    font-weight: 600;
    min-width: 35px;
    text-align: center;
}

/* تخصيص الألوان حسب المرسل (اختياري) */
.message.sent .audio-play-btn {
    background-color: #fff;
    color: var(--pink);
}
.message.sent .audio-player-wrapper {
    background-color: rgba(0, 0, 0, 0.05);
}

/* تنسيق أيقونات الدفع في الفوتر */
#footer-payment-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* مسافة بين الأيقونات */
    margin-top: 10px;
}

.payment-icon-img {
    height: 35px; /* ارتفاع ثابت للأيقونة */
    width: auto;
    object-fit: contain;
    filter: grayscale(0%); /* يمكن جعلها 100% لتكون رمادية وتلون عند التحويم */
    transition: transform 0.2s ease;
}

.payment-icon-img:hover {
    transform: scale(1.1); /* تكبير بسيط عند وضع الماوس */
}

/* تنسيق خريطة الفوتر */
.footer-map-wrapper {
    margin-top: 15px;
    border-radius: 12px;       /* زوايا دائرية */
    overflow: hidden;          /* لضمان احترام الزوايا الدائرية */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* ظل خفيف */
    border: 2px solid rgba(255, 255, 255, 0.1); /* إطار شفاف بسيط */
    transition: transform 0.3s ease;
}

.footer-map-wrapper:hover {
    transform: translateY(-5px); /* حركة طفيفة للأعلى عند وضع الماوس */
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.footer-map-wrapper iframe {
    display: block; /* إزالة المسافات الزائدة أسفل الخريطة */
    filter: grayscale(20%); /* (اختياري) تقليل تشبع الألوان لتناسب الفوتر */
}

.footer-map-wrapper:hover iframe {
    filter: grayscale(0%); /* إعادة الألوان عند التحويم */
}
/* اجعل الحاوية مخفية منذ البداية لمنع الوميض */
.footer-map-wrapper {
    display: none;
}

/* إخفاء أيقونات التواصل الاجتماعي افتراضياً لمنع الوميض */
/* الجافاسكربت سيقوم بإظهارها فقط إذا كان هناك رابط */
.footer-socials .social-link {
    display: none;
}

.footer-desc {
    display: none;
}
/* ================================================= */
/* تحسين نقطة الحالة (Status Dot) - النسخة المرنة   */
/* ================================================= */

/* 1. إخفاء النقطة من الفقاعة الخارجية نهائياً */
#chat-bubble .status-dot,
#chat-bubble::after,
#chat-bubble::before {
    display: none !important;
    content: none !important;
}

/* 2. إظهار النقطة داخل الدردشة مع السماح بتغير اللون */
#chat-window .status-dot {
    display: inline-block !important; /* إجبارها على الظهور */
    width: 12px !important;           /* تكبير الحجم قليلاً للوضوح */
    height: 12px !important;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;           /* إطار أبيض جمالي */
    z-index: 10;
    
    /* ملاحظة: حذفنا سطر background-color من هنا 
       لكي يأخذ اللون (أخضر/أحمر) من البرمجة تلقائياً */
}

/* 3. (اختياري) تحديد ألوان الحالات يدوياً إذا لم تظهر */
#chat-window .status-dot.online {
    background-color: #2ecc71 !important; /* أخضر */
}

#chat-window .status-dot.offline {
    background-color: #c2c2c2 !important; /* أحمر */ /* */
}

/* =========================================
   تطوير تصميم فلاتر الفئات (Categories Filter)
   ========================================= */

/* 1. إخفاء مربع الاختيار الافتراضي المشوه */
.filter-accordion-content input[type="checkbox"] {
    display: none !important;
}

/* 2. تصميم حاوية الفئة (السطر بالكامل) */
.filter-accordion-content label {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    margin-bottom: 8px;
    background-color: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 100%;
    box-sizing: border-box;
}

/* 3. تأثير عند تمرير الماوس */
.filter-accordion-content label:hover {
    background-color: #f8f9fa;
    border-color: #d1d1d1;
    transform: translateY(-1px);
}

/* 4. ترتيب النص والمربع الجديد */
.filter-accordion-content label span {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 0.95rem;
    color: #444;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

/* 5. رسم مربع الاختيار الاحترافي (Custom Checkbox) */
.filter-accordion-content label span::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 14px; /* المسافة من جهة اليسار لأن الموقع بالعربي */
    border: 2px solid #ccc;
    border-radius: 6px; /* زوايا المربع ناعمة */
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    
    /* تهيئة علامة الصح المخفية */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 0;
    background-position: center;
    background-repeat: no-repeat;
}

/* 6. تأثير الفئة عند تحديدها (Checked State) */
.filter-accordion-content input[type="checkbox"]:checked + span::before {
    background-color: var(--pink, #e91e63);
    border-color: var(--pink, #e91e63);
    background-size: 14px; /* إظهار علامة الصح بوضوح بلمسة انيميشن */
}

/* 7. تغيير لون وخط النص عند التحديد */
.filter-accordion-content input[type="checkbox"]:checked + span {
    color: var(--pink, #e91e63);
    font-weight: 700;
}

/* 8. تلوين السطر بالكامل بلمسة وردية عند الاختيار (للمتصفحات الحديثة) */
.filter-accordion-content label:has(input[type="checkbox"]:checked) {
    background-color: #fff0f5; /* لون وردي فاتح جداً */
    border-color: var(--pink, #e91e63);
}

/* 9. تحسين شكل السهم والتبويب الرئيسي (Accordion Toggle) */
.filter-accordion-toggle {
    background-color: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 6px;
    padding: 14px 16px;
    border: 1px solid #eef0f2;
    transition: all 0.3s ease;
}

.filter-accordion-toggle:hover {
    background-color: #f1f3f5;
}

/* 10. شكل التبويب الرئيسي عند فتحه ليتصل بالخيارات الفرعية */
.filter-accordion-toggle.is-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.filter-accordion-content.is-open {
    background-color: #ffffff;
    border: 1px solid #eef0f2;
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    margin-bottom: 12px;
    padding: 12px; /* مساحة داخلية مريحة للعين */
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); /* ظل خفيف جداً يبرز القائمة */
}