@import "../../themes/ionic.globals";

// Toolbar
// --------------------------------------------------

ion-toolbar {
  box-sizing: border-box;
  position: relative;
  z-index: $z-index-toolbar;

  display: flex;
  overflow: hidden;

  flex-direction: row;
  align-items: center;
  justify-content: space-between;

  width: 100%;

  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;

  contain: content;
}

ion-toolbar ion-title {
  box-sizing: border-box;
}

.toolbar-background {
  @include position(0, null, null, 0);

  position: absolute;
  z-index: $z-index-toolbar-background;

  width: 100%;
  height: 100%;

  border: 0;
  transform: translateZ(0);

  pointer-events: none;

  contain: strict;
}

ion-buttons {
  @include margin(0, 2px);

  display: block;

  transform: translateZ(0);

  pointer-events: none;
}

ion-buttons button,
ion-buttons a,
ion-buttons input,
ion-buttons textarea,
ion-buttons div {
  pointer-events: auto;
}


// Transparent Toolbar
// --------------------------------------------------

.toolbar[transparent] .toolbar-background {
  border-color: transparent;
  background: transparent;
}


// TODO this is a temp hack to fix segment overlapping ion-nav-item
ion-buttons,
.bar-button-menutoggle {
  z-index: $z-index-toolbar-buttons;

  transform: translateZ(0);
}


// Toolbar Buttons
// --------------------------------------------------

.bar-button {
  @include margin(0);
  @include padding(0);
  @include text-align(center);
  @include appearance(none);

  position: relative;
  display: inline-block;

  line-height: 1;
  text-decoration: none;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;

  cursor: pointer;

  vertical-align: top; // the better option for most scenarios
  vertical-align: -webkit-baseline-middle; // the best for those that support it

  user-select: none;

  &:active,
  &:focus {
    outline: none;
  }
}

.bar-button::after {
  @include position(-7px, -2px, -6px, -2px);

  // used to make the button's hit area larger
  position: absolute;

  content: "";
}


// Menu Toggle
// --------------------------------------------------

.bar-button-menutoggle {
  display: flex;

  align-items: center;
}

