/* app/assets/stylesheets/shopping_cart.css
*
* Styling for cart card and listed items
*
*/

.shopping-cart-card {}

.shopping-cart-body {
  max-height: 650px;
}

.shopping-cart-row {
  height: 200px;
}

.cart-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.cart-wrapper {
  position: relative;
  display: inline-block;
}

.cart-counter {
  position: absolute;
  top: 3;
  right: 0;
  background-color: #ff0000;
  color: white;
  border-radius: 50%;
  padding: 3px 3px 3px 3px;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  min-width: 15px;
  text-align: center;
}

.cart-summary-container {
  z-index: 2;
  position: fixed;
  bottom: 30px;
  right: 0px;
}

.cart-summary-list {
  max-height: 45vh;
  overflow: auto;
}

.cart-summary-amounts {
  width: 35%;
  display: flex;
  text-align: end;
  align-items: center;
}

.cart-summary-item-title {
  display: flex;
  align-items: center;
  text-align: start;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 200px;
}

.cart-preview-card {
  width: 375px;
  max-width: 100vw;
  background-color: rgba(67, 156, 156, 0.6);
  padding-left: 5px;
  padding-bottom: 5px;
  /* Prevent overflow on small screens */
}

.cart-summary-title {
  animation: pulsing-text 1s alternate infinite;
}

.cart-button {
  border: 3px solid #4da6a6;
  background-color: rgba(195, 216, 225, 0.7);
  z-index: 2;
  position: fixed;
  bottom: 10px;
  right: 10px;
}

.bounce-cart {
  animation: bounce 1s linear;
}

.cart-button:active {
  transform: translateY(2px);
  opacity: 0.8;
}

@keyframes bounce {
  /* At these points, the element is at its resting position (bottom) */
  0%,
  20%,
  53%,
  80%,
  100% {
    /* The cubic-bezier here gives a smooth landing/takeoff (ease-out-ish) */
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0);
  }

  /* The peak of the first, highest bounce */
  40%,
  43% {
    /* This cubic-bezier creates a sharp peak and quick fall (ease-in-ish) */
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -50px, 0) scaleY(1.1);
    /* Bounces up 50px, stretches slightly */
  }

  /* The peak of the second, smaller bounce */
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -20px, 0) scaleY(1.05);
    /* Bounces up 20px, less stretch */
  }

  /* The peak of the third, smallest bounce */
  90% {
    transform: translate3d(0, -10px, 0) scaleY(1.02);
    /* Bounces up 4px, minimal stretch */
  }
}
