.table-variations {
   border-collapse: collapse;
   margin: 20px 0;

   .code {
      display: block !important;
      color: $font-color-light;
      font-size: 10px;
   }
}

.table-variations-row {
   border: 2px solid transparent;
   cursor: pointer;

   &:hover,
   &.active {
      border: 2px solid $border-color;
   }

   &.active {
      border-color: $green;
      cursor: default;

      .price-final {
         font-size: 26px;
      }

      .buy-form {
         pointer-events: auto;
      }
   }

   .buy-form {
      pointer-events: none;
   }

   &.hidden-half > div {
      position: relative;

      &::after {
         display: block;
         content: "";
         position: absolute;
         left: 0;
         right: 0;
         bottom: 0;
         top: 0;
         background-color: rgba(255, 255, 255, 0);
         background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
      }
   }
}

.table-variations-cell {
   padding: 12px 15px;

   p {
      margin-bottom: 0;
   }
}

.variation-price {
   width: 111px;
   padding-left: 0;
   padding-right: 0;

   .price-common {
      text-decoration: line-through;
      color: $font-color-light;
      margin: 0;
      font-size: 16px;
      font-weight: 700;
   }

   .price-final {
      display: block;
      font-size: 24px;
      font-weight: 700;
      line-height: 30px;
      margin: 0;
      white-space: nowrap;
   }

   @media screen and (max-width: 991px) {
      width: 120px;
   }
}

.variation-title strong {
   font-size: 16px;
   padding-right: 10px;
}

.variation-subtitle {
   display: block;
   font-size: 12px;
}

.variation-image {
   padding: 10px 5px 10px 10px;
   width: 95px;
   max-width: 95px; // ie fix
   text-align: center;

   .flag-best-price {
      display: none;
      margin-top: 10px;
   }
}

.variation-buy {
   width: 195px;
   height: 83px;
}

@media screen and (min-width: 1200px) {
   .variation-price {
      width: 135px;
   }

   .table-variations-row.active .price-final {
      font-size: 30px;
   }
}

// harakiri kvuli zmene sirek borderu, na mobilu neni
@media screen and (min-width: 992px) {
   .table-variations-row {
      background: url("/static/images/border.gif") repeat-x top; //horni a spodni 1px border

      &:last-child {
         background: url("/static/images/border.gif") repeat-x top, url("/static/images/border.gif") repeat-x bottom;
      }

      &:hover,
      &.active {
         background: none;

         + .display-row {
            background: none;

            &:last-child {
               background: url("/static/images/border.gif") repeat-x bottom;
            }
         }

         // prebiji border horni row
         .display-cell {
            border-top: 2px solid $border-color;
         }
      }

      &.active .display-cell {
         border-top-color: $green;
      }

      &.active + .display-row:hover {

         .display-cell {
            border-top-color: $green;
         }

         &:last-child {
            background-image: none;
         }
      }

      // animace
      &.active {

         .price-final {
            transition: all .2s;
         }

         .buy-form {
            opacity: 1;
            transition: opacity .3s;
         }
      }
   }

   .variation-price .price-final {
      transition: all .2s;
   }

   .variation-buy .buy-form {
      opacity: .2;
      transition: opacity .3s;
   }
}

@media screen and (max-width: 991px) {
   .table-variations-row {
      border-color: $border-color;
      display: block;
      min-height: 85px;
      overflow: auto;
      padding: 20px 25px;
      position: relative;

      + .table-variations-row {
         border-top: 0;
      }
   }

   .table-variations-cell {
      padding: 0;
      float: left;
      display: block;
   }

   .variation-image {
      position: absolute !important;
      width: 70px;
      left: 15px;
      top: 15px;
      bottom: 15px;

      img {
         max-height: 100%;
      }
   }

   .variation-title {
      padding-right: 95px;
      padding-left: 75px;
   }

   .variation-price {
      position: absolute;
      right: 25px;

      .price-final {
         clear: both;
      }
   }

   .varitation-title .delivery,
   .variation-flags,
   .variation-buy,
   .variation-buy .buy_count,
   .variation-buy .orderInput {
      display: none;
   }

   .table-variations-row.active {
      border-top: 2px solid $green;
      margin-top: -2px;

      .variation-title {
         padding-right: 0;
      }

      .variation-buy {
         display: block;
         float: right;
         height: auto;
         width: auto;
      }

      .variation-price {
         position: static;
         text-align: left;
         padding-left: 75px;
         clear: left;
         width: auto;
         padding-top: 10px;
      }

      .variation-title .delivery {
         display: block;
      }

      .variation-image .flag-best-price {
         display: inline-flex;
      }
   }
}

@media screen and (max-width: 400px) {
   .table-variations-row {
      padding: 15px;

      &.active {
         .variation-buy {
            float: none;
         }

         .variation-price {
            padding-top: 0;
            padding-bottom: 5px;
         }

         .submit-block,
         .btn {
            display: block;
            width: 100%;
         }
      }
   }

   .variation-title {
      padding-right: 0;
   }

   .variation-price {
      float: none;
      width: 100%;
      padding-top: 0;
      position: static;
      text-align: left;
      padding-left: 75px;
      clear: both;
   }

   .price-common,
   .price-final {
      display: inline-block;
   }
}

.view-watched {
   color: $font-color-light;
   display: inline-block;
   font-size: 11px;
   padding-top: 6px;
}
