@import "../../theme.scss";

.radio-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  svg {
    width: 12px;
    height: 12px;
  }

  label {
    cursor: pointer;
  }

  &.has-label {
    .radio-root {
      padding: 0;
    }
  }

  .radio-root {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    background-color: transparent;
    outline: 0px;
    border: 0px;
    margin: 0px;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    appearance: none;
    text-decoration: none;
    padding: 9px;
    border-radius: 50%;

    &:hover {
      background-color: rgba(25, 118, 210, 0.04);
    }

    &.radio-unchecked {
      color: rgba(0, 0, 0, 0.6);
    }

    &.radio-checked {
      color: $secondary;
    }

    .radio {
      cursor: inherit;
      position: absolute;
      opacity: 0;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      margin: 0;
      padding: 0;
      z-index: 1;
    }

    .radio-icon {
      position: relative;
      display: flex;

      svg {
        user-select: none;
        width: 1em;
        height: 1em;
        display: inline-block;
        fill: currentcolor;
        flex-shrink: 0;
        transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
        transform: scale(1);
      }

      &.radio-sm svg {
        font-size: 1.25rem;
      }

      &.radio-md svg {
        font-size: 1.5rem;
      }

      &.radio-lg svg {
        font-size: 1.75rem;
      }
    }
  }
}
