@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;700&display=swap");

:root {
  --primary-color: #8b7355; /* Define the new primary color */
}

body {
  background-color: var(--primary-color); /* Use the primary color variable */
  color: #333;
  font-family: "Poppins", sans-serif;
  margin: 0;
  overflow-x: hidden; /* Hide horizontal scrollbar during animations */
  /* Removed overflow-y: hidden; to allow vertical scrolling */
  width: 100%; /* Ensure body takes full width */
}
.product-container {
  display: flex;
  justify-content: center;
  /* Removed align-items: center; to allow full height for info panel */
  height: 80vh; /* Smaller height */
  gap: 2rem;
  padding: 0; /* Removed padding to allow full height */
  margin-top: 2rem; /* Added margin to the top of the product container */
}
.info-panel {
  width: 30%; /* Increased width to make viewer even smaller */
  height: 80vh; /* Smaller height */
  background: transparent; /* Make background transparent */
  border-radius: 15px;
  padding: 1.5rem 0.5rem 1.5rem 2.5rem; /* Top, Right, Bottom, Left padding - adjusted right and left */
  /* Removed box-shadow to blend with background */
  overflow-y: auto; /* Allow scrolling for content */
}
.viewer {
  flex: 1;
  height: 80vh; /* Smaller height */
  background: #faf7f0;
  border-radius: 15px;
  /* Removed box-shadow to blend with background */
  position: relative;
}
canvas {
  width: 100%;
  height: 100%;
  border-radius: 15px;
}
.product-title {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.color-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #ccc;
  cursor: pointer;
}
.info-panel h2 {
  /* Style for the big name in the info panel */
  font-size: 2.5rem; /* Make it smaller */
  font-weight: 700; /* Make it less bold */
  line-height: 1.1;
  font-family: "Poppins", sans-serif; /* Ensure Poppins font */
}
/* Margin Utilities */
.mb-3-custom {
  margin-bottom: 3rem;
} /* Increased space after title */
.mb-4-custom {
  margin-bottom: 4rem;
} /* Increased space after picture grid */
.mt-3-custom {
  margin-top: 1rem;
}
.mt-4-custom {
  margin-top: 1.5rem;
}
/* New custom margins for reduced spacing in right panel */
.mb-1-5-custom {
  margin-bottom: 0.4rem;
} /* Further reduced */
.my-1-custom {
  margin: 0.4rem 0;
} /* Further reduced */
.mt-1-custom {
  margin-top: 0.25rem;
} /* Further reduced */
.mt-2-custom {
  margin-top: 0.4rem;
} /* Further reduced */
.mb-0-5-custom {
  margin-bottom: 0.1rem;
} /* Even smaller bottom margin */
/* Grid Utilities */
.row-custom {
  display: flex;
  flex-wrap: wrap;
}
.row-cols-2-custom > .col-custom {
  width: 50%;
}
.g-2-custom {
  gap: 0.25rem; /* Less space between */
}
.col-custom {
  flex-grow: 1;
  max-width: 100%;
}
/* Image Utilities */
.img-fluid-custom {
  max-width: 100%;
  height: auto;
}
.rounded-custom {
  border-radius: 0.25rem; /* Default Bootstrap border-radius */
}
/* Flexbox Utilities */
.d-flex-custom {
  display: flex;
}
.gap-2-custom {
  gap: 0.25rem; /* Less space between */
}
/* Text Color Utilities */
.text-success-custom {
  color: #198754; /* Bootstrap's default success color */
}
.text-black-custom {
  color: #000; /* Custom black text color */
}
.mb-0-25-custom {
  margin-bottom: 0.25rem; /* Very small bottom margin */
}
/* Width Utilities */
.w-100-custom {
  width: 100%;
}
/* Horizontal Image Grid */
.image-grid-horizontal {
  display: flex;
  flex-wrap: nowrap; /* Ensure single row */
  justify-content: flex-start; /* Align items to start to reduce overall space */
  overflow-x: auto; /* Allow horizontal scrolling if needed */
}
.image-grid-horizontal > .col-custom {
  flex-shrink: 0; /* Prevent items from shrinking */
  width: 15%; /* Each image takes 15% width to make them more smaller */
  max-width: 60px; /* Set a smaller max-width for individual images */
}
.image-grid-horizontal .img-fluid-custom {
  width: 100%; /* Ensure image fills its column */
  height: auto;
}

/* Keyframe animations for sliding in */
@keyframes slideInFromLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Apply animations to specific panels */
#left-info-panel {
  animation: slideInFromLeft 1s ease-out forwards;
}

#right-info-panel {
  animation: slideInFromRight 1s ease-out forwards;
}

/* Custom button styles */
.btn-custom {
  background-color: #fff;
  color: #333;
  border: 1px solid #333;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  flex: 1; /* Allow buttons to take equal width */
}

.btn-custom:hover {
  background-color: var(--primary-color); /* Use the primary color variable */
  color: #fff;
}

.btn-add-to-cart {
  margin-right: 0.5rem; /* Space between buttons */
}

.button-group {
  display: flex;
  gap: 0.5rem; /* Space between buttons */
  margin-top: 1rem; /* Space above the button group */
}

/* Keyframe animation for image appearance */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#displayed-image {
  /* No initial animation here, will be handled by JS for subsequent clicks */
}

/* Keyframe animation for sliding transition */
@keyframes slideInImage {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in {
  animation: slideInImage 0.5s ease-out forwards;
}

/* Carousel specific styles */
.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 15px;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
  opacity: 0;
  transform: translateX(100%); /* Start off-screen to the right */
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
  opacity: 0; /* All slides are initially hidden */
  transform: translateX(
    100%
  ); /* Default position off-screen to the right */
}

.carousel-slide.active {
  opacity: 1;
  transform: translateX(0); /* Active slide is visible and centered */
}

.carousel-slide.prev {
  transform: translateX(
    -100%
  ); /* Slide positioned to the left, ready to enter or leaving */
  opacity: 0;
}

.carousel-slide.next {
  transform: translateX(
    100%
  ); /* Slide positioned to the right, ready to enter or leaving */
  opacity: 0;
}

.carousel-slide.active {
  opacity: 1;
  transform: translateX(0); /* Active slide is visible and centered */
}

.carousel-slide.prev {
  transform: translateX(
    -100%
  ); /* Slide positioned to the left, ready to enter or leaving */
  opacity: 0;
}

.carousel-slide.next {
  transform: translateX(
    100%
  ); /* Slide positioned to the right, ready to enter or leaving */
  opacity: 0;
}

.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 1rem 0.75rem;
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 10;
  border-radius: 5px;
}

.carousel-control.prev {
  left: 1rem;
}

.carousel-control.next {
  right: 1rem;
}

/* You Might Also Like Section */
.you-might-also-like {
  padding: 2rem;
  text-align: center;
  background-color: #faf7f0; /* Changed to match body background */
  margin-top: 3rem; /* Space above the section */
  opacity: 0; /* Initially hidden for animation */
  transform: translateY(50px); /* Start 50px down */
  animation: slideUp 1s ease-out forwards; /* Animation */
  animation-delay: 1s; /* Delay to start after other animations */
}

.you-might-also-like h3 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
}

.also-like-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.also-like-item {
  width: 200px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s ease;
}

.also-like-item:hover {
  transform: translateY(-10px);
}

.also-like-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.also-like-item-info {
  padding: 1rem;
}

.also-like-item-info h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.also-like-item-info p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

.also-like-item-info .price {
  font-size: 1.1rem;
  font-weight: bold;
  color: #000;
}

/* Animation for "You Might Also Like" section */
@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navigation styles */
.main-nav {
  background-color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-links {
  display: flex;
  justify-content: center;
  flex-grow: 1;
}

.nav-links a {
  color: #333;
  text-decoration: none;
  padding: 0 1rem;
}

/* Inline styles moved from newproduct.php */
.info-panel.left-panel-custom {
  /* Removed negative margin-top */
  padding: 1.5rem 0.1rem 1.5rem 4.5rem; /* Increased left padding to move right */
}

.info-panel h2 {
  /* Style for the big name in the info panel */
  font-size: 2.5rem; /* Make it smaller */
  font-weight: 700; /* Make it less bold */
  line-height: 1.1;
  font-family: "Poppins", sans-serif; /* Ensure Poppins font */
  margin-top: 2rem; /* Adjust top margin to lower the name */
}

.info-panel.right-panel-custom {
  padding: 1.5rem 2.5rem 1.5rem 0.5rem;
}

.back-to-3d-button-custom {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: none;
}

.quantity-input {
  width: 60px;
  padding: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.info-panel.left-panel-custom {
  margin-top: -50px;
  padding: 1.5rem 0.1rem 1.5rem 3.5rem;
}

.info-panel.right-panel-custom {
  padding: 1.5rem 2.5rem 1.5rem 0.5rem;
}

.back-to-3d-button-custom {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: none;
}

.description-title {
  font-size: 1.2rem;
}

.description-text {
  font-size: 0.85rem;
}

.hr-custom {
  border-top: 1px solid #000;
}

.quantity-selector {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.quantity-selector label {
  margin-right: 0.5rem;
}

.color-circle.saddlebrown {
  background-color: #8b4513;
}

.color-circle.tan {
  background-color: #d2b48c;
}

.color-circle.sienna {
  background-color: #a0522d;
}

.color-circle.wheat {
  background-color: #f5deb3;
}

.color-circle.new-color {
  background-color: #8b7355; /* Add a color circle for the new color */
}
