@charset "UTF-8";
/**
 * POPUP and OVERLAY
 */


@popupBackgroundColor: @backgroundColor;

// A dark overlay to hide the rest of the page.
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  background:rgba(0,0,10,0);
  transition: all .3s ease;
  .zIndex('background',-1);
  &.is-active {
    pointer-events: auto;
    opacity: .7;
    background:rgba(0,0,10,1);
    .zIndex('overlay',0)
  }
}

// Positioning of the popup
.popup {
  opacity: 0;
  position: fixed;
  transition: all .3s ease;
  .zIndex('background',-1);
  pointer-events: none;
  top:50px;
  left:-14%;
  width: 33%;
  max-width:@pageWidth/2.5;
  max-height: 90vh;
  transform: translateX(-50%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  &.is-active {
    .zIndex('overlay', 1);
    opacity: 1;
    left:50%;
    pointer-events: auto;
  }
}

.popup-s,
.popup-se,
.popup-sw {
  transform: translateY(110%);
  &.is-active {
    bottom: 20px;
    top: inherit;
    right: inherit;
  }
}
.popup-s {
  left: 50%;
  transform: translate(-50%, 110%);
  &.is-active {
    left: 50%;
    transform: translate(-50%, 0);
  }
}
.popup-se {
  right: 20px;
  &.is-active {
    right: 20px;
    left: inherit;
    transform: none;
  }
}
.popup-sw {
  left: 20px;
  &.is-active {
    left: 20px;
    transform: none;
  }
}

.popup-n,
.popup-ne,
.popup-nw {
  &.is-active {
    bottom: inherit;
    top: 20px;
    right: inherit;
  }
}
.popup-n {
  &.is-active {
    left: 50%;
  }
}
.popup-ne {
  &.is-active {
    left: 20px;
    transform: none;
  }
}
.popup-nw {
  &.is-active {
    left: inherit;
    right: 20px;
    transform: none;
  }
}

.popup-w,
.popup-e {
  &.is-active {
    top: 50%;
    transform: translateY(-50%);
    bottom: inherit;
  }
}
.popup-e {
  &.is-active {
    right: 20px;
    left: inherit;
  }
}
.popup-w {
  &.is-active {
    left: 20px;
    right: inherit;
  }
}

// The main popup window
.popup-box {
  position: relative;
  background-color: @popupBackgroundColor;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.popup-content {
  width: 100%;
  padding: 15px;
  overflow-x:hidden;
  overflow-y:auto;
  color: contrast(@popupBackgroundColor, #222222, #f4f4f4);
  font-size: .9em;
  &:before {
    display: table;
    content: "";
  }
  &:after {
    display: table;
    clear: both;
    content: "";
  }
}

.popup-header {
  width: 100%;
  padding: 15px;
  background-color: darken(@popupBackgroundColor,5%);
  color: contrast(darken(@popupBackgroundColor,5%), #222222, #f4f4f4);
  border-bottom: 1px solid darken(@popupBackgroundColor,15%);
}

.popup-footer {
  width: 100%;
  padding: 2px 15px;
  background-color: darken(@popupBackgroundColor,15%);
  border-top: 1px solid darken(@popupBackgroundColor,25%);
  color: contrast(darken(@popupBackgroundColor,15%), #222222, #f4f4f4);
  font-size: .8em;
}

.popup-close {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 10px;
  cursor: pointer;
  background-color: transparent;
  border: 0;
  opacity: 0.5;
  -webkit-appearance: none;
  transition: all .3s ease;
  &:hover {
    opacity: 1;
  }
  &.has-icon:before {
    content: "";
    position: relative;
    display: inline-block;
    height: 1em;
    width: 1em;
    vertical-align: text-top;
    margin-top: 4px;
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
    background-color: inherit;
    background-blend-mode: multiply;
      //set background-image via icon.less
    }
  }

// Popup sizes
.popup-vSmall {
  font-size: .8rem;
  .popup-content {
    padding: 10px;
  }
  .popup-header {
    padding: 10px;
  }
  .popup-footer {
    padding: 2px 10px;
  }
  .btn {
    padding: 3px 11px;
    font-weight: 400;
  }
  .input {
    padding: 3px 7px;
    font-weight: 400;
  }
  .label {
    padding: 3px 7px;
    font-weight: 400;
  }
  .select {
    padding: 3px 7px 4px;
    font-weight: 400;
    background-size: 10px;
  }
}

.popup-vLarge {
  font-size: 1.2rem;
  max-width:@pageWidth/2;
}

  // Alert messages in popups
  .msg-vPopup {
    margin:0 -15px 15px;
    border-width: 1px 0 1px 0;
    border-radius:0;
  }

  // Form elements in popups
  .inputGroup-vPopup {
    .label {
      border-width: 0 1px;
      width: 100%;
      margin: 0;
      &:first-child{
        border-width:1px;
        border-bottom-width: 0;
      }
      &:last-child{
        border-width: 1px;
        border-top-width: 0;
      }
    }
    .select,
    .input,
    .btn {
      width:100%;
      margin: 0;
    }
  }


// => Popup Media Queries

.media-mixin(@break) when (@break = @breakSmall) {
}

.media-mixin(@break) when (@break = @breakMedium) {
  .popup {
    width:90%;
  }
}

.media-mixin(@break) when (@break = @breakLarge) {
}

.media-mixin(@break) when (@break = @break2x) {
}

.media-mixin(@break) when (@break = @breakPrint) {
}
