@use '../abstracts' as *;

/* Atom checkbox */
yap-checkbox {
  display: flex;
  align-items: center;
}

.a-checkbox {
  $this: &;
  display: inline-flex;
  align-items: center;
  margin-bottom: toRem(10);

  &__input {
    @extend %visuallyHidden;
  }

  &--circle {
    #{$this}__checkmark {
      position: relative;
      height: toRem(18);
      width: toRem(18);
      border-width: 2px;
      border-style: solid;
      border-radius: toRem(9);
      cursor: pointer;

      &:before {
        content: '';
        display: none;
        position: absolute;
        left: toRem(5);
        top: toRem(2);
        width: toRem(4);
        height: toRem(8);
        border-width: 0 1px 1px 0;
        border-style: solid;
        -webkit-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
        transform: rotate(45deg);
      }
    }
  }

  &__text {
    padding-left: toRem(7);
    cursor: pointer;
  }

  &__input:checked ~ #{$this}__checkmark {
    &:before {
      display: block;
    }
  }

  &__input:disabled ~ #{$this}__checkmark,
  &__input:disabled ~ #{$this}__text {
    opacity: 0.7;
    cursor: not-allowed;
  }
}
