/* Base
 ***************************************/


v-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: $v-modal-zindex;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: $v-modal-backdrop;
  padding: $v-modal-spacing * 2 $v-modal-spacing;

  v-close {
    position: absolute;
    top: 0;
    right: 0;
  }
}

v-dialog {
  display: block;
  position: relative;
  pointer-events: auto;
  background: $v-dialog-background;
  z-index: 0;
  min-width: 240px;
  outline: 0;
  max-width: $v-dialog-md-width;

  &:focus {
    outline: 0;
  }
}

v-dialog[middle] {
  max-height: 100%;
  overflow-y: auto;
}

v-dialog[fit] {
  width: 100%;
}

v-dialog[small] {
  max-width: $v-dialog-sm-width;

  @media (min-width: $v-dialog-sm-width) {
    min-width: $v-dialog-sm-width;
  }
}

v-dialog[medium] {
  max-width: $v-dialog-md-width;

  @media (min-width: $v-dialog-md-width) {
    min-width: $v-dialog-md-width;
  }
}

v-dialog[large] {
  max-width: $v-dialog-lg-width;

  @media (min-width: $v-dialog-lg-width) {
    min-width: $v-dialog-lg-width;
  }
}

v-close {
  display: inline-block;
  z-index: 10;
  cursor: pointer;
  outline: 0;
  user-select: none;

  &:hover,
  &:focus {
    outline: 0;
  }
}

[v-modal-open] {
  overflow: hidden;
}

@if $v-modal-use-flexbox {
  v-modal {
    display: flex;
    justify-content: center;
  }

  v-dialog {
    align-self: flex-start;
  }

  v-dialog[middle] {
    align-self: center;
  }
}
@else {
  v-dialog {
    margin: 0 auto;
  }
  v-dialog[middle] {
    top: 50%;
    transform: translateY(-50%);
  }
}
