//
// Modals
// --------------------------------------------------


.modal {
  background: rgba(255, 255, 255, .9);
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  padding: $space-2;
  z-index: $z4;
  opacity: 0;
  visibility: hidden;
  transition: all .2s;
  overflow-x: hidden;
  overflow-y: auto;
}


.modal__content {
  @include prefix((animation-duration: .15s), webkit);
  @include prefix((animation-fill-mode: both), webkit);
  background: $fill-white;
  border: $border;
  border-radius: 3px;
  margin: 0 auto;
  position: relative;
  padding: $space-4;
}


.modal__close {
  width: 3.5rem;
  height: 3.5rem;
  padding: $space-2;
  float: right;
  margin: -2rem -2rem 0 0;

  &:hover {
    cursor: pointer;

      .modal__close-icon {
        fill: $fill-gray-darker;
      }
  }
}


.modal__close-icon {
  width: 1.5rem;
  fill: $fill-gray;
}


// Add this class to the body element to show the modal
.js-show-modal {
  overflow: hidden;

  .modal {
    visibility: visible;
    opacity: 1;
  }

  .modal__content {
    @include prefix((animation-name: modal__content-scale), webkit);
  }
}


// Scale up animation for modal content
@include keyframes(modal__content-scale) {
  from {
    opacity: 0;
    @include prefix((transform: scale3d(.6, .6, .6)), webkit);
  }

  50% {
    opacity: 1;
  }
}
