/* Auto Filter Widget Styles */

.auto-filter-widget {
  --primary-color: #1e3a8a;
  --button-color: #1e3a8a;
  --border-color: #1e3a8a;
  --hover-bg: #f0f4ff;
  --text-color: #1e3a8a;
  --field-padding: 24px;
}

.auto-filter-counter {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 16px;
  text-align: left;
  padding-bottom: 20px;
}

.auto-filter-container {
  background: transparent;
  padding: 0;
  border-radius: 0;
}
  
.auto-filter-field {
  margin-bottom: var(--field-padding, 24px);
}

.auto-filter-field h3 {
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 12px;
  font-size: 14px;
}

/* Dropdown Styles */
.auto-filter-dropdown-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #0f0f0f !important;
  background: transparent !important;
  color: #0f0f0f !important;
  font-family: inherit !important;
  font-weight: 400;
  font-size: 24px !important;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
  position: relative;
}

.auto-filter-dropdown-btn::after {
  content: '';
  width: 21px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='21' height='12' viewBox='0 0 21 12' fill='none'%3e%3cpath d='M2.48953 0.427136C1.92002 -0.142379 0.99665 -0.142379 0.427136 0.427136C-0.142379 0.99665 -0.142379 1.92002 0.427136 2.48953L9.17714 11.2395C9.74665 11.809 10.67 11.809 11.2395 11.2395L19.9895 2.48953C20.559 1.92002 20.559 0.99665 19.9895 0.427136C19.42 -0.142379 18.4967 -0.142379 17.9271 0.427136L10.2083 8.14594L2.48953 0.427136Z' fill='%23DB3B0C'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
  margin-left: auto;
}

.auto-filter-dropdown.open .auto-filter-dropdown-btn {
  background: #db3b0c !important;
  color: white !important;
}

.auto-filter-dropdown.open .auto-filter-dropdown-btn::after {
  transform: rotate(180deg);
  filter: brightness(0) invert(1);
}

.auto-filter-dropdown-btn:hover,
.auto-filter-dropdown-btn:focus {
  background-color: var(--hover-bg);
  outline: none;
}



.auto-filter-dropdown-menu {
  border: 0;
  background: white;
  position: absolute;
  width: 100%;
  z-index: 10;
  max-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.3s ease;
  display: flex !important;
  flex-direction: column !important;
  background: white !important;
}

.auto-filter-dropdown.open .auto-filter-dropdown-menu {
  max-height: 300px;
  border: 2px solid var(--border-color);
  border-top: none;
}

.auto-filter-option {
  width: 100%;
  font-size:16px;
  padding: 8px 16px;
  text-align: left;
  border: none;
  border-bottom: 1px solid #0f0f0f2e !important;
  background: #fff !important;
  color: #0f0f0f !important;
  font-family: inherit !important;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auto-filter-option:last-child {
    border-bottom: none !important;
  }
  

.auto-filter-option:hover {
  background-color: #db3b0c !important;
  color: white !important;
  border:0px !important;
}

/* Range Styles */
.auto-filter-range-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auto-filter-range-inputs input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  text-align: center;
  font-weight: 600;
  transition: background-color 0.2s;
}

.auto-filter-range-inputs input:focus {
  background-color: white;
  outline: none;
  border-color: var(--border-color);
}

.auto-filter-range-slider-container {
  position: relative;
  width: 100%;
  height: 8px;
}

.auto-filter-range-slider-min,
.auto-filter-range-slider-max {
  position: absolute;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.auto-filter-range-slider-min {
  z-index: 3;
}

.auto-filter-range-slider-max {
  z-index: 4;
}

.auto-filter-range-slider-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #bfdbfe;
  border-radius: 4px;
  z-index: 1;
}

.auto-filter-range-slider-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: var(--range-left, 0%);
  width: var(--range-width, 100%);
  bottom: 0;
  background: #0779CA;
  border-radius: 4px;
  z-index: 2;
}

.auto-filter-range-slider-min::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 23px;
  height: 23px;
  background: white;
  border: 2px solid #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
}

.auto-filter-range-slider-max::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 23px;
  height: 23px;
  background: #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
}

.auto-filter-range-slider-min::-moz-range-thumb {
  width: 23px;
  height: 23px;
  background: white;
  border: 2px solid #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
  border: none;
}

.auto-filter-range-slider-max::-moz-range-thumb {
  width: 23px;
  height: 23px;
  background: #0779CA;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  position: relative;
  border: none;
}



.auto-filter-input-field {
  width: 100%;
  padding: 12px 16px !important;
  border: 2px solid #1e3a8a !important;
  text-align: center;
  font-weight: 600;
  margin-bottom: 16px;
  transition: background-color 0.2s !important;
}

.auto-filter-input-field:focus {
  background-color: white;
  outline: none;
  border-color: #1e3a8a !important;
}

.auto-filter-input-slider-container {
  position: relative;
  width: 100%;
  height: 8px;
}

.auto-filter-input-slider-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #bfdbfe;
  border-radius: 4px;
  z-index: 1;
}

.auto-filter-input-slider-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--input-slider-width, 20%);
  bottom: 0;
  background: #0779CA;
  border-radius: 4px;
  z-index: 2;
}

.auto-filter-input-slider {
  position: absolute;
  width: 100%;
  height: 8px;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 3;
}

.auto-filter-input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0779CA;
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 4;
}

.auto-filter-input-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0779CA;
  cursor: pointer;
  border: none;
}



/* Checkbox Styles */
.auto-filter-checkbox-btn {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-color);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
}

.auto-filter-checkbox-btn:hover,
.auto-filter-checkbox-btn:focus {
  background-color: var(--hover-bg);
  outline: none;
}

.auto-filter-checkbox-menu {
  border: 2px solid var(--border-color);
  border-top: none;
  background: white;
  position: absolute;
  width: 100%;
  z-index: 1000;
}

.auto-filter-checkbox-label {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auto-filter-checkbox-label:last-child {
  border-bottom: none;
}

.auto-filter-checkbox-label:hover {
  background-color: var(--hover-bg);
}

.auto-filter-checkbox-input {
  margin-right: 12px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.auto-filter-checkbox-label span {
  color: var(--text-color);
}

/* Toggle Switch Styles */
.auto-filter-toggle {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 8px;
  margin-right: 16px;
  margin-bottom: 8px;
  width: auto;
}

.auto-filter-toggle h3 {
  font-family: Geomanist;
  font-size: 24px;
  font-style: normal;
  font-weight: 500;
  line-height: 120%;
  color: #1E1E1E;
  margin: 0;
}

/* Mobile styles for toggles */
@media (max-width: 768px) {
  .auto-filter-toggle {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 8px;
    margin-right: 0;
    margin-bottom: 16px;
    width: 100%;
  }

  .auto-filter-toggle h3 {
    font-family: Geomanist;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
  }
}

.auto-filter-toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.auto-filter-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-filter-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 28px;
}

.auto-filter-toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .auto-filter-toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .auto-filter-toggle-slider:before {
  transform: translateX(22px);
}

/* Reset Button */
.auto-filter-reset-btn {
  width: auto;
  padding: 12px 24px;
  margin-top: var(--field-padding, 24px);
  background: var(--button-color);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.auto-filter-reset-btn:hover,
.auto-filter-reset-btn:focus {
  background: var(--button-color);
  outline: none;
}

/* Toggle Button Styles */
.auto-filter-toggle-button {
  position: relative !important;
}

.auto-filter-toggle-button-btn {
  width: 100% !important;
  height: 100px !important;
  padding: 12px 16px !important;
  background: #fff !important;
  border: 2px solid #1A509E !important;
  color: #1A509E !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
}

.auto-filter-toggle-button-btn:hover {
  background: #f0f4ff !important;
  
}

.auto-filter-toggle-button-btn.active {
  background: #1A509E !important;
  color: #fff !important;
  border-color: #1A509E !important;
  box-shadow: 0 0 0 2px #1A509E inset !important;
}

/* Button Styles */
.auto-filter-button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.auto-filter-button-item {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
  border-radius: 24px;
  transition: all 0.2s;
  font-size: 14px;
}

.auto-filter-button-item:hover {
  background-color: var(--hover-bg);
}

.auto-filter-button-item.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .auto-filter-container {
    max-width: 100%;
  }

  .auto-filter-button-container {
    gap: 6px;
  }

  .auto-filter-button-item {
    padding: 6px 12px;
    font-size: 12px;
  }

  .auto-filter-toggle-button-btn {
    padding: 10px 12px;
    font-size: 14px;
  }
}
