.cobalt-sidepanel {
  @apply c-bg-surface c-rounded-tl-xl c-rounded-bl-xl;

  position: fixed;

  top: 0;
  right: 0;
  z-index: theme("zIndex.sidepanel");

  height: 100vh;

  display: flex;

  flex-direction: column;

  transform: translateX(100%);

  transition-duration: 250ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-property: transform, box-shadow;

  will-change: transform;

  &--show {
    transform: translateX(0);
  }

  &--visible {
    @apply c-shadow-lg;
  }
}

.cobalt-sidepanel-overlay {
  position: fixed;

  top: 0;
  left: 0;

  z-index: theme("zIndex.sidepanel-below");

  background-color: fade-out(black, 0.2);

  opacity: 0;

  transition-duration: 250ms;
  transition-timing-function: ease-out;
  transition-property: opacity;

  will-change: opacity;
}

/* stylelint-disable unit-allowed-list */
.cobalt-sidepanel--visible + .cobalt-sidepanel-overlay {
  width: 100dvw;
  height: 100dvh;
}
/* stylelint-enable unit-allowed-list */
.cobalt-sidepanel--show + .cobalt-sidepanel-overlay {
  opacity: 1;
}

.cobalt-sidepanel__close {
  @apply c--mr-xs;
  min-height: 32px;
  min-width: 32px;
}
