@import "_theme.scss";

.product-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 120px;
  min-width: 90px;
  position: relative;

  @media (max-width: $lg) {
    align-items: flex-start;
  }

  .loadWrapper {
    display: flex;
    justify-content: center;
    max-width: 90px;

    &.proof-in-progress {
        position: relative;
      border: 1px solid var(--color-highlight);

      &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.85;
        z-index: 1;
        border: 1px solid #979797;
        background: var(--color-fill);
        background-size: 400% 400%;
        animation: CartItemThumbnailGradient 2s ease infinite;
      }
    }

    &.proof-failed {
      position: relative;

      &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0.85;
        z-index: 1;
        border: 1px solid #979797;
          background: var(--color-fill);
      }
    }

    @media (max-width: $lg) {
      justify-content: flex-start;
    }
  }

  @media (max-width: $lg) {
    justify-content: flex-start;
    max-width: 90px;
  }

  .proof-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;

    .loading-dots {
      height: 10px;

      div {
        background: var(--button-primary-background-color);
      }
    }
  }

  .proof-warning-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
  }

  .product-image {
    align-self: center;
    max-width: 90px;
    max-height: 120px;
    border: 2px solid var(--color-line);
    cursor: pointer;

    @media (max-width: $lg) {
      align-self: center;
      object-fit: contain;
      border: 2px solid var(--color-line);
    }

    &.disabled {
      cursor: default;
    }
    &.hide {
      display: none;
    }
  }

  .skeleton {
    --base-color: var(--skeleton-base-color);
    --highlight-color: var(--skeleton-highlight-color);
  }

  .thumbnail-loader {
    @media (min-width: $lg) {
      width: 120px !important;

    }

    @media (max-width: $lg) {
      width: 90px !important;
      height: 90px !important;
      margin-right: 15px;
    }
  }
}

@keyframes CartItemThumbnailGradient {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0.85;
  }
  100% {
    opacity: 0
  }
}
