/* Simple AJAX Filter — v3
   This plugin no longer renders products itself, so there is no product
   grid, card, or title styling here at all — the theme's own WooCommerce
   CSS handles that untouched. This file only styles the filter form. */

.simple-filter {
  --saf-fg: #111;
  --saf-bg: #fff;
  --saf-border: #d8d8d8;
  --saf-border-strong: #111;
  --saf-muted: #6b6b6b;
  --saf-radius: 10px;
  --saf-gap: 14px;

  box-sizing: border-box;
  font-family: var(--blocksy-font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  color: var(--saf-fg);
  background: var(--saf-bg);
  border: 1px solid var(--saf-border);
  border-radius: var(--saf-radius);
  padding: 20px;
}

.simple-filter * {
  box-sizing: border-box;
}

.simple-filter__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 var(--saf-gap);
}

.simple-filter__group {
  margin-top: var(--saf-gap);
}

.simple-filter__group:first-of-type {
  margin-top: 0;
}

.simple-filter__group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--saf-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.simple-filter input[type="number"],
.simple-filter select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--saf-border);
  border-radius: 6px;
  background: var(--saf-bg);
  color: var(--saf-fg);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.simple-filter input[type="number"]:focus,
.simple-filter select:focus {
  outline: none;
  border-color: var(--saf-border-strong);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.simple-filter__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.simple-filter__price-row input {
  min-width: 0;
}

.simple-filter__price-sep {
  color: var(--saf-muted);
  flex-shrink: 0;
}

.simple-filter__actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.simple-filter__apply,
.simple-filter__clear {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  border: 1px solid var(--saf-border-strong);
}

.simple-filter__apply {
  background: var(--saf-border-strong);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.simple-filter__apply:hover {
  opacity: 0.85;
}

.simple-filter__clear {
  background: var(--saf-bg);
  color: var(--saf-fg);
}

.simple-filter__clear:hover {
  background: #f4f4f4;
}

.simple-filter__apply:disabled,
.simple-filter__clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Small spinner shown inside the Apply button while a request is running. */
.simple-filter__btn-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: saf-spin 0.7s linear infinite;
}

.simple-filter.is-loading .simple-filter__btn-spinner {
  display: inline-block;
}

@keyframes saf-spin {
  to { transform: rotate(360deg); }
}

.simple-filter__count {
  font-size: 13px;
  color: var(--saf-muted);
  margin: 14px 0 0;
  min-height: 16px;
}

/* Applied directly to the theme's own product grid element while a
   request is in flight. Intentionally minimal — opacity and pointer-events
   only — so it never touches the theme's own grid/column/typography CSS. */
.saf-target-loading {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.simple-filter__load-more {
  display: block;
  width: 100%;
  margin: 20px 0;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--saf-border-strong);
  border-radius: 6px;
  background: var(--saf-bg);
  color: var(--saf-fg);
  cursor: pointer;
}

.simple-filter__load-more:hover {
  background: #f4f4f4;
}

.simple-filter__load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
