@use '../abstracts' as *;

/* Organism - tabs */

.o-tabs {
  display: flex;
  flex-direction: column;
  height: auto;

  &__list {
    display: flex;
    margin-bottom: 15px;

    &__btn[role='tab'] {
      position: relative;
      flex: 1;
      padding-bottom: toRem(10);
      cursor: pointer;

      &:before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-bottom-width: toRem(3);
        border-bottom-style: solid;
        border-radius: toRem(5);
      }

      &[aria-selected='true'] {
        @include outlineOnFocus($border-radius: 3px);
        font-weight: bold;
      }
    }
  }

  &__panels {
    &__item {
      @include outlineOnFocus($border-radius: 3px);

      .a-h4 {
        margin-bottom: toRem(14);
        font-size: toRem(14);
      }

      .a-p {
        strong {
          font-weight: 500;
        }
      }

      &__content {

        &__actions {
          position: relative;
          display: flex;
          justify-content: space-between;
          width: 100%;
          padding: toRem(10) 0;

          &:before {
            @extend %contentBeforeAbsoluteFull;
            left: -10px;
            right: -10px;
          }

          &__text {
            position: relative;
            z-index: 1;
            display: inline-flex;
            align-items: center;
            gap: toRem(5);
            padding-right: toRem(10);
          }
          &__buttons {
            display: flex;
            justify-content: flex-end;
            gap: toRem(5);
            cursor: pointer;
          }
        }
      }

      &.is-hidden {
        display: none;
      }
    }

    .form-group {
      &::before {
        content: '';
        position: absolute;
        top: toRem(-22);
        width: 100%;
        border-top-width: 1px;
        border-top-style: solid;
      }

      .a-btn[type='submit'] {
        float: right;
        clear: both;
        margin-top: 15px;
      }
    }
  }
}
