/* ══════════════════════════════════════════════
   WC Shop Filters — Stylesheet v1.1.0
   ══════════════════════════════════════════════ */

:root {
  --wcsf-accent:      #555555;   /* neutral dark for interactive elements */
  --wcsf-accent-lt:   #f5f5f5;   /* very light gray hover — no color tint */
  --wcsf-text:        inherit;   /* inherit theme text color */
  --wcsf-muted:       #aaaaaa;   /* light gray for counts & labels */
  --wcsf-border:      #e8e8e8;
  --wcsf-bg:          #ffffff;
  --wcsf-sidebar-w:   260px;
  --wcsf-radius:      6px;
  --wcsf-shadow:      0 1px 6px rgba(0,0,0,.06);
  --wcsf-font:        inherit;   /* inherit theme font */
  --wcsf-transition:  .15s ease;
}

/* ── Layout ──────────────────────────────────── */
.wcsf-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.wcsf-sidebar {
  width: var(--wcsf-sidebar-w);
  flex-shrink: 0;
  background: var(--wcsf-bg);
  border: 1px solid var(--wcsf-border);
  border-radius: var(--wcsf-radius);
  box-shadow: var(--wcsf-shadow);
  padding: 18px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wcsf-border) transparent;
  box-sizing: border-box;
}

.wcsf-sidebar::-webkit-scrollbar { width: 3px; }
.wcsf-sidebar::-webkit-scrollbar-thumb { background: var(--wcsf-border); border-radius: 2px; }

.wcsf-main { flex: 1; min-width: 0; }

/* ── Blocks ──────────────────────────────────── */
.wcsf-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--wcsf-border);
}
.wcsf-block:first-child { padding-top: 0; }
.wcsf-block:last-child  { border-bottom: none; padding-bottom: 0; }

/* Heading — small gray uppercase label like screenshot */
.wcsf-label,
.wcsf-heading {
  display: block;
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--wcsf-muted);
  margin-bottom: 9px;
}
.wcsf-heading { margin: 0 0 10px; }

/* ── Search ──────────────────────────────────── */
.wcsf-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.wcsf-search-icon {
  position: absolute;
  left: 9px;
  color: var(--wcsf-muted);
  pointer-events: none;
}

.wcsf-search {
  width: 100%;
  padding: 8px 10px 8px 31px;
  border: 1px solid var(--wcsf-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  color: inherit;
  background: #fafafa;
  transition: border-color var(--wcsf-transition);
  box-sizing: border-box;
}

.wcsf-search:focus {
  outline: none;
  border-color: #aaa;
  background: #fff;
  box-shadow: none;
}

/* ── Category list ───────────────────────────── */
.wcsf-cat-list,
.wcsf-sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wcsf-sub-list {
  padding-left: 14px;
  margin-top: 2px;
}

.wcsf-cat-item { margin-bottom: 1px; }

.wcsf-cat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--wcsf-transition);
  font-size: 13px;
  color: inherit;            /* let theme color show — matches screenshot */
}

.wcsf-cat-label:hover { background: var(--wcsf-accent-lt); }

.wcsf-cat-cb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px; height: 15px;
  min-width: 15px;
  border: 1px solid #c8c8c8;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  background: #fff;
  transition: background var(--wcsf-transition), border-color var(--wcsf-transition);
}

.wcsf-cat-cb:checked {
  background: #555;
  border-color: #555;
}

.wcsf-cat-cb:checked::after {
  content: '';
  display: block;
  width: 4px; height: 8px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(42deg) translate(1px, -1px);
  margin: auto;
}

.wcsf-cat-name { flex: 1; }

.wcsf-cat-count {
  font-size: 11px;
  color: #aaa;
  background: transparent;   /* no pill background — matches screenshot */
  border-radius: 0;
  padding: 0;
  font-weight: 400;
  min-width: auto;
  text-align: left;
}

/* ── On Sale toggle ──────────────────────────── */
.wcsf-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: inherit;
  user-select: none;
}

.wcsf-toggle-cb { display: none; }

.wcsf-toggle-track {
  width: 36px; height: 20px;
  background: #d0d0d0;
  border-radius: 10px;
  position: relative;
  transition: background var(--wcsf-transition);
  flex-shrink: 0;
}

.wcsf-toggle-thumb {
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform var(--wcsf-transition);
}

.wcsf-toggle-cb:checked + .wcsf-toggle-track            { background: #555; }
.wcsf-toggle-cb:checked + .wcsf-toggle-track .wcsf-toggle-thumb { transform: translateX(16px); }

/* ── Reset button ────────────────────────────── */
.wcsf-reset-btn {
  display: block;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--wcsf-border);
  border-radius: 4px;
  background: transparent;
  color: #aaa;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--wcsf-transition);
}

.wcsf-reset-btn:hover {
  border-color: #999;
  color: #555;
  background: #f5f5f5;
}

/* ── Mobile toggle ───────────────────────────── */
.wcsf-mobile-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 14px;
  transition: opacity var(--wcsf-transition);
}
.wcsf-mobile-toggle:hover { opacity: .85; }

.wcsf-badge {
  background: #fff;
  color: #444;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: 2px;
}

/* ── Result count ────────────────────────────── */
.wcsf-result-count {
  font-size: 12px;
  color: var(--wcsf-muted);
  margin: 0 0 14px;
}

/* ── Loading spinner ─────────────────────────── */
#wcsfResults.wcsf-loading {
  position: relative;
  min-height: 180px;
}

#wcsfResults.wcsf-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.75);
  border-radius: var(--wcsf-radius);
  z-index: 5;
}

#wcsfResults.wcsf-loading::before {
  content: '';
  position: absolute;
  width: 32px; height: 32px;
  border: 3px solid #eee;
  border-top-color: #888;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  animation: wcsf-spin .7s linear infinite;
}

@keyframes wcsf-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ── No results ──────────────────────────────── */
.wcsf-no-results {
  text-align: center;
  padding: 56px 20px;
  color: var(--wcsf-muted);
}
.wcsf-no-results svg  { margin-bottom: 10px; opacity: .3; }
.wcsf-no-results p    { margin: 0 0 14px; font-size: 14px; }
.wcsf-reset-inline    { display: inline-block; width: auto; padding: 8px 22px; }

/* ── Pagination ──────────────────────────────── */
.wcsf-pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.wcsf-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid var(--wcsf-border);
  font-size: 13px;
  color: var(--wcsf-text);
  text-decoration: none;
  transition: all var(--wcsf-transition);
}

.wcsf-pagination .page-numbers:hover,
.wcsf-pagination .page-numbers.current {
  background: #555;
  border-color: #555;
  color: #fff;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .wcsf-layout { display: block; }
  .wcsf-mobile-toggle { display: inline-flex; }

  .wcsf-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 82vw);
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(-110%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 9999;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }

  .wcsf-sidebar.wcsf-open { transform: translateX(0); }

  .wcsf-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.38);
    z-index: 9998;
  }

  .wcsf-sidebar-overlay.wcsf-open { display: block; }
}
