/*
 *
 *  IN LOCO
 *  www.inlocomedia.com
 *
 *  Copyright 2016 - All Rights Reserved.
 *
 *  -------- SUPERNOVA ---------
 *    modal component file
 *  ----------- *** ------------
 *
 */

@import "modal_variables";


.sn-modal {
  display: none;
  position: fixed;
  overflow: hidden;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $default-modal-zindex;
  -webkit-overflow-scrolling: touch;
  outline: 0;

  &.fade .sn-modal__wrap {
    @include translate3d(0, -25%, 0);
    @include transition-transform(0.3s ease-out);
  }
  &.in .sn-modal__wrap {
    @include translate3d(0, 0, 0);
  }


  // DIALOG MODAL

  &.sn-modal--dialog {
    .sn-modal__content {
      padding: 8px;
    }
    .sn-modal__header {
      border: 0;
      line-height: 1.8;
      padding-bottom: 8px;
    }
    .sn-modal__header__title {
      padding-right: 0;
    }
    .sn-modal__header__close-button {
      display: none;
    }
    .sn-modal__body {
      padding: 8px 16px 8px 16px;
      color: grey;
      font-weight: 300;
    }
    .sn-modal__footer {
      border: 0;
      padding-top: 24px;
    }
  }
}


.sn-modal__wrap {
  position: relative;
  width: auto;
  margin: 10px;
}

.sn-modal__content {
  position: relative;
  background-color: #FFF;
  border: 1px solid $default-modal-border-color;
  border-radius: $default-modal-border-radius;
  box-shadow: 0 3px 9px rgba(0,0,0,.5);
  background-clip: padding-box;
  outline: 0;
}

.sn-modal__header {
  position: relative;
  padding: 16px;
  border-bottom: 1px solid $default-modal-border-color;
  .sn-modal__header__title {
    display: inline-block;
    font-size: 20px;
    margin: 0;
    line-height: 1.3;
    padding-right: 52px;
  }
  .sn-modal__header__close-button {
    position: absolute;
    top: 10px;
    right: 16px;
    height: 38px;
    padding: 0 8px;
    min-width: 0;
    color: rgb(0,0,0);
    i {
      margin-right: 0;
    }
  }
}

.sn-modal__body {
  position: relative;
  padding: 16px;
}

.sn-modal__footer {
  padding: 16px;
  text-align: right;
  border-top: 1px solid $default-modal-border-color;
  clear: both;
  .sn-button {
    margin-top: 0;
    margin-bottom: 0;
  }
}

.sn-modal__backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  visibility: hidden;
  opacity: 0;
  z-index: $default-modal-obfuscator;
  background-color: #000;
  &.is-visible { opacity: .3; }
}

.sn-modal.sn-modal--open {
  display: block;
  overflow-x: hidden;
  overflow-y: auto;

  &.sn-modal--centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  ~.sn-modal__backdrop {
    display: block;
    visibility: visible;
    opacity: .3;
  }
}

//.sn-modal--open {
//  overflow: hidden;
//}
//
//.sn-modal--open .sn-modal {
//  display: block;
//  overflow-x: hidden;
//  overflow-y: auto;
//}

// MEDIA QUERIES

@media (min-width: $tablet-xxsmall) { // ~560px
  .sn-modal__wrap {
    width: $default-modal-width;
    margin: 30px auto;
  }
  .sn-modal--sm .sn-modal__wrap { width: 320px; }
}

@media (min-width: $screen-xsmall) { // ~992px
  .sn-modal--lg .sn-modal__wrap { width: $default-modal-width-lg; }
}

@media (min-width: $screen-small) { // ~1024px
  .sn-modal--xl .sn-modal__wrap { width: $default-modal-width-xl; }
}

@media (min-width: $screen-small) { // ~1024px
  .sn-modal--xxl .sn-modal__wrap { width: $default-modal-width-xxl; }
}
