/* === Filter Styles Only (Product grid uses theme) === */
:root{
  --zcwf-card-radius: 12px;
  --zcwf-btn-bg: #00356B;
  --zcwf-btn-color: #fff;
  --zcwf-gap: 28px;
}

/* ===== FILTERS SECTION ===== */
.zcwf-wrapper {
  border: 1px solid #e5e7eb;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 24px;
}

.zcwf-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.zcwf-search {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.zcwf-selected {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* MINIMAL CHIP STYLES - Uses theme primary color */
.zcwf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 10px;
  background: var(--zcwf-chip-bg, #f0f0f0);
  color: var(--zcwf-chip-color, #333);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 20px;
  transition: all 0.2s ease;
  letter-spacing: normal;
}

.zcwf-chip span {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zcwf-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  background: rgba(0,0,0,0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  color: inherit;
  transition: all 0.2s ease;
}

.zcwf-chip button:hover {
  background: rgba(0,0,0,0.2);
  transform: scale(1.1);
}

/* Theme color integration - Use WordPress theme primary color */
.zcwf-chip[data-theme="primary"] {
  background: var(--zcwf-primary-color, #00356B);
  color: var(--zcwf-primary-text, #ffffff);
}

.zcwf-chip[data-theme="primary"] button {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.zcwf-chip[data-theme="primary"] button:hover {
  background: rgba(255,255,255,0.3);
}

/* Empty state */
.zcwf-chip-empty {
  font-size: 12px;
  color: #999;
  font-style: italic;
  padding: 2px 4px;
}

.zcwf-clear {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  color: #666;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zcwf-clear:hover {
  background: var(--zcwf-primary-color, #00356B);
  border-color: var(--zcwf-primary-color, #00356B);
  color: #fff;
}

/* Filters */
.zcwf-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.zcwf-filter-block {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.zcwf-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #F1F5F9;
}

.zcwf-filter-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.zcwf-collapse-toggle {
  border: 1px solid #ddd;
  color: #666;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.zcwf-collapse-toggle:hover {
  background: var(--zcwf-primary-color, #00356B);
  border-color: var(--zcwf-primary-color, #00356B);
  color: #fff;
}

.zcwf-filter-body {
  padding: 8px 12px;
}

.zcwf-terms {
  display: block;
}

.zcwf-term {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.zcwf-term:last-child {
  border-bottom: none;
}

.zcwf-term input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.zcwf-term span {
  font-size: 13px;
  color: #444;
  cursor: pointer;
}

.zcwf-term-count {
  font-size: 10px;
  color: #999;
  margin-left: auto;
}

.zcwf-more {
  margin-top: 4px;
}

.zcwf-view-more {
  margin-top: 6px;
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--zcwf-primary-color, #00356B);
  text-decoration: underline;
  transition: all 0.2s ease;
}

.zcwf-view-more:hover {
  color: var(--zcwf-primary-color-dark, #002244);
}

/* Results + Spinner */
.zcwf-results-wrap {
  position: relative;
  margin-top: 16px;
}

.zcwf-results-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 8px;
}

.zcwf-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: var(--zcwf-primary-color, #00356B);
  animation: wcfspin 1s linear infinite;
}

@keyframes wcfspin {
  to { transform: rotate(360deg); }
}

/* No results */
.zcwf-no-results {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .zcwf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .zcwf-clear {
    margin-left: 0;
  }
  
  .zcwf-chip span {
    max-width: 150px;
  }
}