@import "../global";

:root {
  --dialog-width: var(--dialog-m);
}

.n-dialog {
  background: #ffffff;
  min-width: 320px;
  max-width: calc(100vw - calc(2 * var(--grid-unit)));
  margin: auto;
  outline: none;
  overflow: hidden;

  border-radius: var(--radius-default);
  width: var(--dialog-width);
  box-shadow: var(--box-shadow-m);

  @each $size, $name in $sizes {
    &.size-#{$name} {
      --dialog-width: var(--dialog-#{$size});
    }
  }

  .n-module__content {
    min-height: 80px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  .n-module__header {
    border-bottom: var(--accent-border-width) solid var(--color-grey-border);
    border-radius: var(--radius-default) var(--radius-default) 0 0;
    background: var(--color-grey-background);
    padding: var(--space-s) 0;
  }

  .n-module__footer {
    border-top: 1px solid var(--color-grey-border);
  }
}

.n-dialog__wrapper {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
