/**
 * Featherlight (LiteCart Edition) – ultra slim jQuery lightbox
 * Version 1.7.9 - http://noelboss.github.io/featherlight/
 *
 * Copyright 2017, Noël Raoul Bossart (http://www.noelboss.com)
 * MIT Licensed.
**/

@blur-size: 10px;
@gutter-size: 20px;
@border-radius: 4px;

body.featherlight-open {
  /* prevent scrolling */
  overflow: hidden;
  padding-right: 15px;

  > *:not(.featherlight):not(#animated-cart-item) {
    /* blur backdrop */
    filter: blur(@blur-size);
  }
}

.featherlight {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow-y: auto;

  text-align: center;
  /* insures that the ::before pseudo element doesn't force wrap with fixed width content; */
  white-space: nowrap;

  cursor: pointer;
  background: #333;
  /* IE8 "hack" for nested featherlights */
  background: rgba(0, 0, 0, 0);

  animation: featherlight-fadein 0.1s linear;

  * {
    box-sizing: border-box;
  }

  /* support for nested featherlights. Does not work in IE8 (use JS to fix) */
  &.active {
    background: rgba(0, 0, 0, 0.5);
  }

  &:before {
    /* position: trick to center content vertically */
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
  }

  .featherlight-content {
    position: relative;

    /* position: centering vertical and horizontal */
    text-align: left;
    vertical-align: middle;
    display: inline-block;

    margin: @gutter-size;
    padding: @gutter-size;

    background: #fff;
    cursor: auto;
    box-shadow: 0 5px @gutter-size rgba(0,0,0,0.25);
    border-radius: @border-radius;

    /* reset white-space wrapping */
    white-space: normal;

    animation: featherlight-fadein 0.5s linear;
  }

  .featherlight-close-icon {
    position: absolute;
    top: -.75em;
    right: -.75em;
    z-index: 9999;

    width: 2em;
    line-height: 2em;

    background: #c00;
    border-radius: @border-radius;
    border: none;
    color: #fff;
    font-weight: bold;

    cursor: pointer;
    text-align: center;
    font-family: Arial, sans-serif;
  }

  .featherlight-content > img {
    max-width: 100%;
    max-height: ~"calc(100vh - 80px)";
  }

  .featherlight-content > iframe {
    width: 100%;
    height: 100%;
    border: none;
  }
}

.featherlight-loading {
  .featherlight-loader {
    border: @gutter-size solid #f3f3f3;
    border-top: @gutter-size solid #c00;
    border-radius: 50%;
    width: 128px;
    height: 128px;
    animation: featherlight-spin 2s linear infinite;
    opacity: 0.25;
  }
  .featherlight-content {
    background: none;
    box-shadow: none;
  }
}

/* Stacked modals */
.featherlight {
   perspective: 2048px;

  .featherlight-content {
    transition: transform 0.25s linear, filter 0.25s linear;
    transform: -400px;
    transform: scale(0.8) rotateY(45deg) translateZ(-400px);
    transform-style: preserve-3d;
    filter: blur(@blur-size/2);
  }

  &.active .featherlight-content {
    transform: none !important;
    filter: none !important;
  }
}

@keyframes featherlight-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes featherlight-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}