/* public/css/carousel.css - RandomProductsCarousel 樣式 */

.carousel-wrapper {
  max-width: 75%;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-header {
  width: 100%;
  margin: 0 0 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.carousel-title {
  font-size: 2rem;
  width: 100%;
  display: flex;
  margin-bottom: 1rem;
}

.carousel-description {
  width: 100%;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: #666;
}

.carousel-container {
  position: relative;
  padding: 0 50px;
  margin-bottom: 1rem;
}

.carousel-window {
  overflow: hidden;
  margin: 0 auto;
  width: 1000px;
}

.carousel-track {
  display: flex;
  gap: 60px;
  transition: transform 0.5s ease;
  transform: translateX(0px);
}

.carousel-track.no-transition {
  transition: none;
}

.product-card {
  border: 1px solid #b8272e;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  width: 280px;
  flex: 0 0 280px;
  transition: all 0.3s ease;
  user-select: none;
}

.product-card:hover {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.product-card:hover .category-overlay {
  opacity: 1;
  transform: translateY(0);
}

.product-image-container {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.product-image {
  height: 100%;
  width: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.product-image.active {
  opacity: 1;
}

.image-nav {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 2;
}

.image-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #c4c4c4;
  margin: 0 4px;
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease;
}

.image-dot.active {
  background-color: #b8272e;
}

.image-dot:hover {
  background-color: #b8272e;
}

.category-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(184, 39, 46, 0.85);
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: bold;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s ease;
  z-index: 3;
}

.add-button {
  background-color: #c72f2f;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.add-button.adding {
  background-color: #37b24d;
}

.add-button:active {
  background-color: #b02727;
}

.add-button.adding:active {
  background-color: #2b9d41;
}

.add-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.add-button.ripple::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(100, 100);
    opacity: 0;
  }
}

.button-text {
  color: white;
  margin: 0.2rem;
  font-weight: bold;
  font-size: 1.4rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.add-button:active .button-text {
  transform: scale(0.96);
}

.check-icon {
  display: inline-block;
  margin-left: 0;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.add-button.adding .check-icon {
  margin-left: 8px;
  opacity: 1;
  transform: scale(1);
}

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(184, 39, 46, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-button:hover {
  background-color: #b8272e;
  transform: translateY(-50%) scale(1.1);
}

.nav-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.nav-button:disabled:hover {
  transform: translateY(-50%);
}

.nav-button.prev {
  left: 0;
}

.nav-button.next {
  right: 0;
}

.page-indicator {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.page-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #e0e0e0;
  margin: 0 6px;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.page-dot.active {
  background-color: #b8272e;
  box-shadow: 0 0 4px rgba(184, 39, 46, 0.5);
}

.page-dot:hover {
  background-color: #cccccc;
  transform: scale(1.2);
}

.page-dot.active:hover {
  background-color: #b8272e;
}

.view-more-button {
  background-color: transparent;
  color: #454545;
  border: 1px solid #454545;
  padding: 1rem 5rem;
  font-size: 1rem;
  border-radius: 40px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.view-more-button:hover {
  background-color: transparent;
  color: rgb(56, 56, 56);
  border: 1px solid rgb(56, 56, 56);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 響應式設計 */
@media (max-width: 1200px) {
  .carousel-wrapper {
    max-width: 90%;
  }

  .carousel-window {
    width: 900px;
  }
}

@media (max-width: 1024px) {
  .carousel-window {
    width: 600px;
  }

  .carousel-track {
    gap: 40px;
  }

  .product-card {
    width: 260px;
    flex: 0 0 260px;
  }
}

@media (max-width: 768px) {
  .carousel-wrapper {
    max-width: 95%;
    padding: 0 0.5rem;
  }

  .carousel-header {
    margin: 0 0 0 1rem;
  }

  .carousel-title {
    font-size: 1.5rem;
  }

  .carousel-window {
    width: 300px;
  }

  .product-card {
    width: 280px;
    flex: 0 0 280px;
  }

  .carousel-container {
    padding: 0 30px;
  }

  .nav-button {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .carousel-title {
    font-size: 1.3rem;
  }

  .carousel-description {
    font-size: 0.9rem;
  }

  .view-more-button {
    padding: 0.8rem 3rem;
    font-size: 0.9rem;
  }
}
