/* Filter Bar Variables - Precise UI Colors */
:root {
  --filter-bg: #FFFFFF;
  --filter-label-color: #666666;
  --filter-border-color: #F0F0F0;
  --filter-tag-bg-active: #FECA3C; /* UI yellow */
  --filter-inner-bg: #F8F8F8; /* Light gray background for grid */
  --filter-more-color: #007ADE;
}
.brand-popup{
  flex: 1 1 0;
}
.filter-card {
  background: var(--filter-bg);
  padding: 1.25rem;
  border-radius: 0.25rem;
}

.filter-line {
  min-height: 2.5rem;
}

.filter-label {
  width: 4rem;
  color: var(--filter-label-color);
  font-size: 0.875rem;
  padding: 0.375rem 0;
}

.series-collapsed {
  max-height: 2.5rem; /* Exactly one row */
  overflow: hidden;
}

.series-expanded {
  max-height: none;
  overflow: visible;
}

.more-btn-col {
  width: 6rem;
  padding-top: 0.375rem;
}

.selection-text {
  font-size: 0.875rem;
  color: var(--text-black);
  cursor: pointer;
}

.filter-tag {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-black);
  cursor: pointer;
  border-radius: 0.125rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-tag.active {
  background: var(--filter-tag-bg-active);
}

.alphabet-nav span {
  font-size: 0.875rem;
  color: var(--text-black);
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  transition: all 0.2s;
  border-radius: 0.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alphabet-nav span.active {
  background: var(--filter-tag-bg-active);
}

.alphabet-nav span:hover:not(.active) {
  background: var(--filter-inner-bg);
}

/* Brand Grid */
.brand-grid-wrapper {
  padding: 0.625rem;
  background: var(--filter-inner-bg);
  border-radius: 0.125rem;
}

.brand-grid {
  padding: 0.625rem;
  gap: 1rem;
}

.brand-item {
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  border-radius: 0.125rem;
  gap: 0.5rem;
}

.brand-item.letter-hidden {
  display: none !important;
}

.brand-item.active {
  background: var(--filter-tag-bg-active);
}

.brand-logo {
  width: 1.25rem;
}


.brand-name {
  font-size: 0.875rem;
  color: var(--text-black);
}
.series-popup {
    flex: 1 1 0;
}

/* PC端默认隐藏车系筛选 */
.series-filter {
  display: none !important;
}

/* 选择品牌后显示车系 */
.brand-selected .series-filter {
  display: flex !important;
}

/* Series & Price lines */
.series-filter, .price-filter {
  border-top: 1px solid var(--filter-border-color);
  padding-top: 1.25rem;
  margin-top: 0.625rem;
}

.more-link {
  color: var(--filter-more-color);
  font-size: 0.875rem;
  cursor: pointer;
}

.more-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (max-width: 1200px) {
  
}

/* Mobile Pop-up Filter Layout */
@media (max-width: 768px) {
  .content-area {
    padding: 0 0 12vh 0;
  }

  .filter-card {
    position: fixed;
    top: var(--header-offset, 4.375rem);
    display: flex !important;
    flex-direction: row !important;
    background: #fff;
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    border-radius: 0;
    left: 0;
    width: 100%;
  }
  
  .filter-line {
    flex: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 0 !important;
    border: none !important;
    padding: 0.75rem 0 0 !important;
    min-height: 3rem;
    position: static;
  }
  
  /* Reset PC styles */
  .brand-filter, .series-filter, .price-filter {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    display: flex !important; /* 移动端强制显示车系 */
  }
  
  .filter-label {
    width: auto !important;
    font-size: 0.9375rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .filter-label::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 0.25rem solid transparent;
    border-right: 0.25rem solid transparent;
    border-top: 0.3125rem solid #666;
    transition: transform 0.3s;
  }

  .filter-line.active .filter-label {
    color: var(--filter-tag-bg-active);
  }

  .filter-line.active .filter-label::after {
    transform: rotate(180deg);
    border-top-color: var(--filter-tag-bg-active);
  }

  /* Popups */
  .filter-popup, .grid-popup {
    position: fixed;
    top: calc(var(--header-offset, 4.375rem) + 3rem);
    left: 0;
    right: 0;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    padding: 1rem !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: none !important;
    z-index: 1100;
  }

  /* Show popups when line is active */
  .filter-line.active .filter-popup {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Brand Grid inside popup in mobile */
  .brand-grid-panel {
    display: flex !important;
    flex-direction: column !important;
    max-height: none;
    overflow: visible;
    background: transparent;
    padding: 0 !important;
    box-shadow: none;
    z-index: auto;
    border-top: none;
    margin-left: 0 !important;
    pointer-events: auto;
    position: static;
    max-height: 50vh;
    overflow-y: auto;
  }
  .brand-grid-wrapper{
    margin-bottom: 0;
  }
  .brand-grid-panel .brand-item{
    padding: 0.375rem 0.5rem;
  }

  .brand-grid-panel .brand-grid {
    padding: 0;
    gap: 0.5rem;
  }

  .brand-popup {
    max-height: 80vh !important;
  }

  /* Series Filter optimization in mobile */
  .series-filter.active .series-collapsed {
    max-height: none !important;
    overflow: visible !important;
  }

  .series-filter.active .more-btn-col {
    display: none !important;
  }

  body.filter-open::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
  }
  
}
