.theme-switch {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 26px;
  height: 50px;
  z-index: 8;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.theme-slider:before {
  position: absolute;
  content: "";
  height: 30px;
  width: 30px;
  left: -2px;
  bottom: -2px;
  -webkit-transition: 0.4s;
  transition: 0.4s;
  box-shadow: 0 0px 15px #2020203d;
  background: white url("../images/icons/night.png");
  background-repeat: no-repeat;
  background-position: center;
}

input:checked + .theme-slider {
  background-color: #ccc;
}

input:focus + .theme-slider {
  box-shadow: 0 0 1px #ccc;
}

input:checked + .theme-slider:before {
  -webkit-transform: translateY(-24px);
  -ms-transform: translateY(-24px);
  transform: translateY(-24px);
  background: white url("../images/icons/sunny.png");
  background-repeat: no-repeat;
  background-position: center;
}

.theme-slider.theme-round {
  border-radius: 34px;
}

.theme-slider.theme-round:before {
  border-radius: 50%;
}

@media (max-width: 768px) {
  .theme-switch {
    width: 20px;
    height: 40px;
  }

  .theme-slider:before {
    height: 24px;
    width: 24px;
  }

  input:checked + .theme-slider:before {
    -webkit-transform: translateY(-20px);
    -ms-transform: translateY(-20px);
    transform: translateY(-20px);
  }
}
