@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');
body {
  margin: 0;
  padding: 0;
  padding-top: 70px; /* تعويض مساحة الهيدر الثابت لكي لا يختفي المحتوى تحته */
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}
:root {
  --bg-light: #f5f5f5;
  --text-main: #333;
  --border-color: #ddd;
}
html {
  scroll-behavior: smooth;
}

.main-header {
  width: 100%;
  background: #fff;
  position: fixed;
  top: 0px;
  left: 0;
  z-index: 1000;
}

.container {
  max-width: 1650px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
}

.logo img {
  width: 125px;
  margin-left: 60px;
}

/* شريط البحث */
.search-container {
  flex: 1;
  max-width: 1000px;
  margin-right: 40px;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: #333;
  font-weight: 650;
}

.header-bottom-part {
  flex: 1;
  max-width: 850px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-light);
  border-radius: 8px;
  padding: 5px 15px;
  position: relative; /* لكي تتموضع نتائج البحث بالنسبة له */
}

/* ================================================================
   🌍 القائمة المنسدلة لنتائج البحث العام (Global Search)
   ================================================================ */
.search-results-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  max-height: 450px;
  overflow-y: auto;
  padding: 8px 0;
}

.search-results-dropdown.show {
  display: block;
}

/* عنوان الفئة (Brands, Projects, Products) */
.search-result-category {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  margin-top: 4px;
}

.search-result-category:first-child {
  margin-top: 0;
}

/* عنصر النتيجة الواحد */
.search-result-item {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.15s ease;
  gap: 12px;
}

.search-result-item:hover {
  background-color: #f5f5f5;
}

/* صورة النتيجة */
.search-result-img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}

/* معلومات النتيجة */
.search-result-info {
  display: flex;
  flex-direction: column;
  min-width: 0; /* لكي يعمل text-overflow */
}

.search-result-name {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-type {
  font-size: 11px;
  color: #999;
  text-transform: capitalize;
  margin-top: 2px;
}

/* رسالة خطأ / لا نتائج */
.search-result-error,
.search-result-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: #888;
}

/* الحاوية الأب لضمان الالتصاق */
.category-select {
  position: relative; /* ضروري جداً ليكون التموضع بالنسبة له */
  display: flex;
  align-items: center;
  cursor: pointer;
  height: 100%; /* ليأخذ نفس ارتفاع شريط البحث */
  gap: 15px;
  border-right: 2px solid var(--border-color);
  padding-right: 20px;
}

.arrow-down {
  border: solid #666;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 3px;
  margin-left: 8px;
  transform: rotate(45deg);
}

/* القائمة المنسدلة */
.dropdown-menu {
  display: none;
  position: absolute;
  /* يلتصق أسفل مربع البحث تماماً */
  top: 200%;
  left: -10px;
  width: 100%; /* ليأخذ نفس عرض الـ category-select تماماً */
  min-width: 130px; /* لضمان مساحة كافية للنص */
  background: #fff;
  /* ظل خفيف يعطي إيحاء بالعمق لكن دون فصلها */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  list-style: none;
  padding: 5px 0;
  margin: 0; /* حذفنا المارجن لضمان الالتصاق */
  border: 1px solid #eee; /* حدود خفيفة جداً لتحديدها */
  border-top: none; /* إزالة الحد العلوي لتظهر كأنها تابعة للمربع فوقها */
  max-height: 400px;
  overflow-y: auto;
}

/* العناصر داخل القائمة */
.dropdown-menu li {
  padding: 10px 15px;
  font-size: 14px;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-weight: 700;
  color: #222;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left; /* توسيط النص داخل العنصر */
}

.dropdown-menu a {
  text-decoration: none; /* هذا السطر هو المسؤول عن إزالة الخط */
  color: inherit; /* يجعل لون النص يتبع لون القائمة ولا يتحول للأزرق التقليدي */
  margin: 0 !important; /* إزالة أي إزاحة موروثة من روابط الهيدر */
  display: block; /* لضمان ملء المساحة والتوسيط الصحيح */
}

.dropdown-menu li {
  list-style: none; /* لإزالة النقاط إذا كانت موجودة */
}

.dropdown-menu li:hover {
  background-color: #ebeaea;
}

/* عندما تأخذ القائمة هذا الكلاس تظهر */
.dropdown-menu.show {
  display: block;
}

/* تدوير السهم عند الفتح (اختياري) */
.category-select.active .arrow-down {
  transform: rotate(-135deg);
  margin-top: 5px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 15px;
  outline: none;
  font-size: 15px;
}

.search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
}

/* روابط الدخول */
.auth-links a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 16px;
  margin-left: 20px;
  font-weight: 500;
}

.login-link {
  font-weight: bold !important;
}

/* تحسين الاستجابة للموبايل */
@media (max-width: 768px) {
  .container {
    flex-wrap: wrap;
    padding: 10px 15px;
  }

  .logo h1 {
    font-size: 20px;
  }

  .header-bottom-part {
    order: 3; /* نقل شريط البحث للأسفل */
    width: 100%;
    max-width: 100%;
    margin-top: 15px;
  }

  .search-container {
    margin: 0;
    max-width: 100%;
  }

  .auth-links a {
    margin-left: 10px;
    font-size: 14px;
  }

  .search-box input {
    padding: 8px 10px;
    font-size: 14px;
  }

  .user-nav-container {
    gap: 10px;
  }

  .user-dropdown {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    min-width: 150px !important;
  }
}

/* إعدادات عامة للـ Footer */
.site-footer {
  font-family: Arial, sans-serif;
  color: #fff;
  background-color: #222; /* لون الخلفية للجزء الأوسط */
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 2. قسم الروابط الرئيسي (خلفية سوداء/داكنة) */
.footer-main {
  padding: 60px 0;
  border-bottom: 5px solid #333;
}

.grid-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.footer-col h4 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 25px;
  font-weight: 500;
  position: relative;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 12px;
  font-size: 14px;
  color: #aaa;
}

.footer-col ul li a {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  transition: 0.3s;
}

.footer-col ul li a:hover {
  color: #ffb400;
}

/* الحاوية الأساسية */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px; /* مسافة بين كل وسيلة اتصال وأخرى */
}

/* تنسيق الصف الواحد */
.contact-item {
  display: flex;
  align-items: flex-start; /* محاذاة الأيقونة مع أعلى النص */
  gap: 10px;
}

.contact-item img {
  width: 36px; /* توحيد حجم الأيقونات */
  filter: brightness(0) invert(1);
}

/* تنسيق النصوص والروابط */
.contact-item .details {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.contact-item a,
.contact-item span {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  transition: 0.3s;
  margin-top: 8px;
}

.contact-item a:hover {
  color: #ffb400; /* اللون الذهبي عند التمرير */
  padding-left: 5px; /* حركة بسيطة لليمين */
}
/* 3. شريط الحقوق السفلي */
.footer-bottom {
  background-color: #000;
  padding: 20px 0;
  font-size: 13px;
  color: #888;
}

.bottom-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bottom-links a {
  color: #888;
  text-decoration: none;
  margin-left: 15px;
}

/* التوافق مع الشاشات الصغيرة */
@media (max-width: 992px) {
  .grid-columns {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-newsletter .footer-container {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .grid-columns {
    grid-template-columns: repeat(1, 1fr);
  }
  .bottom-flex {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

.projects-section {
  padding: 60px 0;
  background-color: #fff;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.section-header {
  max-width: 1400px;
  margin: 0 auto 50px auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.section-header a {
  text-decoration: none;
}

.title {
  font-family: Roboto;
  font-size: 45px;
  margin: 0;
  padding: 0;
  margin-left: 50px;
}

.sub-title {
  margin-left: 50px;
  color: #b6b5b5;
  margin-top: 5px;
  padding: 0;
  font-size: 22px;
}
.magazine-grid {
  display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 أعمدة */
    gap: 30px;
    justify-content: center; /* توسيط محتويات الشبكة */
}

.magazine-card{
  background: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 400px; /* زيادة العرض الأقصى للكرت ليظهر بشكل أعرض */
  display: flex;
  flex-direction: column;
  padding: 10px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.magazine-card:hover{
  transform: none; /* Remove the translateY effect */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
  border-color: #eee;
}


/* الحاوية التي تحتوي على الكروت */
.projects-grid {
    display: grid;
    /* هذا السطر سيجبر المتصفح على عرض 3 كروت بجانب بعضها */
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px; /* مسافة مريحة بين الكروت */
    width: 95%;
    max-width: 1400px;
    margin: 0 auto; /* لتوسيط الشبكة في الصفحة */
}

/* حل مشكلة ظهور الكروت كعمود واحد */
@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr); /* كرتين في الشاشات المتوسطة */
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr; /* كرت واحد للموبايل */
    }
}

.project-card {
  background: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 1200px; /* زيادة العرض الأقصى للكرت ليظهر بشكل أعرض */
  display: flex;
  flex-direction: column;
  padding: 10px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid rgba(128, 128, 128, 0.112);
}
.project-card:hover {
  transform: none; /* Remove the translateY effect */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
  border-color: #eee;
}

.card-image {
  position: relative; /* مهم جداً */
  width: 100%;
  height: 250px; /* تعديل الارتفاع ليتناسب مع التوزيع الأفقي */
  overflow: hidden;
  margin-bottom: 15px;
}

.card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(108, 108, 108, 0.091);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}


.project-card:hover .card-image::after {
  opacity: 1;
}
.card-image img {
  width: 100%;
  height: 100%;
  
  transition: transform 0.5s ease;
}
.project-card:hover .card-image img {
  transform: none; /* Remove the scale effect */
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 10px 0;
  line-height: 1.4;
  word-wrap: break-word;
  overflow: visible;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-meta span {
  font-size: 12px;
  color: #999;
}

.category::after {
  content: "";
  margin-left: 5px;
}

.tag {
  display: block;
  width: 100%; /* لجعل التاج الفرعي يظهر في سطر جديد كالمثال */
  color: #ccc !important;
  margin-top: 5px;
}

/* استجابة الموبايل */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* تصغير الحد الأدنى في الشاشات المتوسطة */
  }
}

@media (max-width: 600px) {
  .projects-grid {
    grid-template-columns: 1fr; /* عمود واحد في الموبايل */
  }
}

/*read more*/
.read-more {
  display: flex;
  align-items: center;
  justify-content: center;
}
.read-more button {
  margin-top: 90px;
  padding: 20px 30px;
  background: #333;
  color: white;
  border-radius: 10px;
  font-weight: bold;
  font-size: 13px;
}
.read-more button:hover {
  cursor: pointer;
  background: white;
  color: #333;
  border: 1px solid #333;
}
.read-more a {
  text-decoration: none;
}

.projects-section a {
  text-decoration: none;
}

.card-desc-short {
  font-size: 14px;
  color: #777;
  margin: 5px 0 15px 0;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow: visible;
}

.card-title {
  margin-bottom: 5px; /* تقليل المسافة لتناسب الوصف */
}

/*filters*/
/* التنسيق العام للشريط */
.filter-container {
  display: flex;
  gap: 10px;
  font-family: Arial, sans-serif;
  padding: 30px 70px 10px 70px;
  margin-top: 25px; /* دفع الفلاتر للأسفل قليلاً لتجنب الالتصاق بالهيدر */
}

/* تصميم الأزرار */
.dropbtn,
.filter-btn {
  background-color: white;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 20px; /* حواف دائرية مثل الصورة */
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.arrow.down {
  border: solid #666;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 3px;
  transform: rotate(45deg);
}

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

.dropdown-content {
  display: none; /* مخفية افتراضياً */
  position: absolute;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 1;
  padding: 10px;
  max-height: 400px;
  overflow-y: auto;
}

/* إظهار القائمة عند التحويم (Hover) أو الضغط */
.dropdown:hover .dropdown-content {
  display: block;
}

/* تنسيق حقل البحث داخل القائمة */
.search-input {
  width: 90%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
}

.dropdown-content a {
  color: #333;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
  font-size: 14px;
}

.dropdown-content a:hover {
  background-color: transparent;
  text-decoration: underline;
  color: #000;
}

/* زر مسح الفلاتر */
.clear-filters-btn {
  background-color: #f5f5f5;
  border: 1px dashed #ccc;
  color: #666;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.clear-filters-btn:hover {
  background-color: #eee;
  color: #000;
  border-color: #999;
}

/* تحسين استجابة وحجم الفلاتر في الجوال */
@media (max-width: 768px) {
  .filter-container {
    padding: 10px;
    flex-wrap: nowrap; /* منع النزول لسطر جديد */
    overflow-x: auto; /* تفعيل السحب الأفقي */
    justify-content: flex-start; /* البدء من اليمين/اليسار للسحب */
    gap: 6px;
    -webkit-overflow-scrolling: touch; /* سلاسة السحب في آيفون */
    scrollbar-width: none; /* إخفاء شريط التمرير في فايرفوكس */
  }

  .filter-container::-webkit-scrollbar {
    display: none; /* إخفاء شريط التمرير في كروم وسفاري لمظهر أنظف */
  }

  .dropbtn,
  .filter-btn {
    padding: 5px 10px; /* تقليل الحواف أكثر */
    font-size: 12px; /* تصغير الخط ليتناسب مع الجوال */
    white-space: nowrap; /* منع انكسار النص داخل الزر */
    flex-shrink: 0; /* منع انكماش الزر */
  }

  .brands-container {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 20px;
  }

  .brand-images-grid {
    height: 250px;
  }

  .title {
    font-size: 22px;
    margin-left: 10px;
  }
}

/* --- تنسيق نافذة التسجيل والدخول --- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}
.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 450px;
  padding: 30px;
  border-radius: 12px;
  position: relative;
  animation: slideUp 0.3s ease-out;
  direction: rtl; /* لضمان اتجاه النص العربي */
}
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
}

.auth-form-toggle {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  border-bottom: 1px solid #eee;
  justify-content: center;
}
.auth-form-toggle button {
  padding: 10px 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  color: #949494;
  border-bottom: 2px solid transparent;
}
.auth-form-toggle button.active {
  color: #000;
  border-bottom-color: #000;
}
.hidden {
  display: none !important;
}

/* تنسيقات قائمة المستخدم بعد تسجيل الدخول */
.user-name-btn {
  background: none;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.user-name-btn:hover {
  background-color: #f5f5f5;
  border-radius: 20px;
}

.user-name-btn.active .arrow-down {
  transform: rotate(-135deg);
  margin-top: 5px;
}

.user-dropdown {
  left: 50% !important; /* توسيط القائمة بالنسبة للزر */
  right: auto !important;
  transform: translateX(-50%); /* ضمان التوسيط الدقيق */
  min-width: 180px !important;
  top: 120% !important;
}

/* تنسيق الدائرة التي تحتوي على الحرف الأول من اسم المستخدم */
.user-initial-avatar {
  width: 35px; /* حجم الدائرة */
  height: 35px; /* حجم الدائرة */
  border-radius: 50%; /* لجعلها دائرية */
  background-color: #ddd; /* لون خلفية الدائرة */
  color: #222; /* لون النص داخل الدائرة */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px; /* حجم خط الحرف */
  font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

/* تنسيق الحاوية الجديدة للأزرار والاسم */
.user-nav-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
  position: relative;
}

.notification-btn:hover {
  background: #f0f0f0;
}

.notification-btn::after {
  content: "";
  display: block;
  width: 1px;
  height: 24px;
  background-color: #ddd;
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
}

.notification-dropdown {
  display: none;
  position: absolute;
  top: 130%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  border-radius: 10px;
  z-index: 1000;
  padding: 10px 0;
  border: 1px solid #eee;
}

.notification-dropdown.show {
  display: block;
}

.notification-dropdown-header {
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #eee;
}

.notification-item {
  padding: 12px 16px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #f5f5f5;
}

.notification-item:hover {
  background: #f9f9f9;
}

.notification-empty {
  padding: 30px 16px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}

.header-action-btn {
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  background: #000;
  color: #fff !important;
  transition: 0.3s;
}

/* --- تنسيقات عرض البراندات (تستخدم في صفحة البروفايل وصفحة البراندات العامة) --- */
.brands-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); /* توحيد العرض ليكون أفقي وعريض */
  gap: 40px;
  padding: 10px 40px 80px 40px;
  background-color: #ffffff;
}

.brand-card {
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
  margin-bottom: 10px;
  border: 1px solid rgba(128, 128, 128, 0.068);
  text-align: left;
  
}
.brand-card:hover {
  transform: none; /* Remove the translateY effect */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Add a subtle shadow */
  border-color: #eee;
}

.brand-images-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2px;
  height: 230px;
  background-color: #ffffff;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.112);
}

.brand-images-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.side-imgs {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

.single-layout {
  grid-template-columns: 1fr;
}

.brand-info {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin-top: 10px;
  gap: 10px;
  padding: 10px;

}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: contain;
}

.brand-text {
  flex: 1;
  min-width: 0; /* ضروري جداً لتمكين خاصية ellipsis (النقاط) داخل الـ flexbox */
}

.brand-text h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: #111;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  font-size: 12px;
  color: #666;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  font-size: 11px;
  font-family: bold;
  color: #777;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-action-btn.outline {
  background: transparent;
  color: #000 !important;
  border: 1px solid #000;
}

.header-action-btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}
 .trends {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        margin-bottom: 30px;
      }

      .Fancy-logo {
        display: flex;
        align-items: center;
        margin: 0;
      }

      .Fancy-logo img {
        width: 150px;
      }

      .Fancy-logo p {
        font-size: 35px;
        font-family: "Roboto" !important;
        font-weight: 200;
        color: #414040;
        margin: 0;
      }

/* ================================================
   🚀 تحسينات شاملة للهاتف (موبايل) - شاشات 480px فأقل
   ================================================ */
@media (max-width: 480px) {
  body {
    padding-top: 120px;
  }

  /* ===== الهيدر ===== */
  .main-header .container {
    flex-wrap: wrap;
    padding: 8px 8px;
    margin-bottom: 10px;
    gap: 3px;
    justify-content: space-between;
  }

  .logo img {
    width: 70px;
    margin-left: 0;
  }

  .auth-links {
    display: flex;
    gap: 2px;
    align-items: center;
  }

  .auth-links a {
    margin-left: 0;
    font-size: 10px;
    padding: 3px 5px;
    white-space: nowrap;
  }

  .header-action-btn {
    font-size: 10px;
    padding: 3px 6px;
  }

  .user-name-btn {
    font-size: 10px;
    padding: 3px 4px;
  }

  .user-nav-container {
    gap: 3px;
  }

  .notification-btn {
    padding: 5px;
  }

  .notification-btn::after {
    display: none;
  }

  .user-initial-avatar {
    width: 25px;
    height: 25px;
    font-size: 14px;
  }

  .header-bottom-part {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
  }

  .search-box {
    padding: 2px 8px;
  }

  .search-box input {
    padding: 5px 6px;
    font-size: 12px;
  }

  .category-select {
    gap: 4px;
    padding-right: 6px;
  }

  #selected-text {
    font-size: 10px;
    white-space: nowrap;
  }

  .arrow-down {
    padding: 2px;
    margin-left: 2px;
  }

  .dropdown-menu {
    min-width: 100px;
    left: -5px;
    top: 160%;
  }

  .dropdown-menu li {
    padding: 6px 10px;
    font-size: 11px;
  }

  .search-results-dropdown {
    max-height: 300px;
  }

  /* تعديل عنوان الصفحة */
  .title {
    font-size: 24px;
    margin-left: 15px;
  }

  .sub-title {
    font-size: 16px;
    margin-left: 15px;
    margin-top: 3px;
  }

  /* تعديل أزرار الفلتر */
  .filter-container {
    padding: 8px 8px 5px 8px;
    margin-top: 10px;
    gap: 4px;
  }

  .dropbtn,
  .filter-btn {
    padding: 4px 8px;
    font-size: 11px;
    gap: 6px;
  }

  .dropdown-content {
    min-width: 140px;
  }

  /* تعديل كروت المشاريع */
  .projects-section {
    padding: 30px 0;
  }

  .projects-grid {
    gap: 15px;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .project-card {
    padding: 8px;
  }

  .card-image {
    height: 250px;
    margin-bottom: 10px;
  }

  .card-title {
    font-size: 14px;
    margin: 5px 0;
  }

  .card-desc-short {
    font-size: 13px;
    margin: 3px 0 10px 0;
  }

  .card-meta span {
    font-size: 11px;
  }

  /* تعديل كروت الماجازين */
  .projects-section .container {
    display: block !important;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .magazine-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0;
    box-sizing: border-box;
    justify-content: center;
    width: 100%;
  }

  .magazine-card {
    max-width: 100%;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
  }

  .magazine-card .card-image {
    height: 200px;
  }

  /* تعديل section-header عشان المحتوى ما يروح يسار */
  .section-header .container {
    display: block !important;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }

  /* تعديل كروت البراندات */
  .brands-container {
    grid-template-columns: 1fr;
    padding: 10px 15px 40px 15px;
    gap: 20px;
  }

  .brand-images-grid {
    height: 180px;
  }

  .brand-info {
    padding: 5px;
    gap: 8px;
  }

  .brand-text h3 {
    font-size: 13px;
  }

  .brand-text p {
    font-size: 11px;
  }

  /* تعديل الفوتر */
  .footer-main {
    padding: 30px 0;
  }

  .grid-columns {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .footer-col h4 {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .footer-col ul li {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .contact-item a,
  .contact-item span {
    font-size: 12px;
  }

  .contact-item img {
    width: 28px;
  }

  .footer-bottom {
    padding: 15px 0;
  }

  .bottom-flex {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .bottom-links a {
    margin-left: 10px;
    font-size: 12px;
  }

  /* تعديل صفحة عرض التفاصيل (view) */
  .view-container {
    padding: 0 10px;
    margin-top: 10px;
  }

  .view-content {
    flex-direction: column;
    gap: 15px;
  }

  .view-details-section h1 {
    font-size: 22px;
  }

  .tab-btn {
    font-size: 14px;
    padding: 10px;
  }

  .tab-pane {
    padding: 12px;
  }

  .price-btn {
    font-size: 14px;
    padding: 10px 15px;
  }

  .thumbnails-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .thumb-img {
    height: 100px;
  }

  /* تعديل الفورم */
  .form-container {
    margin: 20px 10px;
    padding: 20px;
  }

  .form-container h2 {
    font-size: 20px;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 8px;
    font-size: 14px;
  }

  .submit-btn {
    padding: 10px;
    font-size: 14px;
  }

  /* تعديل صفحة البروفايل */
  .profile-container {
    padding: 20px 15px;
  }

  /* تعديل نافذة التسجيل */
  .modal-content {
    max-width: 95%;
    padding: 20px;
    margin: 10px;
  }

  .auth-form-toggle button {
    font-size: 14px;
    padding: 8px 0;
  }

  .auth-links .join-link {
    display: none;
  }

  /* تعديل صفحة الادمن */
  .dashboard-container {
    padding: 0 10px;
    margin: 20px auto;
  }

  .dashboard-title {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .forms-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-card {
    padding: 15px;
  }

  .form-card h3 {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .admin-nav {
    gap: 5px;
  }

  .admin-nav a {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* إخفاء السهم في "التسجيل" */
  .read-more button {
    margin-top: 40px;
    padding: 12px 20px;
    font-size: 12px;
  }

  /* تعديل الـ trends */
  .trends {
    margin-bottom: 15px;
  }

  .Fancy-logo img {
    width: 100px;
  }

  .Fancy-logo p {
    font-size: 24px;
  }

  /* صفحة المنتج */
  .options-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .opt-name-box {
    font-size: 12px;
    padding: 6px;
  }

  .opt-type-box {
    font-size: 12px;
    padding: 6px;
    min-width: 80px;
  }

  /* تحسين اختيار الفئة */
  .select-with-add {
    gap: 5px;
  }

  .btn-add-inline {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .quick-add-form {
    padding: 10px;
  }

  .quick-add-form .form-group input {
    font-size: 12px;
  }

  .quick-add-actions button {
    font-size: 12px;
    padding: 6px;
  }

  /* تعديلات خفيفة للهيدر للشاشات الصغيرة جداً */
  .user-dropdown {
    min-width: 140px !important;
    left: auto !important;
    right: 0 !important;
    transform: none !important;
  }

  .notification-dropdown {
    min-width: 200px;
    left: auto;
    right: 0;
    transform: none;
  }

  /* ========================================
     🛠 إصلاحات إضافية لصفحات محددة
     ======================================== */

  /* ---- صفحة المصمم (view_designer.html) ---- */
  .brand-header {
    padding: 15px 0 !important;
  }
  .brand-profile-bar {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 15px !important;
    gap: 15px !important;
  }
  .brand-logo-container {
    width: 100px !important;
    height: 100px !important;
    margin-right: 0 !important;
  }
  .brand-main-info {
    width: 100% !important;
  }
  .brand-main-info h1 {
    font-size: 20px !important;
  }
  .brand-actions {
    width: 100% !important;
    justify-content: center !important;
    padding-bottom: 10px !important;
  }
  .brand-actions .btn {
    font-size: 11px !important;
    padding: 6px 12px !important;
  }
  .social-links {
    justify-content: center !important;
  }
  .services-list {
    justify-content: center !important;
  }
  .cover-photo {
    height: 180px !important;
  }
  .view_designer .title,
  .view_designer .title,
  .brand-content .title {
    margin-left: 15px !important;
    font-size: 22px !important;
  }
  #brandAbout {
    margin-left: 15px !important;
    margin-right: 15px !important;
    padding: 15px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ---- صفحة عرض المجلة (view_magazine.html & view.html) ---- */
  .view-container {
    margin: 15px auto !important;
    padding: 15px !important;
  }
  .view-content {
    flex-direction: column !important;
    gap: 20px !important;
  }
  .view-image-section {
    width: 100% !important;
  }
  .view-image-section img {
    max-height: 300px !important;
  }
  .view-details-section {
    max-width: 100% !important;
    width: 100% !important;
  }
  .view-details-section h1 {
    font-size: 20px !important;
  }
  .designer-info-box img {
    width: 45px !important;
    height: 45px !important;
  }
  .designer-info-box h3 {
    font-size: 15px !important;
  }
  .price-btn {
    font-size: 14px !important;
    padding: 10px 15px !important;
    justify-content: center !important;
  }
  .price-btn img {
    width: 22px !important;
  }
  .back-link {
    font-size: 15px !important;
  }
  .related-grid {
    margin: 15px 0 !important;
    grid-template-columns: 1fr !important;
  }
  .related-section {
    margin-top: 40px !important;
  }
  .specs-section {
    font-size: 18px !important;
  }
  .tab-btn {
    font-size: 13px !important;
    padding: 8px !important;
  }
  .tab-pane {
    padding: 10px !important;
  }
  .thumbnails-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 6px !important;
  }
  .thumb-img {
    height: 80px !important;
  }
  .options-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 8px !important;
  }

  /* ---- صفحة البراندات الرئيسية (page_brand.html) ---- */
  .page_brand .filter-container,
  .filter-container {
    padding: 8px 8px 5px 8px !important;
    margin-top: 5px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .page_brand .brands-container,
  .brands-container {
    padding: 10px 15px 30px 15px !important;
    gap: 15px !important;
  }
  .brand-images-grid {
    height: 170px !important;
  }

  /* ---- صفحة المنتجات (page_prodact.html) ---- */
  .page_prodact .filter-container,
  .products-section .filter-container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* ---- الصفحة الرئيسية (index.html) ---- */
  .second-header {
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 5px !important;
    padding: 0 10px !important;
  }
  .nav {
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .nav a {
    font-size: 12px !important;
  }
  .nav a p {
    margin: 3px 0 !important;
  }
  .publish {
    font-size: 12px !important;
    text-align: center !important;
  }
  .hero-slider {
    height: 35vh !important;
    width: 100% !important;
    margin: 5px auto 10px auto !important;
  }
  .slide-content h1 {
    font-size: 1.2rem !important;
  }
  .slide-content p {
    font-size: 0.7rem !important;
  }
  .prev-btn,
  .next-btn {
    padding: 5px 8px !important;
    font-size: 14px !important;
  }
  .descrition {
    margin: 15px !important;
  }
  .des1 {
    font-size: 16px !important;
    text-align: center !important;
  }
  .des2 {
    font-size: 13px !important;
    text-align: center !important;
  }
  .gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 0 10px !important;
  }
  .gallery-item {
    height: 200px !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .gallery-overlay h4 {
    font-size: 15px !important;
  }
  .gallery-overlay p {
    font-size: 11px !important;
  }
  .newsletter-container {
    flex-direction: column !important;
    padding: 20px !important;
    gap: 15px !important;
    padding-bottom: 30px !important;
  }
  .newsletter-form {
    margin-right: 0 !important;
    max-width: 100% !important;
  }
  .newsletter-text h2 {
    font-size: 13px !important;
    text-align: center !important;
  }
  .input-group input {
    padding: 8px !important;
    font-size: 12px !important;
  }
  .input-group button {
    padding: 8px 14px !important;
    font-size: 12px !important;
  }
  .checkbox-label {
    font-size: 11px !important;
  }

  /* ---- تعديلات شاملة لجميع الصفحات (منع التمرير الأفقي) ---- */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  * {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .hide-on-mobile {
    display: none !important;
  }
  .container {
    justify-content: space-between !important;
    padding: 0 8px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .projects-section .container,
  .section-header .container {
    display: block !important;
    width: 100% !important;
    padding: 0 5px !important;
    max-width: 100% !important;
  }

  /* ---- كروت المنتجات (أكبر وأوضح) ---- */
  .project-card {
    padding: 12px !important;
    margin: 0 !important;
  }
  .card-image {
    height: 220px !important;
    margin-bottom: 12px !important;
  }
  .card-title {
    font-size: 15px !important;
    margin: 8px 0 4px 0 !important;
    min-height: 20px !important;
  }
  .card-desc-short {
    font-size: 13px !important;
    margin: 4px 0 10px 0 !important;
    min-height: 20px !important;
  }

  /* ---- كروت الماجازين (أكبر وأوضح) ---- */
  .magazine-card {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px !important;
  }
  .magazine-card .card-image {
    height: 220px !important;
  }
  .magazine-grid {
    grid-template-columns: 1fr !important;
  }
  .projects-grid {
    grid-template-columns: 1fr !important;
  }

  /* ---- البراندات كرت ----- */
  .brand-card {
    margin: 0 !important;
    padding-bottom: 15px !important;
  }
  .brand-images-grid {
    height: 200px !important;
  }

  /* ---- صفحة عرض المجلة ---- */
  .view-container {
    margin: 10px 0 !important;
    padding: 12px !important;
    width: 100% !important;
  }
  .view-image-section img {
    max-height: 280px !important;
  }
}
