/* ===== پنل فیلتر پیشرفته محصولات — پنجره بازشو با دکمه اعمال ===== */

/* دکمه فیلتر + بج تعداد */
.fp-mobile-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid #0a4aa8; background: #eef4fd; border-radius: 10px; padding: 8px 14px;
  font: inherit; font-size: 13px; font-weight: 800; color: #0a4aa8; cursor: pointer;
  transition: background .15s, color .15s;
}
.fp-mobile-btn:hover { background: #0a4aa8; color: #fff; }
.fp-badge {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: #e8452c; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.fp-badge[hidden] { display: none !important; }
.fp-mobile-btn[hidden] { display: none; }

/* اورلی */
.fp-overlay {
  position: fixed; inset: 0; background: rgba(10,20,35,.5); z-index: 10000;
  opacity: 1; transition: opacity .25s;
}
.fp-overlay[hidden] { display: none; }

/* پنل کشویی (همیشه — دسکتاپ و موبایل) — بالای همه ویجت‌ها از جمله چت‌بات */
.fp-root {
  direction: rtl; position: fixed; top: 0; bottom: 0; right: 0;
  width: min(400px, 94vw); max-height: 100vh; overflow-y: auto;
  background: #fff; border-radius: 16px 0 0 16px; z-index: 10001; padding: 16px;
  box-shadow: -14px 0 40px rgba(0,0,0,.2);
  transform: translateX(105%); transition: transform .3s cubic-bezier(.4,.05,.3,1);
}
.fp-root.is-open { transform: translateX(0); }
body.fp-locked { overflow: hidden; }
/* دکمه شناور چت‌بات هنگام باز بودن فیلتر پنهان شود تا دکمه‌های پنل خوانا و کلیک‌پذیر بمانند */
body.fp-locked .bot-fab, body.fp-locked .bot-panel { display: none !important; }

.fp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fp-head-title { font-weight: 800; font-size: 15px; color: #16202b; }
.fp-close {
  border: 0; background: #f1f4f8; color: #7b8593; border-radius: 50%; width: 28px; height: 28px;
  font-size: 12px; cursor: pointer; line-height: 1; flex: none;
}
.fp-close:hover { background: #e8452c; color: #fff; }

/* جست‌وجو */
.fp-search { position: relative; margin-bottom: 10px; }
.fp-search input {
  width: 100%; box-sizing: border-box; border: 1.5px solid #dde3ec; border-radius: 10px;
  padding: 9px 34px 9px 10px; font: inherit; font-size: 13px; background: #f7f9fc; transition: border-color .15s, background .15s;
}
.fp-search input:focus { outline: none; border-color: #0a4aa8; background: #fff; }
.fp-search-clear {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: #e5e8ee; color: #7b8593; border-radius: 50%; width: 20px; height: 20px;
  font-size: 10px; cursor: pointer; line-height: 1;
}
.fp-search-clear:hover { background: #d6dce6; color: #16202b; }

/* مرتب‌سازی */
.fp-sort { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12.5px; color: #5b6472; }
.fp-sort select {
  flex: 1; border: 1.5px solid #dde3ec; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px;
  background: #fff; cursor: pointer; color: #16202b;
}
.fp-sort select:focus { outline: none; border-color: #0a4aa8; }

/* چیپ‌ها */
.fp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fp-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #eef4fd; color: #0a4aa8;
  border: 1px solid #c9dcf7; border-radius: 999px; padding: 3px 6px 3px 8px; font-size: 11.5px; font-weight: 700;
}
.fp-chip button { border: 0; background: #0a4aa8; color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 9px; cursor: pointer; line-height: 1; }
.fp-chip button:hover { background: #e8452c; }

/* بخش‌های آکاردئونی (تفکیک‌شده) */
.fp-section { border: 1px solid #eef1f5; border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.fp-section-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  border: 0; background: #f7f9fc; padding: 10px 12px; font: inherit; font-size: 13px; font-weight: 800;
  color: #16202b; cursor: pointer;
}
.fp-section-head:hover { background: #f0f4f9; }
.fp-caret { font-size: 11px; color: #98a1ad; transition: transform .2s; }
.fp-section.is-open .fp-caret { transform: rotate(180deg); }
.fp-section-body { display: none; padding: 10px 12px; }
.fp-section.is-open .fp-section-body { display: block; }

.fp-opts { display: flex; flex-direction: column; gap: 6px; }
.fp-opts-scroll { max-height: 210px; overflow-y: auto; padding-left: 4px; }
.fp-brand-search {
  width: 100%; box-sizing: border-box; border: 1.5px solid #e5e8ee; border-radius: 8px;
  padding: 7px 10px; font: inherit; font-size: 12.5px; margin-bottom: 8px; background: #f7f9fc;
}
.fp-brand-search:focus { outline: none; border-color: #0a4aa8; background: #fff; }

/* گزینه‌ها */
.fp-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: right;
  background: #fff; border: 1.5px solid #e5e8ee; border-radius: 9px;
  padding: 8px 10px; font: inherit; font-size: 13px; color: #16202b;
  cursor: pointer; transition: background .15s, border-color .15s, opacity .15s;
}
.fp-opt:hover { background: #f4f7fb; }
.fp-opt .fp-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-check {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #b8c0cc; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: 11px; font-weight: 800; transition: all .15s;
}
.fp-opt.is-selected { border-color: #0a4aa8; background: #eef4fd; font-weight: 700; }
.fp-opt.is-selected .fp-check { background: #0a4aa8; border-color: #0a4aa8; color: #fff; }
.fp-opt.is-empty { opacity: .45; }
.fp-count { margin-right: auto; font-size: 11px; color: #98a1ad; background: #f1f4f8; border-radius: 999px; padding: 1px 8px; min-width: 24px; text-align: center; }
.fp-opt.is-selected .fp-count { background: #d8e6fb; color: #0a4aa8; font-weight: 800; }

/* اسلایدر دوتایی قیمت */
.fp-range { position: relative; height: 30px; margin: 6px 4px 10px; }
.fp-range-track {
  position: absolute; top: 50%; right: 0; left: 0; height: 5px; transform: translateY(-50%);
  background: #e5e8ee; border-radius: 3px;
}
.fp-range-fill { position: absolute; top: 0; bottom: 0; background: #0a4aa8; border-radius: 3px; }
.fp-range input[type="range"] {
  position: absolute; inset: 0; width: 100%; margin: 0; -webkit-appearance: none; appearance: none;
  background: none; pointer-events: none; height: 30px;
}
.fp-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 3px solid #0a4aa8; box-shadow: 0 2px 6px rgba(10,74,168,.35); cursor: grab;
}
.fp-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 3px solid #0a4aa8; box-shadow: 0 2px 6px rgba(10,74,168,.35); cursor: grab;
}
.fp-range input[type="range"]::-moz-range-track { background: none; }

/* ورودی‌های قیمت */
.fp-price-inputs { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.fp-price-inputs input {
  width: 100%; min-width: 0; border: 1.5px solid #dde3ec; border-radius: 9px; padding: 8px 8px;
  font: inherit; font-size: 12px; text-align: center; color: #16202b;
}
.fp-price-inputs input:focus { outline: none; border-color: #0a4aa8; }
.fp-price-inputs span { color: #98a1ad; flex: none; }
.fp-presets { display: flex; flex-wrap: wrap; gap: 5px; }
.fp-preset {
  border: 1px solid #dde3ec; background: #fff; border-radius: 999px; padding: 4px 10px;
  font: inherit; font-size: 11.5px; color: #5b6472; cursor: pointer; transition: all .15s;
}
.fp-preset:hover { border-color: #0a4aa8; color: #0a4aa8; }
.fp-preset.is-active { background: #0a4aa8; border-color: #0a4aa8; color: #fff; font-weight: 700; }

/* نتیجه + دکمه‌های اعمال/ریست */
.fp-result-note {
  font-size: 12px; color: #0a7a4f; background: #e9f7f0; border-radius: 8px;
  padding: 8px 10px; margin-top: 10px; text-align: center; font-weight: 700;
}
.fp-actions { display: flex; gap: 8px; margin-top: 12px; }
.fp-apply {
  flex: 1; border: 0; border-radius: 10px; padding: 11px; font: inherit; font-size: 13.5px; font-weight: 800;
  background: #0a4aa8; color: #fff; cursor: pointer; transition: background .15s;
}
.fp-apply:hover { background: #0e5fd8; }
.fp-reset {
  border: 1.5px solid #dde3ec; background: #fff; color: #7b8593;
  border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.fp-reset:hover { color: #b42318; border-color: #e5b4ae; }

.fp-product-hidden { display: none !important; }

/* حالت خالی */
.fp-empty { text-align: center; padding: 48px 16px; color: #5b6472; }
.fp-empty-icon { font-size: 42px; margin-bottom: 10px; }
.fp-empty h3 { margin: 0 0 6px; color: #16202b; }
.fp-empty p { margin: 0 0 16px; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) { .fp-root, .fp-overlay { transition: none; } }
