/*  fonts */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   ۱. تنظیمات پایه و تایپوگرافی
   ============================================================ */
body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: #F1F3F6; /* Ice Silver Background */
    color: #1A1A1A; /* Charcoal Text */
    line-height: 1.6;
}

/* حذف اسکرول‌بار در المان‌های خاص */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   ۲. هدر و ناوبری (Navigation)
   ============================================================ */
.nav-link {
    color: #2D4B8C; /* Royal Blue */
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 4px; /* فضا برای خط زیرین */
}

.nav-link:hover {
    color: #1A1A1A;
}

/* استایل حالت فعال */
.nav-link.active {
    color: #2D4B8C;
    font-weight: 800; /* کمی ضخیم‌تر برای تاکید بیشتر */
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -28px; /* فاصله خط از متن - با ارتفاع هدر (h-20) تنظیم شده */
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #2D4B8C;
    border-radius: 4px 4px 0 0; /* گرد کردن لبه‌های بالایی خط */
}

/* ============================================================
   ۳. کارت‌های آگهی و المان‌های عمومی (Grid Cards)
   ============================================================ */
.grid a.block {
    background-color: #FFFFFF;
    border: 1px solid rgba(45, 75, 140, 0.1);
    transition: all 0.3s ease;
    border-radius: 16px;
}

.grid a.block:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(45, 75, 140, 0.08);
    border-color: #2D4B8C;
}

/* متون و عناوین مهم */
h1,  .text-royal {
    color: #090a0a;
}

h2,  .text-royal {
    color: #444343 !important;
}
/* تزیین کنار تیترها */
.accent-line {
    width: 4px;
    height: 24px;
    background-color: #DA363C; /* Racing Red Accent */
    border-radius: 99px;
}

.text-royal-blue { color: #2D4B8C !important; }

/* ============================================================
   ۷. استایل نشان کارشناسی شده (Badge Expert) - مشکی و طلایی
   ============================================================ */

/* هدف قرار دادن نشان در صفحه لیست آگهی‌ها و صفحه جزئیات */
.absolute span.bg-\[\#2e378b\], 
.bg-blue-900.text-white.w-fit,
.badge-expert-top {
    background-color: #2D4B8C !important; /* مشکی زغالی */
    color: #f5f5f5 !important; /* طلایی */
    border: 1px solid rgba(255, 215, 0, 0.3); /* حاشیه ظریف طلایی برای جذابیت بیشتر */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px !important;
    font-weight: 800 !important;
}

/* اصلاح رنگ آیکون داخل نشان اگر از اموجی استفاده نشده باشد */
.absolute span.bg-\[\#2e378b\] span,
.badge-expert-top svg {
    color: #FFD700 !important;
}

/* انیمیشن نقطه تپنده در صفحه جزئیات (Pulse) */
.animate-pulse {
    background-color: #575755 !important; /* تغییر رنگ نقطه چشمک‌زن به طلایی */
}
/* ============================================================
   ۴. سایدبار، فیلترها و اسلایدر قیمت
   ============================================================ */
  :root{
      --site-header-height: 64px;
  }
  .no-scrollbar::-webkit-scrollbar { display: none; }
  .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

  .custom-select {
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: left 1rem center;
      background-size: 1.2em;
  }

  .range-slider-container { position: relative; width: 100%; height: 6px; margin-bottom: 45px; }
  .slider-track { width: 100%; height: 100%; position: absolute; border-radius: 9999px; background: #e2e8f0; }
  
  input[type="range"].dual-range {
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      width: 100%;
      position: absolute;
      top: -7px;
      background-color: transparent;
      pointer-events: none;
  }
  input[type="range"].dual-range::-webkit-slider-thumb {
      pointer-events: all;
      -webkit-appearance: none;
      appearance: none;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background-color: #2D4B8C;
      box-shadow: 0 2px 5px rgba(45, 75, 140, 0.4); /* سایه متناسب با رنگ آبی */
      cursor: pointer;
  }
  input[type="range"].dual-range::-moz-range-thumb {
      pointer-events: all;
      width: 20px;
      height: 20px;
      background-color: #2D4B8C;
      border: none;
      border-radius: 50%;
      box-shadow: 0 2px 5px rgba(45, 75, 100, 0.4);
      cursor: pointer;
  }
  .slider-tooltip {
      position: absolute;
      top: 26px;
      font-size: 11px;
      font-weight: 900;
      color: #0f172a;
      background: #ffffff;
      padding: 4px 10px;
      border-radius: 8px;
      border: 1px solid #e2e8f0;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
      transform: translateX(-50%);
      white-space: nowrap;
      z-index: 10;
      direction: rtl;
  }
  .slider-tooltip::after {
      content: '';
      position: absolute;
      top: -4px;
      left: 50%;
      transform: translateX(-50%) rotate(45deg);
      width: 8px;
      height: 8px;
      background: #ffffff;
      border-left: 1px solid #e2e8f0;
      border-top: 1px solid #e2e8f0;
  }

  .mobile-filter-panel {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      max-height: calc(100dvh - var(--site-header-height));
      overflow-y: auto;
      scroll-behavior: smooth;
  }
/* ============================================================
   ۵. صفحه جزئیات موتور (Motor Details)
   ============================================================ */
/* سفید کردن باکس‌های محتوا در صفحه جزئیات */
/* section.space-y-4 > div, aside > div {
    background-color: #FFFFFF !important;
    border: 1px solid rgba(45, 75, 140, 0.05); /* یک حاشیه بسیار ملایم آبی */
/* } */ */

   /* گالری تصاویر */
#main-display-image {
    background-color: #F1F3F6 ;
    transition: transform 0.3s ease;
}

/* استایل گزارش کارشناسی آکاردئونی */
.inspection-items-container {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.inspection-items-container.open {
    max-height: 1000px;
    opacity: 1;
    padding: 1rem 0.5rem;
}

/* آیکون‌های وضعیت (تیک و ضربدر) */
.status-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
}

.status-icon.ok {
    background: #2D4B8C; /* سبز ملایم */
    color: #ffffff;
}

.status-icon.warn {
    background: #FEE2E2; /* قرمز ملایم */
    color: #B91C1C;
}

.inspection-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #F1F3F6;
    font-size: 14px;
}

/* باکس خلاصه نظر کارشناس */
#expert-summary-container {
    background-color: rgba(45, 75, 140, 0.05); /* آبی سلطنتی بسیار شفاف */
    border-right: 4px solid #2D4B8C;
}

/* ============================================================
   ۶. المان‌های موبایل و ریسپانسیو
   ============================================================ */
@media (max-width: 767px) {
    .mobile-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #FFFFFF;
        padding: 12px 20px;
        box-shadow: 0 -8px 20px rgba(45, 75, 140, 0.1);
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-top: 1px solid #E5E7EB;
    }
    
    .safe-area-padding {
        padding-bottom: 90px;
    }

    /* استایل دکمه‌های شناور موبایل */
    .mobile-filter-btn {
        background: white;
        border: 1px solid #E5E7EB;
        color: #2D4B8C;
        font-weight: bold;
    }
}

/* مودال تصاویر (Photo Modal) */
#photo-modal {
    background-color: rgba(26, 26, 26, 0.98); /* Charcoal Black Overlay */
}

/* آیکون‌های ویژگی‌ها (Icons Grid) */
.feature-icon-box {
    background-color: rgba(45, 75, 140, 0.05);
    color: #2D4B8C;
    transition: all 0.2s ease;
}

.feature-icon-box:hover {
    background-color: #2D4B8C;
    color: #FFFFFF;
}

@keyframes blink-and-switch {
    0%, 45% {
        opacity: 1;
        content: "⚡ موتورت رو بدون کمیسیون بفروش!";
    }
    50% {
        opacity: 0;
    }
    55%, 100% {
        opacity: 1;
        content: "🛡️ خرید امن و شفاف موتور سیکلت";
    }
}

.animate-text-switch::after {
    content: "⚡ موتورت رو بدون کمیسیون بفروش!"; /* متن پیش‌فرض */
    animation: blink-and-switch 4s infinite;
}
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
/* تنظیمات استاندارد برای بریدن متن‌های طولانی */
.truncate {
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

/* برای اطمینان از اینکه فلکس‌باکس مانع truncate نمی‌شود */
.min-w-0 {
    min-width: 0;
}