/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
@import "~@bentley/ui-core/lib/ui-core/z-index";
@import "variables";

.nz-toolbar-toolbar {
  display: inline-block;
  position: relative;
  pointer-events: auto;

  > .nz-panels {
    @include uicore-z-index(toolbar-panels);
  }

  > .nz-expanded {
    pointer-events: none;
    position: absolute;
  }

  &.nz-vertical {
    > .nz-expanded {
      > * > * {
        display: grid;
        height: $nz-desktop-item-height;
        margin-top: $nz-desktop-space-between-toolbar-items;
      }
    }

    &.nz-panel-alignment-start {
      > .nz-panels {
        > * > * {
          align-content: start;
        }
      }
    }

    &.nz-panel-alignment-end {
      > .nz-panels {
        > * > * {
          align-content: end;
        }
      }
    }
  }

  &.nz-horizontal {
    > .nz-expanded {
      display: flex;

      > * > * {
        width: $nz-desktop-item-width;
        margin-left: $nz-desktop-space-between-toolbar-items;
        display: grid;
        justify-content: center;
      }
    }

    > .nz-panels {
      > * > *{
        float: left;
      }
    }

    &.nz-panel-alignment-start {
      > .nz-panels {
        > * > * {
          justify-content: start;
        }
      }
    }

    &.nz-panel-alignment-end {
      display: flex;
      justify-content: flex-end;

      > .nz-panels {
        > * > * {
          justify-content: end;
        }
      }
    }
  }

  &.nz-direction-left {
    > .nz-expanded {
      left: $nz-items-border-width;
      transform: translateX(-100%);
    }
  }

  &.nz-direction-right {
    > .nz-expanded {
      left: 100%;
      transform: translateX(-$nz-items-border-width);
    }
  }

  &.nz-direction-bottom {
    > .nz-expanded {
      top: 100%;
      transform: translateY(-$nz-items-border-width);
    }
  }
}
