@import "_theme.scss";


.product-sticky-price {
  padding: 0 60px;
  position: sticky;
  bottom: 0;
  background: var(--white);
  box-shadow: 1px 1px 4px 0 var(--background-around-popup-color);
  border-left: none;
  z-index: 1;

  .sticky-image-block {
    display: none;
  }

  .loading-dots {
    height: 15px;
    margin: auto;
  }

  .price-display {
    margin-bottom: 5px;
  }

  .popper-tooltip-inner {
    padding-right: 10px;
  }

  @media (max-width: $md) {
    padding: 0 20px;
  }

  @media (min-width: $lg) {
    max-width: unset !important;
  }

  .text-hidden {
    visibility: hidden;
  }

  .sticky-image-block {
    position: relative;
    @media (max-width: $md) {
      display: block;
      padding: 15px 30px 15px 0px;
    }

    img {
      border: var(--image-border-width) solid var(--image-border-color);
    }
  }

  .sticky-container {
    @media (max-width: $md) {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    @media (max-width: $sm) {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap-reverse;
      width: calc(100% - 45px);
    }
  }

  .block-reload {
    transform-origin: center;
    animation: shake 1s;
    transition: 1s ease-in-out all;
    animation-iteration-count: 1;
    @keyframes shake {
      0% {
        transform: rotate(0deg);
      }
      25% {
        transform: rotate(-7deg);
      }
      50% {
        transform: rotate(0deg);
      }
      75% {
        transform: rotate(7deg);
      }
      100% {
        transform: rotate(0deg);
      }
    }
  }

  .sticky-container .total-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;


    .loading-dots {
      position: absolute;
      align-self: flex-start;
      margin-top: 27px;
    }

    @media (min-width: $xs) and (max-width: $md) {
      .price {
        font-size: var(--text-size-h4);

        .price-currency {
          font-size: var(--text-size-label);
        }
      }
    }

    @media (max-width: $lg) {
      width: 100%;
    }

    &.long-price,
    &.button-only {
      @media (max-width: $md) {
        padding-top: 15px;
      }
      @media (min-width: $md) {
        width: 100%;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: normal;
        align-items: normal;
        align-content: normal;
        margin-top: 10px;
      }

      .sticky-add-to-cart-button {
        flex-basis: 100%;
      }

      .price-display {
        padding-bottom: 10px;
      }
    }

    .add-to-cart-icon-wrapper {
      background-color: var(--button-primary-background-color);
      border-radius: 50%;
      height: 40px;
      width: 40px;

      .icon {
        margin-left: 7px;
        margin-top: -4px;
      }
    }

    &.button-only {
      .add-to-cart-icon-wrapper {
        display: none;
      }

      .sticky-add-to-cart-button {
        @media (max-width: $sm) {
          display: flex;
        }
      }
    }

    .filler {
      flex-grow: 1;
    }

    .sticky-add-to-cart-button {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 38px;
      min-width: 200px;
      padding: 5px 25px;
      margin: 12.5px 0;

      .loading-dots {
        margin-top: -3px;
      }

      .loading-dot {
        background-color: white;
      }

      @media (min-width: $md) and (max-width: $lg) {
        min-width: 110px;
      }

      @media (max-width: $sm) {
        display: none;
      }
    }

    .sticky-add-to-cart-icon,
    .add-to-cart-icon-wrapper {
      margin: auto 0 auto auto;

      @media (min-width: $sm) {
        display: none;
      }

      @media (max-width: $sm) {
        align-items: center;
        display: flex;
      }
    }
  }
}


.product-layout .dynamic .right .product-sticky-price {
  .sticky-container {
    @media (min-width: $lg) {
      max-width: 720px;
    }
  }
  .minimum-price-notation {
    margin-right: 8px;
    color: var(--text-color-dark);
    font-size: var(--text-size-regular);
  }

  .price {
    font-size: calc(var(--text-size-h2) * 0.8);
    color: var(--text-color-ultra-dark);
    @media (max-width: $md) {
      font-size: var(--text-size-h4);
    }
  }

  .price-currency {
    font-size: var(--text-size-h4);
    color: var(--text-color-ultra-dark);
    @media (min-width: $sm) and (max-width: $md) {
      font-size: var(--text-size-label);
    }
    @media (max-width: $sm) {
      font-size: var(--text-size-fineprint);
    }
  }

  .add-to-cart-icon-wrapper {
    position: absolute;

    right: 20px;
    bottom: 20px;
    background-color: var(--button-primary-background-color);
    border-radius: 50%;
    height: 40px;
    width: 40px;
    @media (min-width: $sm) {
      display: none;
    }

    @media (max-width: $sm) {
      align-items: center;
      display: flex;
      margin-left: 20px;
    }

    .icon {
      margin-left: 7px;
      margin-top: -4px;
    }
  }

  .price-display {
    @media (min-width: $lg) {
      margin-right: 8px;
    }
    @media (max-width: $md) {
      margin-right: 20px;
    }
  }

  .total-price {
    white-space: nowrap;

    @media (max-width: $md) {
      width: auto;
    }
  }

  .sticky-add-to-cart-icon-container {
    @media (max-width: $sm) {
      top: 41px;
    }
  }

  .sticky-add-to-cart-button {
    height: 40px;
    min-width: 200px;
    margin: 20px 0 20px 0;
    @media (min-width: $lg) {
      min-width: 180px;
    }
    @media (min-width: $md) {
      margin: 20px 0 20px 0;
    }
    @media (max-width: $md) {
      background-color: var(--button-primary-background-color);
      border-color: var(--button-secondary-border-color);
      color: var(--button-primary-text-color);
      font-size: var(--text-size-label);
    }

  }
}

.product-layout .static .right .product-sticky-price {

  .sticky-container {
      @media (min-width: $lg) {
        max-width: 600px;
      }

      @media (max-width: $md) {
      width: unset;
    }
  }

  .total-price {
    padding-top: 7.5px;
    padding-bottom: 7.5px;
  }
}
