
body {
  font-family: 'Vazirmatn', sans-serif !important;
  background-color: #f9f5ff;
  color: #2d3748;
  direction: rtl;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}


#load-more-container {
    margin-top: 20px;
}

#load-more-btn {
    padding: 10px 20px;
    font-size: 16px;
    width: 200px;
}

#end-of-list {
    font-size: 18px;
    color: #6c757d;
}

.loader {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.loader::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}








#toggle-extra-filters:hover {
    color: #fff !important;
}







/* استایل دکمه انتخاب مدل - بدون تغییر رنگ */
.btn-model-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff !important;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.btn-model-select:not([disabled]) {
    background: #fff !important;
    color: #333 !important;
    border-color: #ddd !important;
    cursor: pointer !important;
}

.btn-model-select[disabled] {
    background: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
}

/* استایل کادر جستجوی برند */
.brand-search-container {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
}

.brand-selected-display {
    background: #1ebaac;
    color: white;
    padding: 12px 15px;
    border-radius: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-clear-btn {
    background-color: #c31f2e !important;
    border: none;
    color: white !important;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: all 0.2s ease;
    /* این خط ضربدر رو 3px پایین میاره تا وسط قرار بگیره */
    padding-top: 2px !important;
}

.brand-clear-btn:hover {
    background-color: #bb2d3b !important;
    transform: scale(1.05) translateY(3px);
}

.brand-clear-btn:active {
    transform: scale(0.95) translateY(3px);
}








.search-input-wrapper {
    position: relative;
    padding: 10px 12px;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#brand-search-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: none;
    outline: none;
}

.brand-list-wrapper {
    max-height: 250px;
    overflow-y: auto;
    border-top: 1px solid #f0f0f0;
}

.brand-select {
    width: 100%;
    padding: 8px;
    border: none !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
}

.model-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    z-index: 1000;
    display: none;
    margin-top: 8px;
    overflow-y: visible !important;
}

.model-popup.show {
    display: block;
}

.model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.model-tag {
    background: #e7f1ff;
    color: #0d6efd;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.remove-tag {
    cursor: pointer;
    margin-right: 5px;
}




















/* استایل دکمه انتخاب مدل */
.btn-model-select {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    text-align: right;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-model-select:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}
.btn-model-select .selected-models {
    display: inline-block;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0d6efd;
    font-weight: 500;
}
.btn-model-select .arrow {
    float: left;
    transition: transform 0.2s;
}
/* کادر پاپآپ مدل‌ها */
.model-popup {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.02);
    z-index: 1050;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
.model-popup.show {
    display: block;
}
.model-popup .popup-header {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    background: #fff;
}
.model-popup .popup-body {
    padding: 8px 0;
    overflow-y: auto !important;
    max-height: 250px !important;
}
.model-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
}
.model-item:hover {
    background-color: #f1f3f5;
}
.model-item input[type="checkbox"] {
    margin-left: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.model-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    font-weight: normal;
}
.select-all-item {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    font-weight: 500;
}
.select-all-item label {
    font-weight: 500;
}
/* برچسب مدل‌های انتخاب شده */
.model-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.model-tag {
    background: #e7f1ff;
    color: #0c63e4;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.model-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    color: #0a58ca;
}
.model-tag .remove-tag:hover {
    color: #dc3545;
}



















/* Home Container */
.home-container {
  width: 100%;
  padding: 0 1rem 6.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

/* Spacing Utility */
.g-4 {
  margin-bottom: 12.5rem;
}

/* Categories Section */
.categories {
  background-color: #ffffff;
  padding: 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
  margin-top: 0.9375rem;
}

.categories h2 {
  font-weight: 700;
  font-size: 1.3rem;
  color: #4a3c8c;
  border-bottom: 2px solid #6b46c1;
  padding-bottom: 0.375rem;
  margin-bottom: 0.5rem;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f9fafb;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: #2d3748;
  font-weight: 500;
  font-size: 0.75rem;
  height: 4rem;
  margin: 0.125rem;
}

.category-item img {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.25rem;
}

.category-item:hover {
  background-color: #6b46c1;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 0.1875rem 0.5rem rgba(107, 70, 193, 0.2);
}

.category-item:hover img {
  filter: brightness(0) invert(1);
}
/* ======================================== */
/*   SEARCH & FILTERS — Modern 2026         */
/* ======================================== */

.search-filters {
    margin: 1rem 0;
}

.search-filters .card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 1.25rem;
    background-color: #ffffff;
}

/* عنوان */
.search-filters h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

/* کادر جستجو */
.search-filters .input-group {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    overflow: hidden;
}

.search-filters .form-control {
    border: 1px solid #e8ecf0;
    border-left: none;
    border-radius: 0 14px 14px 0 !important;
    padding: 13px 18px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: auto;
}

.search-filters .form-control:focus {
    border-color: #6b46c1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.08);
    outline: none;
}

/* دکمه جستجو */
.search-filters #search-submit-btn,
.search-filters .btn-primary {
    border-radius: 14px 0 0 14px !important;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #6b46c1, #7c3aed);
    border: none;
    color: #fff;
    transition: all 0.25s ease;
    margin: 0;
}

.search-filters #search-submit-btn:hover,
.search-filters .btn-primary:hover {
    background: linear-gradient(135deg, #553c9a, #6b46c1);
    box-shadow: 0 6px 18px rgba(107, 70, 193, 0.25);
    transform: translateY(-1px);
}

/* دکمه‌های فیلتر */
.search-filters #toggle-extra-filters,
.search-filters #clear-filters-btn,
.search-filters .btn-toggle {
    border-radius: 25px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
    margin: 4px;
}

.search-filters #toggle-extra-filters,
.search-filters .btn-toggle {
    background: #6b46c1;
    color: #fff;
    border: none;
}

.search-filters #toggle-extra-filters:hover,
.search-filters .btn-toggle:hover {
    background: #553c9a;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(107, 70, 193, 0.25);
}

.search-filters #clear-filters-btn {
    background: #fff;
    color: #dc3545;
    border: 1px solid #ffc9ce;
    display: none;
}

.search-filters #clear-filters-btn:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.25);
}

/* فیلتر گروه‌ها */
.search-filters .filter-group .card {
    border-radius: 14px;
    padding: 1rem;
    margin-top: 12px;
}

.search-filters .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 6px;
}

.search-filters select.form-control {
    border-radius: 10px;
    border: 1px solid #e8ecf0;
    padding: 10px 14px;
    font-size: 0.9rem;
}

    #clear-filters-btn {
        background-color: #dc3545 !important;
        color: white !important;
        border: none;
        transition: 0.2s;
        display: none;  /* مخفی بودن اولیه */
        width: auto !important;      /* جلوگیری از پهن شدن بیش از حد */
        min-width: 120px;            /* عرض مناسب برای متن فارسی */
        white-space: nowrap;         /* متن در یک خط بماند */
        text-align: center;
        border-radius: 50px;         /* گردی لبه‌ها مانند دکمه‌های دیگر */
        padding: 8px 20px;           /* فاصله داخلی مناسب */
        font-size: 18px;
        font-weight: 500;
    }
    #clear-filters-btn:hover {
        background-color: #bb2d3b !important;
        transform: translateY(-1px);
    }
	
#toggle-extra-filters {
    border-radius: 50px !important;
}

.search-filters .btn-toggle:hover,
.search-filters .btn-primary:hover {
  background-color: #553c9a;
  transform: translateY(-2px);
}

.filter-group {
  display: none;
  transition: opacity 0.3s ease;
}

.filter-group.show {
  display: block;
  opacity: 1;
}

/* Ads Sections */
.featured-ads,
.all-ads {
  background-color: #ffffff;
  padding: 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
  margin-bottom: 0.9375rem;
}

.featured-ads h2,
.all-ads h2 {
  font-weight: 700;
  font-size: 1.3rem;
  color: #4a3c8c;
  border-bottom: 2px solid #6b46c1;
  padding-bottom: 0.375rem;
  margin-bottom: 0.5rem;
}

.ad-card {
  border: none;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(180deg, #6b46c1 0%, #9f7aea 100%);
  color: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 0 0.375rem;
  min-width: 12.5rem;
  display: flex;
  flex-direction: column;
}

.ad-card a {
  text-decoration: none;
}

.ad-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0.5rem 1.25rem rgba(107, 70, 193, 0.3);
}

.ad-card img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  height: 10rem;
  border-radius: 0.75rem 0.75rem 0 0;
}

.card-body {
  padding: 0.75rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-text,
.ad-info,
.mileage-info {
  font-size: 0.85rem;
  color: #e2e8f0;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.card-text {
  font-weight: 700;
  font-size: 0.9rem;
}

.ad-info i,
.mileage-info i {
  color: #ffffff;
  font-size: 0.9rem;
}

.badges-container {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.featured-badge,
.stair-badge,
.ladder-badge,
.urgent-badge,
.exhibition-badge {
  background-color: #ffffff;
  padding: 0.1875rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.featured-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: #6b46c1;
}

.stair-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  color: #f6ad55;
}

.ladder-badge,
.urgent-badge,
.exhibition-badge {
  color: #553c9a;
  font-size: 0.65rem;
  padding: 0.125rem 0.3125rem;
}

.urgent-badge {
  color: #e53e3e;
}

.exhibition-badge {
  color: #9b2c2c;
}

.featured-badge:hover,
.stair-badge:hover {
  transform: scale(1.1);
}

/* Slider Styles */
.featured-slider {
     visibility: hidden;
    min-height: 320px;
  direction: rtl;
}

.featured-slider.slick-initialized {
    visibility: visible;
    min-height: auto;  /* بعد از لود، ارتفاع خودکار */
}

.featured-slider .slick-slide {
  margin: 0 0.375rem;
}

.featured-slider .slick-list {
  overflow: hidden;
}

.featured-slider .slick-track {
  display: flex;
  align-items: stretch;
}

.featured-slider .slick-prev,
.featured-slider .slick-next {
  z-index: 1;
  width: 2rem;
  height: 2rem;
  background-color: rgba(107, 70, 193, 0.7);
  border-radius: 50%;
}

.featured-slider:hover .slick-prev:hover,
.featured-slider:hover .slick-next:hover {
  z-index: 1;
  width: 2rem;
  height: 2rem;
  background-color: rgba(107, 70, 193, 0.7);
  border-radius: 50%;
}
.featured-slider .slick-prev:before,
.featured-slider .slick-next:before {
  color: #ffffff;
  font-size: 1rem;
}

.featured-slider .slick-prev {
  right: -0.75rem;
}

.featured-slider .slick-next {
  left: -0.75rem;
}

.featured-slider .slick-dots {
  bottom: -1.5rem;
}

.featured-slider .slick-dots li button:before {
  color: #6b46c1;
  font-size: 0.5rem;
}

/* Loader */
.loader {
  display: none;
  text-align: center;
  padding: 1rem;
}

.loader img {
  width: 2.5rem;
}
























/* استایل با قابلیت تنظیم کامل موقعیت ضربدر */
#close-brand-model {
    background: linear-gradient(145deg, #ff4d4d, #e63939);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.25s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* پارامترهای تنظیم دستی - اینها را کم و زیاد کنید */
    padding: 0;
    margin: 0;
    display: block;
    text-align: center;
    /* تنظیم عمودی با line-height */
    line-height: 31px;  /* اگر ضربدر بالا/پایین بود این عدد را کم/زیاد کنید */
    /* تنظیم افقی با text-indent */
    text-indent: 1.5px;   /* اگر ضربدر چپ/راست بود این عدد را کم/زیاد کنید */
    /* تنظیم با transform */
    transform: translate(0px, 0px); /* (X, Y) => X: مثبت=راست, منفی=چپ / Y: مثبت=پایین, منفی=بالا */
}

/* روش دیگر با استفاده از span */
#close-brand-model span {
    display: inline-block;
    position: relative;
    left: 0px;    /* مثبت = راست, منفی = چپ */
    top: 0px;     /* مثبت = پایین, منفی = بالا */
    font-size: 17px;
    font-weight: 500;
}

#close-brand-model:hover {
    background: linear-gradient(145deg, #e63939, #cc0000);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#close-brand-model:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* دکمه بستن دایره قرمز با ضربدر سفید */
.btn-close-filter {
    width: 28px;
    height: 28px;
    background-color: #dc3545;  /* قرمز استاندارد */
    border: none;
    border-radius: 50%;         /* گرد کامل برای ایجاد دایره */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: bold;
    color: white !important;     /* رنگ ضربدر سفید */
    line-height: 1;
    padding: 0;
	 padding-top: 3px !important;
}

.btn-close-filter:hover {
    background-color: #bb2d3b;   /* قرمز تیره‌تر در حالت هاور */
    transform: scale(1.05);       /* کمی بزرگ‌تر می‌شود */
}

.btn-close-filter:active {
    transform: scale(0.95);       /* افکت فشرده شدن هنگام کلیک */
}






































/* Popup Styles */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(0.25rem);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-in-out;
}

.popup-overlay.active {
  display: flex;
}

.popup-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(0.625rem);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 90vw;
  width: 37.5rem;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
  animation: slideIn 0.4s ease-out;
}

.popup-content h2 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.popup-content p {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: #4a4a4a;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.popup-banner img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.popup-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(45deg, #6b48ff, #9b59b6);
  color: #fff;
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  margin: 0.75rem 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popup-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.25rem 0.75rem rgba(107, 72, 255, 0.3);
}

.popup-close {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  padding: 0.625rem 1.25rem;
  border: none;
  background: #dc3545;
  color: #fff;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popup-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.25rem 0.75rem rgba(220, 53, 69, 0.3);
}

.popup-timer {
  font-size: 0.8125rem;
  color: #2c3e50;
  display: flex;
  justify-content: center;
  gap: 0.3125rem;
  font-weight: 600;
  margin: 1rem 0 2.875rem;
}

.popup-timer span {
  color: #dc3545;
}
/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(3.125rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (min-width: 1200px) {
  .categories .row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.25rem;
  }

  .category-item {
    flex: 0 0 5.625rem;
    font-size: 0.65rem;
  }

  .category-item img {
    width: 3rem;
    height: 3rem;
  }
}



@media (max-width: 767.98px) {
  .categories .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
    gap: 0.25rem;
  }

  .category-item {
    font-size: 0.6rem;
    padding: 0.5rem;
  }

  .category-item img {
    width: 2rem;
    height: 2rem;
  }

  .ad-card img {
    height: 12rem;
  }

  .search-filters .card {
    padding: 0.625rem;
  }

  .search-filters h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 576px) {
  .categories h2,
  .featured-ads h2,
  .all-ads h2 {
    font-size: 1.2rem;
  }

  .category-item {
    font-size: 0.55rem;
    height: 3.5rem;
  }

  .category-item img {
    width: 1.875rem;
    height: 1.875rem;
  }

  .ad-card img {
    height: 10rem;
  }

  .search-filters .btn-toggle,
  .search-filters .btn-primary {
    padding: 0.3125rem 0.625rem;
    font-size: 0.8rem;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-text,
  .ad-info,
  .mileage-info {
    font-size: 0.75rem;
  }

  .featured-badge,
  .stair-badge,
  .ladder-badge,
  .urgent-badge,
  .exhibition-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.25rem;
  }

  .popup-content h2 {
    font-size: 1.5rem;
  }

  .popup-content p {
    font-size: 0.875rem;
  }

  .popup-link {
    font-size: 0.8125rem;
    padding: 0.625rem 1.125rem;
  }

  .popup-timer {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .popup-content {
    padding: 1rem;
    max-width: 95vw;
  }
}
.ad-card a {
    text-decoration: none;
}
.ad-card .card-title {
    color: #fff !important;
}
.ad-card .ad-info {
    color: rgba(255,255,255,0.8) !important;
}


/* ======================================== */
/*   TABLET + MOBILE + SMALL MOBILE         */
/*   ALL ADS CARDS ONLY                    */
/* ======================================== */
@media (max-width: 991.98px) {

    /* ========== ADS CONTAINER ========== */
    .all-ads .row.g-4 {
        display: flex !important;
        flex-direction: column !important;
        gap: 0px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .all-ads .col-12,
    .all-ads .col-md-6,
    .all-ads .col-lg-3 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0 !important;
    }

    /* ========== CARD ========== */
    .all-ads .ad-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        background: #fff !important;
        border: 1px solid #f0f0f5 !important;
        border-radius: 16px !important;
        padding: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.03) !important;
    }

    .all-ads .ad-card a {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        text-decoration: none !important;
        color: inherit !important;
        gap: 12px !important;
    }

    .all-ads .ad-card .position-relative {
        flex-shrink: 0 !important;
        position: relative !important;
    }

    .all-ads .ad-card img {
        object-fit: cover !important;
        display: block !important;
        border-radius: 12px !important;
    }

    .all-ads .ad-card .card-body {
        flex: 1 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 3px !important;
        min-width: 0 !important;
        background: transparent !important;
    }

    .all-ads .ad-card .card-body .card-title:first-of-type {
        color: #1e293b !important;
        font-weight: 700 !important;
        line-height: 1.5 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        margin-bottom: 4px !important;
        white-space: normal !important;
    }

    .all-ads .ad-card .card-body p:nth-of-type(2) {
        color: #6b46c1 !important;
        font-weight: 700 !important;
        margin-bottom: 4px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .all-ads .ad-card .card-body .ad-info {
        color: #94a3b8 !important;
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .all-ads .ad-card .card-body .ad-info i {
        color: #c0c8d4 !important;
        font-size: 0.65rem !important;
    }

    .all-ads .ad-card .card-body .mileage-info {
        color: #94a3b8 !important;
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .all-ads .ad-card .card-body .mileage-info i {
        color: #c0c8d4 !important;
        font-size: 0.65rem !important;
    }

    .all-ads .ad-card .badges-container {
        margin-top: auto !important;
        padding-top: 4px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    .all-ads .ladder-badge,
    .all-ads .urgent-badge,
    .all-ads .exhibition-badge {
        font-size: 0.6rem !important;
        font-weight: 600 !important;
        padding: 3px 8px !important;
        border-radius: 12px !important;
    }

    .all-ads .ladder-badge { background: #eff6ff !important; color: #3b82f6 !important; }
    .all-ads .urgent-badge { background: #fef2f2 !important; color: #ef4444 !important; }
    .all-ads .exhibition-badge { background: #fefce8 !important; color: #ca8a04 !important; }

    .all-ads .featured-badge {
        position: absolute !important;
        top: 6px !important;
        right: 6px !important;
        font-size: 0.55rem !important;
        font-weight: 700 !important;
        padding: 3px 8px !important;
        border-radius: 12px !important;
        background: #7c3aed !important;
        color: #fff !important;
        z-index: 3 !important;
    }

    .all-ads .stair-badge {
        position: absolute !important;
        top: 6px !important;
        left: 6px !important;
        font-size: 0.55rem !important;
        font-weight: 700 !important;
        padding: 3px 8px !important;
        border-radius: 12px !important;
        background: #f59e0b !important;
        color: #fff !important;
        z-index: 3 !important;
    }

    .all-ads .ad-card, 
    .all-ads .ad-card:hover { 
        background: #fff !important; 
    }
}

/* ========== TABLET 2 columns ========== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .all-ads .row.g-4 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 7px !important;
    }

    .all-ads .ad-card img {
        width: 150px !important;
        height: 130px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }

    .all-ads .ad-card .card-body .card-title:first-of-type { font-size: 0.95rem !important; }
    .all-ads .ad-card .card-body p:nth-of-type(2) { font-size: 0.95rem !important; }
}

/* ========== MOBILE 1 column ========== */
@media (max-width: 767.98px) {
    .all-ads .ad-card img {
        width: 125px !important;
        height: 115px !important;
        min-width: 125px !important;
        max-width: 125px !important;
    }

    .all-ads .ad-card .card-body .card-title:first-of-type { font-size: 0.88rem !important; }
    .all-ads .ad-card .card-body p:nth-of-type(2) { font-size: 0.9rem !important; }
}

/* ========== SMALL MOBILE ========== */
@media (max-width: 374.98px) {
    .all-ads .ad-card { padding: 10px !important; }
    .all-ads .ad-card img {
        width: 105px !important;
        height: 95px !important;
        min-width: 105px !important;
        max-width: 105px !important;
    }
    .all-ads .ad-card a { gap: 1px !important; }
    .all-ads .ad-card .card-body .card-title:first-of-type { font-size: 0.8rem !important; }
    .all-ads .ad-card .card-body p:nth-of-type(2) { font-size: 0.82rem !important; }
}





















/* ======================================== */
/*   STORIES — Mobile & Tablet Only         */
/* ======================================== */
.stories-section {
    display: none;
}

@media (max-width: 991.98px) {
    .stories-section {
        display: block;
        padding: 14px 0 8px;
        margin: 0;
        background: transparent;
    }

    .stories-container {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 16px;
        padding: 10px 14px 14px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        direction: rtl;
    }

    .stories-container::-webkit-scrollbar { display: none; }

    .story-item {
        flex: 0 0 auto;
        width: 76px;
        height: 76px;
        min-width: 76px;
        max-width: 76px;
        border-radius: 50%;
        background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
        padding: 3px;
        position: relative;
        scroll-snap-align: start;
        display: block;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s ease;
    }

    .story-item:active { transform: scale(0.95); }

    .story-item::before {
        content: '';
        position: absolute;
        top: 3px; left: 3px; right: 3px; bottom: 3px;
        border-radius: 50%;
        background: #fff;
        z-index: 1;
        pointer-events: none;
    }

    .story-item img {
        position: absolute;
        top: 3px; left: 3px;
        width: calc(100% - 6px);
        height: calc(100% - 6px);
        border-radius: 50%;
        object-fit: cover;
        z-index: 2;
        border: none;
    }
	
	   .all-ads .row.g-4 > * {
        margin-top: 2px !important;
        margin-bottom: 2px !important;
    }
	
   .all-ads .featured-badge,
    .all-ads .stair-badge {
        font-size: 0.8rem !important;
        padding: 9px 18px !important;
        border-radius: 14px !important;
}

@media (min-width: 768px) and (max-width: 991.98px) {
	
	
    .stories-section { padding: 16px 0 10px; }
    .stories-container { gap: 18px; padding: 12px 18px 16px; }
    .story-item { width: 82px; height: 82px; min-width: 82px; max-width: 82px; }
}

@media (max-width: 374.98px) {
    .stories-section { padding: 10px 0 4px; }
    .stories-container { gap: 12px; padding: 8px 10px 12px; }
    .story-item { width: 64px; height: 64px; min-width: 64px; max-width: 64px; }
}

/* ======================================== */
/*   FEATURED ADS SLIDER — Desktop Only     */
/* ======================================== */
.featured-ads {
    display: none;
}

/* Show slider above 992px */
@media (min-width: 992px) {
	
	
    .stories-section {
        display: none !important;
    }

    .featured-ads {
        display: block !important;
    }
}


@media (max-width: 991.98px) {
    .stories-section {
        margin-bottom: -30px !important;
        padding-bottom: 0 !important;
    }

    .search-filters {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .search-filters .card {
        margin-top: 30px !important;
    }

    .categories {
        margin-top: 0 !important;
        margin-bottom: 0px !important;
    }

    .search-filters .card,
    .categories {
        position: relative;
        z-index: 1;
    }
	
    #clear-filters-btn,
    #toggle-extra-filters {
        min-width: 80px !important;
        padding: 6px 12px !important;
        font-size: 14px !important;
    }
}


@media (min-width: 768px) and (max-width: 991.98px) {
    #clear-filters-btn,
    #toggle-extra-filters {
        min-width: 100px !important;
        padding: 8px 16px !important;
        font-size: 15px !important;
    }
}




/* ======================================== */
/*   SEARCH & FILTERS — Mobile & Tablet     */
/* ======================================== */
@media (max-width: 991.98px) {

    .search-filters {
        margin: 0.5rem 0 0.75rem;
    }

    .search-filters .card {
        padding: 14px;
        border-radius: 14px;
    }

    .search-filters h3 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    /* کادر جستجو */
    .search-filters .input-group {
        border-radius: 12px;
    }

    .search-filters .form-control {
        padding: 11px 14px;
        font-size: 0.85rem;
        border-radius: 0 12px 12px 0 !important;
    }

    /* دکمه جستجو */
    .search-filters #search-submit-btn,
    .search-filters .btn-primary {
        padding: 11px 18px;
        font-size: 0.85rem;
        border-radius: 12px 0 0 12px !important;
    }

    /* دکمه‌های فیلتر */
    .search-filters #toggle-extra-filters,
    .search-filters #clear-filters-btn,
    .search-filters .btn-toggle {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin: 3px;
    }
}

/* ========== TABLET ========== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .search-filters .form-control {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .search-filters #search-submit-btn,
    .search-filters .btn-primary {
        padding: 12px 22px;
        font-size: 0.9rem;
    }

    .search-filters #toggle-extra-filters,
    .search-filters #clear-filters-btn,
    .search-filters .btn-toggle {
        padding: 9px 20px;
        font-size: 0.85rem;
    }
}

/* ========== SMALL MOBILE ========== */
@media (max-width: 374.98px) {
    .search-filters .card {
        padding: 10px;
    }

    .search-filters .form-control {
        padding: 10px 10px;
        font-size: 0.78rem;
    }

    .search-filters #search-submit-btn,
    .search-filters .btn-primary {
        padding: 10px 14px;
        font-size: 0.78rem;
    }

    .search-filters #toggle-extra-filters,
    .search-filters #clear-filters-btn,
    .search-filters .btn-toggle {
        padding: 7px 14px;
        font-size: 0.75rem;
    }
}


@media (max-width: 991.98px) {
    .all-ads .ad-card {
        align-items: center !important;
    }

    .all-ads .ad-card a {
        align-items: center !important;
    }

    .all-ads .ad-card .position-relative {
        line-height: 0 !important;
        font-size: 0 !important;
    }

    .all-ads .ad-card img {
        vertical-align: middle !important;
        display: block !important;
    }
	
	   .all-ads .row.g-4 {
        padding-right: 0px !important;
        padding-left: 0px !important;
    }

    .all-ads .container {
        padding-right: 0px !important;
        padding-left: 0px !important;
    }
}




@media (max-width: 767.98px) {
    .all-ads .row.g-4 {
        padding-right: 0px !important;
        padding-left: 10px !important;
    }

    .all-ads .container {
        padding-right: 0px !important;
        padding-left: 0px !important;
    }
	
	
	 .all-ads .ad-card {
        align-items: center !important;
    }

    .all-ads .ad-card a {
        align-items: center !important;
    }

    .all-ads .ad-card .position-relative {
        line-height: 0 !important;
        font-size: 0 !important;
    }

    .all-ads .ad-card img {
        vertical-align: middle !important;
        display: block !important;
    }
}

.btn-apply-filters {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25) !important;
}

.btn-apply-filters:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35) !important;
}

.btn-apply-filters:active {
    transform: scale(0.97) !important;
}

select.form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%237c3aed'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    padding-left: 32px !important;
}
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%237c3aed'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    padding-left: 32px !important;
}

.brand-list-wrapper {
    max-height: 400px !important;
    overflow-y: auto;
    border-top: 1px solid #f0f0f0;
}

.brand-list-wrapper::-webkit-scrollbar {
    display: none !important;
}


@media (max-width: 991.98px) {
    .brand-select {
        pointer-events: auto !important;
    }
    
    #brand-search-input {
        pointer-events: auto !important;
        readonly: false !important;
    }
    
    #brand-list-wrapper {
        pointer-events: auto !important;
    }
}



#model-popup,
.model-popup,
.model-popup .popup-body {
    background-color: #fff !important;
}

.model-popup .popup-body {
    max-height: 380px !important;
    overflow-y: auto !important;
}



/* ========== Toggle Switch ========== */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
}

.toggle-switch-wrapper.active .toggle-switch-label {
    color: #28a745;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: #dee2e6;
    border-radius: 13px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* حالت فعال - سبز */
.toggle-switch-wrapper.active .toggle-switch {
    background: #28a745;
}

.toggle-switch-wrapper.active .toggle-switch::before {
    right: 25px;
}

/* ========== رنگ‌های اختصاصی هر دکمه ========== */

/* فوری - قرمز */
.toggle-switch-wrapper[data-filter="is_urgent"] .toggle-switch-label {
    color: #6c757d;
}
.toggle-switch-wrapper[data-filter="is_urgent"].active .toggle-switch {
    background: #dc3545;
}
.toggle-switch-wrapper[data-filter="is_urgent"].active .toggle-switch-label {
    color: #dc3545;
}

/* عکس‌دار - آبی */
.toggle-switch-wrapper[data-filter="has_image"] .toggle-switch-label {
    color: #6c757d;
}
.toggle-switch-wrapper[data-filter="has_image"].active .toggle-switch {
    background: #007bff;
}
.toggle-switch-wrapper[data-filter="has_image"].active .toggle-switch-label {
    color: #007bff;
}

/* ویدیودار - بنفش */
.toggle-switch-wrapper[data-filter="has_video"] .toggle-switch-label {
    color: #6c757d;
}
.toggle-switch-wrapper[data-filter="has_video"].active .toggle-switch {
    background: #6f42c1;
}
.toggle-switch-wrapper[data-filter="has_video"].active .toggle-switch-label {
    color: #6f42c1;
}


