/* style.css */

/* عام */
body {
  font-family: 'Cairo', sans-serif;
  margin: 0; padding: 0;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
}

/* الهيدر */
header {
  background: rgba(255,255,255,0.98);
  padding: 12px 0 7px 0;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); z-index: 2;
  width: 105vw;
}
.slider-wrapper {
  position: relative;
}
.sections-container {
  display: flex !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

/* أشرطة التنقل العلوية */
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  width: 96%; max-width: 1100px; flex-wrap: wrap; gap: 10px; margin-bottom: 4px;
}

/* العنوان وأزرار الحساب */
h1 { margin: 0; font-size: 29px; color: #2e7d32; font-weight: 800; flex-grow: 1; text-align: right; }
.account-buttons { display: flex; align-items: center; gap: 10px; }
.account-buttons button {
  padding: 8px 15px; cursor: pointer; background: #4caf50; color: #fff; border: none; border-radius: 7px; font-weight: 600; font-size: 16px;
  transition: background 0.2s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(44,155,100,0.08);
}
.account-buttons button:hover { background: #357a39; }
#latestAdsSlider,
#seenAdsSlider {
  display: flex;
  justify-content: center;  /* يوسّط العناصر */
  flex-wrap: wrap;          /* تلف إلى الأسفل عند الحاجة */
  gap: 14px;                /* مسافة بين البطاقات */
}

/* قائمة الملف الشخصي */
.profile-container { display: none; position: relative; }
#profileBtn { padding: 8px 14px 8px 6px; background: #4caf50; color: #fff; border: none; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 4px; font-size: 16px; }
#profileBtn img { width: 24px; height: 24px; border-radius: 50%; }
#profileBtn::after { content: "▼"; font-size: 11px; margin-right: 3px; color: #fff; }
.profile-menu { list-style: none; margin: 0; padding: 8px 0; position: absolute; top: 110%; right: 0; background: #fff; border: 1px solid #c3eedb; border-radius: 7px; box-shadow: 0 2px 10px rgba(0,0,0,0.16); display: none; min-width: 140px; z-index: 1000; }
.profile-menu li { padding: 10px 16px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; font-size: 15px; color: #0e462a; transition: background 0.18s; }
.profile-menu li img { width: 20px; height: 20px; }
.profile-menu li:hover { background: #f2f7f5; color: #22a16a; }

/* البحث السريع */
.search-area {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(243,255,248,0.65);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(44,155,100,0.06);
  }

.search-area input, .search-area select {
  padding: 10px; font-size: 16px; border: 1px solid #c3eedb; border-radius: 7px; background: #f9fffc; color: #166d32; min-width: 120px; transition: box-shadow 0.2s;
}
.search-area .search-btn {
  padding: 10px 18px; background: #4caf50; color: #fff; border: none; border-radius: 7px; font-weight: 600; font-size: 16px; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; box-shadow: 0 2px 6px rgba(44,155,100,0.07); display: flex; align-items: center; gap: 5px;
}
.search-area .search-btn img { width: 20px; height: 20px; }
/* عند المرور بالمؤشر فوق أي عنصر اقتراح */
#searchSuggestions li:hover {
  background-color: #f0f0f0;
  cursor: pointer;
}

/* عند اختيار العنصر (مثلاً بفئة active) */
#searchSuggestions li.active {
  background-color: #d0eaff;
}


/* المحتوى الرئيسي */
main {
  padding: 26px 0 28px 0;
  width: 100vw;
  box-sizing: border-box;
}
.sections-container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 18px; max-width: 670px; margin: 0 auto 18px auto; z-index: 1; position: relative;
}
.section {
  background: #fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.09); text-align: center; cursor: pointer; padding: 14px 5px 12px 5px;
  transition: box-shadow 0.20s cubic-bezier(.64,09,08,1.01), transform 0.13s; min-width: 80px; max-width: 100px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; border: 2.5px solid #f5f6fa; position: relative;
}
.section.selected, .section:hover { box-shadow: 0 8px 22px rgba(52,170,100,0.13); border: 2.5px solid #22c37d; background: #f5fff9; transform: translateY(-2px) scale(1.022); }
.section img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; margin-bottom: 7px; border: 2px solid #d3f6e3; background: #fff; transition: box-shadow 0.17s; display: block; margin-left: auto; margin-right: auto; }
.section p { margin: 0; font-weight: 700; color: #238c41; font-size: 13.2px; letter-spacing: 0.09px; margin-top: 4px; }

/* تصميم ثنائي الأعمدة */
.main-container {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  width: 100%;
}



/* بطاقات الإعلانات */
.ads-area {
  background: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.07);
  border-radius: 14px;
  margin: 40px 0 0 0;
  padding: 21px 13px 8px 13px;
  position: relative;
  min-height: 120px;
  flex: 1;
}
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px 18px;
  width: 100%;
}
.ad-card {
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 2px 10px rgba(44,155,100,0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: 1.7px solid #d2f1e2;
  position: relative;
  transition: box-shadow 0.15s, border 0.16s;
  max-width: 310px;
  margin: 0 auto;
  min-width: 0;
}
.ad-card:hover { box-shadow: 0 7px 22px #23c37d20; border: 1.7px solid #21a464; }
.ad-img-wrap {
  position: relative;
  width: 100%;
  min-height: 140px;
  background: #f6fffa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-img { width: 100%; height: 145px; object-fit: cover; }
.ad-price-badge {
  position: absolute; left: 8px; bottom: 9px;
  background: #ea2727; color: #fff;
  padding: 5px 16px 5px 12px; border-radius: 7px;
  font-size: 10px; font-weight: 900; box-shadow: 0 1px 7px #b52a2a22;
  letter-spacing: 0.5px; z-index: 4; min-width: 54px; text-align: center;
}
.ad-info { padding: 12px 9px 10px 9px; display: flex; flex-direction: column; gap: 4px; }
.ad-title { font-size: 16px; font-weight: 700; color: #18613b; margin: 0 0 3px 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.ad-meta { font-size: 13px; color: #888; margin-bottom: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.seen-badge { color: #26bb6d; font-size: 12px; margin-top: 2px; font-weight: 700; }

/* ترقيم الصفحات */
.pagination { display: flex; justify-content: center; gap: 7px; margin: 22px 0 10px 0; }
.pagination button {
  background: #f3fff8; color: #1b6130; border: 1.5px solid #c2eed3;
  border-radius: 5px; padding: 6px 14px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.17s;
}
.pagination button.active, .pagination button:hover {
  background: #1db85c; color: #fff; border-color: #158342;
}
.show-more-btn {
  display: block;
  margin: 8px 20px;
  padding: 8px 0;
  width: calc(100% - 40px);
  background: #23c85d;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
}
.show-more-btn:hover {
  background: #1fa852;
}

@media (min-width: 901px) {
  .sections-container {
    display: grid !important;
    grid-template-columns: repeat(10, max-content) !important;
    justify-content: center !important;
    gap: 12px !important;
    max-width: none !important;
    width: max-content !important;
    margin: 0 auto 24px auto !important;
  }
  .section {
    min-width: 0;
    max-width: 80px;
    padding: 10px 4px;
  }
  .section img {
    width: 32px;
    height: 32px;
  }
  .section p {
    font-size: 11px;
    margin-top: 2px;
  }
}
@media (min-width: 901px) {
  /* إعادة عرض ملف التعريف (مُخفي أصلاً بقيمة display: none) */
  .header-actions-row .profile-container {
    display: inline-block !important; /* override display: none  */
  }

  /* تنسيق زر "أضف إعلانك" */
  #addBtn {
    background: #4caf50 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 7px !important;
    padding: 8px 15px !important;
    font-size: 16px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(44,155,100,0.08) !important;
    margin: 0 !important;
  }
  #addBtn:hover {
    background: #357a39 !important;
  }

  /* تأكد أن صف الأفعال يضمهم متجاورين */
  .header-actions-row {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }
}
/* تصغير حقلي المدينة والمسافة */
.search-area select#citySelect,
.search-area select#distSelect {
  width: 80px;    /* قلّص حسب الحاجة */
  min-width: 0;
}

/* تغليف حقل البحث مع زر البحث */
.search-area {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-input-wrapper {
  position: relative;
  flex: 1;                    /* يمتد لملء المساحة المتبقية */
}
 .search-input-wrapper input {
    height: 38px;                /* اجعل الحقل بنفس ارتفاع المدينة */
    border-radius: 7px;
    font-size: 15.5px;
    background: #f9fffc;
    border: 1.5px solid #c3eedb;
    box-sizing: border-box;
    transition: border 0.16s;
  }
.search-input-wrapper .search-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: #4caf50;
  border: none;
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-input-wrapper .search-btn img {
  width: 20px;
  height: 20px;
}
/* ▷ أيقونة المدينة فقط بدلاً من النص */
.select-icon-wrapper {
  position: relative;
  width: 36px;    /* عرض الحقل = عرض الأيقونة */
  height: 36px;   /* ارتفاع الحقل = ارتفاع الأيقونة */
}
.select-icon-wrapper select#citySelect {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: url('images/icons/location.png') no-repeat center;
  background-size: 24px 24px;
  border: none;
  width: 100%;
  height: 100%;
  cursor: pointer;
  padding: 0;
  text-indent: 100%; /* إخفاء النص */
  white-space: nowrap;
  overflow: hidden;
}
/* إخفاء سهم الـ select في IE */
.select-icon-wrapper select#citySelect::-ms-expand {
  display: none;
}
/* لون اسم المدينة داخل المودال */
.modal-content h3 {
  margin-bottom: 16px;
  font-size: 18px;
  color: #238c41; /* أخضر متناسق مع بقية الألوان */
}
.modal-content h3 #selectedCityName {
  font-weight: 700;
}
@media (min-width: 901px) {
  .sections-container {
    display: grid !important;
    grid-template-columns: repeat(10, max-content) !important;
    justify-content: center !important;
    gap: 12px !important;
    max-width: none !important;
    width: max-content !important;
    margin: 0 auto 24px auto !important;
    overflow-x: unset !important;
    scroll-snap-type: none !important;
  }
}
  .filter-bar {
    width: 200px;
    min-width: 100px;
    max-width: 140px;
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 3px 14px #38eaa414;
    border: 1.5px solid #dff5e9;
    padding: 20px 18px 18px 18px;
    margin: 0;
    position: sticky;
    top: 34px;
    align-self: flex-start;
    display: block ;
    z-index: 1;
  }
  .filter-bar h2 {
    font-size: 19px;
    color: #18995a;
    margin: 0 0 18px 0;
    font-weight: 700;
    border-bottom: 1px solid #e7f4ed;
    padding-bottom: 7px;
    letter-spacing: 0.1px;
  }
  .filter-group {
    margin-bottom: 17px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .filter-group label {
    font-size: 14px;
    color: #15804a;
    font-weight: bold;
    margin-bottom: 3px;
  }
  .filter-row {
    display: flex;
    gap: 8px;
  }
  .filter-group input,
  .filter-group select {
    border: 1.5px solid #e0f3ea;
    border-radius: 7px;
    padding: 7px 8px;
    font-size: 15px;
    font-family: inherit;
    background: #f8fdfa;
    color: #218a4d;
    outline: none;
    margin-bottom: 2px;
    transition: border 0.19s, box-shadow 0.14s;
    box-shadow: 0 1px 4px #b9f8e607;
  }
  .filter-group input:focus,
  .filter-group select:focus {
    border-color: #22c37d;
    background: #fff;
    box-shadow: 0 2px 9px #c3f7e115;
  }
  .apply-filter-btn {
    width: 100%;
    background: #22c37d;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    margin-top: 6px;
    cursor: pointer;
    transition: background 0.14s;
    letter-spacing: 0.15px;
    margin-bottom: 4px;
    box-shadow: 0 2px 13px #22c37d17;
  }
  .apply-filter-btn:hover {
    background: #1a9657;
  }
  .filter-group:last-child { margin-bottom: 10px; }
}
@media (min-width: 901px) {
  .filter-row input[type="text"],
  .filter-row input[type="number"] {
    width: 25px;   /* يمكنك تعديل العرض كما تريد مثلاً 65 أو 90 */
    min-width: 50px;
    max-width: 50px;
    padding: 6px 6px;
    font-size: 8px;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
    display: inline-block;
    text-align: center;
  }
  .filter-row {
    gap: 6px;
  }
}
@media (min-width: 901px) {
  #priceFromInput, #priceToInput,
  #yearFromInput,  #yearToInput,
  #kmFromInput,    #kmToInput {
    width: 50px;        /* التحكم في العرض */
    min-width: 62px;
    max-width: 62px;
    padding: 5px 5px;
    font-size: 13px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
    display: inline-block;
    background: #fafdff;
    color: #218a4d;
    border: 1.3px solid #e0f3ea;
    transition: border 0.18s;
  }
  #priceFromInput:focus, #priceToInput:focus,
  #yearFromInput:focus,  #yearToInput:focus,
  #kmFromInput:focus,    #kmToInput:focus {
    border: 1.5px solid #22c37d;
    background: #fff;
  }
}
/* روابط الفوتر باللون الأخضر */
footer a[href$="contact.html"],
footer a[href$="about.html"],
footer a[href$="privacy.html"],
footer a[href$="terms.html"] {
  color: #22c37d;    /* أو أي قيمة لون أخضر تفضلها */
  text-decoration: none; /* إن أردت إزالة التسطير الافتراضي */
}
footer a[href$="contact.html"]:hover,
footer a[href$="about.html"]:hover,
footer a[href$="privacy.html"]:hover,
footer a[href$="terms.html"]:hover {
  text-decoration: underline; /* تأثير عند المرور بالفأرة */
}
@media (min-width: 901px) {
  .main-container {
    gap: 10px !important;      /* بدّل الرقم لزيادة أو تقليل المسافة بين الفلتر والنتائج */
    padding-right: 70px !important; /* حرك كل الحاوية الرئيسية يميناً */
  }
  .filter-bar {
    margin-right: 115px !important; /* حرك الفلتر فقط لليمين أكثر */
  }
  #sectionResultsContainer, .results-section {
    margin-right: 24px !important; /* حرك النتائج لليمين قليلاً */
  }
}
#mainAdsSliders {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 0 15px;
  
}


@media (max-width: 900px) {
  .sections-container {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px;
    padding: 0 8px;
  }
  .sections-container::-webkit-scrollbar { display: none; }
  .section {
    flex: 0 0 85px !important;
    min-width: 85px !important;
    scroll-snap-align: start;
    padding: 10px 0 !important;
  }
}
@media (min-width: 901px) {
  body {
    background: #f8fff9;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .main-container, #mainAdsSliders, header, footer {
    transform: scale(0.95);
    transform-origin: top center;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (min-width: 901px) {
  .site-name-row {
    width: 100%;
    display: flex;
    justify-content: flex-start !important;
    align-items: center;
  }
}
@media (min-width: 901px) {
  header {
    padding-top: 0px !important;
    padding-bottom: 2px !important;
  }
  .site-name-row {
    margin-bottom: 4px !important;
    margin-top: 0 !important;
  }
  .header-actions-row {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-items: flex-start !important; /* يجعل كل العناصر تصعد للأعلى */
    padding-top: 0 !important;
    min-height: unset !important;
    height: 20px !important; /* يصغر ارتفاع الشريط */
  }
  .search-area {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-items: flex-start !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  #addBtn, #profileContainer {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-self: flex-start !important;
  }
}
@media (min-width: 901px) {
  main,
  .ads-area,
  .results-section,
  #sectionResultsContainer {
    margin-top: 0px !important;   /* قلل القيمة أو حتى 0 إذا أردت */
    padding-top: 0 !important;
  }
}




/* --- تصاميم الموبايل: كل شيء في كتلة واحدة وبدون تكرار --- */
@media (max-width: 900px) {
  /* الهيدر وكل ما فيه */
  header { padding: 7px 0 6px 0; }
  .top-bar { flex-direction: column; gap: 7px; max-width: 100vw; }
  h1 { font-size: 22px; }
  .account-buttons button { font-size: 13.7px; padding: 7px 11px; }
  .profile-container, #profileBtn { font-size: 13px; }
  .search-area { padding: 6px 6px; flex-direction: column; gap: 7px; }
  .search-area input, .search-area select { font-size: 14px; min-width: 80px; padding: 8px 6px;}
  .search-area .search-btn { font-size: 14px; padding: 8px 12px; }

  

  /* الفلاتر */
  .main-container { flex-direction: column; }
  #adsFilterBar {
    display: none !important; /* يظل مخفي حتى يفتح */
    position: fixed !important;
    top: 0; right: 0; bottom: 0;
    width: 84vw; background: #fff; z-index: 3000;
    box-shadow: -2px 0 18px #0003; padding-top: 56px;
    overflow-y: auto; transition: right 0.28s;
    border-radius: 0 0 0 20px;
  }
  #adsFilterBar.active { display: block !important; }
  .show-filters-btn { display: flex; }

  /* بطاقات نتائج البحث */
  .ads-area { margin-top: 13px !important; padding: 10px 4px 5px 4px; }
  .ads-grid { grid-template-columns: repeat(2, 1fr); gap: 7px 4px; }
  .ad-card { max-width: 20vw; min-width: 0; }
  .ad-img { height: 50px; }

  /* ترقيم الصفحات */
  .pagination { gap: 3px; }
  .pagination button { font-size: 13px; padding: 4px 8px; }

 

  /* شريط التنقل السفلي */
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0; right: 0; left: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 18px #0001;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    padding: 0;
    border-top: 1.5px solid #e0eee7;
  }
  .mobile-bottom-bar button {
    background: none;
    border: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    color: #238c41;
    gap: 2px;
    outline: none;
    cursor: pointer;
    padding: 6px 0 0 0;
  }
  .mobile-bottom-bar button img {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }
  .mobile-bottom-bar .add-btn-bottom {
    background: #23c85d;
    color: #fff !important;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-top: -18px;
    box-shadow: 0 3px 18px #15c47c26;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
  }
  .mobile-bottom-bar .add-btn-bottom img {
    filter: brightness(15) invert(1);
    width: 25px;
    height: 25px;
    margin-bottom: 0;
  }
  .mobile-bottom-bar span { font-size: 10.6px; }
  body { padding-bottom: 70px !important; } /* مساحة حتى لا تغطي الإعلانات */
}



  /* تباعد السلايدرات (أحدث الإعلانات وغيرها) عن الأقسام */
  #mainAdsSliders {
    margin-top: 13px !important;
    margin-bottom: 7px !important;
  }
  .ads-slider-row {
    margin-bottom: 12px !important;
    border-radius: 14px;
  }

  /* تباعد مريح بين كل منطقة */
  main {
    padding: 0 0 30px 0 !important;
    margin-bottom: 0 !important;
  }

  /* شريط التنقل السفلي */
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0; right: 0; left: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 18px #0001;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 55px;
    padding: 0;
    border-top: 1.5px solid #e0eee7;
  }
  .mobile-bottom-bar button {
    background: none;
    border: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    color: #238c41;
    gap: 1.5px;
    outline: none;
    cursor: pointer;
    padding: 3px 0 0 0;
  }
  .mobile-bottom-bar button img {
    width: 21px;
    height: 21px;
    margin-bottom: 1px;
  }
  .mobile-bottom-bar span { font-size: 10.6px; }
  body { padding-bottom: 65px !important; }

@media (max-width: 900px) {
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0; right: 0; left: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 14px #0002;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 61px;
    padding: 0 2vw;
    border-top: 1.5px solid #e0eee7;
  }
  .mobile-bottom-bar button {
    background: none;
    border: none;
    outline: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    min-width: 0;
    font-family: 'Cairo', Arial, sans-serif;
  }
  .mobile-bottom-bar .icon-circle {
    background: #e7f7ea;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
  }
  .mobile-bottom-bar button.active .icon-circle,
  .mobile-bottom-bar button:active .icon-circle {
    background: #23c85d;
    box-shadow: 0 2px 12px #23c85d23;
  }
  .mobile-bottom-bar svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: #238c41;
    transition: stroke 0.18s;
  }
  .mobile-bottom-bar button.active .icon-circle svg,
  .mobile-bottom-bar button:active .icon-circle svg {
    stroke: #fff;
  }
  .mobile-bottom-bar span {
    margin-top: 1.5px;
    font-size: 11.2px;
    color: #238c41;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.16;
  }
  .mobile-bottom-bar button.active span,
  .mobile-bottom-bar button:active span {
    color: #23c85d;
    font-weight: 700;
  }
  body { padding-bottom: 66px !important; }
}
@media (max-width: 900px) {
  .profile-menu-mobile {
    display: none;
    position: fixed;
    bottom: 70px;
    right: 13px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 18px #23c85d2a;
    z-index: 99999;
    padding: 10px 0;
    min-width: 142px;
    border: 1.2px solid #e1efe5;
    flex-direction: column;
    align-items: flex-start;
    animation: fadeInMenu .19s;
  }
  .profile-menu-mobile.show {
    display: flex;
  }
  .profile-menu-mobile button {
    background: none;
    border: none;
    color: #1fa356;
    font-family: 'Cairo', Arial, sans-serif;
    font-size: 15px;
    padding: 11px 22px 11px 13px;
    text-align: right;
    width: 100%;
    cursor: pointer;
    border-bottom: 1px solid #f2f2f2;
    transition: background 0.18s, color 0.18s;
  }
  .profile-menu-mobile button:last-child {
    border-bottom: none;
    color: #e61c37;
  }
  .profile-menu-mobile button:hover {
    background: #f4fbf7;
    color: #197442;
  }
  @keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(15px);}
    to   { opacity: 1; transform: translateY(0);}
  }
}

  /* بطاقات الإعلانات (تصغير حجم الكارت) */
  .ads-slider-card {
    min-width: 10vw;
    max-width: 20vw;
  }
  .ads-slider-img-wrap {
    height: 25px;
  }
  .ads-slider-title {
    font-size: 10.2px;
    margin-bottom: 1px;
  }
  .ads-slider-meta {
    font-size: 9.3px;
  }
  .ads-slider-price {
    font-size: 10px;
    padding: 1.5px 3px;
  }
 @media (max-width: 900px) {
  .search-area {
    flex-direction: column;
    gap: 9px;
    width: 100vw;
    max-width: 100vw;
    padding: 10px 7px 0 7px;
    background: #fff;
    box-shadow: none;
    border-radius: 0;
  }
  .search-input-wrapper {
    width: 100%;
    margin: 0;
  }
  .search-input-wrapper input {
    width: 100%;
    height: 39px !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    padding: 0 12px !important;
    background: #f9fffc !important;
    border: 1px solid #c3eedb !important;
    box-sizing: border-box;
  }

  .city-select-unified {
    height: 38px;                /* نفس ارتفاع input */
    border-radius: 7px;
      background: #f9fffc !important;
    border: 1.5px solid #e6eee6;
    display: flex;
    align-items: center;
    min-width: 140px;
    max-width: 180px;
    padding: 0 9px;
    box-sizing: border-box;
    position: relative;
    font-size: 15.5px;
  }
 .city-select-unified select {
    height: 100%;
    border: none;
    background: transparent;
    font-size: 15.5px;
    padding: 0 0 0 16px;
    outline: none;
    width: 100%;
    color: #18806a;
    font-family: inherit;
    cursor: pointer;
    z-index: 2;
  }
  .city-select-unified .city-location-icon {
    width: 21px;
    height: 21px;
    margin: 0 7px 0 0;
    flex-shrink: 0;
  }
  .city-select-unified .dropdown-arrow {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 14px;
    height: 14px;
    opacity: .7;
  }
}
  
/* ─── تنسيقات أيقونات الشريط السفلي (SVG) ─── */
.mobile-bottom-bar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
}

.mobile-bottom-bar .icon-circle {
  background: #e7f7ea;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s;
}

.mobile-bottom-bar .icon-circle svg {
  width: 22px;
  height: 22px;
  stroke: #238c41;
}

.mobile-bottom-bar button.active .icon-circle,
.mobile-bottom-bar button:active .icon-circle {
  background: #23c85d;
  box-shadow: 0 2px 12px #23c85d23;
}

.mobile-bottom-bar button span {
  margin-top: 1.5px;
  font-size: 11.2px;
  color: #238c41;
  font-weight: 500;
  line-height: 1.16;
}

.mobile-bottom-bar button.active span,
.mobile-bottom-bar button:active span {
  color: #23c85d;
  font-weight: 700;
}
@media (max-width: 900px) {
  .sections-container {
    display: flex !important;
    overflow-x: auto;
    gap: 6px;
    padding: 0 8px;
    scroll-snap-type: x mandatory;
  }
  .sections-container::-webkit-scrollbar { display: none; }

  .section {
    flex: 0 0 70px !important;
    min-width: 70px !important;
    scroll-snap-align: start;
    padding: 10px 0 !important;
  }
  .section img { width: 60px !important; height: 60px !important; }
  .section p   { font-size: 11px !important; }
}
@media (min-width: 901px) {
  .mobile-bottom-bar {
    display: none !important;
  }
}
@media (min-width: 901px) {
  .profile-menu-mobile {
    display: none !important;
  }
}
.city-select-unified {
  background: #f9fffc !important;
  border: 1.5px solid #c3eedb !important;
  box-shadow: none !important;
}
@media (min-width: 901px) {
  .header-actions-row {
    justify-content: center !important;
    margin: 0 auto 32px auto !important;
    padding-top: 5px;
    width: 100% !important;
    max-width: 1100px !important;
  }
  .search-area {
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    justify-content: center !important;
    width: 420px !important;
    min-width: 280px !important;
    max-width: 600px !important;
    background: #f9fffc !important;
  }
.search-input-wrapper .search-btn {
  position: absolute;
  top: 50%;
  right: 120px !important; /* ← هذه تحدد مكان الأيقونة */
  transform: translateY(-50%);
  
}

  .sections-container {
    margin-top: 24px !important;
    margin-bottom: 24px !important;
  }
}
.ads-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 18px !important;
  margin: 0 auto !important;
  width: 100% !important;
  justify-items: center !important;
}
.ad-card {
  background: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 10px rgba(44,155,100,0.10) !important;
  overflow: hidden !important;
  border: 1.5px solid #e2e6e8 !important;
  transition: box-shadow 0.13s, border 0.13s !important;
  max-width: 245px !important;
  min-width: 0 !important;
  position: relative !important;
}
.ad-card:hover {
  box-shadow: 0 7px 18px #33d47f20 !important;
  border: 1.5px solid #7ae17a !important;
}
.ad-img-wrap {
  position: relative !important;
  width: 100% !important;
  height: 160px !important;
  background: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
.ad-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #fff !important;
}
.ad-price-badge {
  position: absolute !important;
  left: 8px !important;
  bottom: 8px !important;
  background: #7ae17a !important;
  color: #145a1c !important;
  padding: 6px 18px 6px 15px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  box-shadow: 0 1px 7px #5cc64722 !important;
  letter-spacing: 0.3px !important;
  z-index: 4 !important;
  min-width: 54px !important;
  text-align: center !important;
}
.ad-fav-btn {
  position: absolute !important;
  top: 11px !important;
  right: 11px !important;
  background: rgba(255,255,255,0.89) !important;
  border-radius: 50% !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 7px #0001 !important;
  z-index: 10 !important;
  cursor: pointer !important;
  border: none !important;
  transition: background 0.15s !important;
}
.ad-fav-btn svg {
  width: 22px !important;
  height: 22px !important;
  fill: #f77a7a !important;
  stroke: #db5050 !important;
}
.ad-fav-btn.active svg {
  fill: #e62363 !important;
  stroke: #b4132b !important;
}
.ad-info {
  padding: 11px 9px 13px 9px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}
.ad-title {
  font-size: 15.5px !important;
  font-weight: 700 !important;
  color: #18613b !important;
  margin-bottom: 0 !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
.ad-meta {
  font-size: 13px !important;
  color: #888 !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}
.ads-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
  gap: 18px 15px !important;
  margin: 0 auto !important;
  width: 100% !important;
  justify-items: stretch !important;
}

.ad-card {
  background: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 10px rgba(30, 55, 65, 0.10) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid #e5e7ea !important;
  max-width: 235px !important;
  min-width: 0 !important;
  position: relative !important;
  transition: box-shadow 0.12s, border 0.12s !important;
  cursor: pointer !important;
}

.ad-card:hover {
  box-shadow: 0 7px 22px #24bb5720 !important;
  border: 1px solid #1fc875 !important;
}

.ad-img-wrap {
  position: relative !important;
  width: 100% !important;
  height: 135px !important;
  background: #f7f9fa !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.ad-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: #fff !important;
  display: block !important;
}

.ad-price-badge {
  position: absolute !important;
  left: 8px !important;
  bottom: 10px !important;
  background: #63d900 !important;
  color: #fff !important;
  padding: 5px 15px !important;
  border-radius: 7px !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  box-shadow: 0 1px 7px #7bca3b33 !important;
  letter-spacing: 0.2px !important;
  z-index: 4 !important;
  min-width: 44px !important;
  text-align: center !important;
}

.ad-fav-btn {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  background: #fff !important;
  border-radius: 50% !important;
  width: 30px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 7px #0001 !important;
  z-index: 10 !important;
  cursor: pointer !important;
  border: 1px solid #eee !important;
  transition: background 0.15s !important;
}

.ad-fav-btn svg {
  width: 19px !important;
  height: 19px !important;
  fill: #f7f7f7 !important;
  stroke: #a8b0b9 !important;
}

.ad-fav-btn.active svg {
  fill: #e62363 !important;
  stroke: #a8162d !important;
}

.ad-info {
  padding: 10px 9px 10px 9px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.ad-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #222 !important;
  margin-bottom: 3px !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.ad-meta {
  font-size: 13px !important;
  color: #888 !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  margin-top: 2px !important;
}
/* إخفاء زر "أضف إعلانك" في شريط التنقل السفلي على الموبايل */
@media (max-width: 900px) {
  .add-btn-bottom {
    display: none !important;
  }
}
@media (max-width: 900px) {
  /* إخفاء زر أضف إعلانك العلوي على الموبايل */
  #addBtn {
    display: none !important;
    
  }
}

@media (max-width: 900px) {
  /* إخفاء شريط الملف الشخصي */
  .profile-container,
  #profileBtn {
    display: none !important;
  }

}
@media (max-width: 900px) {
  .search-area {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 10px 7px 0 7px !important;
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .search-input-wrapper {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  .search-input-wrapper input {
    width: 100% !important;
    height: 38px !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    padding: 0 12px !important;
    background: #f9fffc !important;
    border: 1px solid #c3eedb !important;
    box-sizing: border-box;
  }
  .city-select-unified {
    min-width: 108px !important;
    max-width: 140px !important;
    margin: 0 !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 7px !important;
    background: #f9fffc !important;
    border: 1.5px solid #e6eee6 !important;
    font-size: 14px !important;
    padding: 0 8px !important;
  }
}
@media (max-width: 900px) {
  .city-select-unified select {
    font-size: 20px !important; /* جرب من 12 إلى 14 حسب النتيجة */
  }
}
@media (max-width: 900px) {
  .city-select-unified {
    min-width: 100px !important;   /* أصغر عرض */
    max-width: 100px !important;   /* أصغر عرض ممكن */
    width: 150px !important;       /* يفضل وضع width */
    padding: 0 5px !important;    /* تقليل الحشو الداخلي */
  }
  .city-select-unified select {
    font-size: 10px !important;   /* يبقى صغير */
    padding: 0 2px !important;    /* لتصغير المسافة داخل select */
  }
  .search-input-wrapper {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }
}
@media (max-width: 900px) {
.search-input-wrapper .search-btn {
  position: absolute;
  top: 50%;
  right: 102px !important; /* ← هذه تحدد مكان الأيقونة */
  transform: translateY(-50%);
  
}
@media (max-width: 900px) {
  .search-area {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .search-input-wrapper {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
   
    margin-right: 50px !important; /* عدّل القيمة حسب ما تراه مناسبًا */
  }

  
  .search-input-wrapper input {
    width: 100% !important;
    border-radius: 7px !important;
  }
 
}
/* الحالة العادية */
#filtersContainer {
  transition: max-height 0.3s ease;
  overflow: hidden;
  max-height: 1000px; /* أو قيمة تكفي لما يكون مفتوح بالكامل */
}

/* الحالة المصغرة */
#filtersContainer.collapsed {
  max-height: 3.5rem; /* ارتفاع مصغر يعرض العنوان فقط */
}


#distSelect {
  display: none !important;
} 
@media (max-width: 768px) {
  /* أخفِ السلايدر وزر “عرض المزيد” */
  #mainAdsSliders,
  .show-more-btn {
    display: none !important;
  }

  /* اعرض شبكة 2 عمود على الموبايل */
  #mobileAdsGrid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }

  /* تنسيق البطاقة */
  #mobileAdsGrid .ad-card {
    width: 100% !important;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    overflow: hidden;
  }

  /* حاوية الصورة موضعيًا لاستيعاب الأوفيرات */
  #mobileAdsGrid .ad-img-wrap {
    position: relative;
  }

  /* شارة السعر داخل الصورة */
  #mobileAdsGrid .ad-price-overlay {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: #fff;
    color: #24c256;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  }

  /* صندوق المعلومات تحت الصورة */
  #mobileAdsGrid .ad-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
  }

  /* عنوان الإعلان */
  #mobileAdsGrid .ad-title {
    font-size: 14px;
    font-weight: 600;
    color: #1b6246;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* صف الموقع تحت العنوان */
  #mobileAdsGrid .ad-location-row {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  /* أيقونة الموقع */
  #mobileAdsGrid .ad-location-icon {
    width: 12px;
    height: 12px;
  }

  /* نص الموقع */
  #mobileAdsGrid .ad-location-text {
    font-size: 12px;
    color: #555;
  }
}
#mobileAdsGrid .ad-img-wrap {
    height: 100px;          /* اختر ما يناسبك من 80px إلى 120px */
    overflow: hidden;
  }
  /* شفافية خفيفة للخلفية واللون الأبيض للنص */
#mobileAdsGrid .ad-price-overlay {
  background: rgba(36, 194, 86, 0.6) !important;  /* أخضر مع شفافية 60% */
  color: #fff !important;                          /* النص أبيض */
  box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
}

  /* تغطية كاملة وتقليم احترافي للصورة */
  #mobileAdsGrid .ad-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

@media (min-width: 901px) {
  .main-container {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 0 50px 0;
    box-sizing: border-box;
  }
  .filter-bar {
    width: 200px;
    min-width: 100px;
    max-width: 170px;
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 3px 14px #38eaa414;
    border: 1.5px solid #dff5e9;
    padding: 20px 18px 18px 18px;
    margin: 0;
    position: sticky;
    top: 34px;
    align-self: flex-start;
    display: block ;
    z-index: 1;
  }
  .filter-bar h2 {
    font-size: 19px;
    color: #18995a;
    margin: 0 0 18px 0;
    font-weight: 700;
    border-bottom: 1px solid #e7f4ed;
    padding-bottom: 7px;
    letter-spacing: 0.1px;
  }
  .filter-group {
    margin-bottom: 17px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .filter-group label {
    font-size: 14px;
    color: #15804a;
    font-weight: bold;
    margin-bottom: 3px;
  }
  .filter-row {
    display: flex;
    gap: 8px;
  }
  .filter-group input,
  .filter-group select {
    border: 1.5px solid #e0f3ea;
    border-radius: 7px;
    padding: 7px 8px;
    font-size: 15px;
    font-family: inherit;
    background: #f8fdfa;
    color: #218a4d;
    outline: none;
    margin-bottom: 2px;
    transition: border 0.19s, box-shadow 0.14s;
    box-shadow: 0 1px 4px #b9f8e607;
  }
  .filter-group input:focus,
  .filter-group select:focus {
    border-color: #22c37d;
    background: #fff;
    box-shadow: 0 2px 9px #c3f7e115;
  }
  .apply-filter-btn {
    width: 100%;
    background: #22c37d;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    margin-top: 6px;
    cursor: pointer;
    transition: background 0.14s;
    letter-spacing: 0.15px;
    margin-bottom: 4px;
    box-shadow: 0 2px 13px #22c37d17;
  }
  .apply-filter-btn:hover {
    background: #1a9657;
  }
  .filter-group:last-child { margin-bottom: 10px; }
}
@media (min-width: 901px) {
  .filter-row input[type="text"],
  .filter-row input[type="number"] {
    width: 25px;
    min-width: 50px;
    max-width: 50px;
    padding: 6px 6px;
    font-size: 8px;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
    display: inline-block;
    text-align: center;
  }
  .filter-row {
    gap: 6px;
  }
}
@media (min-width: 901px) {
  #priceFromInput, #priceToInput,
  #yearFromInput,  #yearToInput,
  #kmFromInput,    #kmToInput {
    width: 50px;
    min-width: 62px;
    max-width: 62px;
    padding: 5px 5px;
    font-size: 13px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
    display: inline-block;
    background: #fafdff;
    color: #218a4d;
    border: 1.3px solid #e0f3ea;
    transition: border 0.18s;
  }
  #priceFromInput:focus, #priceToInput:focus,
  #yearFromInput:focus,  #yearToInput:focus,
  #kmFromInput:focus,    #kmToInput:focus {
    border: 1.5px solid #22c37d;
    background: #fff;
  }
}
@media (min-width: 901px) {
  .results-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    min-width: 0;
    max-width: 900px;
    margin: 0;
  }
  .ad-card {
    display: flex;
    flex-direction: row-reverse; /* صورة يمين الكرت */
    align-items: stretch;
    background: #fff;
    border: 1.2px solid #e1e7e2;
    border-radius: 13px;
    box-shadow: 0 1.5px 12px #90c6a71a;
    width: 100%;
    max-width: 200px;
    min-width: 200px;
    margin: 0 0 14px 0;
    transition: box-shadow .17s, transform .13s;
    overflow: hidden;
    cursor: pointer;
    position: relative;
  }
  .ad-card:hover {
    box-shadow: 0 6px 24px #49d88a26;
    transform: translateY(-3px) scale(1.012);
  }
  .ad-image {
    width: 600px;
    min-width: 200px;
    max-width: 200px;
    height: 600px;
    background: #f3faf6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-left: none;
    border-right: 1.5px solid #f2f5f5;
    position: relative;
  }
  .ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
  }
  .ad-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px 25px 16px 10px;
    gap: 7px;
    min-width: 0;
    position: relative;
  }
  .ad-location {
    color: #888;
    font-size: 15px;
    margin-bottom: 1.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
  }
  .ad-location img {
    width: 19px;
    height: 19px;
    margin-left: 4px;
    margin-right: 0;
    opacity: 0.8;
  }
  .ad-title {
    margin: 0 0 3px 0;
    font-size: 20px;
    font-weight: bold;
    color: #192a21;
    line-height: 1.14;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ad-desc {
    font-size: 15px;
    color: #3a493b;
    margin-bottom: 2.5px;
    margin-top: 0px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .ad-meta-bar {
    display: flex;
    gap: 8px;
    margin-top: 0px;
    margin-bottom: 2px;
    justify-content: flex-start;
    align-items: center;
  }
  .ad-meta-bar span {
    background: #f5faf8;
    border-radius: 7px;
    padding: 2.5px 13px;
    color: #18411a;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #d3eede;
    min-width: 68px;
    text-align: center;
    letter-spacing: .1px;
    display: inline-block;
  }
  .ad-price {
    font-size: 25px;
    color: #1ea722;
    font-weight: bold;
    margin-top: 6px;
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-block;
    align-self: flex-start;
    letter-spacing: 0.6px;
  }
  .ad-date {
    font-size: 13.2px;
    color: #90b79a;
    margin-top: 7px;
    text-align: left;
    align-self: flex-start;
    font-weight: 500;
    margin-bottom: 0;
  }
  .ad-img-count {
    position: absolute;
    bottom: 9px;
    right: 16px;
    background: #2e4633e6;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    padding: 2px 10px 2px 7px;
    z-index: 4;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 0.1px;
  }
}

/* حاوية الصورة مع الميتا أسفلها */
.ad-image {
  display: flex;
  flex-direction: column;
}
/* تنسيق الصورة نفسها */
.ad-image img {
  width: 1000%;
  height: 500px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}
/* الميتا (المدينة + التاريخ) تحت الصورة */
.ad-image-meta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #666;
}
.ad-image-meta .ad-location {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ad-image-meta .ad-location img {
  width: 16px;
  height: 16px;
}
.ad-image-meta .ad-date {
  font-size: 12px;
  color: #999;
}

/* على الشاشات العريضة: خليك أفقي */
@media (min-width: 768px) {
  #sectionResultsContainer .results-section .ad-card {
    display: flex !important;
    flex-direction: row-reverse !important;
  }
}
.ad-card {
  flex-direction: column;
}
.ad-image-meta {
  margin-top: 8px;
  clear: both; /* لو تستخدم float */
}
@media (min-width: 901px) {
  #sectionResultsContainer {
    flex: 1;
    display: block !important;
  }
}
@media (min-width: 768px) {
  /* بطاقة الإعلان في نتائج الديسكتوب */
  #sectionResultsContainer .results-section .ad-card {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  }
  /* صورة الإعلان */
  #sectionResultsContainer .results-section .ad-card .ad-image {
    flex: 0 0 50px;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    margin-left: 16px;
  }
  #sectionResultsContainer .results-section .ad-card .ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* تفاصيل الإعلان */
  #sectionResultsContainer .results-section .ad-card .ad-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  /* عناوين وأسطر الوصف */
  #sectionResultsContainer .results-section .ad-card .ad-detail .ad-location {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
  }
  #sectionResultsContainer .results-section .ad-card .ad-detail .ad-title {
    font-size: 18px;
    font-weight: 400;
    margin: 4px 0;
    line-height: 1.2;
  }
  #sectionResultsContainer .results-section .ad-card .ad-detail .ad-desc {
    font-size: 14px;
    color: #444;
    margin-bottom: 8px;
  }
  /* شريط الميتا والسعر والتاريخ */
  #sectionResultsContainer .results-section .ad-card .ad-detail .ad-meta-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
  }
  #sectionResultsContainer .results-section .ad-card .ad-detail .ad-price {
    font-size: 20px;
    font-weight: bold;
    color: #238c41;
    margin-top: 4px;
  }
  #sectionResultsContainer .results-section .ad-card .ad-detail .ad-date {
    font-size: 12px;
    color: #999;
    text-align: right;
  }
}
@media (min-width: 768px) {
  /* بطاقة عريضة أفقية لنتائج الديسكتوب */
  #sectionResultsContainer .results-section .ad-card {
    display: flex !important;
    flex-direction: row-reverse !important;
    width: 80% !important;
    max-width: 80% !important;
    min-width: 0 !important;
    margin-bottom: 16px !important;
    padding: 16px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
    overflow: hidden !important;
  }

/* ============================
   ضبط صورة إعلان نتائج الأقسام
   ============================ */
#sectionResultsContainer .results-section .ad-card .ad-image {
  flex: 0 0 170px !important;
  width: 170px !important;
  min-width: 150px !important;
  max-width: 220px !important;
  height: 125px !important;
  margin-left: 16px !important;
  background: #f3faf6 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  border-right: 1.5px solid #f2f5f5 !important;
  position: relative !important;
  border-radius: 8px !important;
}
#sectionResultsContainer .results-section .ad-card .ad-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 8px !important;
}
.ad-media .ad-meta-footer .ad-location,
.ad-media .ad-meta-footer .ad-date {
  color: #888 !important;  /* نفس اللون */
  font-weight: 500 !important;
}

