@use '../../../scss/variables' as *;
@use '../../../scss/mixins';

.slider {
  background-color: var(--background-color);
  cursor: pointer;
  width: 100%;
  max-width: $max-content-width;
  padding: 0; // IE11
  appearance: none;

  &:focus {
    outline: 0;
  }

  &:focus-visible {
    outline: $focus-outline;
  }

  // Track
  &::-webkit-slider-runnable-track {
    background: var(--primary-slider-color);
    height: 4px;
    border-radius: 2px;
  }

  &::-moz-range-track {
    background: var(--primary-slider-color);
    height: 3px;
    border-radius: 2px;
  }

  &::-ms-track {
    border-color: var(--primary-slider-color);
    height: 3px;
    border-width: 7px 0;
    color: transparent;
  }

  &::-ms-fill-lower {
    background: var(--secondary-slider-color);
  }

  &::-ms-fill-upper {
    background: var(--secondary-slider-color);
  }

  // Thumb
  &::-webkit-slider-thumb {
    background: var(--secondary-slider-color);
    box-shadow: 0 1px 3px 0 var(--overlay-color);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--primary-slider-color);
    appearance: none;
    transition: 0.15s ease-in-out;
    transform: translateY(calc(-50% + 2px));

    &:active {
      transform: translateY(calc(-50% + 2px)) scale(1.15);
    }
  }

  &::-moz-range-thumb {
    background: var(--secondary-slider-color);
    box-shadow: 0 1px 3px 0 var(--overlay-color);
    height: 15px;
    width: 15px;
    border-radius: 50%;
    border: 1px solid var(--primary-slider-color);
    appearance: none;
    transition: 0.15s ease-in-out;

    &:active {
      transform: scale(1.15);
    }
  }

  &::-ms-thumb {
    background: var(--secondary-slider-color);
    box-shadow: 0 1px 3px 0 var(--overlay-color);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--primary-slider-color);
    appearance: none;
    transition: 0.15s ease-in-out;

    &:active {
      transform: scale(1.15);
    }
  }

  &::-ms-tooltip {
    display: none;
  }
}
