/* Product Page CSS - Complete Rewrite */

/* Hide search bar on product page */
.header-search-container {
  display: none !important;
}

.product-view-page {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

/* Product Detail Section */
.product-detail {
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
}

/* Product Gallery */
.product-gallery {
  width: 100%;
}

.main-image {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.main-image img {
  width: 100%;
  height: auto;
  display: block;
}

.thumbnail-images {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: #007bff;
}

/* Product Info */
.product-info {
  width: 100%;
  overflow-x: hidden;
}

.product-title {
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
  color: #333;
}

.product-rating {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  gap: 5px;
  color: #f39c12;
}

.product-price {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0;
  font-size: 18px;
}

.current-price {
  font-weight: bold;
  color: #28a745;
  font-size: 24px;
}

.old-price {
  text-decoration: line-through;
  color: #999;
}

.discount-percent {
  color: #dc3545;
  background-color: #ffe5e5;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* Product Description */
.product-description {
  text-align: center;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin: 12px 0 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  padding: 0 10px;
}

/* Product Variations */
.product-variations {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.variation-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.variation-group label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.variation-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.variation-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Quantity Selector */
.quantity-selector {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
}

.quantity-selector label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

.quantity-selector input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  box-sizing: border-box;
}

/* Product Actions */
.product-actions {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
  align-items: stretch !important;
}

/* Buttons */
.btn {
  padding: 14px 20px !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.add-to-cart-btn {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.add-to-cart-btn:hover {
  background-color: #e0a800 !important;
}

.add-to-cart-btn:active {
  opacity: 0.9;
}

.buy-now-btn {
  background-color: #007bff !important;
  color: #fff !important;
}

.buy-now-btn:hover {
  background-color: #0056b3 !important;
}

.buy-now-btn:active {
  opacity: 0.9;
}

/* Product Meta */
.product-meta {
  text-align: center;
  font-size: 13px;
  color: #666;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.product-meta p {
  margin: 5px 0;
}

/* Reviews Section */
.product-reviews {
  margin-top: 40px;
  padding: 30px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.section-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 20px;
}

.review-item {
  border-bottom: 1px solid #ddd;
  padding: 15px 0;
}

.review-item:last-child {
  border-bottom: none;
}

.review-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
}

.review-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #ffc107;
}

.review-stars ion-icon {
  font-size: 18px;
  color: #ffc107;
}

.review-comment {
  color: #666;
  line-height: 1.5;
  margin-top: 8px;
}

/* Related Products */
.related-products {
  margin-top: 40px;
}

.product-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.product-card {
  background-color: #fff;
  border-radius: 10px;
  padding: 15px;
  flex: 0 0 250px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.product-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.product-content h3 {
  font-size: 16px;
  margin: 10px 0 5px;
}

.product-actions-btn {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.action-btn {
  background: #eee;
  border: none;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
}

.view-all-reviews-btn {
  margin-top: 20px;
  background-color: #17a2b8;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.view-all-reviews-btn:hover {
  background-color: #138496;
}

/* Responsive */
@media (max-width: 768px) {
  .product-detail {
    padding: 15px;
    gap: 20px;
  }

  .product-gallery {
    width: 100%;
  }

  .product-info {
    width: 100%;
  }

  .thumbnail {
    width: 60px;
    height: 60px;
  }

  .btn {
    width: 100% !important;
    padding: 14px !important;
    font-size: 16px !important;
  }

  .product-reviews {
    padding: 15px;
  }

  .product-grid {
    flex-direction: column;
  }

  .product-card {
    flex: 1 1 100%;
  }
}

@media (min-width: 769px) {
  .product-detail {
    flex-direction: row;
    gap: 40px;
    padding: 40px;
  }

  .product-gallery {
    flex: 0 1 45%;
  }

  .product-info {
    flex: 1;
  }

  .product-title {
    text-align: left;
    font-size: 28px;
  }

  .product-rating {
    justify-content: flex-start;
  }

  .product-price {
    justify-content: flex-start;
  }

  .product-description {
    text-align: left;
  }

  .product-variations {
    flex-direction: row;
    gap: 20px;
  }

  .variation-group {
    flex: 1;
  }

  .thumbnail {
    width: 80px;
    height: 80px;
  }

  .product-actions {
    flex-direction: row !important;
  }

  .quantity-selector {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
  }

  .quantity-selector label {
    white-space: nowrap;
  }

  .quantity-selector input {
    width: 80px !important;
  }

  .btn {
    width: auto !important;
    padding: 12px 30px !important;
  }

  .product-reviews {
    padding: 40px;
  }

  .product-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .product-card {
    flex: 0 1 calc(50% - 10px);
  }
}
