/*[File content truncated: showing lines 1-2000 of 2059 total lines. Use offset/limit parameters to view more.]
/* =============================================== */
/* == إعدادات أساسية وتنسيقات عامة == */
/* =============================================== */

/* تعيين حجم الخط الأساسي للتصميم المتجاوب */
html {
    font-size: 16px; /* حجم أساسي للـ rem */
}

body {
    /* استخدام الخطوط المخصصة للهوية البصرية */
    font-family: var(--font-primary, 'Tajawal', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f4f4f4 0%, #f8f9fa 100%);
    color: #333;
    direction: ltr;
    font-size: var(--font-size-base, 1rem);
    line-height: 1.6;
    font-weight: var(--font-weight-normal, 400);
    scroll-behavior: smooth;
}

body.no-scroll {
    overflow: hidden;
}

html[dir="rtl"] body {
    direction: rtl;
}

/* =============================================== */
/* == الهيدر الرئيسي (Main Header) == */
/* =============================================== */
header.main-header {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #e8eaf6 100%);
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    gap: 0.9375rem;
    align-items: center;
    width: 100%;
    flex-wrap: wrap; /* السماح بالتفاف العناصر */
    background: transparent; /* الخلفية الآن على الهيدر الرئيسي */
    padding: 1rem 0.9375rem;
    position: relative;
    z-index: 2;
}

.logo-container {
    flex: 0 0 auto;
    order: 1;
}

.header-search-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    margin: 0 20px;
    order: 2;
}

.auth-nav {
    flex: 0 0 auto;
    order: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =============================================== */
/* == Logo Styles == */
/* =============================================== */

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2.5rem; /* Increased icon size */
    margin-right: 0.625rem; /* 10px to rem */
    color: #3f51b5;
}

html[dir="rtl"] .logo-icon {
    margin-right: 0;
    margin-left: 10px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-shadow: 0.0625rem 0.0625rem 0.125rem rgba(0,0,0,0.1); /* Added text shadow */
}

.logo-sub {
    font-size: 0.8rem;
    color: #757575; /* Changed subtext color */
}

.main-nav, .auth-nav {
    display: flex;
    flex-shrink: 1; /* السماح لحاوية الأزرار بالتقلص عند الحاجة لمنع تجاوز المحتوى */
    align-items: center;
    gap: 8px; /* تقليل المسافة بين الأيقونات والأزرار قليلاً */
}

/* أزرار روابط التنقل الرئيسية */
.main-nav a {
    display: inline-block;
    padding: 0.625rem 1.25rem; /* 10px 20px to rem */
    background-color: #e0e3f3;
    color: #3f51b5;
    border: none;
    border-radius: 0.375rem; /* 6px to rem */
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    min-height: 2.75rem; /* 44px - الحد الأدنى للمس السهل */
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-nav a:hover {
    background-color: #3f51b5;
    color: #fff;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.2);
    transform: translateY(-2px);
    
}

/* زر تسجيل الدخول */
.btn-login,
.btn-register {
    display: inline-block;
    padding: 0.5rem 0.75rem; /* 8px 12px to rem - تعديل الحشو العمودي لتحسين التناسق */
    background-color: #3f51b5;
    color: #fff !important;
    border: none;
    border-radius: 0.375rem; /* 6px to rem */
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-left: 0;
    white-space: nowrap; /* ضمان بقاء النص في سطر واحد وعدم التفافه */
    min-height: 2.75rem; /* 44px - الحد الأدنى للمس السهل */
    min-width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    background-color: #283593;
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.2);
    transform: translateY(-2px);
    
}

.btn-register {
    background-color: #4CAF50;
}

html[dir="rtl"] .btn-register {
    margin-left: 30px;
}

html[dir="ltr"] .btn-register {
    margin-right: 30px;
}

.btn-register:hover {
    background-color: #45a049;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
    transform: translateY(-2px);
}

/* =============================================== */
/* == تعديلات الهيدر للشاشات المتوسطة == */
/* =============================================== */
/* حل مشكلة خروج الأزرار عن الشاشة في العرض بين 992px و 1150px */
@media (max-width: 1150px) {
    .btn-login,
    .btn-register {
        padding: 6px 8px; /* تعديل الحشو ليكون متوازنًا */
        font-size: 0.8rem; /* تصغير الخط قليلاً */
                          /* لا حاجة لـ flex-shrink هنا لأن التفاف الحاوية هو الحل */
    }

    .auth-nav {
        gap: 4px; /* تقليل المسافة بين العناصر مع الحفاظ على فراغ بسيط */
        flex-wrap: wrap; /* السماح للعناصر بالانتقال إلى سطر جديد */
        justify-content: flex-end; /* محاذاة العناصر إلى اليمين عند التفافها لسطر جديد */
        /* تم إزالة الخصائص الزائدة لأن المشكلة حُلت من المصدر في .header-top */
    }

    .header-search-container {
        max-width: 400px; /* تقليل العرض الأقصى لشريط البحث */
    }
}

.main-header .main-nav {
    flex-grow: 1;
    justify-content: center;
}

.lang-switcher-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem; /* 44px - زيادة الحجم للمس السهل */
    height: 2.75rem; /* 44px */
    background-color: #3f51b5;
    border-radius: 50%;
    text-decoration: none;
    color: #fff;
    position: relative;
    box-shadow: 0 0.125rem 0.3125rem rgba(0,0,0,0.2); /* 2px 5px to rem */
}

html[dir="rtl"] .lang-switcher-link {
    margin-right: 0;
    margin-left: 15px;
}

.globe-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-globe"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>');
    background-size: 20px;
    background-repeat: no-repeat;
    background-position: center;
    width: 20px;
    height: 20px;
}

.lang-text {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: #ffffff;
    color: #3f51b5;
    border: 1px solid #3f51b5;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    transform: translate(30%, 30%);
}

html[dir="rtl"] .lang-text {
    right: auto;
    left: 0;
    transform: translate(-30%, 30%);
}

.lang-switcher-link:hover {
    background-color: #303f9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* تنسيقات النموذج (Forms) */
.form-container {
    max-width: 450px;
    margin: 50px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative; /* أضف هذا السطر */
}
.back-arrow {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2rem;
    color: #3f51b5;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.back-arrow:hover {
    transform: scale(1.1);
}

html[dir="rtl"] .back-arrow {
    left: auto;
    right: 20px;
    transform: scaleX(-1);
}

html[dir="rtl"] .back-arrow:hover {
    transform: scaleX(-1) scale(1.1);
}

.form-container h2 {
    text-align: center;
    color: #3f51b5;
    margin-bottom: 25px;
    font-size: 2rem;
}

.form-container form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* تنسيق حقول الإدخال النصية */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.2);
    outline: none;
}

/* تنسيق placeholder */
.form-group input::placeholder {
    color: #aaa;
    font-size: 1rem;
}

/* تنسيق حقل تاريخ الميلاد (قوائم منسدلة) */
.birthdate-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.birthdate-group p {
    font-weight: bold;
    color: #555;
    margin: 0;
}

.birthdate-selects {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.birthdate-selects select {
    flex-grow: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23555555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat right 10px center;
    background-size: 16px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.birthdate-selects select:focus {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.2);
    outline: none;
}
html[dir="rtl"] .birthdate-selects select {
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23555555" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat left 10px center;
}

/* تنسيق حقل الجنس بشكل حديث */
.gender-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gender-group p {
    font-weight: bold;
    color: #555;
    margin: 0;
}

.gender-options {
    display: flex;
    gap: 15px;
}

.gender-item {
    flex-grow: 1;
}
/* =============================================== */
/* == أنماط مخصصة لأزرار اختيار الجنس (Radio) == */
/* =============================================== */

/* إخفاء زر الراديو الافتراضي للمتصفح */
.gender-item input[type="radio"] {
    display: none;
}

/* تصميم النص (label) ليبدو كزر قابل للنقر */
.gender-item label {
    display: block;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gender-item label:hover {
    border-color: #3f51b5;
}

.gender-item input[type="radio"]:checked + label {
    background-color: #3f51b5;
    color: #fff;
    border-color: #3f51b5;
}

/* تنسيق زر الإرسال */
.form-container button {
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.form-container button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* تنسيق خيارات تسجيل الدخول */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    accent-color: #3f51b5;
    width: 16px;
    height: 16px;
}

.remember-me label {
    color: #555;
    cursor: pointer;
    user-select: none;
}

.forgot-password-link {
    color: #3f51b5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #303f9f;
    text-decoration: underline;
}

html[dir="rtl"] .login-options {
    flex-direction: row-reverse;
}

html[dir="ltr"] .login-options {
    flex-direction: row-reverse;
    justify-content: space-between;
}

/* =============================================== */
/* == صفحات متنوعة (تواصل معنا، تفاصيل المنتج) == */
/* =============================================== */

/* تنسيقات صفحة "تواصل معنا" */
.contact-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.contact-container h2 {
    text-align: center;
    color: #3f51b5;
    margin-bottom: 25px;
}

.contact-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-container input[type="text"],
.contact-container input[type="email"],
.contact-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
}

.contact-container textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-container button {
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.contact-container button:hover {
    background-color: #45a049;
}

/* تنسيقات عامة للصفحة الرئيسية */
.container {
    max-width: 1300px;
    margin: 50px auto;
    padding: 0 15px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.2rem;
    color: #3f51b5;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); /* 260px to rem */
    gap: 1.875rem; /* 30px to rem */
    padding: 0 0.5rem;
}

.product-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(224,227,231,0.5);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3f51b5, #5c6bc0, #7986cb);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(63,81,181,0.12), 0 4px 12px rgba(0,0,0,0.08);
    border-color: rgba(63,81,181,0.2);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card img {
    width: 100%;
    height: 12.5rem;
    object-fit: cover;
    transition: all 0.3s ease;
    filter: brightness(0.98) saturate(0.95);
}

.product-card:hover img {
    transform: scale(1.03);
    filter: brightness(1.02) saturate(1.05);
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem; /* 20px to rem */
}

.product-info h3 {
    margin: 0 0 0.625rem 0; /* 10px to rem */
    font-size: 1.2rem;
    min-height: 2.8em; /* استخدام min-height للسماح بالنمو مع الحفاظ على المحاذاة */
    height: auto;
    overflow: hidden;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.4rem;
    color: #e91e63;
    font-weight: bold;
    margin: 0 0 0.9375rem 0; /* 15px to rem */
    text-align: center;
}

.btn-view-product {
    display: inline-block;
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    align-self: center;
    transition: all 0.3s ease;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(63,81,181,0.2);
}

.btn-view-product:hover {
    background: linear-gradient(135deg, #303f9f 0%, #3f51b5 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(63,81,181,0.3);
}

html[dir="rtl"] .product-card {
    text-align: right;
}

/* تنسيقات صفحة تفاصيل المنتج */
.product-detail-container {
    max-width: 1000px;
    margin: 50px auto;
    display: flex;
    gap: 40px;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .product-detail-container {
        flex-direction: column;
        align-items: center;
    }
}

.product-image {
    flex-basis: 50%;
}

.product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-info-details {
    flex-basis: 50%;
}

.product-name {
    font-size: 2.5rem;
    color: #3f51b5;
    margin-top: 0;
}

.product-price-details {
    font-size: 2rem;
    color: #e91e63;
    font-weight: bold;
    margin: 15px 0;
}

.product-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 3px solid #3f51b5;
    border-radius: 6px;
}

html[dir="rtl"] .product-description {
    border-left: none;
    border-right: 3px solid #3f51b5;
}

.btn-add-to-cart {
    background-color: #3f51b5;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-add-to-cart:hover {
    background-color: #303f9f;
}

.error-message {
    text-align: center;
    color: #e91e63;
    font-size: 1.5rem;
    margin-top: 50px;
}

.no-products-message {
    grid-column: 1 / -1; /* Make it span all columns of the grid */
    text-align: center;
    font-size: 1.2rem;
    color: #555;
    padding: 50px 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    background: #333;
    color: #fff;
    width: 100%;
    margin-top: 50px;
    content-visibility: auto; /* تحسين الأداء بتأجيل تصيير الفوتر حتى الوصول إليه */
    contain-intrinsic-size: 0 300px; /* تقدير لارتفاع الفوتر لمنع القفزات */
}


/* تنسيق خاص لزر تسجيل الدخول */
.form-container .login-button {
    background-color: #3f51b5; /* لون أزرق */
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    box-shadow: 0 4px 10px rgba(63, 81, 181, 0.3);
}

.form-container .login-button:hover {
    background-color: #303f9f;
    transform: translateY(-2px);
}
/* تنسيق روابط النموذج الإضافية (مثل: نسيت كلمة المرور وإنشاء حساب) */
.form-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.form-links a {
    color: #5c6bc4;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.form-links a:hover {
    color: #9a9af1;
    text-decoration: underline;
}

/* تنسيق زر "نسيت كلمة المرور" في المنتصف */
.link-forgot {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 10px;
}

/* تنسيق زر "إنشاء حساب" في المنتصف وبخلفية خضراء */
.link-register {
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 6px;
    background-color: #4CAF50;
    color: white !important;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    width: 70%;
    display: inline-block;
    margin: 0 auto;
}

.link-register:hover {
    background-color: #45a049;
    text-decoration: none;
}
/* تنسيق قسم "لديك حساب بالفعل؟ سجل الدخول الآن" */
.account-link-container {
    text-align: center;
    margin-top: 20px;
}

.account-link-container p {
    margin: 0;
    font-size: 1rem;
    color: #555;
}

.account-link-container .login-link {
    color: #3f51b5;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.account-link-container .login-link:hover {
    color: #303f9f;
    text-decoration: underline;
}

/* يمكنك إضافة هذا في style.css لتحسين شكل مربع الشروط */
#terms-checkbox {
    accent-color: #3f51b5;
    margin-left: 8px;
    margin-right: 8px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 10px;
}

.social-icons a img {
    width: 32px;
    height: 32px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-icons a:hover img {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(63,81,181,0.18);
}
.important-links {
    text-align: center;
    margin-bottom: 12px;
    font-size: 1rem;
}
.important-links a {
    margin: 0 8px;
    color: #d8d9e0;
    text-decoration: none;
    transition: color 0.2s;
}
.important-links a:hover {
    color: #2f778d;
    text-decoration: underline;
}

/* =============================================== */
/* == مكونات إضافية (رسائل، نوافذ منبثقة) == */
/* =============================================== */

/* تنسيق رسائل الخطأ */
.error-messages {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-messages p {
    margin: 0;
    padding: 0;
    font-weight: 500;
}

/* =============================================== */
/* == أنماط رسالة نجاح تفعيل الحساب == */
/* =============================================== */
.verification-success-container {
    text-align: center;
    background-color: #e8f5e9;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
}

.success-icon {
    font-size: 4rem;
    color: #4CAF50;
    line-height: 1;
    margin-bottom: 15px;
}

.verification-success-container p {
    font-size: 1.2rem;
    color: #388e3c;
    margin: 0;
    font-weight: 500;
}

/* تصميم رابط "سجل الدخول الآن" كزر جذاب */
.btn-login-success {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background-color: #4CAF50;
    color: #fff !important;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.btn-login-success:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    color: #fff !important;
}

/* =============================================== */
/* == أنماط قائمة المستخدم المنسدلة == */
/* =============================================== */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu-button {
    background-color: #f0f2f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 15px 5px 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
}

html[dir="rtl"] .user-menu-button {
    padding: 5px 10px 5px 15px;
}

.user-menu-button:hover {
    background-color: #e4e6eb;
}

.user-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

html[dir="rtl"] .user-icon {
    margin-right: 0;
    margin-left: 8px;
}

.user-name {
    color: #333;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 100;
    border-radius: 8px;
    overflow: hidden;
    padding: 8px 0;
}

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

.user-dropdown-menu.active {
    display: block;
}

.user-dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.user-dropdown-menu a svg {
    flex-shrink: 0;
}

.user-dropdown-menu a:hover {
    background-color: #f1f1f1 !important;
    color: #3f51b5 !important;
}

.user-dropdown-menu .logout-link {
    border-top: 1px solid #eee;
    color: #e91e63;
}

.user-dropdown-menu .logout-link:hover {
    color: #fff !important;
    background-color: #e91e63 !important;
}

/* =============================================== */
/* == أنماط رسالة الترحيب للمستخدم الجديد == */
/* =============================================== */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.welcome-overlay.active {
    opacity: 1;
    visibility: visible;
}

.welcome-modal {
    background-color: #fff;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(0.7);
    transition: transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    max-width: 500px;
    width: 90%;
}

.welcome-modal.active {
    transform: scale(1);
}

.welcome-modal h2 {
    color: #3f51b5;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 15px;
}

.welcome-modal p {
    font-size: 1.3rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* =============================================== */
/* == أنماط صفحة الملف الشخصي == */
/* =============================================== */
.profile-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.profile-container h2 {
    text-align: center;
    color: #3f51b5;
    margin-bottom: 30px;
}

.profile-container .form-group {
    margin-bottom: 20px;
}

.profile-container .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.profile-container input[disabled] {
    background-color: #f0f2f5;
    cursor: not-allowed;
}

.profile-picture-section {
    text-align: center;
    margin-bottom: 30px;
}

.profile-picture-section label {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

#profile-image-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: filter 0.3s ease;
}

.profile-picture-section label:hover #profile-image-preview {
    filter: brightness(0.8);
}

.edit-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: #3f51b5;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px solid white;
    transition: transform 0.3s ease;
}

.profile-picture-section label:hover .edit-icon {
    transform: scale(1.1);
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* تعديل أيقونة المستخدم في الهيدر */
.user-icon {
    border-radius: 50%;
    object-fit: cover;
}

/* =============================================== */
/* == تصميم زر تحديث الملف الشخصي == */
/* =============================================== */
.profile-container button[type="submit"] {
    background: linear-gradient(45deg, #3f51b5, #5c6bc0);
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 4px 15px rgba(63, 81, 181, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-container button[type="submit"]:hover {
    box-shadow: 0 6px 20px rgba(63, 81, 181, 0.5);
    transform: translateY(-3px);
}

.profile-container button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(63, 81, 181, 0.4);
}

/* =============================================== */
/* == RESPONSIVE DESIGN - MEDIA QUERIES == */
/* =============================================== */

/* للهواتف الصغيرة جداً (أقل من 480px) */
@media (max-width: 479px) {
    html {
        font-size: 14px; /* تصغير الخط الأساسي */
    }
    
    .header-top {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .logo-container {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .header-search-container {
        order: 2;
        width: 100%;
        max-width: none;
        margin: 0;
        min-width: auto;
    }
    
    .auth-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .logo-main {
        font-size: 1.25rem;
    }
    
    .btn-login, .btn-register {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 2.75rem; /* 44px للمس السهل */
        flex: 1;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .product-card img {
        height: 12.5rem; /* 200px to rem */
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .category-sidebar {
        width: 85vw;
        padding: 1rem;
    }
}

/* للهواتف (480px - 768px) */
@media (min-width: 480px) and (max-width: 767px) {
    html {
        font-size: 15px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-container {
        width: 100%;
        justify-content: center;
    }
    
    .header-search-container {
        width: 100%;
        max-width: none;
    }
    
    .auth-nav {
        width: 100%;
        justify-content: center;
    }
    
    .btn-login, .btn-register {
        min-height: 2.75rem; /* 44px للمس السهل */
        padding: 0.75rem 1.25rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-sidebar {
        width: 80vw;
    }
}

/* للأجهزة اللوحية (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .header-search-container {
        max-width: 25rem; /* 400px to rem */
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    
    .btn-login, .btn-register {
        min-height: 2.75rem; /* 44px للمس السهل */
    }
    
    .category-sidebar {
        width: 20rem; /* 320px to rem */
    }
}

/* للشاشات الكبيرة (أكبر من 1024px) */
@media (min-width: 1025px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); /* 260px to rem */
        gap: 1.875rem; /* 30px to rem */
    }
}

/* تحسينات خاصة للأجهزة اللوحية في الوضع الأفقي */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .header-top {
        padding: 0.75rem 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =============================================== */
/* == تحسينات الأداء والحالات == */
/* =============================================== */

/* تحسين الهيدر عند التمرير */
.main-header.scrolled {
    box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

/* حالة التحميل */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.25rem;
    height: 1.25rem;
    margin: -0.625rem 0 0 -0.625rem;
    border: 0.125rem solid #f3f3f3;
    border-top: 0.125rem solid #3f51b5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* تحسين التركيز للوصولية */
.sr-only {
    position: absolute;
    width: 0.0625rem;
    height: 0.0625rem;
    padding: 0;
    margin: -0.0625rem;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تحسين الأداء */
* {
    box-sizing: border-box;
}

/* تحسين الصور */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* تحسين الفيديو */
video {
    max-width: 100%;
    height: auto;
}

/* كلاسات مساعدة للأجهزة */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* =============================================== */
/* == أنماط النافذة المنبثقة (Modal) == */
/* =============================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1500;
    display: none; /* مخفية افتراضياً */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    max-width: 650px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    
    /* إخفاء شريط التمرير */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* لجعل محتوى البروفايل يظهر بشكل جيد داخل النافذة */
.modal-content .profile-container {
    margin: 0;
    max-width: 100%;
    box-shadow: none;
}

#login-modal .modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    font-weight: normal;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #999 !important;
    line-height: 1;
    padding: 0 !important;
    z-index: 1501;
    transition: color 0.2s ease;
    width: auto !important;
    height: auto !important;
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    text-decoration: none !important;
}

#login-modal .modal-close-btn:hover {
    color: #333 !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* تأكيد أن زر الإغلاق يظهر داخل صندوق تسجيل الدخول */
.modal-content .form-container {
    position: relative;
}

/* تحسينات على تخطيط نموذج الملف الشخصي */
.profile-container .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* جعل الحقول تحت بعضها في الشاشات الصغيرة */
@media (max-width: 500px) {
    .profile-container .form-row {
        grid-template-columns: 1fr;
    }
}

/* =============================================== */
/* == تأثير التحميل بين الصفحات (Preloader) == */
/* =============================================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85); /* خلفية بيضاء شبه شفافة */
    backdrop-filter: blur(8px); /* تأثير ضبابي للخلفية */
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column; /* لترتيب العناصر عمودياً */
    justify-content: center;
    align-items: center;
    gap: 1rem; /* مسافة بين الدوار والنص */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#preloader.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e3f3; /* لون أفتح */
    border-top: 5px solid var(--primary-color, #3f51b5); /* اللون الرئيسي */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--primary-dark, #303f9f);
    font-weight: 500;
    font-size: 1.1rem;
}

/* =================================================================== */
/* == أنماط مدمجة لصفحة البروفايل داخل النافذة المنبثقة (Modal) == */
/* =================================================================== */

/* تقليل الحشو والهوامش لجعل النموذج أصغر */
.modal-content .profile-container {
    padding: 25px 30px;
    box-shadow: none;
    border-radius: 0;
}

.modal-content .profile-container h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

/* تصغير الصورة الشخصية */
.modal-content #profile-image-preview {
    width: 120px;
    height: 120px;
}

.modal-content .profile-picture-section {
    margin-bottom: 20px;
}

/* تقليل المسافات بين حقول النموذج */
.modal-content .profile-container .form-group {
    margin-bottom: 15px;
}

.modal-content .profile-container .form-row {
    gap: 15px;
}

/* تصغير زر التحديث */
.modal-content .profile-container button[type="submit"] {
    padding: 12px 20px;
    font-size: 1.1rem;
}

/* =============================================== */
/* == (تصحيح) تنسيقات الأقسام القابلة للتمرير في الهيدر الفرعي == */
/* =============================================== */

/* الحاوية الكاملة التي تضم الأسهم وروابط الأقسام */
.sections-wrapper {
    flex: 1; /* Change: Let it take available space */
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative; /* Keep for potential absolute children if needed, but arrows are not absolute now */
}

/* حاوية الروابط القابلة للتمرير */
.sections-scroll-container {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    white-space: nowrap;
    padding: 8px 0;
    background: transparent;
    border-radius: 25px;
    margin: 0;
    
    /* إخفاء شريط التمرير الافتراضي للمتصفح */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.sections-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* أزرار الأسهم (تصميم نهائي) */
.scroll-arrow {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    box-shadow: 0 3px 8px rgba(63,81,181,0.3);
}

.scroll-arrow:hover {
    background: linear-gradient(135deg, #303f9f 0%, #3f51b5 100%);
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(63,81,181,0.4);
    transform: translateY(-2px) scale(1.05);
}

.scroll-arrow:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(63,81,181,0.3);
}

.scroll-arrow svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

/* The .left and .right classes are no longer needed for positioning */


/* إخفاء الأسهم مبدئياً، سيتم إظهارها عبر الجافاسكربت عند الحاجة */
.scroll-arrow.hidden {
    display: none;
}

/* =============================================== */
/* == القائمة الجانبية للفئات (Sidebar) == */
/* =============================================== */

/* 1. الإعدادات الأساسية والموحدة */
.category-sidebar {
    position: fixed;
    top: 0; /* نجعلها تغطي كامل الشاشة عمودياً */
    width: 280px;
    height: 100%;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.92); /* تعديل الشفافية لتكون أكثر أناقة مع الحفاظ على وضوح النص */
    backdrop-filter: blur(10px); /* التأثير الضبابي */
    -webkit-backdrop-filter: blur(10px); /* لدعم متصفح Safari */
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); /* حركة انزلاق أكثر سلاسة */
    box-shadow: 0 0 20px rgba(0,0,0,0.1); /* إضافة ظل خفيف */
    box-sizing: border-box; /* لضمان أن الحشو لا يزيد من الارتفاع الكلي */
}

/* 2. إعدادات الإخفاء والظهور (LTR vs RTL) */

/* الوضع الافتراضي (من اليسار لليمين - LTR) */
.category-sidebar {
    left: 0;
    border-right: 1px solid rgba(200, 200, 200, 0.3);
    transform: translateX(-100%); /* إخفاء القائمة إلى اليسار */
}

/* الوضع العربي (من اليمين لليسار - RTL) */
[dir="rtl"] .category-sidebar {
    left: auto; /* إلغاء خاصية left للسماح لـ 'right' بالعمل */
    right: 0;   /* تثبيت القائمة على اليمين */
    border-right: none; /* إزالة الحد الأيمن */
    border-left: 1px solid rgba(200, 200, 200, 0.3); /* إضافة حد أيسر */
    transform: translateX(100%); /* إخفاء القائمة إلى اليمين */
}

/* عند تفعيل القائمة، تظهر دائمًا في المنتصف */
.category-sidebar.active {
    transform: translateX(0);
}

/* زر إغلاق القائمة الجانبية */
#sidebar-close-btn {
    position: absolute;
    top: 10px;
    background: transparent;
    border: none;
    font-family: 'Times New Roman', Times, serif; /* خط أنيق لعلامة الإغلاق */
    font-size: 3rem; /* حجم كبير وواضح */
    font-weight: 300;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.3s ease;
    z-index: 2001; /* للتأكد من أنه فوق كل المحتوى */
}

#sidebar-close-btn:hover {
    color: #e91e63; /* لون أحمر جذاب عند المرور */
    transform: rotate(90deg); /* تأثير دوران بسيط */
}

/* تحديد موضع الزر في الوضع الإنجليزي (LTR) */
[dir="ltr"] #sidebar-close-btn { right: 15px; }
/* تحديد موضع الزر في الوضع العربي (RTL) */
[dir="rtl"] #sidebar-close-btn { left: 15px; }

.category-sidebar h3 {
    margin-top: 40px; /* إضافة مسافة لتجنب التداخل مع زر الإغلاق */
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: #3f51b5;
}
.category-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* طبقة التعتيم */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1999; /* أقل من القائمة الجانبية */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 3. تحسين روابط القائمة والأيقونات */
.category-sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    color: #333; /* لون النص الافتراضي */
    text-decoration: none; /* إزالة الخط تحت الرابط */
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

html[dir="rtl"] .category-sidebar ul li a:hover {
    transform: translateX(-5px);
}

.category-sidebar ul li a:hover {
    background-color: rgba(63, 81, 181, 0.1);
    color: #3f51b5;
    transform: translateX(5px);
}

.category-icon {
    display: inline-flex;
    color: #3f51b5;
}

.category-icon svg {
    width: 24px;
    height: 24px;
    transition: color 0.2s ease;
}

/* 4. تحسين حركة ظهور العناصر */
.category-sidebar ul li {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* عند فتح القائمة، تظهر العناصر بتأثير متتابع */
.category-sidebar.active ul li {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================== */
/* == قائمة الفئات المنسدلة (Accordion) == */
/* =============================================== */
.category-item {
    border-bottom: 1px solid #eee;
}
.category-item:last-child {
    border-bottom: none;
}

.category-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-main-link {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 8px;
}

.category-main-link:hover {
    background-color: rgba(63, 81, 181, 0.1);
    color: #3f51b5;
}

.submenu-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 5px;
    transition: background-color 0.2s ease;
}

.submenu-toggle:hover {
    background-color: #f0f2f5;
}

.submenu-toggle .arrow-icon {
    width: 18px;
    height: 18px;
    color: #555;
    transition: transform 0.3s ease;
}

/* عند فتح القائمة، يتم تدوير السهم */
.submenu-toggle[aria-expanded="true"] .arrow-icon {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding-inline-start: 40px; /* مسافة بادئة للداخل */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.submenu li a {
    display: block;
    padding: 8px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
}
.submenu li a:hover {
    background-color: #f0f2f5;
    color: #3f51b5;
}
.submenu .view-all-link {
    font-weight: bold;
    color: #3f51b5;
}

/* إضافة تأخير لكل عنصر ليظهر بشكل متتابع */
.category-sidebar.active ul li:nth-child(1) { transition-delay: 0.1s; }
.category-sidebar.active ul li:nth-child(2) { transition-delay: 0.15s; }
.category-sidebar.active ul li:nth-child(3) { transition-delay: 0.2s; }
.category-sidebar.active ul li:nth-child(4) { transition-delay: 0.25s; }
.category-sidebar.active ul li:nth-child(5) { transition-delay: 0.3s; }

/* زر تسجيل الخروج في القائمة الجانبية */
.sidebar-logout {
    margin-top: auto;
    padding: 15px 20px 20px;
    border-top: 1px solid #e0e3f3;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(233,30,99,0.3);
    width: 100%;
}

.sidebar-logout-btn:hover {
    background: linear-gradient(135deg, #d81b60 0%, #c2185b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233,30,99,0.4);
}

.sidebar-logout-btn svg {
    flex-shrink: 0;
}

/* زر المفضلة في القائمة الجانبية */
.sidebar-wishlist {
    margin-top: auto;
    padding: 15px 20px 20px;
    border-top: 1px solid #e0e3f3;
}

.sidebar-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(233,30,99,0.3);
    width: 100%;
}

.sidebar-wishlist-btn:hover {
    background: linear-gradient(135deg, #c2185b 0%, #ad1457 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233,30,99,0.4);
}

.sidebar-wishlist-btn svg {
    flex-shrink: 0;
}

.category-sidebar {
    display: flex;
    flex-direction: column;
}

.category-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 10px;
}

@media (max-width: 768px) {
    .sidebar-logout {
        padding: 12px 15px 15px;
    }
    
    .sidebar-logout-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* =============================================== */
/* == تصميم شريط التمرير للقائمة الجانبية == */
/* =============================================== */

/* For Webkit browsers (Chrome, Safari, Edge) */
.category-sidebar::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
}

.category-sidebar::-webkit-scrollbar-track {
    background: #f0f2f5; /* Background of the track */
    border-radius: 4px;
}

.category-sidebar::-webkit-scrollbar-thumb {
    background-color: #c1c1c1; /* Color of the scroll thumb */
    border-radius: 4px; /* Roundness of the scroll thumb */
    border: 2px solid #f0f2f5; /* Creates padding around thumb */
}

.category-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8; /* Color on hover */
}

/* For Firefox */
.category-sidebar {
    scrollbar-width: thin; /* "auto" or "thin" */
    scrollbar-color: #c1c1c1 #f0f2f5; /* thumb and track color */
}

/* =============================================== */
/* == أيقونة سلة المشتريات في الهيدر == */
/* =============================================== */

.cart-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 0.5rem; /* 8px to rem */
    /* إزالة الانتقال من الرابط نفسه لتجنب التأثير على موضع الأبناء */
    transition: color 0.2s ease;
    min-height: 2.75rem; /* 44px - الحد الأدنى للمس السهل */
    min-width: 2.75rem;
    border-radius: 0.375rem;
}

.cart-icon-wrapper {
    position: relative; /* This is the new, stable positioning context */
    display: flex;
}

.cart-icon-link:hover {
    color: #3f51b5; /* تغيير اللون عند التمرير */
}

.cart-icon-link svg {
    width: 26px;
    height: 26px;
    stroke-width: 1.8;
    transition: transform 0.2s ease; /* نقل تأثير التكبير إلى الأيقونة مباشرة */
}

.cart-icon-link:hover svg {
    transform: scale(1.15); /* تكبير الأيقونة عند التمرير */
}

.cart-item-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e91e63;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f8f9fa; /* نفس لون خلفية الهيدر */
    z-index: 1; /* التأكد من أن الدائرة تظهر فوق أيقونة السلة */
}

html[dir="rtl"] .cart-item-count {
    right: auto;
    left: -8px;
}

/* =============================================== */
/* == صفحة سلة المشتريات (Cart Page) == */
/* =============================================== */

.cart-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.cart-table thead {
    background-color: #3f51b5;
    color: #fff;
    font-weight: bold;
}

.cart-table th, .cart-table td {
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.cart-product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-product-name a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.cart-product-name a:hover {
    color: #3f51b5;
    text-decoration: underline;
}

.quantity-input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-remove {
    background: none;
    border: none;
    color: #e91e63;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-remove:hover {
    transform: scale(1.2);
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.cart-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-totals {
    text-align: right;
}

html[dir="rtl"] .cart-totals {
    text-align: left;
}

.cart-totals h3 {
    margin: 0 0 10px 0;
    color: #555;
}

.cart-totals p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3f51b5;
    margin: 0 0 15px 0;
}

.cart-empty {
    text-align: center;
    padding: 50px 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cart-empty p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 25px;
}

/* =============================================== */
/* == أزرار عامة (General Buttons) == */
/* =============================================== */

/* الزر الرئيسي (مثل تحديث السلة) */
.btn-primary {
    display: inline-block;
    background-color: #3f51b5;
    color: #fff !important;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #303f9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.2);
}

/* زر المتابعة للدفع (أكثر بروزاً) */
.btn-checkout {
    display: block; /* يأخذ عرض كامل */
    background-color: #4CAF50;
    color: #fff !important;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

/* =============================================== */
/* == شريط الإعلانات المتحرك (Announcements Carousel) == */
/* =============================================== */

/* حاوية الإعلانات الرئيسية - توضع في الهيدر السفلي */
.announcements-container {
    flex-grow: 1;
    min-width: 0;
    height: 40px; /* تحديد ارتفاع ثابت لشريط الإعلانات */
    overflow: hidden; /* إخفاء أي محتوى يتجاوز الحاوية */
    position: relative;
    display: flex;
}

/* Simplified and elegant error message for login */
.error-message-login {
    background-color: #ffebee; /* A very light red */
    color: #c62828; /* A darker, more readable red */
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    border-left: 5px solid #c62828; /* A subtle accent */
    animation: fadeIn 0.5s ease-in-out;
}

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

/* =============================================== */
/* == Shop by Brand Banner == */
/* =============================================== */

.shop-by-brand-section {
    margin-bottom: 40px;
}

.shop-by-brand-banner {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.shop-by-brand-banner::-webkit-scrollbar {
    display: none;
}

.brand-items-wrapper {
    display: flex;
    width: fit-content;
    animation: scroll-brands 30s linear 3s infinite;
    align-items: center;
    transition: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    will-change: transform;
    gap: 30px;
    cursor: grab;
}

html[dir="ltr"] .brand-items-wrapper {
    animation: scroll-brands-ltr 30s linear 3s infinite;
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.3s ease, filter 0.3s ease;
    padding: 10px;
}

.brand-items-wrapper img {
    height: 80px;
    width: auto;
    object-fit: contain;
    max-width: 140px;
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(0.2) brightness(0.9);
    border-radius: 8px;
}

.brand-item:hover img {
    transform: scale(1.08);
    filter: grayscale(0) brightness(1);
}

.brand-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    transition: color 0.3s ease;
}

.brand-item:hover .brand-name {
    color: #3f51b5;
}

.shop-by-brand-banner:hover .brand-items-wrapper {
    animation-play-state: paused;
}

.brand-items-wrapper:active {
    cursor: grabbing !important;
}



@keyframes scroll-brands {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
}

@keyframes scroll-brands-ltr {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}



/* =============================================== */
/* == Fixes & Enhancements for Banners == */
/* =============================================== */

/* Fix for Shop by Category Banner Layout */
.category-items-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 25px !important;
}

.shop-by-category-banner .category-item {
    flex: 0 1 120px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
}

/* Banner Title Alignment */
.section-title.text-right {
    text-align: right;
}

.section-title.text-left {
    text-align: left;
}

/* Category Item Font and Hover Animation */
.shop-by-category-banner .category-item a {
    text-decoration: none !important;
    color: inherit !important;
}

.shop-by-category-banner .category-item span {
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.shop-by-category-banner .category-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(63,81,181,0.15), 0 4px 8px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #e8eaf6 100%);
    z-index: 10;
    position: relative;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-by-category-banner .category-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(224,227,231,0.5);
}

.shop-by-category-banner .category-item img {
    transition: all 0.3s ease;
    filter: brightness(0.95) saturate(0.9);
}

.shop-by-category-banner .category-item:hover img {
    filter: brightness(1.05) saturate(1.1);
    transform: scale(1.05);
}

.shop-by-category-banner .category-item span {
    transition: all 0.3s ease;
    color: #5f6368;
}

.shop-by-category-banner .category-item:hover span {
    color: #3f51b5;
    font-weight: 600;
}

/*[File content truncated: showing lines 1-2000 of 2059 total lines. Use offset/limit parameters to view more.]
/* =============================================== */
/* == إعدادات أساسية وتنسيقات عامة == */
/* =============================================== */

/* تعديلات على الهيدر السفلي ليتناسب مع الأسهم */
.header-bottom {
    display: flex;
    justify-content: flex-start;
    gap: 10px; /* Reduced gap between side menu button and scroll arrows */
    width: 100%;
    align-items: center;
    background-color: #f8f9fa; /* لون خلفية الجزء السفلي */
    padding: 10px 15px;
}

.nav-link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(63, 81, 181, 0.1);
    margin: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-link:hover {
    background: linear-gradient(135deg, #3f51b5, #5c6bc0);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
    border-color: transparent;
}

@media (max-width: 992px) {
    .header-top {
        flex-direction: column;
    }
    .header-search-container {
        order: -1; /* Move search to top on mobile */
        width: 100%;
        margin-bottom: 15px;
    }
    .auth-nav {
        margin-top: 15px;
    }
}
.category-menu-btn {
    background: #3f51b5; /* Darker background */
    border: none; /* No border */
    border-radius: 8px;
    padding: 8px 15px; /* Increased padding */
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1rem; /* Increased font size */
    font-weight: 500;
    color: #fff; /* White text color */
    margin-top: 10px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Added transition */
}

.category-menu-btn:hover {
    background-color: #303f9f; /* Darker hover background */
    box-shadow: 0 4px 10px rgba(63, 81, 181, 0.3); /* Added box-shadow on hover */
}

.header-search-container {
    flex: 1;
    min-width: auto;
    max-width: 600px;
    margin: 0 20px;
    order: 2;
    display: flex;
    align-items: stretch;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
    height: 40px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    transition: all 0.2s ease;
}

.header-search-container:hover {
    border-color: #0969da;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.header-search-container:focus-within {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

.header-search-container select {
    border: none;
    border-right: 1px solid #d0d7de;
    padding: 0 28px 0 12px;
    background: #f6f8fa;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: #24292f;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16" fill="%23656d76"><path d="M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    width: 140px;
    height: 40px;
    flex-shrink: 0;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
}

.header-search-container input {
    border: none;
    padding: 0 12px;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: #24292f;
    height: 40px;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
    line-height: 20px;
}

.header-search-container button {
    background: #0969da;
    color: #ffffff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    height: 40px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
}

.header-search-container button:hover {
    background-color: #0860ca;
}

.header-search-container button:active {
    background-color: #0757ba;
}

.header-search-container button svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
}

.header-search-container select {
    border: none;
    border-right: 1px solid #d0d7de;
    padding: 0 28px 0 12px;
    background: #f6f8fa;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: #24292f;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 16 16" fill="%23656d76"><path d="M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    width: 140px;
    height: 40px;
    flex-shrink: 0;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
    order: 1;
}

.header-search-container input {
    border: none;
    padding: 0 12px;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    color: #24292f;
    height: 40px;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
    line-height: 20px;
    order: 2;
}

.header-search-container button {
    background: #0969da !important;
    color: #ffffff !important;
    border: none !important;
    padding: 8px 16px !important;
    cursor: pointer !important;
    height: 40px !important;
    min-width: 80px !important;
    display: block !important;
    text-align: center !important;
    line-height: 24px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: Arial, sans-serif !important;
    order: 3 !important;
    overflow: visible !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 999 !important;
}

.header-search-container button * {
    display: block !important;
}

.header-search-container button {
    background: transparent !important;
    color: #5f6368 !important;
    border: none !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    height: 40px !important;
    width: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 3 !important;
    border-radius: 0 6px 6px 0 !important;
    transition: background-color 0.2s ease !important;
}

.header-search-container button:hover {
    background: #f8f9fa !important;
    color: #202124 !important;
}

.header-search-container button svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2.5 !important;
}

.header-search-container select {
    order: 1;
}

.header-search-container input {
    order: 2;
}

.header-search-container button {
    order: 3;
    border-radius: 0 6px 6px 0 !important;
}

html[dir="rtl"] .header-search-container select {
    border-right: none;
    border-left: 1px solid #d0d7de;
    background-position: left 8px center;
    padding: 0 12px 0 28px;
    order: 1;
}

html[dir="rtl"] .header-search-container input {
    order: 2;
}

html[dir="rtl"] .header-search-container button {
    order: 3;
    border-radius: 6px 0 0 6px !important;
}

.header-search-container select:focus {
    background-color: #ffffff;
    border-color: #0969da;
}

.header-search-container input::placeholder {
    color: #656d76;
    font-style: normal;
    font-weight: 400;
}

.header-search-container input:focus {
    outline: none;
}
/* =============================================== */
/* == تحسينات بسيطة لشريط البحث == */
/* =============================================== */

@media (max-width: 768px) {
    .header-search-container {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .header-search-container select {
        width: 90px;
        font-size: 13px;
        padding-right: 20px;
        padding-left: 5px;
        background-position: right 4px center;
    }

    html[dir="rtl"] .header-search-container select {
        padding-left: 20px;
        padding-right: 5px;
        background-position: left 4px center;
    }
    
    .header-search-container input {
        font-size: 13px;
        min-width: 0;
    }
    
    .header-search-container button {
        min-width: 40px !important;
        padding: 0 8px !important;
        font-size: 13px;
    }
}

/* =============================================== */
/* == شريط قوة كلمة المرور (Password Strength) == */
/* =============================================== */
.password-strength-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.strength-meter {
    flex-grow: 1;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.strength-meter-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    transition: color 0.3s ease;
}

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

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

html[dir="rtl"] .password-wrapper input[type="password"],
html[dir="rtl"] .password-wrapper input[type="text"] {
    padding-right: 12px;
    padding-left: 40px; /* مساحة للأيقونة في الوضع العربي */
}

/* استخدام محدد أكثر تحديداً للتغلب على تنسيقات .form-container button */
.toggle-password, .form-container .toggle-password {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: auto; /* إعادة تعيين العرض لمنع تمدده */
    box-shadow: none; /* إزالة الظل */
    min-width: auto;
}

html[dir="rtl"] .toggle-password {
    right: auto;
    left: 5px;
}

.toggle-password:hover, .form-container .toggle-password:hover {
    color: #3f51b5;
    background: none;
    transform: translateY(-50%); /* الحفاظ على التوسيط ومنع الحركة عند التمرير */
    box-shadow: none;
}

/* =============================================== */
/* == صفحة الإعدادات (Settings Page) == */
/* =============================================== */
.settings-container {
    max-width: 600px; /* تحديد عرض مناسب للحاوية لتقليل عرض الحقول */
    margin: 0 auto;
    width: 100%;
}

.settings-card {
    background: #fff;
    padding: 2rem; /* 32px */
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid #f0f2f5;
}

.settings-card h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    color: #3f51b5;
    font-size: 1.4rem;
}

/* Danger Zone Styles */
.settings-card.danger-zone {
    border: 1px solid #ffcdd2;
    background: #fffafa;
}

.settings-card.danger-zone h3 {
    color: #d32f2f;
    border-bottom-color: #ffcdd2;
}

.warning-text {
    color: #c62828;
    background-color: #ffebee;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border-left: 4px solid #ef5350;
}

html[dir="rtl"] .warning-text {
    border-left: none;
    border-right: 4px solid #ef5350;
}

.btn-danger {
    background-color: #f44336;
    color: white !important;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(244, 67, 54, 0.2);
}

.btn-danger:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(244, 67, 54, 0.3);
}

/* =============================================== */
/* == حقول رمز التحقق (Verification Code Inputs) == */
/* =============================================== */
.verification-code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    direction: ltr; /* الأرقام دائماً من اليسار لليمين */
}

.code-box {
    width: 50px;
    height: 55px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: bold;
    color: #3f51b5;
    background-color: #f9f9f9;
}

.code-box:focus {
    border-color: #3f51b5;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(63, 81, 181, 0.15);
    outline: none;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .verification-code-inputs {
        gap: 6px;
    }
    .code-box {
        width: 40px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* حالة الخطأ لمربعات التحقق */
.verification-code-inputs.error .code-box {
    border-color: #d32f2f; /* لون أحمر واضح للخطأ */
    background-color: #ffebee; /* خلفية حمراء فاتحة */
}

.verification-code-inputs.error .code-box:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.25); /* ظل أحمر عند التركيز */
}


/* =============================================== */
/* == عداد الوقت وإعادة الإرسال (Timer & Resend) == */
/* =============================================== */
.verification-timer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.95rem;
    color: #666;
}

.timer-countdown {
    font-weight: bold;
    color: #e91e63;
}

.resend-container {
    text-align: center;
    margin-top: 15px;
}

.btn-resend {
    background: none;
    border: none;
    color: #3f51b5;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 5px;
    transition: color 0.3s;
}

.btn-resend:hover {
    color: #303f9f;
}

.btn-resend:disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

/* =============================================== */
/* == تأثير الاهتزاز عند الخطأ (Shake Effect) == */
/* =============================================== */
.form-container.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@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);
    }
}

/* =============================================== */
/* == تنسيقات التحقق من صحة الإدخال (Input Validation) == */
/* =============================================== */

.input-error {
    border-color: #d32f2f !important; /* لون أحمر واضح للخطأ */
    background-color: #ffebee !important; /* خلفية حمراء فاتحة */
}

.input-error:focus {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.25) !important; /* ظل أحمر عند التركيز */
}

.input-error-message {
    color: #d32f2f;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 5px;
}

/* تعطيل زر الإرسال */
.form-container button:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* =============================================== */
/* == أزرار الإجراءات (Form Actions) == */
/* =============================================== */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.form-actions button,
.form-actions .btn-secondary {
    flex: 1;
    width: auto; /* السماح لـ flex بالتحكم في العرض */
}

.btn-secondary {
    background-color: #757575;
    color: white !important;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(117, 117, 117, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background-color: #616161;
    transform: translateY(-2px);
}

/* =============================================== */
/* == زر اختيار الصورة (Select Photo Button) == */
/* =============================================== */
.btn-select-photo {
    background-color: #e0e3f3;
    color: #3f51b5;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.btn-select-photo:hover {
    background-color: #d0d3e3;
}

/* =============================================== */
/* == خريطة الموقع (Map Styles) == */
/* =============================================== */
.map-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    height: 300px;
    width: 100%;
    margin-bottom: 5px;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-wrapper .btn-locate {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2000; /* قيمة عالية لضمان الظهور فوق عناصر الخريطة */
    background-color: #fff;
    color: #333;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    width: auto; /* تصحيح العرض لمنع تمدده */
}

.map-wrapper .btn-locate:hover {
    background-color: #f8f9fa;
    color: #3f51b5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.map-wrapper .btn-locate:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-wrapper .btn-locate svg {
    width: 18px;
    height: 18px;
}

/* =============================================== */
/* == صندوق البحث في الخريطة (Map Search Box) == */
/* =============================================== */
.map-search-box {
    position: relative;
    display: flex;
    background: #fff;
    border-radius: 6px;
    box-shadow: none;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
}

.map-search-box input {
    border: none;
    padding: 8px 12px;
    outline: none;
    font-size: 0.9rem;
    width: auto;
    flex: 1;
    background: transparent;
    border-radius: 6px 0 0 6px;
}

.map-search-box button {
    background: transparent;
    border: none;
    border-left: 1px solid #eee;
    cursor: pointer;
    padding: 0;
    width: 40px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 0 6px 6px 0;
}

html[dir="rtl"] .map-search-box button {
    border-left: none;
    border-right: 1px solid #eee;
    border-radius: 6px 0 0 6px;
}

html[dir="rtl"] .map-search-box input {
    border-radius: 0 6px 6px 0;
}

.map-search-box button:hover {
    color: #3f51b5;
}

.map-search-box button svg {
    width: 16px;
    height: 16px;
}

/* =============================================== */
/* == Cart Notification Styles == */
/* =============================================== */

#cart-notification {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 1050;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: opacity 0.3s, top 0.3s;
}

#cart-notification.success {
    background-color: #4CAF50; /* Green for success */
}

#cart-notification.error {
    background-color: #f44336; /* Red for error */
}

/* =============================================== */
/* == Cart Responsiveness & AJAX States == */
/* =============================================== */

/* Hide the old update button */
#update-cart-btn {
    display: none;
}

/* Style for rows being removed */
tr.removing {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.5s ease-out;
}

/* Responsive Cart Table */
@media (max-width: 768px) {
    .cart-table thead {
        display: none; /* Hide table header on small screens */
    }

    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
        display: block;
        width: 100%;
    }

    .cart-table tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 15px;
        position: relative;
    }

    .cart-table td {
        padding: 8px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f5f5f5;
    }
    .cart-table td:last-child {
        border-bottom: none;
    }

    .cart-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 15px;
    }

    .cart-product-image {
        width: 80px;
        margin: 0 auto 10px auto;
        padding: 0;
    }
    .cart-product-image::before{
        display: none;
    }
    .cart-product-image img{
        border-radius: 8px;
    }

    .cart-product-name a {
        font-weight: bold;
        color: #3f51b5;
    }

    .cart-product-remove {
        position: absolute;
        top: 10px;
        right: 10px;
        border: none !important;
    }
    html[dir="rtl"] .cart-product-remove{
        right: auto;
        left: 10px;
    }
    .cart-product-remove::before{
        display: none;
    }
    .btn-remove {
        font-size: 1.5rem;
        padding: 5px;
        line-height: 1;
    }

    .cart-summary {
        flex-direction: column;
        gap: 20px;
    }
}



/* =============================================== */
/* == Product Page Enhancements == */
/* =============================================== */

.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quantity-selector label {
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.quantity-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    background-color: #f5f5f5;
    border: none;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3f51b5;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #e0e3f3;
    color: #303f9f;
}

.quantity-btn:active {
    background-color: #d0d3e3;
    transform: scale(0.95);
}

.quantity-stepper .quantity-input {
    width: 70px;
    height: 45px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    background-color: #fff;
}

.btn-add-to-cart {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: #fff !important;
    border: none !important;
    padding: 15px 30px !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
}

.btn-add-to-cart:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

.btn-add-to-cart:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3) !important;
}

.btn-add-to-cart:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

@media (max-width: 768px) {
    .quantity-stepper {
        width: 100%;
    }
    
    .quantity-stepper .quantity-input {
        flex: 1;
    }
    
    .btn-add-to-cart {
        width: 100%;
    }
}


/* Hide number input spinners */
.quantity-stepper .quantity-input::-webkit-outer-spin-button,
.quantity-stepper .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-stepper .quantity-input[type="text"] {
    -moz-appearance: textfield;
}


/* Product Stock Info Styles */
.product-stock-info {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.stock-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border: 1px solid #e0e3f3;
    transition: all 0.3s ease;
}

.stock-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stock-item svg {
    flex-shrink: 0;
}

.stock-item > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.stock-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.stock-available {
    color: #4CAF50;
}

.stock-sold {
    color: #3f51b5;
}

.stock-item:first-child svg {
    color: #4CAF50;
}

.stock-item:last-child svg {
    color: #3f51b5;
}

@media (max-width: 768px) {
    .product-stock-info {
        flex-direction: column;
    }
}


/* Product Card Stock Badges */
.product-card-stock {
    display: flex;
    gap: 8px;
    margin: 8px 0;
    justify-content: center;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.stock-badge svg {
    flex-shrink: 0;
}

.stock-badge.stock-available {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.stock-badge.stock-sold {
    background: rgba(63, 81, 181, 0.1);
    color: #3f51b5;
    border: 1px solid rgba(63, 81, 181, 0.2);
}


/* Product Image Gallery */
.product-image-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnail-images {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.thumbnail-images::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-images::-webkit-scrollbar-thumb {
    background: #3f51b5;
    border-radius: 3px;
}

.thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.thumb:hover {
    border-color: #3f51b5;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(63,81,181,0.3);
}

.thumb.active {
    border-color: #3f51b5;
    box-shadow: 0 0 0 3px rgba(63,81,181,0.3);
}

@media (max-width: 768px) {
    .main-image {
        height: 300px;
    }
    
    .thumb {
        width: 100px;
        height: 100px;
    }
    
    .thumbnail-images {
        gap: 8px;
        padding: 8px;
    }
}

/* شارة العلامة التجارية على صفحة تفاصيل المنتج */
.product-detail-container {
    position: relative;
    padding-top: 70px;
}

.brand-badge-detail {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.brand-badge-detail:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(63,81,181,0.3);
}

.brand-badge-detail img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .product-detail-container {
        padding-top: 60px;
    }
    
    .brand-badge-detail img {
        width: 40px;
        height: 40px;
    }
}

/* تأثير carousel للصور في بطاقة المنتج */
.product-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: grab;
    height: 100%;
    will-change: transform;
}

.carousel-track:active {
    cursor: grabbing;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    height: 100%;
}

.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.product-carousel .carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
    pointer-events: all;
}

.product-carousel .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-carousel .dot.active {
    background: #fff;
    width: 20px;
    border-radius: 3px;
}

.product-carousel .dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* تكبير صورة المنتج عند التمرير */
.main-image {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}

.main-image img {
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.zoom-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.zoom-icon svg {
    display: block;
    color: #3f51b5;
}

.main-image:hover .zoom-icon {
    opacity: 0;
}
/* This is a fix for the logout button visibility issue on mobile devices. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.category-sidebar {
    box-sizing: border-box;
}


/* Remove from wishlist button */
.btn-remove-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 10;
}

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

.btn-remove-wishlist svg {
    width: 20px;
    height: 20px;
}

/* Heart button in favorites - red color */
.btn-remove-wishlist.in-favorites,
.btn-remove-wishlist.in-wishlist {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e91e63;
}

.btn-remove-wishlist.in-favorites svg,
.btn-remove-wishlist.in-wishlist svg {
    fill: #e91e63;
    stroke: #e91e63;
}

.btn-remove-wishlist.in-favorites:hover,
.btn-remove-wishlist.in-wishlist:hover {
    background: #e91e63;
}

.btn-remove-wishlist.in-favorites:hover svg,
.btn-remove-wishlist.in-wishlist:hover svg {
    fill: white;
    stroke: white;
}

/* =============================================== */
/* == تنسيقات صفحة المنتج المت-harmonized == */
/* =============================================== */

/* حاوية الإجراءات الرئيسية للمنتج */
.product-actions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

/* صف الأزرار (السلة والمفضلة) */
.product-actions-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.product-actions-row .add-to-cart-form {
    flex: 2;
}

/* زر إضافة للسلة - تصميم متناسق */
.btn-add-to-cart {
    width: 100%;
    min-height: 50px;
    padding: 14px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #4CAF50 0%, #43A047 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-to-cart:hover {
    background: linear-gradient(135deg, #43A047 0%, #388E3C 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.45);
}

.btn-add-to-cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.btn-add-to-cart svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* زر المفضلة - تصميم متناسق مع زر السلة */
.favorites-button-row {
    flex: 1;
}

.btn-add-to-wishlist,
.btn-favorites,
.btn-wishlist {
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.35);
}

.btn-add-to-wishlist:hover,
.btn-favorites:hover,
.btn-wishlist:hover {
    background: linear-gradient(135deg, #d81b60 0%, #c2185b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.45);
}

.btn-add-to-wishlist svg,
.btn-favorites svg,
.btn-wishlist svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* منتقي الكمية - تصميم متناسق */
.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quantity-selector label {
    font-weight: 600;
    color: #3f51b5;
    font-size: 0.95rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #e0e3f3;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.qty-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
    color: #3f51b5;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: linear-gradient(135deg, #3f51b5 0%, #5c6bc0 100%);
    color: #fff;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 60px;
    height: 45px;
    text-align: center;
    border: none;
    border-left: 1px solid #e0e3f3;
    border-right: 1px solid #e0e3f3;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    background: #fff;
    -moz-appearance: textfield;
}

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

.qty-input:focus {
    outline: none;
    background: #f8f9ff;
}

/* معلومات المخزون - تصميم متناسق */
.product-stock-info {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.stock-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 12px;
    border: 2px solid #e0e3f3;
    transition: all 0.3s ease;
}

.stock-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(63, 81, 181, 0.15);
    border-color: #3f51b5;
}

.stock-item svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.stock-item:first-child svg {
    color: #4CAF50;
}

.stock-item:last-child svg {
    color: #3f51b5;
}

.stock-item > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-label {
    font-size: 0.8rem;
    color: #757575;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stock-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}

.stock-value.stock-available {
    color: #4CAF50;
}

.stock-value.stock-sold {
    color: #3f51b5;
}

/* =============================================== */
/* == الاستجابة للأجهزة المختلفة == */
/* =============================================== */

/* الأجهزة المتوسطة (Tablets) */
@media (max-width: 992px) {
    .product-actions-row {
        flex-direction: column;
    }
    
    .product-actions-row .add-to-cart-form {
        flex: none;
    }
    
    .favorites-button-row {
        flex: none;
    }
    
    .product-stock-info {
        gap: 12px;
    }
    
    .stock-item {
        padding: 14px;
    }
    
    .stock-value {
        font-size: 1.4rem;
    }
}

/* الهواتف الذكية */
@media (max-width: 576px) {
    /* حاوية تفاصيل المنتج - تحسين العرض */
    .product-detail-container {
        padding: 15px;
        margin: 15px auto;
        gap: 20px;
    }
    
    /* معلومات المخزون - تناسق كامل */
    .product-stock-info {
        flex-direction: row;
        gap: 8px;
        margin: 15px 0;
    }
    
    .stock-item {
        padding: 10px 8px;
        flex: 1;
        gap: 8px;
        border-radius: 8px;
    }
    
    .stock-item svg {
        width: 20px;
        height: 20px;
    }
    
    .stock-label {
        font-size: 0.65rem;
    }
    
    .stock-value {
        font-size: 1rem;
    }
    
    /* صف الإجراءات - تناسق الأزرار */
    .product-actions-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-actions-row .add-to-cart-form {
        width: 100%;
    }
    
    /* منتقي الكمية - تناسق */
    .product-actions-row .quantity-selector {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .product-actions-row .quantity-selector label {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    
    .product-actions-row .quantity-controls {
        flex: 1;
        justify-content: center;
    }
    
    .product-actions-row .qty-btn {
        width: 40px;
        height: 38px;
        font-size: 1.2rem;
    }
    
    .product-actions-row .qty-input {
        width: 50px;
        height: 38px;
        font-size: 0.95rem;
    }
    
    /* زر إضافة للسلة - تناسق كامل */
    .product-actions-row .btn-add-to-cart {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    /* زر المفضلة - تناسق مع زر السلة */
    .favorites-button-row {
        width: 100%;
        margin-top: 0;
    }
    
    .favorites-button-row .btn-favorites {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    
    /* صورة المنتج الرئيسي */
    .main-image {
        height: 280px;
    }
    
    .thumbnail-images .thumb {
        width: 60px;
        height: 60px;
    }
    
    /* اسم المنتج والسعر */
    .product-name {
        font-size: 1.4rem;
    }
    
    .product-price-details {
        font-size: 1.3rem;
    }
}

/* الهواتف الصغيرة جداً */
@media (max-width: 380px) {
    .btn-add-to-cart,
    .btn-add-to-wishlist {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .btn-add-to-cart svg,
    .btn-add-to-wishlist svg {
        width: 18px;
        height: 18px;
    }
}

