.energy-savings-slider-container {
  padding-top: 340px;
  margin-bottom: 20px;
}

.energy-savings-slider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Fira Sans";
}

.slider-control-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1050px;
  padding: 20px;
  gap: 30px;
  background: #e3dfdc;
  border-radius: 20px;
}

.slider-center-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slider-container {
  align-self: stretch;
}

.slider-toggle-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.slider-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 400px;
  overflow: visible;
  position: relative;
}

.slider-image-container img {
  position: absolute;
  bottom: 0;
  max-width: auto;
}

.value-display {
  text-align: center;
  width: 130px;
  background: #1A3C66;
  color: #fff;
  padding: 7px 20px;
  border-radius: 20px;
  align-self: start;
  margin-top: 25px;
  margin-bottom: -25px;
  position: relative;
}

.value-display::after {
  content: "";
  position: absolute;
  bottom: 88%;
  left: var(--caret-left);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 15px solid #1A3C66;
}

.toggle-btn {
  position: relative;
  display: block;
  width: 18px;
  height: 42px;
  margin: 0;
  border-radius: 15px;
  background: #fff;
  border: 0;
  cursor: pointer;
  transition: background-color 0.3s;
  padding: 0;
  overflow: visible; /* Allow the circle to overflow */
}

.toggle-btn::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -2px;      /* Slightly off-center to appear larger than background */
  width: 22px;     /* Slightly wider than container */
  height: 22px;    /* Slightly taller than half the container */
  background: #209895; /* Green circle */
  border-radius: 17px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: top 0.3s; /* Transition top instead of left */
}

.toggle-btn.factory::after {
  top: calc(100% - 21px); /* Move to bottom position */
}

/* Hide text content for visual toggle */
.toggle-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Type display */
.type-display-top, .type-display-bottom {
  font-weight: 700;
  margin: 5px 0;
  text-transform: capitalize;
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-container input[type="range"] {
  width: 100%;
  height: 10px;
  -webkit-appearance: none;
  appearance: none;
  background: #1A3C66;
  border-radius: 5px;
  outline: none;
  margin: 0;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #C1594C;
  border: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #C1594C;
  border: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.savings-container {
  display: flex;
  flex-direction: row;
  text-align: center;
  gap: 20px;
  padding: 20px 0 30px 0;
  font-weight: bold;
  font-size: 18px;
}

.savings-title {
  font-weight: bold;
}

.savings-title::after {
  content: "";
  display: block;
  width: 100%;
  height: 8px;
  background: #209895;
  margin-top: 5px;
  border-radius: 4px;
  margin-right: 10px;
}

.financial-value, .environment-value {
  color: #209895;
  display: inline-block;
  min-width: 80px;
}


/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .slider-control-container {
    flex-direction: column;
    padding: 15px;
    gap: 20px;
  }
  
  .slider-image-container {
    width: 100%;
    order: -1;
  }
  
  .slider-toggle-container {
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    margin: 10px 0 30px 0;
  }
  
  .toggle-btn {
    width: 42px;
    height: 18px;
    margin: 0 10px;
    min-height: auto !important;
  }
  
  .toggle-btn::after {
    top: -2px;
    left: -3px;
    transition: left 0.3s;
  }
  
  .toggle-btn.factory::after {
    top: -2px;
    left: calc(100% - 21px);
  }
  
  .type-display-top {
    margin: 0;
  }
  
  .type-display-bottom {
    margin: 0;
    order: 3;
  }
  
  .slider-center-container {
    width: 100%;
  }
  
  .value-display {
    align-self: left;
  }
  
  .savings-container {
    align-self: center;
    text-align: center;
  }
  
  .financial-unit, .environment-unit {
    display: block;
  }
}