/* Carousel Container */
.carousel-container {
  width: 100%;
  max-width: 1200px;
  height: 550px;
  position: relative;
  margin-top: var(--space-xl) 1%;
  overflow: hidden;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Card Base Styles */
.card {
  position: absolute;
  width: 200px;
  height: auto;
  transition: all 0.8s ease;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  padding: var(--space-md);
}

.product-meta {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Product Card Specific Styles */
.product-card {
  border: 2px solid var(--color-secondary);
}

.product-name {
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  font-size: 1.1em;
}

.product-price {
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1.2em;
}

/* FIXED: Consolidated Add to Cart Button */
.add-to-cart {
  display: flex;
  background: var(--color-primary);
  color: var(--color-light);
  border: none;
  padding: var(--space-sm) var(--space-xs); /* Fixed padding */
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  transition: all var(--transition-normal);
  margin: var(--space-md) auto; /* Center with auto margins */
  font-size: 0.9em;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  width: calc(100% - 2 * var(--space-md)); /* Proper width calculation */
  min-height: 44px;
  margin-top: auto; /* Push to bottom of flex container */
}

.add-to-cart:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
}

/* Card Positioning */
.card.center {
  height: auto;
  z-index: 10;
  transform: scale(1.1) translateZ(0);
  background-color: #0000009d;
  opacity: 1;
}

#product-carousel .card.center .product-meta .product-name {
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.3);
  color: var(--color-dark);
}

.card.center img {
  filter: none;
}

.card.left-1 {
  z-index: 8;
  transform: translateX(-180px) scale(0.95) translateZ(-50px);
  opacity: 0.9;
}

.card.left-1 img {
  filter: grayscale(50%);
}

.card.left-2 {
  z-index: 6;
  transform: translateX(-340px) scale(0.85) translateZ(-100px);
  opacity: 0.7;
}

.card.left-2 img {
  filter: grayscale(75%);
}

.card.right-1 {
  z-index: 8;
  transform: translateX(180px) scale(0.95) translateZ(-50px);
  opacity: 0.9;
}

.card.right-1 img {
  filter: grayscale(50%);
}

.card.right-2 {
  z-index: 6;
  transform: translateX(340px) scale(0.85) translateZ(-100px);
  opacity: 0.7;
}

.card.right-2 img {
  filter: grayscale(75%);
}

.card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(0) scale(0.5) translateZ(-500px);
}

/* Carousel Navigation */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-secondary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all var(--transition-normal);
  font-size: 1.5rem;
  border: none;
  outline: none;
  padding-bottom: 4px;
}

.nav-arrow:hover {
  background: var(--color-primary);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow.left {
  left: var(--space-lg);
  padding-right: 3px;
}

.nav-arrow.right {
  right: var(--space-lg);
  padding-left: 3px;
}

/* Carousel Dots */
.dots {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  box-shadow: none;
  border: none;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: none;
  border: none;
}

.dot.active {
  background: var(--color-primary);
  transform: scale(1.5);
}

.dot:hover {
  background: var(--color-primary);
  transform: scale(1.5);
}

/* Responsive Design for 5 cards */
@media (max-width: 768px) {
  .carousel-container {
    height: 400px;
  }

  .card {
    width: 200px;
    height: 280px;
  }

  .card.left-1 {
    transform: translateX(-110px) scale(0.95) translateZ(-50px);
  }

  .card.left-2 {
    transform: translateX(-210px) scale(0.85) translateZ(-100px);
  }

  .card.right-1 {
    transform: translateX(110px) scale(0.95) translateZ(-50px);
  }

  .card.right-2 {
    transform: translateX(210px) scale(0.85) translateZ(-100px);
  }

  .card img {
    height: 180px;
  }
}
