/**
 * CPAF — Range Slider display type
 */

.cpaf-range {
  padding: 4px 0 10px;
}

/* ── Value display ──────────────────────────────────────────────────────── */

.cpaf-range__values {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.9em;
  color: var(--wp--preset--color--text-light);
}

.cpaf-range__val {
  font-weight: 600;
  color: var(--cpaf-color-primary);
  min-width: 2ch;
}

.cpaf-range__sep {
  color: var(--wp--preset--color--text-light);
}

/* ── Track wrapper ──────────────────────────────────────────────────────── */

.cpaf-range__track-wrap {
  position: relative;
  height: 24px; /* tall enough to contain both thumbs */
}

/* ── Track ──────────────────────────────────────────────────────────────── */

.cpaf-range__track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 4px;
  background: var(--wp--preset--color--border);
  border-radius: 2px;
  pointer-events: none;
}

/* ── Fill (colored range between thumbs) ───────────────────────────────── */

.cpaf-range__fill {
  position: absolute;
  height: 100%;
  background: var(--cpaf-color-primary);
  border-radius: 2px;
}

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

.cpaf-range__input {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none; /* thumbs only */
  margin: 0;
  padding: 0;
}

/* Thumb — Webkit */
.cpaf-range__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--wp--preset--color--surface);
  border: 2px solid var(--cpaf-color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.1s, box-shadow 0.1s;
}

.cpaf-range__input::-webkit-slider-thumb:hover,
.cpaf-range__input::-webkit-slider-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Thumb — Firefox */
.cpaf-range__input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--wp--preset--color--surface);
  border: 2px solid var(--cpaf-color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: all;
}

/* z-index: put max on top when both thumbs are at the right edge */
.cpaf-range__input--min { z-index: 2; }
.cpaf-range__input--max { z-index: 3; }

/* ── Apply button (multiple mode) ───────────────────────────────────────── */

.cpaf-range__footer {
  margin-top: 14px;
}

.cpaf-range__apply {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: var(--cpaf-color-primary);
  color: var(--wp--preset--color--surface);
  border: none;
  border-radius: 3px;
  font-size: 0.9em;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.15s;
  text-transform: none;
  letter-spacing: normal;
  min-height: unset;
}

.cpaf-range__apply:hover {
  opacity: 0.85;
}
