/* 筛选器样式 */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  font-size: 0.875rem;
  color: #374151;
  min-width: 150px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: #865E7B;
  box-shadow: 0 0 0 3px rgba(134, 94, 123, 0.1);
}

/* 搜索框样式 */
.search-container {
  position: relative;
  margin-right: 1rem;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s;
  width: 300px;
  height: 40px;
}

.search-input-wrapper:focus-within {
  border-color: #865E7B;
  box-shadow: 0 0 0 3px rgba(134, 94, 123, 0.1);
  background-color: white;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: #6b7280;
  margin-left: 12px;
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  padding: 0;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: #374151;
  background: transparent;
  height: 100%;
}

.search-input::placeholder {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* 搜索建议样式 */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 300px;
  overflow-y: auto;
}

.search-suggestions.hidden {
  display: none;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f3f4f6;
}

.search-suggestion-item:hover {
  background-color: #f9fafb;
}

.search-suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-image {
  width: 40px;
  height: 40px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.suggestion-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-price {
  font-size: 0.75rem;
  color: #865E7B;
  font-weight: 600;
}

/* 移动端搜索面板样式 */
.mobile-search-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2rem;
}

.mobile-search-panel.hidden {
  display: none;
}

.mobile-search-content {
  background: white;
  border-radius: 0.5rem;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.mobile-search-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-search-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  outline: none;
}

.mobile-search-close {
  margin-left: 0.75rem;
  padding: 0.5rem;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
}

.mobile-search-suggestions {
  max-height: 300px;
  overflow-y: auto;
}

.mobile-search-suggestion-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid #f3f4f6;
}

.mobile-search-suggestion-item:hover {
  background-color: #f9fafb;
}

/* 移动端筛选面板样式 */
.mobile-filter-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mobile-filter-panel.hidden {
  display: none;
}

.mobile-filter-content {
  background: white;
  border-radius: 1rem 1rem 0 0;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1);
}

.mobile-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-filter-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

.mobile-filter-close {
  padding: 0.5rem;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.mobile-filter-close:hover {
  background-color: #f3f4f6;
}

.mobile-filter-body {
  padding: 1.5rem;
  max-height: 50vh;
  overflow-y: auto;
}

.mobile-filter-group {
  margin-bottom: 1.5rem;
}

.mobile-filter-group:last-child {
  margin-bottom: 0;
}

.mobile-filter-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.mobile-filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
  font-size: 1rem;
  color: #374151;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mobile-filter-select:focus {
  outline: none;
  border-color: #865E7B;
  box-shadow: 0 0 0 3px rgba(134, 94, 123, 0.1);
}

.mobile-filter-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.mobile-filter-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.mobile-filter-btn-secondary {
  background-color: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.mobile-filter-btn-secondary:hover {
  background-color: #f9fafb;
}

.mobile-filter-btn-primary {
  background-color: #865E7B;
  color: white;
}

.mobile-filter-btn-primary:hover {
  background-color: #6b4c6b;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-container {
    margin-right: 0.5rem;
    width: 100%;
    max-width: 250px;
  }
  
  .search-input-wrapper {
    width: 100%;
    max-width: 250px;
  }
  
  .filter-group {
    margin-bottom: 1rem;
  }
  
  .filter-select {
    min-width: 120px;
  }
  
  .desktop-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 640px) {
  .search-container {
    width: 100%;
    max-width: 200px;
  }
  
  .search-input-wrapper {
    width: 100%;
    max-width: 200px;
    height: 36px;
  }
  
  .search-icon {
    width: 16px;
    height: 16px;
    margin-left: 8px;
    margin-right: 6px;
  }
  
  .search-input {
    font-size: 0.8rem;
  }
  
  .mobile-search-content {
    width: 95%;
  }
  
  .mobile-filter-content {
    max-height: 90vh;
  }
  
  .filter-group {
    margin-bottom: 1rem;
  }
  
  .filter-select {
    min-width: 100px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .search-container {
    max-width: 150px;
  }
  
  .search-input-wrapper {
    max-width: 150px;
    height: 32px;
  }
  
  .search-icon {
    width: 14px;
    height: 14px;
    margin-left: 6px;
    margin-right: 4px;
  }
  
  .search-input {
    font-size: 0.75rem;
  }
  
  .search-input::placeholder {
    font-size: 0.75rem;
  }
}
