.canvasSidebar {
  @include euiScrollBar;

  width: 100%;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: absolute;
  top: 0;
  bottom: 0;
}

.canvasSidebar__pop {
  animation: sidebarPop $euiAnimSpeedFast $euiAnimSlightResistance;
}

.canvasSidebarFlyout {
  width: 350px;
  min-width: 350px;
}

.canvasSidebar__elementButtons {
  background: darken($euiColorLightestShade, 5%);
  margin-bottom: $euiSizeS;
}

.canvasSidebar__panel {
  border-bottom: $euiBorderThin;
  padding: $euiSizeS $euiSizeM;

  &--isEmpty {
    border-bottom: none;
  }

  .canvasSidebar__expandable:last-child {
    .canvasSidebar__accordion {
      margin-bottom: (-$euiSizeS);
    }

    .canvasSidebar__accordion:after {
      content: none;
    }

    .canvasSidebar__accordion.euiAccordion-isOpen:after {
      display: none;
    }
  }
}

.canvasSidebar__panel-noMinWidth .euiButton {
  min-width: 0;
}

.canvasSidebar__expandable {
  width: 100%;
}

.canvasSidebar__expandable + .canvasSidebar__expandable {
  margin-top: 1px;

  .canvasSidebar__accordion:before {
    display: none;
  }
}

.canvasSidebar__accordion {
  padding: $euiSizeM;
  margin: 0 (-$euiSizeM);
  background: $euiColorLightestShade;
  position: relative;

  &.euiAccordion-isOpen {
    background: transparent;
  }

  &:before,
  &:after {
    content: '';
    height: 1px;
    position: absolute;
    left: 0;
    width: 100%;
    background: $euiColorLightShade;
  }

  &:before {
    top: 0;
  }

  &:after {
    bottom: 0;
  }
}
.canvasSidebar__accordion.filtersSidebar__accordion {
  margin: auto;
}

.canvasSidebar__accordionContent {
  padding-top: $euiSize;
  padding-left: $euiSizeXS + $euiSizeS + $euiSize;
}

@keyframes sidebarPop {
  0% {
    opacity: 0;
  }

  1% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
