/* ===== Base Styles ===== */
:root {
  --primary-color: #4361ee;
  --primary-hover: #3a56d4;
  --secondary-color: #3f37c9;
  --text-color: #2b2d42;
  --text-light: #8d99ae;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #e9ecef;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --error-color: #f72585;
  --star-color: #ffd700;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
  background: var(--bg-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Main Content Layout ===== */
.main-content {
    margin-top: 60px;
    margin-left: 80px;
    width: calc(100% - 80px);
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 30px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Product Container ===== */
.product-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
}

/* ===== Product Images Section ===== */
.product-images {
  flex: 1;
  min-width: 300px;
  max-width: 550px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.image-slider {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #f9f9f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease-in-out;
  border-radius: 8px;
}

.image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-color);
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.image-nav:hover {
  background: var(--primary-color);
  color: white;
}

.prev-main {
  left: 15px;
}

.next-main {
  right: 15px;
}

/* ===== Thumbnail Gallery ===== */
.thumbnail-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnails-wrapper {
  position: relative;
  overflow: hidden;
  width: calc(100% - 60px);
}

.thumbnail-wrapper {
  display: flex;
  gap: 10px;
  transition: transform 0.3s ease-in-out;
  padding: 5px 0;
}

.thumbnail {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: cover;
  transition: var(--transition);
  border: 2px solid transparent;
  background: #f9f9f9;
}

.thumbnail:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail.active {
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.thumbnail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-color);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.thumbnail-nav:hover {
  background: var(--primary-color);
  color: white;
}

.prev-thumb {
  left: 5px;
}

.next-thumb {
  right: 5px;
}

/* ===== Product Details Section ===== */
.product-details {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  padding: 0 10px;
}

.product-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--text-color);
  line-height: 1.3;
}

.product-category {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 20px;
  display: inline-block;
  background: #f0f4ff;
  padding: 4px 12px;
  border-radius: 20px;
}

.product-price {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.original-price {
  font-size: 1.4rem;
  color: var(--text-light);
  text-decoration: line-through;
}

.discount-badge {
  background: var(--error-color);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.seller-info, .shipping-info {
  font-size: 1rem;
  margin: 8px 0;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-info span, .shipping-info span {
  font-weight: 600;
  color: var(--text-color);
}

.seller-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
}

.star-rating {
  color: var(--star-color);
  font-size: 0.9rem;
}

/* ===== Variations Section ===== */
.variations-section {
  margin: 25px 0;
}

.variation-label {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-color);
}

.variation-options {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 10px;
}

.variation-description {
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
}

/* ===== Quantity Controls ===== */
.quantity-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 25px 0;
}

.quantity-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.qty-btn {
  background: #f0f0f0;
  border: 1px solid var(--border-color);
  padding: 8px 15px;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
}

.qty-btn:hover {
  background: #e0e0e0;
}

.quantity-input {
  width: 60px;
  height: 36px;
  text-align: center;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 5px;
  font-weight: 500;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-left {
  font-size: 0.9rem;
  color: var(--text-light);
  white-space: nowrap;
  margin-left: 10px;
}

.low-stock {
  color: var(--warning-color);
  font-weight: 600;
}

/* ===== Add to Cart Button ===== */
.add-to-cart {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
  width: 100%;
}

.add-to-cart:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(67, 97, 238, 0.3);
}

.cart-icon {
  font-size: 1.2rem;
}

/* ===== Share Section ===== */
.share-section {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.share-section span {
  font-size: 0.95rem;
  color: var(--text-light);
}

.share-link {
  font-size: 1.4rem;
  color: var(--text-light);
  transition: var(--transition);
  text-decoration: none;
}

.share-link:hover {
  transform: translateY(-3px);
}

.share-link:nth-child(2):hover { color: #3b5998; } /* Facebook */
.share-link:nth-child(3):hover { color: #000000; } /* TikTok */
.share-link:nth-child(4):hover { color: #E1306C; } /* Instagram */

/* ===== Back Button ===== */
.back-button {
  position: absolute;
  top: 30px;
  left: 30px;
  background: var(--primary-color);
  border: none;
  padding: 10px 15px 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  transition: var(--transition);
  z-index: 10;
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.back-button i {
  font-size: 1rem;
}

/* Initially hidden comments */
.comment.hidden-comment {
  display: none;
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  margin-left: 8px;
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-warning {
  background: var(--warning-color);
  color: white;
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 20px;
  }
  
  .product-container {
    flex-direction: column;
    padding: 20px;
  }
  
  .product-images, .product-details {
    max-width: 100%;
  }
  
  .back-button {
    left: 20px;
    top: 20px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 15px;
  }
  
  .product-title {
    font-size: 1.6rem;
  }
  
  .product-price {
    font-size: 1.8rem;
  }
  
  .comments-container {
    padding: 20px;
  }
  
  .comment-body {
    padding-left: 0;
  }
  
  .comment-actions {
    padding-left: 0;
  }
}

@media (max-width: 576px) {
  .thumbnail {
    width: 60px;
    height: 60px;
  }
  
  .quantity-controls {
    flex-wrap: wrap;
  }
  
  .stock-left {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
  
  .comment-header {
    flex-wrap: wrap;
  }
  
  .user-avatar {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

/* ===== Animation ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment {
  animation: fadeIn 0.3s ease-out forwards;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* ===== Comments Section - Base Styles ===== */
.comments-container {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--box-shadow);
  width: 100%;
}

.comments-container h3 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.comments-container h3::before {
  content: "";
  display: block;
  width: 5px;
  height: 20px;
  background: var(--primary-color);
  border-radius: 3px;
}

/* ===== Rating Filter Dropdown ===== */
.rating-filter-container {
  position: relative;
  margin-bottom: 25px;
}

.rating-filter-button {
  background: white;
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 200px;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.rating-filter-button:hover {
  border-color: var(--primary-color);
}

.rating-filter-button::after {
  content: "▼";
  font-size: 1rem;
  margin-left: 10px;
  transition: transform 0.2s ease;
}

.rating-filter-button.active::after {
  transform: rotate(180deg);
}

.rating-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 200px;
  z-index: 100;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 0;
}

.rating-filter-dropdown.show {
  max-height: 300px;
  opacity: 1;
}

.filter-option {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
}

.filter-option:hover {
  background: #f8f9fa;
}

.filter-option.active {
  background: rgba(67, 97, 238, 0.1);
  color: var(--primary-color);
}

.filter-option .star-count {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== Rating Summary ===== */
.rating-summary {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.rating-overview {
  flex: 1;
  min-width: 200px;
}

.average-rating {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.rating-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.stars {
  display: flex;
  gap: 3px;
}

.stars i {
  color: var(--star-color);
  font-size: 1.2rem;
}

.rating-count {
  font-size: 0.9rem;
  color: var(--text-light);
}

.rating-distribution {
  flex: 2;
  min-width: 250px;
}

.star-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.star-label {
  width: 70px;
  font-size: 0.9rem;
  color: var(--text-color);
}

.progress-container {
  flex-grow: 1;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  margin: 0 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--star-color);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.star-count {
  width: 40px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ===== Comment Form ===== */
.comment-form {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.rating-input {
    display: flex;
    flex-direction: row-reverse; /* This makes the stars highlight correctly */
    justify-content: flex-end;
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.2s;
    margin-right: 5px;
}

.rating-input input[type="radio"]:checked ~ label {
    color: #ffc107;
}

.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #ffc107;
}

.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  transition: var(--transition);
  background: white;
}

.form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.submit-comment {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.submit-comment:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

/* ===== Comments List ===== */
.comments-list {
  margin-top: 20px;
}

.comment {
  padding: 20px;
  margin-bottom: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.comment:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.comment-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
}

.user-avatar {
  margin-right: 15px;
  flex-shrink: 0;
}

.user-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0f0f0;
}

.avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
}

.user-info {
  flex-grow: 1;
}

.user-name {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

.comment-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.comment-rating {
  display: flex;
  gap: 3px;
  margin-bottom: 5px;
}

.comment-rating i.fas {
    color: #ddd;
    font-size: 0.9rem;
}

.comment-rating i.fas.filled {
    color: #ffc107;
}

.comment-rating i {
  color: var(--star-color);
  font-size: 0.9rem;
}

.comment-body {
  padding-left: 65px;
}

.comment-body p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-color);
  font-size: 0.95rem;
}

.no-comments {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 1rem;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px dashed var(--border-color);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .rating-summary {
    flex-direction: column;
    gap: 20px;
  }
  
  .comment-body {
    padding-left: 0;
    margin-top: 15px;
  }
  
  .comment-header {
    flex-wrap: wrap;
  }
  
  .user-avatar {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

@media (max-width: 576px) {
  .comments-container {
    padding: 20px;
  }
  
  .comment {
    padding: 15px;
  }
  
  .rating-filter-button {
    width: 100%;
  }
  
  .rating-filter-dropdown {
    width: 100%;
  }
}

/* Media upload styles */
.media-upload {
    margin-top: 15px;
}

.media-upload label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.media-preview {
    margin-top: 10px;
}

.media-preview img {
    max-width: 200px;
    max-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.remove_media {
    display: block;
    margin-top: 5px;
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 4px;
    border-radius: 4px;
}

.pagination a.active {
    background-color: blue;
    color: white;
    border: 1px solid blue;
}

.pagination a:hover:not(.active) {
    background-color: #ddd;
}


/* ===== Multiple Media Upload Styles ===== */
.media-previews-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.media-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.media-preview-item img:hover {
    transform: scale(1.05);
}

.remove-preview-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.remove-preview-btn:hover {
    background: rgba(255, 0, 0, 1);
}


.comment-media {
    margin-top: 10px;
}

.comment-media img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* ===== Enhanced Lightbox Styles ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: zoom-out;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}
        
        /* Comment media grid */
.comment-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.comment-media-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.3s;
    border: 1px solid #eee;
}

.comment-media-img:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
        
        .view-full-btn {
            display: block;
            margin-top: 8px;
            background: #4361ee;
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.8rem;
        }
        
.purchase-badge {
        background: #e8f5e9;
        padding: 8px 12px;
        border-radius: 4px;
        margin-bottom: 15px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #2e7d32;
    }
    .purchase-required {
        background: #fff3e0;
        padding: 15px;
        border-radius: 4px;
        margin-bottom: 20px;
    }
    .verified-badge {
        background: #e3f2fd;
        padding: 3px 8px;
        border-radius: 10px;
        font-size: 0.8em;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    /* Edit Comment Form Styles */
.edit-comment-form {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e1e1e1;
}

.edit-comment-form .form-group {
    margin-bottom: 15px;
}

.edit-comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Edit Rating Stars - Horizontal Left-to-Right Layout */
.edit-comment-form .edit-rating {
    direction: rtl; /* Change from rtl to ltr */
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    padding-right: 87%;
}

.edit-comment-form .edit-rating input {
    display: none;
}

.edit-comment-form .edit-rating label {
    color: #ddd;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    order: 1; /* Ensure proper order */
}

/* Hover and selection states */
.edit-comment-form .edit-rating label:hover,
.edit-comment-form .edit-rating label:hover ~ label,
.edit-comment-form .edit-rating input:checked ~ label {
    color: #ffc107;
}

.edit-comment-form .edit-rating input:checked + label {
    color: #ffc107;
}

.edit-comment-form .edit-rating input:checked + label {
    color: #ffc107;
}

.edit-comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 100px;
    margin-bottom: 15px;
    resize: vertical;
    font-family: inherit;
}

/* Media Management Styles */
.media-management {
    margin-bottom: 20px;
}

.current-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.media-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.media-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-media {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.remove-media:hover {
    background: #ff4444;
}

.remove-media i {
    font-size: 10px;
}

.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.media-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.remove-preview:hover {
    background: #ff4444;
}

.remove-preview i {
    font-size: 10px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.form-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.form-actions button[type="button"] {
    background: #f1f1f1;
    border: 1px solid #ddd;
    color: #333;
}

.form-actions button[type="button"]:hover {
    background: #e1e1e1;
}

.form-actions button[type="submit"] {
    background: #4CAF50;
    border: 1px solid #45a049;
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: #45a049;
}

/* Edit Button */
.edit-comment-btn {
    background: transparent;
    border: none;
    color: #2196F3;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 10px;
}

.edit-comment-btn:hover {
    background: rgba(33, 150, 243, 0.1);
}

.edit-comment-btn i {
    margin-right: 5px;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Upload Button Styles */
.upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    margin-bottom: 10px;
}

.upload-btn:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.upload-btn i {
    font-size: 16px;
}

/* Media Display Styles */
.comment-media {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.comment-media-item {
    width: 120px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid #eee;
}

.comment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.comment-image:hover {
    transform: scale(1.03);
}

/* For the media preview in the edit form */
.media-preview-container, 
.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.media-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid #eee;
}

.preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.variations-section {
    margin: 20px 0;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.variation-group {
    margin-bottom: 15px;
}

.variation-label {
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variation-option {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
}

.variation-option:hover {
    border-color: #aaa;
}

.variation-option.active {
    background: #4e51ff;
    color: white;
    border-color: #4e51ff;
}

.variation-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Spinner Styles */
.image-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    transition: opacity 0.3s ease;
}

.image-loading-spinner i {
    font-size: 3rem;
    color: #4a6cf7;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* When image is loaded */
.main-image.loaded + .image-loading-spinner {
    opacity: 0;
    pointer-events: none;
}

/* For the main image container */
.image-slider {
    position: relative;
    overflow: hidden;
}

.main-image {
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 100%;
    height: auto;
    display: block;
}

.main-image.loaded {
    opacity: 1;
}

/* For the thumbnails loading state */
.thumbnail {
    position: relative;
}

.thumbnail:not([src]) {
    background-color: #f5f5f5;
}

.thumbnail:not([src])::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 108, 247, 0.2);
    border-top-color: #4a6cf7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Button loading state */
button .fa-spinner {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

/* Lightbox spinner */
.lightbox-content.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.expired-note {
  color: #999;
  font-size: 0.8em;
  font-style: italic;
}

/* Buy Now Button Styles */
.buy-now {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
}

.buy-now:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.3);
}

.buy-now i {
    font-size: 1.2rem;
}

/* Out of stock styles */
.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.out-of-stock-overlay span {
    background-color: #ff4444;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.out-of-stock-image {
    filter: grayscale(100%);
    opacity: 0.7;
}

.out-of-stock-btn {
    background-color: #cccccc !important;
    cursor: not-allowed !important;
    opacity: 0.8 !important;
}

.out-of-stock-btn:hover {
    transform: none !important;
    box-shadow: none !important;
}

.product-price-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-price.original-price {
    text-decoration: line-through;
    color: #888;
    font-size: 20px;
    margin: 0;
}

.product-price.discounted-price {
    color: #e74c3c;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.discount-badge {
    background-color: #e74c3c;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
}