.sui-o-side-panel {
  z-index: $sui-z-index-o-side-panel;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: rem(400);
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s $sui-curve-easeInOutCubic, box-shadow .3s, bottom .3s;
  background: $sui-color-brand-denim-200;
  border-left: $sui-size-border solid $sui-color-border;
  display: flex;
  flex-direction: column;

  &.as--left {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    border-left: none;
    border-right: $sui-size-border solid $sui-color-border;
  }

  &.as--bottom,
  &.as--top {
    width: 100%;
    height: rem(320);
    right: 0;
    left: 0;
    top: auto;
    transform: translateY(100%);
    border-left: none;
    border-top: $sui-size-border solid $sui-color-border;

    &.as--open {
      transform: translateY(0);
    }
  }

  &.as--top {
    top: 0;
    bottom: auto;
    border-top: none;
    transform: translateY(-100%);
    border-bottom: $sui-size-border solid $sui-color-border;

    &.as--open {
      transform: translateY(0);
    }
  }

  &.as--sticky {
    position: sticky;
    transform: none !important;
    float: right;
    height: rem(320);
    max-height: 0;
    border: none;
    transition: max-height .3s ease-out, border .3s;

    &.as--left {
      float: left;
    }

    &.as--top,
    &.as--bottom {
      float: none;
    }

    &.as--open {
      z-index: 25;
      max-height: rem(320);
      border: $sui-size-border solid $sui-color-border;
    }
  }

  &.as--open {
    z-index: $sui-z-index-o-side-panel-open;
    transform: translateX(0);
    box-shadow: 0 0 rem(10) rgba(0, 0, 0, .1);
  }

  &__header {
    position: relative;
    flex: none;
    background: $sui-color-brand-denim-100;
    border-bottom: $sui-size-border solid $sui-color-border;
    display: flex;
    flex-wrap: nowrap;
  }

  &__close {
    font-size: $sui-font-size-xl;
    font-family: $sui-font-family-secondary;
    padding: 0 $sui-space-md;
    font-weight: 300;
    order: 1;
    margin-left: auto;
    border-left: $sui-size-border solid $sui-color-border;
    opacity: .4;
    transition: .2s;

    &:hover,
    &:focus {
      opacity: 1;
    }
  }

  &__title {
    font-weight: 300;
    margin: 0;
    font-size: $sui-font-size-ml;
    padding: $sui-space-sm $sui-space-md;
  }

  &__body {
    flex-grow: 1;
    position: relative;
    padding: $sui-space-md;
  }

  &__scroll {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: $sui-space-md;

    & > :first-child {
      margin-top: 0;
    }
  }

  &__footer {
    flex: none;
    overflow: hidden;
    margin-top: auto;
    background: $sui-color-brand-denim-100;
    border-top: $sui-size-border solid $sui-color-border;
    padding: $sui-space-sm;
  }
}

.sui-o-side-panel__sticky-sibling {
  min-height: rem(640);
  margin-right: rem(400);
}
