@import '../helpers/variables';

.checkout-chip {
  position: relative;
  flex: 0 0 auto;

  &__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;

    &:checked + .checkout-chip__label {
      border-color: $blue;

      .checkout-chip__label-top,
      .checkout-chip__label-bottom {
        color: $blue;
      }
    }

    &:focus-visible + .checkout-chip__label {
      outline: 2px solid $blue;
      outline-offset: 2px;
    }
  }

  &__label {
    background: $white;
    border: 1px solid $gray;
    border-radius: 16px;
    padding: 6px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s;
    width: 78px;
    margin-bottom: 0;
  }

  &__label-top {
    font-family: Roboto, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 20px;
  }

  &__label-bottom {
    font-family: Roboto, sans-serif;
    font-weight: 400;
    font-size: 0.87rem;
    line-height: 22px;
    text-align: center;
  }
}

.form-row_validation-error {
  .checkout-chip__label {
    border: 1px solid $red;
  }
}
