/* ============================================================
   Filter Sidebar — Component Styles  (fsb-* namespace)
   Brand colors:
     Blue      #25639c  |  Blue Dark  #1a4f82  |  Blue Light  #e8f0f8
     Orange    #ff6c2c  |  Orange Dark #ee3824  |  Orange Light #fff3ef
   ============================================================ */

/* ── Mobile trigger button ── */
.fsb-mobile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-blue);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  color: var(--clr-white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  position: relative;
  box-shadow: 0 4px 14px rgba(37, 99, 156, 0.28);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.fsb-mobile-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 156, 0.38);
}

.fsb-trigger-badge {
  background: var(--clr-orange);
  color: var(--clr-white);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Backdrop (mobile overlay) ── */
.fsb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(1px);
  animation: fsb-fade-in 0.2s ease;
}

@keyframes fsb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Panel ── */
.fsb-panel {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-blue-light);
  box-shadow: var(--shadow-blue-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
}

/* Mobile: slide in from the left */
@media (max-width: 991px) {
  .fsb-panel {
    position: fixed;
    inset-block: 0;
    inset-inline-start: -100%;
    width: min(340px, 88vw);
    z-index: 1050;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    max-height: 100vh;
    top: 0;
    transition: inset-inline-start 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.18);
  }

  .fsb-panel--open {
    inset-inline-start: 0;
  }
}

/* ── Header ── */
.fsb-header {
  background: linear-gradient(120deg, var(--clr-blue-dark) 0%, var(--clr-blue) 55%, var(--clr-blue-mid) 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.fsb-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fsb-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fsb-header-title {
  color: var(--clr-white);
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.fsb-header-sub {
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
  font-size: 11px;
}

.fsb-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fsb-clear-btn {
  background: rgba(255, 108, 44, 0.18);
  border: 1px solid rgba(255, 108, 44, 0.4);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-white);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--trans-fast);
}

.fsb-clear-btn:hover {
  background: rgba(255, 108, 44, 0.32);
}

.fsb-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-white);
  cursor: pointer;
  transition: background var(--trans-fast);
  flex-shrink: 0;
}

.fsb-close-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Scrollable body ── */
.fsb-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
}

.fsb-body::-webkit-scrollbar {
  width: 4px;
}

.fsb-body::-webkit-scrollbar-track {
  background: transparent;
}

.fsb-body::-webkit-scrollbar-thumb {
  background: var(--clr-fsb-scrollbar);
  border-radius: 4px;
}

/* ── Collapsible section ── */
.fsb-section {
  border-bottom: 1px solid var(--clr-border-light);
}

.fsb-section:last-child {
  border-bottom: none;
}

.fsb-section-header {
  width: 100%;
  background: none;
  border: none;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--trans-fast);
}

.fsb-section-header:hover {
  background: var(--clr-fsb-section-hover);
}

.fsb-section--open .fsb-section-header {
  background: var(--clr-fsb-section-hover);
}

.fsb-section-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fsb-section-icon {
  color: var(--clr-blue);
  display: flex;
  align-items: center;
}

.fsb-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--clr-text-label);
}

.fsb-section-badge {
  background: var(--clr-orange);
  color: var(--clr-white);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}

.fsb-section-chevron {
  color: var(--clr-text-faint);
  display: flex;
  align-items: center;
  transition: transform 0.2s;
}

.fsb-section--open .fsb-section-chevron {
  color: var(--clr-blue);
}

.fsb-section-body {
  padding: 4px 16px 14px;
  animation: fsb-slide-down 0.18s ease;
}

@keyframes fsb-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Checklist (brands / models) ── */
.fsb-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fsb-check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}

.fsb-check-item:hover {
  background: var(--clr-fsb-check-hover);
}

.fsb-checkbox {
  accent-color: var(--clr-blue);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}

.fsb-check-label {
  font-size: 13.5px;
  color: var(--clr-kim-label);
  cursor: pointer;
}

.fsb-view-more {
  background: none;
  border: none;
  color: var(--clr-blue);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  margin-top: 4px;
  text-align: start;
  transition: color var(--trans-fast);
}

.fsb-view-more:hover {
  color: var(--clr-blue-dark);
}

/* ── Pill grid (seat / fuel / transmission / features) ── */
.fsb-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fsb-pill-grid--wide .fsb-pill {
  min-width: 70px;
}

.fsb-pill {
  background: var(--clr-blue-bg);
  border: 1.5px solid var(--clr-border-blue);
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--clr-fsb-pill-text);
  cursor: pointer;
  transition: border-color var(--trans-fast), background var(--trans-fast), color var(--trans-fast);
  min-width: 58px;
}

.fsb-pill:hover {
  border-color: var(--clr-blue);
  background: var(--clr-blue-light);
  color: var(--clr-blue);
}

.fsb-pill--active {
  border-color: var(--clr-blue);
  background: var(--grad-blue);
  color: var(--clr-white);
}

.fsb-pill--active:hover {
  background: linear-gradient(135deg, var(--clr-blue-dark), var(--clr-blue));
  color: var(--clr-white);
}

.fsb-pill-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: none;
}

.fsb-pill--active .fsb-pill-img {
  filter: brightness(0) invert(1);
}

/* ── Range slider ── */
.fsb-range-values {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-text-mid);
  margin-bottom: 6px;
}

.fsb-slider-wrap {
  padding: 4px 6px 0;
}

/* ── Footer ── */
.fsb-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--clr-blue-light);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.fsb-footer-clear {
  flex: 1;
  background: var(--clr-fsb-footer-clear-bg);
  border: 1px solid var(--clr-fsb-footer-clear-border);
  border-radius: 10px;
  height: 40px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--clr-fsb-footer-clear-text);
  cursor: pointer;
  transition: background var(--trans-fast);
}

.fsb-footer-clear:hover {
  background: var(--clr-fsb-footer-clear-hover);
  color: var(--clr-kim-label);
}

.fsb-footer-apply {
  flex: 1;
  background: var(--grad-orange);
  border: none;
  border-radius: 10px;
  height: 40px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--clr-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(255, 108, 44, 0.28);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.fsb-footer-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(255, 108, 44, 0.42);
}
