/*
 * Firma: WebsiteWerk - Internetdienstleistungen | Autor: Kristian Snaczke | https://www.websitewerk.de
 * Nutzen/Sinn:
 *   Styles des Carousel mit ALLEM: Preise, Badges, Prime, STERNE!
 */

.amazon-products-wrapper {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  padding: 0 1px;
  margin: 20px 0 30px 0;
  box-sizing: border-box;
}

.amazon-products {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

.amazon-products::-webkit-scrollbar {
  display: none;
}

.amazon-product {
  flex: 0 0 calc(25% - 15px);
  max-width: calc(25% - 15px);
  box-sizing: border-box;
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  padding: 10px;
  text-align: center;
  background: #fff;
  scroll-snap-align: start;
}

@media (max-width: 1024px) {
  .amazon-product {
    flex: 0 0 calc(33.33% - 13.33px);
    max-width: calc(33.33% - 13.33px);
  }
}

@media (max-width: 768px) {
  .amazon-product {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

.image-container {
  position: relative;
  width: 100%;
  height: 100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  width: 90px;
  height: 90px;
}

.shop-button {
  margin-top: 10px;
  font-size: 14px;
  line-height: 19px;
  font-weight: 500;
  color: #1b1b1b;
  text-decoration: none;
}

.shop-button:hover {
  color: #8d7844;
}

.savings {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #b7a26d;
  color: #ffffff;
  font-size: 13px;
  width: 45px;
  height: 45px;
  padding-top: 8px;
  border-radius: 50%;
  font-weight: bold;
  z-index: 2;
  text-align: center;
}

.amazon-product .prime-icon {
  opacity: 0;
  transition: 0.2s linear;
  position: absolute;
  top: -34px;
  left: 0;
  z-index: 2;
  width: 35px;
}

.amazon-product:hover .prime-icon {
  opacity: 1;
}

.amazon-product h4 {
  font-size: 16px !important;
  margin: 10px 0;
  line-height: 21px !important;
  color: #1b1b1b;
  max-height: 2.8em;
  overflow: hidden;
  transition: 0.3s linear;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.amazon-product h4:hover {
  color: #8d7844;
  transition: 0.3s linear;
}

/* STERNE - Amazon-Style! */
.amazon-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 8px 0;
}

.amazon-rating-stars {
  display: inline-flex;
  gap: 2px;
}

.amazon-rating-stars img {
  width: 14px;
  height: 14px;
}

.amazon-rating-count {
  font-size: 12px;
  color: #007185;
}

.price {
  font-weight: bold;
  color: #8d7844;
  font-size: 16px;
}

.old-price {
  text-decoration: line-through;
  color: #626262;
  font-size: 12px;
  margin-right: 10px;
  vertical-align: top;
}

.struck {
  text-decoration: line-through;
}

.prev-arrow,
.next-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-40%);
  background-color: #ffffff;
  color: white;
  border: none;
  padding: 10px !important;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prev-arrow svg,
.next-arrow svg {
  fill: #000000;
}

.prev-arrow {
  left: 0;
}

.next-arrow {
  right: 0;
}

.amazon-products.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* Loading States */
.amazon-products-loading {
  padding: 20px;
  background: #fafafa;
  border-radius: 4px;
  margin: 20px 0;
}

.loading-skeleton {
  display: flex;
  gap: 20px;
}

.skeleton-product {
  flex: 0 0 calc(25% - 15px);
  height: 300px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 3px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.loading-text {
  text-align: center;
  color: #666;
  font-size: 13px;
  margin-top: 15px;
}

/* Error & Fallback Notice */
.amazon-error,
.amazon-fallback-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 15px;
  border-radius: 4px;
  color: #856404;
  text-align: center;
  margin: 20px 0;
}

.amazon-fallback-notice small {
  font-size: 12px;
}
