.grit-switch {
  --transition-speed: 150ms;
  overflow: hidden;
  max-width: 64px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.grit-switch .grit-switch__track {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--grit-switch-track-padding);
  width: var(--grit-switch-width);
  height: var(--grit-switch-height);
  border-radius: var(--grit-switch-border-radius);
  background: var(--grit-switch-background-off);
  box-sizing: border-box;
  transition: all var(--transition-speed) var(--transition-curve-deceleration);
}

.grit-switch .grit-switch__track.hasLabel {
  margin-bottom: 4px;
}

.grit-switch.grit-switch--on .grit-switch__track {
  background: var(--grit-switch-background-on);
}

.grit-switch.grit-switch--disabled .grit-switch__track {
  background: var(--grit-switch-disabled-background-off);
}

.grit-switch.grit-switch--disabled.grit-switch--on .grit-switch__track {
  background: var(--grit-switch-disabled-background-on);
}

.grit-switch .grit-switch__thumb {
  position: relative;
  border-radius: var(--grit-switch-thumb-border-radius);
  background: var(--grit-switch-thumb-background);
  color: var(--grit-switch-thumb-color);
  width: calc(
    var(--grit-switch-height) - calc(var(--grit-switch-track-padding) * 2)
  );
  height: 100%;
  box-shadow: var(--grit-switch-thumb-box-shadow);
  box-sizing: border-box;
  left: 0%;
  transform: translateX(0%);
  transition: all var(--transition-speed) var(--transition-curve-deceleration);
}

.grit-switch.grit-switch--disabled .grit-switch__thumb {
  background: var(--grit-switch-disabled-thumb-background);
  box-shadow: var(--grit-switch-disabled-thumb-box-shadow);
}

.grit-switch.grit-switch--on .grit-switch__thumb {
  left: 100%;
  transform: translateX(-100%);
}

.grit-switch .grit-switch__label {
  font-family: var(--grit-switch-label-font-family);
  font-size: var(--grit-font-size-0);
  color: var(--grit-switch-label-color);
  font-weight: var(--grit-switch-label-font-weight);
  position: relative;
  line-height: 1em;
  width: auto;
  text-align: center;
  top: 0;
  white-space: nowrap;
  margin: 4px 0 0;
}

.grit-switch .grit-switch__label-wrapper {
  display: flex;
  flex-direction: row;
  position: relative;
  transition: all var(--transition-speed) var(--transition-curve-deceleration);
}

.grit-switch__label {
  transition: all var(--transition-speed) var(--transition-curve-deceleration);
}

.grit-switch__label--on {
  opacity: 0;
  left: 0;
}

.grit-switch__label--off {
  opacity: 0;
  right: 0;
}

.grit-switch.grit-switch--on .grit-switch__label--on {
  opacity: 1;
  transform: translateX(-50%);
  transition: all var(--transition-speed) var(--transition-curve-deceleration);
  left: 50%;
}

.grit-switch.grit-switch--off .grit-switch__label--off {
  opacity: 1;
  right: 50%;
  transform: translateX(50%);
  transition: all var(--transition-speed) var(--transition-curve-deceleration);
}

.grit-switch-position--top .grit-switch__label {
  bottom: 0px;
  top: auto;
  margin: 0 0 4px;
}

.grit-switch-position--top {
  display: inline-flex;
  flex-direction: column;
  vertical-align: top;
  margin-top: 4px;
  margin-bottom: 0px;
}

.grit-switch-position--top .grit-switch__track {
  order: 2;
}

.grit-switch-position--top .grit-switch__label-track {
  order: 1;
}

grit-wc-switch.grit-component.grit-switch.grit-switch--disabled {
  pointer-events: none;
}
