@import '../mixins/responsive';
@import '../variables';

.checkbox {
  margin: 0;
  line-height: 2rem;
  background-color: $brand-white;
  transition: background-color .3s;

  @include responsive(sm) {
    margin: 0.3rem 0;
  }

  &.active {
    background-color: #E1E1E1;

    @include responsive(sm) {
      background-color: $brand-white;
    }
  }

  &-label {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 2;

    @include responsive(sm) {
      display: inline-block;
      padding: 0;
      font-weight: 400;
      font-size: 1.2rem;
      line-height: 2rem;
    }

    &:hover {
      cursor: pointer;
    }
  }

  &-container {
    margin-top: -1px;
    border: 1px solid #e1e1e1;

    &:nth-child(2) {
      border-top-left-radius: 0.2rem;
      border-top-right-radius: 0.2rem;
    }

    &:last-child {
      border-bottom-left-radius: 0.2rem;
      border-bottom-right-radius: 0.2rem;
    }

    @include responsive(sm) {
      margin: 0;
      display: inline-block;
      width: 50%;
      border: none;
    }
  }

  &-control {
    appearance: none;
    display: inline-block;
    position: absolute;
    right: 3rem;
    outline: none;
    background-color: transparent;
    width: 2.1rem;
    height: 2.1rem;
    border: none;
    vertical-align: middle;
    margin-right: .1rem;
    text-decoration: none;
    white-space: nowrap;
    outline: none!important; // fix bootstrap

    @include responsive(sm) {
      position: relative;
      right: auto;
      width: 1.4rem;
      height: 1.4rem;
      border: 1px solid #ccc;
    }

    &:before {
      content: "";
      position: absolute;
      transition: background-color 0.3s;
    }

    &:checked {
      border-color: $brand-primary;

      &:before {
        background-color: $brand-primary;
        content: "";
        width: 2rem;
        height: 2rem;
        border-radius: 50%;

        @include responsive(sm) {
          border-radius: 0;
          width: 1.3rem;
          height: 1.3rem;
        }
      }
    }
  }
}
