/* ============================================
   PRODUCT DETAIL PAGE STYLES (product.css)
   ============================================ */

/* ============================================
   MAIN PRODUCT LAYOUT
   ============================================ */
.product-detail {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin: 2rem 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ============================================
   PRODUCT IMAGES SECTION (LEFT SIDE)
   ============================================ */
.product-images {
  flex: 0 0 45%; /* Fixed width for image section */
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
}

#product-image {
  width: 100%;
  max-width: 500px;
  height: auto;
  object-fit: fit;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease;

  overflow-y: auto;


}

#product-image:hover {
  transform: scale(1.02);
}

/* ============================================
   THUMBNAIL STYLES
   ============================================ */
#image-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}

#image-thumbnails img {
  width: 65px;
  height: 65px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
}

#image-thumbnails img:hover,
#image-thumbnails img.active {
  border-color: #007bff;
  transform: scale(1.05);
}

/* Swiper container for thumbnails */
#thumbnailSwiper {
  width: 100%;
  max-width: 500px;
  margin-top: 1rem;
}

#thumbnailSwiper .swiper-slide {
  width: auto;
  display: flex;
  justify-content: center;
}

/* ============================================
   PRODUCT INFO SECTION (RIGHT SIDE)
   ============================================ */
.info {
  flex: 1; /* Take remaining space */
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0; /* Prevent flex overflow */
}

#product-name {
  font-size: 2rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.price {
  font-size: 1.8rem;
  color: #28a745;
  font-weight: bold;
  margin: 1rem 0;
}

#product-desc {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
  margin: 1rem 0;
}

#product-nutrition {
  font-size: 1rem;
  color: #555;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid #28a745;
}

/* ============================================
   PRODUCT ACTION BUTTONS
   ============================================ */
.product-detail .add-btn,
.product-detail #buyNowBtn {
  min-width: 120px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-detail .add-btn {
  background-color: #28a745;
  color: white;
}

.product-detail .add-btn:hover {
  background-color: #218838;
  transform: translateY(-1px);
}

.product-detail #buyNowBtn {
  background-color: #ffbf00;
  color: rgb(12, 12, 12);
}

.product-detail #buyNowBtn:hover {
  background-color: #efff09;
  transform: translateY(-1px);
}

/* ============================================
   PRODUCT PAGE QUANTITY CONTROLS
   ============================================ */
.product-detail .quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.product-detail .quantity-display {
  width: 60px;
  text-align: center;
  font-weight: bold;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem;
  background-color: #f8f9fa;
  font-size: 1rem;
}

.product-detail .increase-btn,
.product-detail .decrease-btn {
  min-width: 40px;
  height: 40px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.product-detail .increase-btn:hover,
.product-detail .decrease-btn:hover {
  background-color: #218838;
}

/* ============================================
   REVIEWS SECTION
   ============================================ */
.reviews {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.reviews h3 {
  color: #333;
  font-weight: bold;
  margin-bottom: 2rem;
}

#average-rating {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
}

.avg-stars {
  color: #ffc107;
  font-size: 1.8rem;
  letter-spacing: 2px;
  display: inline-block;
}

.avg-score {
  color: #333;
  font-weight: bold;
}

.review-count {
  color: #666;
  font-style: italic;
}

#reviews-list {
  margin: 2rem 0;
}

.review-item {
  background-color: #fff;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.review-item .review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.review-item .review-stars {
  color: #ffc107;
  font-size: 1.2rem;
}

.review-item .review-date {
  color: #666;
  font-size: 0.9rem;
}

.review-item .review-text {
  color: #333;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* ============================================
   REVIEW FORM STYLES
   ============================================ */
.review-form-section {
  background-color: #f8f9fa;
  padding: 2rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.review-form-section h5 {
  color: #333;
  margin-bottom: 1.5rem;
}

.rating {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.star {
  font-size: 2rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease-in-out, transform 0.2s;
}

.star:hover,
.star.hovered {
  color: #ffc107;
  transform: scale(1.1);
}

.star.selected {
  color: #ffc107;
}

#review-form .form-control {
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 0.75rem;
  font-size: 1rem;
}

#review-form .form-control:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

#review-form button[type="submit"] {
  background-color: #28a745;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

#review-form button[type="submit"]:hover {
  background-color: #218838;
}

/* ============================================
   ZOOM MODAL STYLES
   ============================================ */
#imageZoomModal .modal-content {
  background-color: rgba(0, 0, 0, 0.9);
}

#panzoom-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoomedImage {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: grab;
}

#zoomedImage:active {
  cursor: grabbing;
}

#imageZoomModal .btn-close {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  opacity: 1;
  filter: none;
}

/* ============================================
   RESPONSIVE STYLES FOR PRODUCT PAGE
   ============================================ */

/* Tablet and below */
@media (max-width: 992px) {
  .product-detail {
    flex-direction: column;
    gap: 1.5rem;
    margin: 1rem 0;
  }

  .product-images {
    flex: 1 1 100%;
    position: static;
    max-height: unset;
    margin-bottom: 1rem;
  }

  .info {
    flex: 1 1 100%;
    padding: 0;
  }

  #product-image {
    max-width: 100%;
    max-height: 400px;
  }

  #product-name {
    font-size: 1.5rem;
  }

  .price {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .product-detail {
    padding: 0.5rem;
    margin: 0.5rem 0;
  }

  #product-name {
    font-size: 1.3rem;
  }

  .price {
    font-size: 1.3rem;
  }

  #product-desc {
    font-size: 1rem;
  }

  .product-detail .add-btn,
  .product-detail #buyNowBtn {
    min-width: 100px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .reviews {
    padding: 1rem 0.5rem;
  }

  #average-rating {
    padding: 1rem;
  }

  .avg-stars {
    font-size: 1.5rem;
  }

  .review-form-section {
    padding: 1rem;
  }

  .star {
    font-size: 1.5rem;
  }

  #image-thumbnails img {
    width: 50px;
    height: 50px;
  }
}

/* Small mobile */
@media (max-width: 576px) {
  .product-detail {
    padding: 0.25rem;
  }

  #product-name {
    font-size: 1.1rem;
  }

  .price {
    font-size: 1.1rem;
  }

  .product-detail .add-btn,
  .product-detail #buyNowBtn {
    min-width: 90px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .product-detail .quantity-display {
    width: 50px;
    padding: 0.4rem;
    font-size: 0.9rem;
  }

  .product-detail .increase-btn,
  .product-detail .decrease-btn {
    min-width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  #image-thumbnails img {
    width: 45px;
    height: 45px;
  }

  .avg-stars {
    font-size: 1.3rem;
  }

  .star {
    font-size: 1.3rem;
  }
}

/* Extra small mobile */
@media (max-width: 360px) {
  #product-name {
    font-size: 1rem;
  }

  .price {
    font-size: 1rem;
  }

  #product-desc {
    font-size: 0.9rem;
  }

  .product-detail .add-btn,
  .product-detail #buyNowBtn {
    min-width: 80px;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .product-detail .quantity-display {
    width: 45px;
    padding: 0.3rem;
    font-size: 0.8rem;
  }

  .product-detail .increase-btn,
  .product-detail .decrease-btn {
    min-width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  #image-thumbnails img {
    width: 40px;
    height: 40px;
  }

  .avg-stars {
    font-size: 1.1rem;
  }

  .star {
    font-size: 1.1rem;
  }

  .review-item {
    padding: 1rem;
  }
}

