.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%);

  will-change: transform;

  &--show {
    transform: translateX(0);
    animation: c-slide-in-from-right 250ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  &--hide {
    transform: translateX(100%);
    animation: c-slide-out-to-right 250ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  &--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;

  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;

  animation: c-fade-in 250ms ease-out forwards;
}

.cobalt-sidepanel--hide + .cobalt-sidepanel-overlay {
  opacity: 0;

  animation: c-fade-out 250ms ease-out forwards;
}

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