.new-filter-modal-btn-open {
  padding:10px 18px;
  background:#fff;
  color:#007bff;
  border:none;
  border-radius:4px;
  cursor:pointer;
  font-size:16px;
  float:right;
}

/* Overlay */
.new-filter-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1001;
  backdrop-filter: blur(2px);
}

/* Modal container */
.new-filter-modal-container {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  padding: 20px 25px 30px;
  z-index: 1001;
  display: none;
  box-sizing: border-box;
}

/* Modal Header */
.new-filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.new-filter-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
}
.new-filter-modal-btn-close {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
  color: #888;
  transition: color 0.2s;
}
.new-filter-modal-btn-close:hover {
  color: #007bff;
}

/* 篩選組件 */
.new-filter-modal-filter {
  margin-bottom: 18px;
}
.new-filter-modal-filter label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

/* 分類卡片 */
.new-filter-modal-category-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.new-filter-modal-category-card {
  cursor: pointer;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  color: #444;
  user-select: none;
  background: #fff;
  transition: border-color 0.3s, background-color 0.3s;
  flex: 1 0 calc(50% - 10px);
  text-align: center;
  box-sizing: border-box;
}
.new-filter-modal-category-card.selected {
  border-color: #007bff;
  background-color: #e6f0ff;
  color: #007bff;
  font-weight: 700;
}

/* 價錢區 */
.new-filter-modal-price-inputs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.new-filter-modal-price-inputs input[type="number"] {
  flex: 1 1 45%;
  min-width: 100px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* noUiSlider 容器 */
.new-filter-modal-slider {
  margin: 0 auto 10px;
  max-width: 100%;
}

/* 評分區 */
.new-filter-modal-rating-display {
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
  text-align: center;
}

/* 關鍵字修正為全寬 */
.new-filter-modal-search-filter input[type="text"] {
  width: 100% !important;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* 排序 */
.new-filter-modal-sort {
  margin-bottom: 20px;
}
.new-filter-modal-sort select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  cursor: pointer;
}

/* 按鈕群 */
.new-filter-modal-btn-group {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 12px;
}
.new-filter-modal-btn-reset,
.new-filter-modal-btn-apply {
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 6px;
  border:none;
  cursor: pointer;
  transition: background-color 0.3s;
  user-select:none;
  font-size: 15px;
}
.new-filter-modal-btn-reset {
  background: #ddd;
  color: #444;
}
.new-filter-modal-btn-reset:hover {
  background: #ccc;
}
.new-filter-modal-btn-apply {
  background: #007bff;
  color: white;
}
.new-filter-modal-btn-apply:hover {
  background: #005dc1;
}

/* Responsive */
@media (min-width: 600px) and (max-width: 900px) {
  .new-filter-modal-container {
    max-width: 600px;
  }
  .new-filter-modal-category-card {
    flex: 1 0 calc(33.333% - 10px);
  }
}
@media (max-width: 599px) {
  .new-filter-modal-container {
    max-width: 95vw;
    max-height: 80vh;
  }
  .new-filter-modal-filter label {
    font-size: 14px;
  }
  .new-filter-modal-btn-open {
    font-size: 14px;
    padding: 8px 14px;
  }
  .new-filter-modal-category-card {
    flex: 1 0 calc(50% - 10px);
  }
}

/* scrollbar */
.new-filter-modal-container::-webkit-scrollbar {
  width: 8px;
}
.new-filter-modal-container::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

.new-filter-modal-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Tag 樣式 */
.new-filter-modal-filter-tag {
  display: inline-flex;
  align-items: center; /* 垂直置中 */
  background-color: #121535;
  color: white;
  border-radius: 9999px; /* 完全圓邊 */
  padding: 6px 12px;
  font-size: 0.9em;
  user-select: none;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 刪除按鈕 */
.new-filter-modal-filter-tag .delete-btn {
  display: inline-flex;
  margin-left: 8px;
  cursor: pointer;
  user-select: none;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.new-filter-modal-filter-tag .delete-btn:hover {
  background-color: rgba(255 255 255 / 0.2);
}

/* 關閉圖示SVG */
.new-filter-modal-filter-tag .delete-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}