/* filters.css */
#sidebar-filters,
#sidebar-filters * {
  box-sizing: border-box;
  max-width: 100%;
}



.filter-item {
  margin-bottom: 1rem;
}

.filter-label {
  font-weight: bold;
}


.filter-group {
  position: relative;
  z-index: auto;
  margin-bottom: 24px;
}

.filter-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.filter-group input[type="number"],
.filter-group select {
  width: 100%;
  padding: 6px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

#filters-container {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#filters-container.visible {
  opacity: 1;
}

.filters-inner {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.range-slider-container {
  margin-bottom: 20px;
  position: relative;
  z-index: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding-left: 4px;
  padding-right: 4px;
}

.range-value {
  font-size: 14px;
  margin-top: 4px;
  color: #333;
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
}

.range-slider {
  margin-top: 4px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  z-index: 0;
}

#sidebar-filters {
  position: fixed;
  display: flex;
  flex-direction: column;
  top: 150px;
  /* изменено с 480px на 120px */
  left: -500px;
  /* скрыт за экраном */
  width: 520px;
  top: 150px;
  bottom: 0;
  height: auto;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  /* критично */
  transition: left 0.4s ease;
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px;
  padding-left: 30px;
  padding-right: 30px;
  padding-bottom: 80px;
}

/* Когда открыт */
#sidebar-filters.open {
  left: 0;
}

/* Кнопка */
#toggle-filters-btn {
  position: fixed;
  top: 80px;
  /* изменено с 120px на 80px */
  left: 0px;
  /* изменено с 10px на 0px */
  background: #008060;
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1100;
}

#sidebar-filters * {
  max-width: 100%;
  box-sizing: border-box;
}

.range-value-box {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #e0e0e0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #000;
  white-space: nowrap;
}

/* Красивые дропдауны */
.filter-group select {
  font-family: 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease;
}

.filters-sidebar {
  transition: transform 0.3s ease;
  transform: translateX(-100%);
}

.filters-sidebar.slide-in {
  transform: translateX(0);
}

.filter-group select:focus {
  outline: none;
  border-color: #008060;
  background-color: #fff;
}

.apply-filters-btn {
  position: fixed;
  top: 80px;
  /* изменено с 120px на 80px */
  left: 100px;
  /* изменено с 10px на 0px */
  padding: 8px 12px;
  background-color: #008060;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  z-index: 1200;
  display: none;
  /* по умолчанию скрыта */
  /*box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);*/
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#sidebar-filters::after {
  content: '';
  display: block;
}

.loading-indicator {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  border: 2px solid #000000;
  border-top: 2px solid #008060;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: relative;
}

.loading-indicator.visible {
  opacity: 1;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.filters-reset-button {
  display: block;
  margin-top: 10px;
  background-color: #eee;
  color: #333;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.choices__item--disabled {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.filters-wrapper {
  position: relative;
  max-height: none;
  /* например */
  overflow-y: visible;
  padding-top: 60px;
  /* высота кнопочной панели */
}

.filters-buttons {
  position: sticky;
  top: 0;
  z-index: 1200;
  padding: 10px;
  display: flex;
  background-color: #008060;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.filters-panel-wrapper {
  max-height: none;
  overflow-y: auto;
  position: relative;
  padding-bottom: 300px;
}

/* Сами кнопки */
.filters-buttons button {
  background-color: #008060;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.filters-buttons button:hover {
  background-color: #00694d;
}

/* Чтобы контент не заезжал под кнопки */
.filters-loading,
.filters-container {
  padding-top: 60px;
  /* = высота кнопочной панели */
}