.wrpf-filters {
  position: relative;
  padding: 6px 6px 12px;
  color: #111;
  font-family: inherit;
}

.wrpf-mobile-toggle,
.wrpf-mobile-backdrop,
.wrpf-mobile-panel-header {
  display: none;
}

.wrpf-mobile-toolbar {
  display: none;
}

.wrpf-mobile-toggle {
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 0;
  background: #fff;
  color: #4b4b4d;
  text-align: left;
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.04);
}

.wrpf-mobile-toggle-text,
.wrpf-mobile-panel-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.wrpf-mobile-toggle-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: #111;
}

.wrpf-mobile-toggle-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wrpf-mobile-panel {
  position: relative;
}

.wrpf-mobile-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.wrpf-mobile-close:focus-visible,
.wrpf-mobile-toggle:focus-visible,
.wrpf-mobile-backdrop:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.22);
  outline-offset: 2px;
}

#product-grid {
  position: relative;
}

.wrpf-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.wrpf-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(17, 17, 17, 0.16);
  border-top-color: #111;
  border-radius: 50%;
  animation: wrpf-spin 0.7s linear infinite;
}

.wrpf-filters .wrpf-loading-spinner {
  display: none;
}

.wrpf-loading-active .wrpf-loading-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wrpf-loading-active > :not(.wrpf-loading-overlay) {
  pointer-events: none;
}

@keyframes wrpf-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.wrpf-title {
  margin: 0 0 18px;
  color: #111;
  font-size: 28px;
  font-weight: 700;
}

.wrpf-filters-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wrpf-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wrpf-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #4b4b4d;
}

.wrpf-section-head h5 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
}

.wrpf-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.wrpf-section-toggle:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.22);
  outline-offset: 2px;
}

.wrpf-section-mark {
  display: inline-block;
  min-width: 16px;
  font-size: 29px;
  line-height: 0.8;
  font-weight: 700;
  text-align: center;
  color: #111;
}

.wrpf-select,
.wrpf-price-number {
  width: 100%;
  height: 30px;
  border: 1px solid #8a8a8a;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-size: 14px;
  padding: 4px 8px;
}

.wrpf-price-slider {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wrpf-price-track {
  position: relative;
  height: 26px;
}

.wrpf-price-track::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  right: 0;
  height: 2px;
  background: #111;
}

.wrpf-price-progress {
  position: absolute;
  top: 11px;
  height: 2px;
  background: #111;
}

.wrpf-range {
  pointer-events: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.wrpf-range::-webkit-slider-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border: 1px solid #111;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
}

.wrpf-range::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border: 1px solid #111;
  background: #fff;
  cursor: pointer;
  border-radius: 0;
}

.wrpf-range::-webkit-slider-runnable-track,
.wrpf-range::-moz-range-track {
  background: transparent;
}

.wrpf-price-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wrpf-currency,
.wrpf-separator {
  color: #111;
  font-size: 16px;
}

.wrpf-price-number {
  width: 78px;
  text-align: left;
  font-size: 15px;
  padding: 4px 6px;
}

.wrpf-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wrpf-option-item {
  margin: 0;
}

.wrpf-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111;
  font-size: 14px;
  cursor: pointer;
}

.wrpf-option-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.wrpf-option-label:hover input[type="checkbox"] {
  border-color: #9a9a9a;
}

.wrpf-option-label input[type="checkbox"]:checked {
  border-color: #8b8b8b;
  background: #f5f5f5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23444444' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 11px 11px;
  box-shadow: none;
}

.wrpf-option-label input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 120, 120, 0.18);
}

.wrpf-options-list-radio .wrpf-option-label input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1px solid #cfcfcf;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 4px #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.wrpf-options-list-radio .wrpf-option-label:hover input[type="radio"] {
  border-color: #9a9a9a;
}

.wrpf-options-list-radio .wrpf-option-label input[type="radio"]:checked {
  border-color: #8b8b8b;
  box-shadow: inset 0 0 0 4px #fff;
  background: #8b8b8b;
}

.wrpf-options-list-radio .wrpf-option-label input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 120, 120, 0.18), inset 0 0 0 4px #fff;
}

.wrpf-scroll-area {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

.wrpf-scroll-area::-webkit-scrollbar {
  width: 10px;
}

.wrpf-scroll-area::-webkit-scrollbar-track {
  background: #dadada;
}

.wrpf-scroll-area::-webkit-scrollbar-thumb {
  background: #6a6a6a;
  border: 1px solid #3b3b3b;
}

.wrpf-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.wrpf-submit {
  display: none;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    opacity 0.18s ease;
}

.wrpf-submit:hover {
  background: #262626;
  border-color: #262626;
}

.wrpf-reset {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.wrpf-reset:hover {
  color: #262626;
}

.wrpf-reset.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.wrpf-reset-icon {
  font-size: 15px;
  line-height: 1;
}

.wrpf-reset-text {
  text-decoration: underline;
}

@media (max-width: 991px) {
  body.wrpf-mobile-open {
    overflow: hidden;
  }

  .wrpf-filters {
    padding: 0;
  }

  .wrpf-mobile-toggle {
    display: flex;
  }

  .wrpf-mobile-toolbar {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .wrpf-mobile-toolbar .wrpf-mobile-toggle,
  .wrpf-mobile-ordering {
    flex: 1 1 0;
    min-width: 0;
  }

  .wrpf-mobile-toolbar .wrpf-mobile-toggle {
    min-height: 42px;
    padding: 10px 16px;
  }

  .wrpf-mobile-ordering .woocommerce-ordering {
    float: none;
    width: 100%;
    height: 100%;
    margin: 0;
  }

  .wrpf-mobile-ordering .woocommerce-ordering select {
    width: 100%;
    height: 100%;
    min-height: 42px;
    margin: 0;
  }

  /* A ordenação equivalente fica no toolbar do filtro neste breakpoint. */
  .woocommerce-page #product-grid > .woocommerce-ordering {
    display: none;
  }

  .wrpf-mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9997;
    width: 100%;
    border: 0;
    padding: 0;
    background: rgba(17, 17, 17, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }

  .wrpf-mobile-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
  }

  .wrpf-mobile-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 50px;
    height: 50px;
    padding: 0 16px;
    border-bottom: 1px solid #ece7eb;
  }

  .wrpf-filters .wrpf-loading-overlay {
    z-index: 3;
    padding-top: 84px;
    border-radius: 10px;
  }

  .wrpf-filters-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 16px;
  }

  .wrpf-title {
    font-size: 24px;
    display: none;
  }

  .wrpf-filters.is-mobile-open .wrpf-mobile-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .wrpf-filters.is-mobile-open .wrpf-mobile-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .wrpf-actions {
    flex: 0 0 auto;
    min-height: 50px;
    margin: 0;
    padding: 4px 16px calc(4px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #ece7eb;
    align-items: center;
    justify-content: flex-end;
  }

  .wrpf-reset {
    order: 1;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .wrpf-actions .wrpf-reset:not(.is-disabled) {
    color: #111;
    opacity: 1;
  }

  .wrpf-submit {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 14px;
    font-size: 13px;
  }
}

@media (min-width: 992px) {
  .wrpf-mobile-panel {
    display: block;
  }
}
