.tui-popup {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background-color: $color-white;
  opacity: 1;
  filter: alpha(opacity=100);
  border: 1px solid $color-black;
  z-index: 20002;
  box-shadow: 0 0 $margin-triple $color-black;
  border-radius: $border-radius-double;
  width: 560px;
  margin-left: -280px;
  left: 50%;
  padding: 0;
  overflow: hidden;

  hr {
    margin: $margin-double 0;
    border-width: 0;
    border-bottom: 1px solid $color-blue-300;
  }
}

.tui-popup-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: $color-black;
  z-index: 20001;
  opacity: .7;
  filter: alpha(opacity=70);
  margin: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .tui-popup {
    width: auto;
    left: auto;
    margin-left: $margin-normal;
    margin-right: $margin-normal;
  }
}

.tui-popup-footer {
  text-align: right;
  justify-content: space-between;
  align-items: center;
  display: flex;
}

.tui-popup-content,
.tui-popup-footer,
.tui-popup-header-title {
  margin: $margin-double;
}

.tui-popup-header-close {
  position: absolute;
  top: $margin-normal;
  right: $margin-normal;
}

.fr-icon-btn {
  display: inline-block;
  line-height: $margin-triple;
  height: $margin-triple;
  width: $margin-triple;
  background: $color-white;
  font-size: $margin-quadruple;
  text-decoration: none;
  border-radius: $border-radius-normal;
}

.fr-icon-btn:hover {
  text-decoration: none;
}

.fr-center {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.fr-img {
  position: absolute;
  display: block;
  left: -50%;
  right: -50%;
  top: -50%;
  bottom: -50%;
  margin: auto;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tui-popup-content p:last-child {
  margin-bottom: 0;
}

.tui-popup-campaign-logo {
  padding: 14px 0 0 0;
  text-align: center;
  background: $color-blue-300;
}

@media (min-width: 767px) and (max-width: 992px) {
  .tui-popup-footer {
    text-align: center;
  }
}

@media (max-width: 767px) {
  .tui-popup-btn {
    width: 100%;
  }
}

.black-friday {
  &.tui-popup {
    background: $color-black;
    color: $color-white;
    width: 720px;
    margin-left: -360px;
    overflow: hidden;

    hr {
      border-bottom-color: #979797;
    }
  }

  .image-container {
    margin-top: 50px;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, #000), linear-gradient(to bottom, rgba(216, 216, 216, 0), rgba(216, 216, 216, 0));
  }

  .img-fade {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, #000), linear-gradient(to bottom, rgba(216, 216, 216, 0), rgba(216, 216, 216, 0));
  }

  .fr-icon-btn {
    @include font-size(35);
    background: transparent;
    border-radius: $border-radius-normal;
    border: 1px solid $color-white;
    color: $color-white;
    width: auto;
    display: inline-flex;
    padding: $margin-half $margin-normal;
  }

  .tui-popup-campaign-logo {
    position: relative;
    background: $color-black;
  }

  .pictogram-tui-smile {
    position: absolute;
    left: 12px;
    top: 12px;
    height: 36px;
    width: 36px;
  }

  .tui-popup-content,
  .tui-popup-footer,
  .tui-popup-header-title {
    margin: $margin-quadruple;
  }
}

@media (max-width: 640px) {
  .black-friday {
    &.tui-popup {
      width: auto;
      left: auto;
      margin-left: $margin-normal;
      margin-right: $margin-normal;
    }

    .tui-popup-content,
    .tui-popup-footer,
    .tui-popup-header-title {
      margin: $margin-normal;
    }

    .tui-popup-footer {
      flex-direction: column;
    }
  }
}

/* stylelint-disable selector-class-pattern */
.flipdown.flipdown__theme-dark {
  font-family: sans-serif;
  font-weight: bold;
}

.flipdown.flipdown__theme-dark .rotor-group-heading:before {
  color: $color-white;
}

.flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):before,
.flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):after {
  background-color: #151515;
}

.flipdown.flipdown__theme-dark .rotor,
.flipdown.flipdown__theme-dark .rotor-top,
.flipdown.flipdown__theme-dark .rotor-leaf-front {
  color: #fff;
  background-color: #151515;
}

.flipdown.flipdown__theme-dark .rotor-bottom,
.flipdown.flipdown__theme-dark .rotor-leaf-rear {
  color: #efefef;
  background-color: #202020;
}

.flipdown.flipdown__theme-dark .rotor:after {
  border-top: solid 1px #151515;
}

/* stylelint-enable */
.flipdown {
  overflow: visible;
  //width: 510px;
  height: 110px;
}

.flipdown .rotor-group {
  position: relative;
  float: left;
  padding-right: $margin-normal;
}

.flipdown .rotor-group:last-child {
  padding-right: 0;
}

.flipdown .rotor-group-heading:before {
  display: block;
  height: 30px;
  line-height: 30px;
  text-align: center;
}

[data-market='se'] {
  .flipdown .rotor-group:nth-child(1) .rotor-group-heading:before {
    content: 'Dag.';
  }

  .flipdown .rotor-group:nth-child(2) .rotor-group-heading:before {
    content: 'Tim.';
  }

  .flipdown .rotor-group:nth-child(3) .rotor-group-heading:before {
    content: 'Min.';
  }

  .flipdown .rotor-group:nth-child(4) .rotor-group-heading:before {
    content: 'Sek.';
  }
}

$rotor-width: 40px;
$rotor-height: 60px;

.flipdown .rotor {
  position: relative;
  float: left;
  width: $rotor-width;
  height: $rotor-height;
  margin: 0 5px 0 0;
  border-radius: 4px;
  font-size: 4rem;
  text-align: center;
  perspective: 200px;
}

.flipdown .rotor:last-child {
  margin-right: 0;
}

.flipdown .rotor-top,
.flipdown .rotor-bottom {
  overflow: hidden;
  position: absolute;
  width: $rotor-width;
  height: $rotor-height / 2;
}

.flipdown .rotor-leaf {
  z-index: 1;
  position: absolute;
  width: $rotor-width;
  height: $rotor-height;
  transform-style: preserve-3d;
  transition: transform 0s;
}

.flipdown .rotor-leaf.flipped {
  transform: rotateX(-180deg);
  transition: all .5s ease-in-out;
}

.flipdown .rotor-leaf-front,
.flipdown .rotor-leaf-rear {
  overflow: hidden;
  position: absolute;
  width: $rotor-width;
  height: $rotor-height / 2;
  margin: 0;
  transform: rotateX(0deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flipdown .rotor-leaf-front {
  line-height: $rotor-height;
  border-radius: 4px 4px 0 0;
}

.flipdown .rotor-leaf-rear {
  line-height: 0;
  border-radius: 0 0 4px 4px;
  transform: rotateX(-180deg);
}

.flipdown .rotor-top {
  line-height: $rotor-height;
  border-radius: 4px 4px 0 0;
}

.flipdown .rotor-bottom {
  bottom: 0;
  line-height: 0;
  border-radius: 0 0 4px 4px;
}

.flipdown .rotor:after {
  content: '';
  z-index: 2;
  position: absolute;
  bottom: 0;
  left: 0;
  width: $rotor-width;
  height: 30px;
  border-radius: 0 0 4px 4px;
}

@media (max-width: 550px) {
  .flipdown {
    //width: 312px;
    height: 70px;
    margin-bottom: $margin-double;
  }

  .flipdown .rotor {
    font-size: 2.2rem;
    margin-right: 3px;
  }

  .flipdown .rotor,
  .flipdown .rotor-leaf,
  .flipdown .rotor-leaf-front,
  .flipdown .rotor-leaf-rear,
  .flipdown .rotor-top,
  .flipdown .rotor-bottom,
  .flipdown .rotor:after {
    width: 30px;
  }

  .flipdown .rotor-group {
    padding-right: $margin-normal;
  }

  .flipdown .rotor-group:last-child {
    padding-right: 0;
  }

  .flipdown .rotor-group-heading:before {
    font-size: .8rem;
    height: 20px;
    line-height: 20px;
  }

  .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before,
  .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after {
    left: 69px;
  }

  .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before {
    bottom: 13px;
    height: 8px;
    width: 8px;
  }

  .flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after {
    bottom: 29px;
    height: 8px;
    width: 8px;
  }

  .flipdown .rotor-leaf-front,
  .flipdown .rotor-top {
    line-height: 50px;
  }

  .flipdown .rotor-leaf,
  .flipdown .rotor {
    height: 50px;
  }

  .flipdown .rotor-leaf-front,
  .flipdown .rotor-leaf-rear,
  .flipdown .rotor-top,
  .flipdown .rotor-bottom,
  .flipdown .rotor:after {
    height: 25px;
  }
}

@media (max-width: 320px) {
  .flipdown .rotor-group {
    padding-right: 4px;
  }
}
