@use "../../style/index" as mixins;

$prefix: "adui-layout";

.#{$prefix} {
  &-header {
    position: relative;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fff;
    box-shadow: 0 1px 0 0 rgba(223, 223, 223, 0.4),
      0 1px 10px 0 rgba(0, 0, 0, 0.03);
  }
  &-header_affixed {
    position: sticky;
    z-index: 13;
    top: 0;
    left: 0;
    width: 100%;
  }
  &-aside {
    flex: none;
    width: 240px;
    background-color: #fff;
    box-shadow: 1px 0 0 0 rgba(223, 223, 223, 0.45);
  }
  &-asideInner {
    height: 100%;
    background-color: #fff;
  }
  &-asideContent {
    height: 100%;
    overflow: hidden;

    &:hover {
      @include mixins.overlay();
    }
  }
  &-aside_affixed {
    position: sticky;
    z-index: 12;
    top: 72px;
    left: 0;
    max-height: calc(100vh - 72px);
  }
  &-aside_affixed_alone {
    max-height: calc(100vh - 72px);
  }
  &-aside_collapsible {
    width: 0;
    z-index: 14;

    .#{$prefix}-asideInner {
      position: fixed;
      z-index: 13;
      top: 0;
      left: 0;
      width: 240px;
      height: 100%;
      opacity: 0.6;
      transform: translateX(-100%);
      transition: all var(--motion-duration-slow) var(--ease-in-out);
      margin-top: 0;
    }

    &:not(.#{$prefix}-aside_collapsed) {
      .#{$prefix}-asideInner {
        opacity: 1;
        transform: translateX(0);
      }

      .#{$prefix}-asideMask {
        opacity: 1;
        visibility: visible;
      }
    }

    .#{$prefix}-asideContent {
      height: calc(100vh - 72px);
      @include mixins.overlay();
    }
  }

  &-asideMask {
    position: fixed;
    z-index: 12;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: all var(--motion-duration-base) var(--ease-in-out);
  }
  &-asideBackButton {
    padding: 12px 8px;
    box-shadow: 0 1px 0 rgba(107, 107, 107, 0.15);

    button {
      width: 48px;
      height: 48px;

      svg {
        width: 20px;
        height: 20px;
      }
    }
  }
  &-main {
    flex: 1;
    max-width: calc(100vw - 240px);
  }
  &-mian-fix {
    margin-top: 72px;
  }
}
