#custom-product-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

#custom-product-filters .filter-by-term {
  width: 100%;
  max-width: 700px;
  max-height: 50px;
}

#custom-product-filters button {
  cursor: pointer;
  flex-basis: 100px;
  padding: 8px 12px;
  color: #fff;
  background-color: var(--wp--preset--color--primary-700);
  border: none;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

#custom-product-filters button.affiner {
  flex-basis: 100%;
  min-height: 50px;
  max-width: 700px;
  margin-top: 0.25rem;
  border-radius: 4px;
}

#custom-product-filters #selected-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

#custom-product-filters #selected-filters .filter-tag {
  padding: 0 0 0 1rem;
  color: rgb(255, 255, 255);
  background-color: var(--wp--preset--color--supports-500);
  border-radius: 4px;
  text-transform: capitalize;
}

#custom-product-filters #selected-filters .filter-tag button {
  margin-left: 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--wp--preset--color--error);
  font-size: 1.5rem;
}

#custom-product-filters .panneau {
  z-index: 10000;
  position: fixed;
  top: 0;
  bottom: 0;
  left: -100vw;
  width: 100vw;
  max-width: 500px;
  padding: 4rem 2rem;
  background-color: rgba(240, 240, 240, 0.9);
  transition: left 0.3s ease;
}

#custom-product-filters .panneau .close {
  cursor: pointer;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 1rem;
  border-radius: 4px;
}

#custom-product-filters .panneau .products-found-count {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

#custom-product-filters .panneau .filter-by-price label[for="price_range"] {
  display: block;
  margin: 0 0 1rem;
}

#custom-product-filters .panneau p {
  margin: 0;
}

#custom-product-filters .panneau input {
  margin-bottom: 0.5rem;
}

/* Input range with central track and custom thumb design */
#custom-product-filters input[type="range"] {
  -webkit-appearance: none;
  position: relative;
  width: 100%;
  height: 6px;
  margin: 0;
  padding: 1.2rem 0;
  background: transparent;
  border: none;
  border-radius: 5px;
  outline: none;
}

/* Style for the slider thumb */
#custom-product-filters input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--wp--preset--color--primary-700);
  border-radius: 50%;
  cursor: pointer;
  border: 4px solid white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

#custom-product-filters input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--wp--preset--color--primary-700);
  border-radius: 50%;
  cursor: pointer;
  border: 4px solid white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Track styles for Firefox */
#custom-product-filters input[type="range"]::-moz-range-track {
  height: 6px;
  background: var(--wp--preset--color--primary-700);
  border-radius: 5px;
}

/* Hover and focus effects */
#custom-product-filters input[type="range"]:hover::-webkit-slider-thumb {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#custom-product-filters input[type="range"]:focus::-webkit-slider-thumb {
  outline: 3px solid var(--wp--preset--color--primary-700);
}


#custom-product-filters .panneau .filter-by-category,
#custom-product-filters .panneau .filter-by-attribute {
  position: relative;
  margin: 0 0 0.5rem 0;
}

#custom-product-filters .panneau .filter-by-category select,
#custom-product-filters .panneau .filter-by-attribute select {
  z-index: 1;
  cursor: pointer;
  appearance: none;
  /* Supprime le style natif */
  position: relative;
  width: 100%;
  padding: 1rem 40px 1rem 15px;
  color: #333;
  background-color: white;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-position: calc(100% - 20px) calc(1em + 8px),
    calc(100% - 15px) calc(1em + 8px);
  background-image: linear-gradient(45deg,
      transparent 50%,
      var(--wp--preset--color--supports-800) 50%),
    linear-gradient(135deg,
      var(--wp--preset--color--supports-800) 50%,
      transparent 50%);
  border: 2px solid var(--wp--preset--color--supports-800);
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#custom-product-filters .panneau .filter-by-category select:hover,
#custom-product-filters .panneau .filter-by-attribute select:hover {
  border-color: #0056b3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#custom-product-filters .panneau .filter-by-category select:focus,
#custom-product-filters .panneau .filter-by-attribute select:focus {
  border-color: #0056b3;
  outline: none;
}

#custom-product-filters .panneau .filter-by-category::after,
#custom-product-filters .panneau .filter-by-attribute::after {
  pointer-events: none;
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 10px;
  height: 10px;
  background-position: center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  background: linear-gradient(45deg,
      transparent 50%,
      var(--wp--preset--color--supports-800) 50%),
    linear-gradient(135deg,
      var(--wp--preset--color--supports-800) 50%,
      transparent 50%);
  transform: translateY(-50%);
}

#custom-product-filters .panneau .filter-by-category option,
#custom-product-filters .panneau .filter-by-attribute option {
  padding: 10px;
  color: #333;
}

#custom-product-filters .panneau .filtrer,
#custom-product-filters .panneau .reset {
  cursor: pointer;
  width: 100%;
  padding: 1rem;
  color: #fff;
  background-color: var(--wp--preset--color--primary-700);
  border: none;
  border-bottom: 4px;
  outline: none;
}

#custom-product-filters .panneau .reset {
  margin-bottom: .5rem;
}

#custom-product-results {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#custom-product-results #product-list {
  width: 100%;
}