.ui-accordeon {
  &.ui-accordeon-horizontal {
    display: flex;
    position: relative;
    > .ui-accordeon-item {
      padding: 10px;
      > .ui-accordeon-item__header {
        grid-template-areas: "icon title counter right";
        gap: 5px;
        padding: 0;
        padding-right: 15px;
        .ui-header__title {
          padding: 0;
        }
        .ui-accordeon-item__header__counter {
          border-radius: 5px;
          font-weight: 400;
          min-width: 30px;
          height: fit-content;
          line-height: initial;
          width: fit-content;
          margin-left: 0;
        }
        .ui-accordeon-item__header__right {
          ui-button {
            .ui-btn__icon {
              padding: 5px;
              width: auto;
              ui-icon {
                font-size: 0.8rem;
              }
            }
          }
        }
        &.expanded {
          > .ui-header__title {
            text-decoration: underline;
          }
        }
      }

      > .ui-accordeon-item__body {
        position: absolute;
        left: 0;
        right: 0;
        top: 40px;
        padding: 10px;
      }
    }
  }

  $base: unquote(".ui-accordeon-item");

  .ui-accordeon-item {
    &__header {
      display: grid;
      flex-wrap: wrap;
      align-items: center;

      grid-template-columns: auto 1fr auto auto;
      grid-template-areas: "icon title right counter";

      .ui-header__icon {
        grid-area: icon;
      }

      .ui-header__title {
        grid-area: title;
      }

      &__right {
        display: flex;
        flex-direction: row;
        align-items: center;
        grid-area: right;
        justify-content: end;
      }

      @media only screen and (min-width: $breakpoints-xs) and (max-width: $breakpoints-sm) {
        & {
          grid-template-columns: auto 1fr auto;
          grid-template-areas:
            "icon title counter"
            "right right right";
        }

        &__right {
          display: none;
        }
      }

      &.expanded {
        #{$base}__header__right {
          display: flex;
        }
      }

      &__counter {
        grid-area: counter;
        height: 2rem;
        width: 2rem;
        line-height: 2rem;
        text-align: center;
        grid-area: counter;
      }

      &:hover {
        cursor: pointer;
      }
    }

    &__body {
      overflow: visible;
      // max-height: 2000px;

      &.aurelia-hide {
        display: none !important;
        max-height: 0;
        overflow: hidden;
      }
      ui-table .ui-table > thead {
        position: initial;
      }
    }
  }
}
