:root {
  --rf-border: 1px solid #e1e5e9;
  --rf-radius: 16px;
  --rf-spacing: 1.25rem;
  --rf-bg: #ffffff;
  --rf-surface: #f8fafc;
  --rf-primary: #0f172a;
  --rf-accent: #3b82f6;
  --rf-accent-hover: #2563eb;
  --rf-muted: #64748b;
  --rf-text: #334155;
  --rf-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  --rf-desktop-drawer-width: clamp(300px, 20vw, 420px);
}

body.responsive-filter--locked {
  overflow: hidden;
}

.responsive-filter {
  width: 100%;
  display: block;
}

.responsive-filter__ordering {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.responsive-filter__ordering .woocommerce-ordering {
  flex: 1 1 220px;
}

.responsive-filter__ordering .responsive-filter__toggle {
  flex: 0 0 auto;
}

.responsive-filter__toggle,
.responsive-filter__reset,
.responsive-filter__apply,
.responsive-filter__close {
  border: none;
  border-radius: var(--rf-radius);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.responsive-filter__toggle:hover,
.responsive-filter__reset:hover,
.responsive-filter__apply:hover,
.responsive-filter__close:hover {
  transform: translateY(-1px);
  color: #0f172a;
}

.responsive-filter__toggle:active,
.responsive-filter__reset:active,
.responsive-filter__apply:active,
.responsive-filter__close:active {
  transform: translateY(0);
}

.responsive-filter__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--rf-surface);
  color: var(--rf-primary);
  border: 1px solid #cbd5f5;
}

.responsive-filter__toggle:hover {
  background: var(--rf-bg);
  border-color: var(--rf-accent);
}

.responsive-filter__toggle svg {
  width: 20px;
  height: 20px;
}

.responsive-filter__chip {
  background: var(--rf-accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.responsive-filter__chip[hidden] {
  display: none;
}

.responsive-filter__reset,
.responsive-filter__reset--inline {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.responsive-filter__reset:hover,
.responsive-filter__reset--inline:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.responsive-filter__reset--inline {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: none;
}

.responsive-filter__drawer-panel {
  background: var(--rf-bg);
  border: var(--rf-border);
  border-radius: var(--rf-radius);
  padding: var(--rf-spacing);
  display: flex;
  flex-direction: column;
  box-shadow: var(--rf-shadow);
}

.responsive-filter__drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rf-border);
}

.responsive-filter__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rf-primary);
  margin: 0;
}

.responsive-filter__header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.responsive-filter__close {
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.5rem;
  color: var(--rf-muted);
  border-radius: 8px;
  box-shadow: none;
}

.responsive-filter__close:hover {
  background: var(--rf-surface);
  color: var(--rf-primary);
}

.responsive-filter__form {
  display: grid;
  gap: 1.25rem;
  overflow: auto;
  padding-right: 0.5rem;
  flex: 1;
}

.responsive-filter__group {
  border: var(--rf-border);
  border-radius: var(--rf-radius);
  padding: 1rem;
  background: var(--rf-bg);
}

.responsive-filter__group--search,
.responsive-filter__group--price {
  border: none;
  padding: 0;
  background: transparent;
  margin-bottom: 1rem;
}

.responsive-filter__price-slider {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  --range-start: 0%;
  --range-end: 100%;
}

.responsive-filter__price-values {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--rf-primary);
}

.responsive-filter__slider-inputs {
  position: relative;
  height: 28px;
}

.responsive-filter__slider-inputs::before,
.responsive-filter__slider-inputs::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  top: 50%;
  transform: translateY(-50%);
}

.responsive-filter__slider-inputs::before {
  background: #e2e8f0;
}

.responsive-filter__slider-inputs::after {
  background: var(--rf-accent);
  clip-path: inset(0 calc(100% - var(--range-end)) 0 var(--range-start));
}

.responsive-filter__slider-inputs input[type="range"] {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  pointer-events: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.responsive-filter__slider-inputs input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--rf-accent);
  border: 2px solid #fff;
  pointer-events: auto;
  cursor: grab;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.responsive-filter__slider-inputs
  input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.05);
}

.responsive-filter__slider-inputs
  input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.1);
  cursor: grabbing;
}

.responsive-filter__slider-inputs input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--rf-accent);
  border: 2px solid #fff;
  pointer-events: auto;
  cursor: grab;
  transition: transform 0.1s ease;
}

.responsive-filter__slider-inputs input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.05);
}

.responsive-filter__slider-inputs input[type="range"]::-moz-range-thumb:active {
  transform: scale(1.1);
  cursor: grabbing;
}

.responsive-filter__slider-inputs
  input[type="range"]::-webkit-slider-runnable-track,
.responsive-filter__slider-inputs input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
}

.responsive-filter__group--search + .responsive-filter__group--price {
  margin-top: 1rem;
}

.responsive-filter__search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.responsive-filter__group--search input[type="search"] {
  flex: 1;
  border-radius: 999px;
  border: var(--rf-border);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.responsive-filter__search-button {
  background: var(--rf-accent);
  color: #fff;
  border: none;
  border-radius: 10px;

  width: 46px;
  height: 46px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--rf-shadow);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.responsive-filter__search-button:hover {
  background: var(--rf-accent-hover);
  transform: translateY(-1px);
}

.responsive-filter__search-button svg {
  width: 20px;
  height: 20px;
}

.responsive-filter__group legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--rf-primary);
  font-size: 1rem;
}

.responsive-filter__price-inputs {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.responsive-filter__price-inputs input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: var(--rf-border);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.responsive-filter__price-inputs input:focus,
.responsive-filter__group--search input[type="search"]:focus {
  outline: none;
  border-color: var(--rf-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.responsive-filter__checkboxes {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 0.5rem;
}

.responsive-filter__checkboxes label,
.responsive-filter__group--search label {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
  align-items: center;
  color: var(--rf-text);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.responsive-filter__checkboxes label:hover {
  background: var(--rf-surface);
}

.responsive-filter__group--search input[type="search"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: var(--rf-border);
  font-size: 0.9rem;
}

.responsive-filter__checkboxes input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--rf-accent);
  cursor: pointer;
}

.responsive-filter__actions {
  display: flex;
  gap: 0;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rf-border);
}

.responsive-filter__apply,
.responsive-filter__reset {
  flex: 1;
}

.responsive-filter__apply {
  background: var(--rf-accent);
  color: #fff;
  font-weight: 600;
}

.responsive-filter__apply:hover {
  background: var(--rf-accent-hover);
}

.responsive-filter__drawer {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
}

.responsive-filter__drawer-panel {
  width: min(420px, 90vw);
  max-width: 90vw;
  height: 100%;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.responsive-filter__drawer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.responsive-filter__drawer.is-open .responsive-filter__drawer-panel {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .responsive-filter__drawer-panel {
    width: min(480px, 90vw);
    max-width: 90vw;
  }
}

@media (min-width: 1024px) {
  body {
    transition: padding-left 0.35s ease;
  }

  body.responsive-filter--desktop-open {
    padding-left: var(--rf-desktop-drawer-width);
    box-sizing: border-box;
    width: 100%;
  }

  .responsive-filter__drawer {
    justify-content: flex-start;
  }

  .responsive-filter__drawer-panel {
    width: var(--rf-desktop-drawer-width);
    max-width: none;
    height: 100vh;
  }

  body.responsive-filter--desktop-open .responsive-filter__drawer {
    background: transparent;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
  }

  body.responsive-filter--desktop-open .responsive-filter__drawer-panel {
    transform: translateX(0);
    position: fixed;
    left: 0;
    top: 0;
    border-radius: 0;
    pointer-events: auto;
  }
}
