/**
 * 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: 3px;
@gutter-size: 2em;
@border-radius: 8px;

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

.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;

  z-index: 999;

  animation: featherlight-fadein 100ms linear;
  backdrop-filter: saturate(0%) blur(@blur-size);

  backdrop-filter: blur(3px) grayscale(1);
  z-index: 999;

  * {
    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: start;
    vertical-align: middle;
    display: inline-block;

    margin: 1em;

    border-radius: @border-radius;

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

    animation: featherlight-fadein 250ms linear;

    &:not(.featherlight-seamless) {
      padding: @gutter-size;
      background: #fff;
      box-shadow: 0 5px @gutter-size rgba(0,0,0,0.25);
    }

    &.featherlight-seamless > * {
      margin: 0 !important;
    }


    @media (min-width: 640px) {
      margin: @gutter-size;
    }
  }

  .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); }
}

