/**
 * Filter Everything PRO — theme overrides
 *
 * Adapts wpc-* plugin classes to match the native filter design.
 * Loaded only when kv_filter_engine === 'fepro'.
 *
 * Design tokens (from theme.css):
 *   accent:     #5c776f
 *   text:       #1a1d2e
 *   muted:      #9ca3af
 *   border:     #e5e7eb / #eef0f2
 *   divider:    #f0f1f3
 *   input-bg:   #fafafa
 *   radius-lg:  14px
 *   radius-sm:  8px
 */

/* ── Widget wrapper (matches .kva-filter-block) ──────────────────────────── */

.kva-fe-widget {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  border: 1px solid #eef0f2;
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.kva-fe-widget::-webkit-scrollbar { width: 4px; }
.kva-fe-widget::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.kva-fe-widget::-webkit-scrollbar-track { background: transparent; }

.kva-fe-widget__title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f1f3;
}

/* ── Filter group container ──────────────────────────────────────────────── */

.wpc-filter-wrapper {
  padding: 14px 0;
  border-top: 1px solid #f0f1f3;
}
.wpc-filter-wrapper:first-child {
  border-top: none;
  padding-top: 0;
}

/* Filter label */
.wpc-filter-wrapper > label,
.wpc-filter-wrapper > .wpc-filter-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .3px;
  color: #1a1d2e;
  margin-bottom: 8px;
  font-family: 'Manrope', sans-serif;
}

/* ── Dropdown select ─────────────────────────────────────────────────────── */

.wpc-filters-widget-select {
  width: 100%;
  padding: 7px 32px 7px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  font-family: 'Manrope', sans-serif;
  color: #1a1d2e;
  background: #fafafa;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .15s;
}
.wpc-filters-widget-select:focus {
  outline: none;
  border-color: #5c776f;
  box-shadow: 0 0 0 3px rgba(92,119,111,.12);
}

/* ── Checkbox / radio list ───────────────────────────────────────────────── */

.wpc-filters-ul-list,
.wpc-filters-checkboxes,
.wpc-filters-radio {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 220px;
  overflow-y: auto;
}
.wpc-filters-ul-list::-webkit-scrollbar,
.wpc-filters-checkboxes::-webkit-scrollbar,
.wpc-filters-radio::-webkit-scrollbar { width: 3px; }
.wpc-filters-ul-list::-webkit-scrollbar-thumb,
.wpc-filters-checkboxes::-webkit-scrollbar-thumb,
.wpc-filters-radio::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Individual item */
.wpc-term-item,
.wpc-radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  font-size: .82rem;
  color: #374151;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  line-height: 1.3;
  user-select: none;
  font-family: 'Manrope', sans-serif;
}
.wpc-term-item:hover,
.wpc-radio-item:hover { background: #f9fafb; }

/* Selected state */
.wpc-term-item.wpc-term-selected,
.wpc-radio-item.wpc-term-selected {
  color: #1a1d2e;
  font-weight: 600;
}

/* Count badge */
.wpc-term-count {
  font-size: .72rem;
  font-weight: 500;
  color: #9ca3af;
  margin-left: auto;
  flex-shrink: 0;
}

/* Disabled state */
.wpc-term-item.wpc-term-disabled,
.wpc-radio-item.wpc-term-disabled {
  opacity: .4;
  pointer-events: none;
}

/* Checkboxes / radios — styled inputs */
.wpc-term-item input[type="checkbox"],
.wpc-radio-item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
}
.wpc-radio-item input[type="radio"] { border-radius: 50%; }

.wpc-term-item input[type="checkbox"]:checked,
.wpc-radio-item input[type="radio"]:checked {
  background: #5c776f;
  border-color: #5c776f;
}
.wpc-term-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.wpc-radio-item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #fff;
  border-radius: 50%;
}
.wpc-term-item input[type="checkbox"]:hover,
.wpc-radio-item input[type="radio"]:hover { border-color: #5c776f; }
.wpc-term-item input:focus-visible,
.wpc-radio-item input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(92,119,111,.15);
}

/* ── Filter link (anchor-based terms) ───────────────────────────────────── */

.wpc-filter-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.wpc-filter-link:hover { color: #5c776f; }

/* ── Range inputs ────────────────────────────────────────────────────────── */

.wpc-filters-range-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wpc-filters-range-column {
  flex: 1;
  min-width: 0;
}
.wpc-filters-range-min,
.wpc-filters-range-max {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  font-family: 'Manrope', sans-serif;
  color: #1a1d2e;
  background: #fafafa;
  transition: border-color .15s, background .15s;
  -moz-appearance: textfield;
}
.wpc-filters-range-min::-webkit-inner-spin-button,
.wpc-filters-range-min::-webkit-outer-spin-button,
.wpc-filters-range-max::-webkit-inner-spin-button,
.wpc-filters-range-max::-webkit-outer-spin-button { -webkit-appearance: none; }
.wpc-filters-range-min::placeholder,
.wpc-filters-range-max::placeholder { color: #c4c9d4; }
.wpc-filters-range-min:focus,
.wpc-filters-range-max:focus {
  outline: none;
  border-color: #5c776f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(92,119,111,.12);
}

/* Range slider */
.wpc-filters-range-slider-wrapper {
  margin-top: 10px;
}
.wpc-filters-range-slider-control {
  width: 100%;
  accent-color: #5c776f;
}

/* ── Active filter chips ─────────────────────────────────────────────────── */

.wpc-filter-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.wpc-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  color: #374151;
  background: #f9fafb;
  cursor: pointer;
  transition: border-color .13s, background .13s, color .13s;
  user-select: none;
}
.wpc-filter-chip:hover { border-color: #5c776f; color: #5c776f; background: #f0f5f3; }
.wpc-chip-remove-icon {
  display: inline-flex;
  align-items: center;
  color: #9ca3af;
  font-size: .9em;
}

/* ── Apply / reset buttons ───────────────────────────────────────────────── */

.wpc-filters-apply-button {
  display: inline-block;
  padding: 8px 18px;
  background: #5c776f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: background .15s;
  letter-spacing: .02em;
}
.wpc-filters-apply-button:hover { background: #4a6158; }

.wpc-filters-close-button,
.wpc-filters-reset {
  display: inline-block;
  padding: 6px 16px;
  color: #9ca3af;
  background: none;
  border: none;
  font-size: .78rem;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
  cursor: pointer;
  transition: color .15s;
  letter-spacing: .02em;
}
.wpc-filters-close-button:hover,
.wpc-filters-reset:hover { color: #5c776f; }

/* ── Bottom controls bar ─────────────────────────────────────────────────── */

.wpc-filters-open-button-container {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f0f1f3;
  margin-top: 4px;
  padding-top: 14px;
}

/* ── Posts found count ───────────────────────────────────────────────────── */

.wpc-posts-found,
.wpc-filters-found-posts {
  font-size: .75rem;
  color: #9ca3af;
  font-family: 'Manrope', sans-serif;
}
.wpc-posts-found-number { font-weight: 700; color: #5c776f; }

/* ── Search field inside filter ──────────────────────────────────────────── */

.wpc-filter-search-form {
  position: relative;
  margin-bottom: 8px;
}
.wpc-search-field {
  width: 100%;
  padding: 7px 32px 7px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  font-family: 'Manrope', sans-serif;
  color: #1a1d2e;
  background: #fafafa;
  transition: border-color .15s;
}
.wpc-search-field:focus {
  outline: none;
  border-color: #5c776f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(92,119,111,.12);
}
.wpc-search-icon,
.wpc-search-clear-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  cursor: pointer;
}

/* ── Sorting form ────────────────────────────────────────────────────────── */

.wpc-sorting-form { margin-bottom: 8px; }
.wpc-orderby-select {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: .82rem;
  font-family: 'Manrope', sans-serif;
  color: #1a1d2e;
  background: #fafafa;
  cursor: pointer;
  transition: border-color .15s;
}
.wpc-orderby-select:focus {
  outline: none;
  border-color: #5c776f;
  box-shadow: 0 0 0 3px rgba(92,119,111,.12);
}

/* ── Labels list — chip/pill layout (matches native .kvf-chips) ──────────── */

.wpc-filters-labels {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  max-height: none;
  overflow-y: visible;
}

.wpc-filters-labels .wpc-label-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 5px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: #4b5563;
  background: #fff;
  cursor: pointer;
  transition: border-color .13s, background .13s, color .13s;
  user-select: none;
  list-style: none;
}
.wpc-filters-labels .wpc-label-item:hover {
  border-color: #5c776f;
  color: #5c776f;
  background: #f0f5f3;
}
.wpc-filters-labels .wpc-label-item.wpc-term-selected {
  background: #5c776f !important;
  border-color: #5c776f !important;
  color: #fff !important;
  font-weight: 700;
}
.wpc-filters-labels .wpc-label-item.wpc-term-disabled {
  opacity: .4;
  pointer-events: none;
}

/* Wrapper fills chip area */
.wpc-filters-labels .wpc-term-item-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}
.wpc-filters-labels .wpc-label-input { display: none !important; }

/* label — strip browser defaults, fill chip */
.wpc-filters-labels .wpc-label-item label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  font-family: 'Manrope', sans-serif;
  line-height: 1;
  outline: none;
}

/* inner span wrapper */
.wpc-filters-labels .wpc-filter-label-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
}

/* anchor — no underline, no outline, inherit chip color */
.wpc-filters-labels .wpc-filter-link {
  display: inline;
  text-decoration: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  outline: none;
}
.wpc-filters-labels .wpc-filter-link:hover,
.wpc-filters-labels .wpc-filter-link:focus,
.wpc-filters-labels .wpc-filter-link:focus-visible { color: inherit; outline: none; }

/* Hide term count badge and any pseudo-content inside chips */
.wpc-filters-labels .wpc-term-count { display: none; }
