@keyframes panel-title-forward-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-40%);
  }
}
@keyframes panel-title-forward-in {
  from {
    opacity: 0;
    transform: translateX(60%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes panel-title-backward-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(60%);
  }
}
@keyframes panel-title-backward-in {
  from {
    opacity: 0;
    transform: translateX(-50%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ntrn--flyout {
  @include inactive_panel();

  .ntrn__sub {
    @include inactive_panel();
    @include mobile_panel();
    display: flex;
    flex-direction: column;
    transform: translate(100%,0);
    width: 100%;
    height: calc(100vh - 50px);
    position: absolute;
    overflow: hidden;
    right: 0;

    &--active {
      transform: translate(0,0);
    }
    &.ntrn--scroll {
      overflow-y: scroll;
    }
  }

  &.ntrn__sub--hidden:before,
  .ntrn__sub--hidden:before {
    opacity: 1;
    z-index: 1;
  }

  .ntrn__header {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: $mobile-header-padding;
    top: 0;
    background: $white;
    z-index: 1;
    transition: $transition;
    z-index: z('heavenly');

    &--shadow {
      box-shadow: 0px 3px 20px rgba(0, 0, 0, 0.05);
    }
  }

  .ntrn__title {
    position: relative;
    margin: 0;
    padding: 0 10px;
    flex: 1 0 auto;
    height: 100%;
    text-align: center;
    height: 30px;
    line-height: 25px;

    &-text {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      position: absolute;
      top: 0;
      right: 0;
      left: 0;
      display: block;
      height: 100%;
      animation-timing-function: cubic-bezier(.25,.90,0,1);
      animation-fill-mode: forwards;
      animation-duration: 600ms;
    }

    &--forward {
      .ntrn__title-text--old {
        animation-name: panel-title-forward-out;
      }
      .ntrn__title-text--new {
        animation-name: panel-title-forward-in;
      }
    }

    &--back {
      .ntrn__title-text--old {
        animation-name: panel-title-backward-out;
      }
      .ntrn__title-text--new {
        animation-name: panel-title-backward-in;
      }
    }
  }

  .ntrn__closesub {
    @include ms-icon('chevron-left', 16px, after);
    transition: $transition;
    background: $mobile-closesub-bg;
    border-radius: 50%;
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;

    &:after {
      position: relative;
      right: 0;
      top: 0;
      margin: 0;
    }

    &--hidden {
      opacity: 0;
      visibility: hidden;
    }
  }
}



