@use 'sass:math';

.pwv-Toolbar {
  display: flex;
  position: relative;
  min-height: $toolbarItem__height;

  @include toolbar;
  &--wrap {
    flex-wrap: wrap;
  }
  &--paddingRight {
    padding-right: $toolbarItem__MinWidth + 5px;
  }
  &--center {
    justify-content: center;
  }
  &ItemGroup {
    display: flex;

    &--pushLeft {
      margin-left: auto;
    }

    &--pushRight {
      position: absolute;
      right: 0;
      top: 0;
      z-index: 2;
    }
  }

  &Item {
    @include toolbarItem;
  }

  &Button {
    @include toolbarItem;

    &:focus {
      outline: none;
    }
    &:not(:disabled) {
      &:hover {
        @include toolbarItem__Hover;
      }
      &:focus {
        @include toolbarItem__Focus;
      }
      &:active {
        @include toolbarItem__Active;
      }
    }

    &--selected {
      @include toolbarItem__Selected;
    }

    &--disabled {
      @include toolbarItem__Disabled;
    }

    .pwv-icon {
      display: block;
      height: $toolbarItem__IconSize;
      svg {
        height: $toolbarItem__IconSize;
      }
    }
    &__Text {
      display: inline-block;
      padding: 0 0.5rem;
    }
  }

  .pwv-CustomButtons {
    display: flex;
  }

  .pwv-DropdownPanel {
    z-index: 5;
    top: 48px;
  }

  input {
    border: none;
    font-size: 1em;
    height: math.div($toolbarItem__height, 1.5);
    box-sizing: border-box;
    padding: 3px 6px;
  }

  .pwv-ToolbarSeparator {
    display: flex;
    justify-content: center;
    align-items: center;
    width: math.div($toolbarItem__MinWidth, 2);

    .pwv-WebViewer--sm &,
    .pwv-WebViewer--md & {
      width: math.div($toolbarItem__MinWidth, 4);
    }

    .pwv-WebViewer--sm & {
      display: none;
    }

    span {
      display: block;
      background-color: $toolbarItem__TextColor;
      opacity: 0.2;
      width: 1px;
      height: 50%;
      box-sizing: border-box;
    }
  }
}
