/* ===== Base Styles ===== */
:root {
  --yellow:       #FFD600;
  --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: 0;
  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;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
  border: none;
}

.image-nav:hover {
  background: var(--yellow);
  color: var(--text-color);
}

.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: 100%;
}

.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(--yellow);
  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: 0;
  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;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 12px;
  border: none;
}

.thumbnail-nav:hover {
  background: var(--yellow);
  color: var(--text-color);
}

.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:not(.detail-badge) {
  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: var(--yellow);
  color: var(--text-color);
}

/* Hide number input arrows */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input {
    -moz-appearance: textfield; /* Firefox */
    width: 50px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.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(--yellow);
  color: var(--text-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 214, 0, 0.35);
}

.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);
  color: var(--text-color);
}

.share-link:nth-child(2):hover { color: var(--text-color); } /* Facebook */
.share-link:nth-child(3):hover { color: var(--text-color); } /* TikTok */
.share-link:nth-child(4):hover { color: var(--text-color); } /* 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(--yellow);
  color: var(--text-color);
  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(--yellow);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.25);
}

.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(--yellow);
  color: var(--text-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 214, 0, 0.25);
}

/* ===== 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: var(--yellow);
}


/* ===== 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: var(--yellow);
    color: var(--text-color);
}

.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: var(--yellow);
    border-color: var(--yellow);
    color: var(--text-color);
}

.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;
}

.image-slider-media .main-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-slider-media .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;
}

/* Review Button Styles */
.review-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.review-button:hover {
    background-color: var(--yellow);
    color: var(--text-color);
}

.review-button i {
    font-size: 12px;
}

.item-review-button {
    margin-top: 10px;
    text-align: right;
}

.item-review-button .review-button {
    padding: 5px 10px;
    font-size: 12px;
}

/* Container for the entire edit form */
.edit-comment-form {
    max-width: 100%;
    overflow: hidden; /* Prevent content from overflowing */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Rating section specifically */
.edit-comment-form .edit-rating {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* Allow wrapping if needed */
    gap: 8px;
    margin-bottom: 15px;
    width: 100%; /* Ensure it takes full container width */
}

/* Mobile-specific adjustments */
@media (max-width: 576px) {
    .edit-comment-form {
        padding: 15px; /* Add some padding */
    }
    
    .edit-comment-form .edit-rating {
        gap: 5px; /* Reduce gap between stars */
    }
    
    .edit-comment-form .edit-rating label {
        font-size: 20px;
        flex: 0 0 calc(20% - 4px); /* Distribute stars evenly */
        text-align: center; /* Center stars in their space */
    }
    
    /* Media upload section */
    .media-management {
        width: 100%;
    }
    
    .media-upload {
        width: 100%;
    }
    
    .upload-btn {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .edit-comment-form .edit-rating label {
        font-size: 18px;
        flex: 0 0 calc(20% - 3px); /* Adjust for smaller screens */
    }
}
/* Buy Now Button Styles */
.buy-now {
    background: linear-gradient(135deg, var(--primary-color, #4361ee) 0%, #3a56d4 100%);
    color: #fff;
    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: linear-gradient(135deg, #3a56d4 0%, #3530a8 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.35);
}

.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;
}

/* ===== Seller Details Card ===== */
.seller-card-container {
    margin: 24px 0 8px;
    width: 100%;
}

.seller-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(110deg, #ffffff 0%, #ffffff 48%, #f8f9ff 72%, #f0f4ff 100%);
    border-radius: 18px;
    border: 1px solid rgba(67, 97, 238, 0.1);
    box-shadow: 0 8px 32px rgba(67, 97, 238, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0;
    transition: var(--transition);
}

.seller-card:hover {
    box-shadow: 0 12px 40px rgba(67, 97, 238, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.seller-card-pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 100% 50%, rgba(67, 97, 238, 0.14) 0%, transparent 45%);
    pointer-events: none;
}

.seller-card-header,
.seller-card-body {
    position: relative;
    z-index: 2;
}

.seller-card-header {
    position: relative;
    display: flex;
    align-items: center;
    padding: 18px 24px 14px;
    border-bottom: 1px solid rgba(67, 97, 238, 0.08);
}

/* Shared pill badge (product category, seller section, etc.) */
.detail-badge,
.seller-card-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    width: fit-content;
}

.detail-badge i,
.seller-card-label i {
    font-size: 0.85rem;
}

.seller-card-body {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px 28px;
    align-items: center;
    padding: 22px 24px 26px;
}

.seller-profile-link {
    text-decoration: none;
    flex-shrink: 0;
}

.seller-profile-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 50%;
}

.seller-avatar-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--yellow));
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.25);
    transition: var(--transition);
}

.seller-profile-link:hover .seller-avatar-wrap {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.32);
}

.seller-avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    background: #eef1f8;
}

.seller-card-details {
    min-width: 0;
}

.seller-card-name {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.seller-card-tagline {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    max-width: 420px;
}

.seller-stat-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.seller-stat-pill {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.seller-stat-icon--followers {
    background: rgba(255, 193, 7, 0.18);
    color: #c99200;
}

.seller-stat-icon--products {
    background: rgba(67, 97, 238, 0.12);
    color: var(--primary-color);
}

.seller-stat-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}

.seller-stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-color);
}

.seller-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}

.seller-card-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 168px;
}

.view-shop-btn-mini,
.chat-btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.btn-seller-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(67, 97, 238, 0.35);
}

.btn-seller-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #3530a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(67, 97, 238, 0.4);
    color: #fff;
}

.btn-seller-secondary {
    background: #fff;
    color: var(--primary-color);
    border: 1.5px solid rgba(67, 97, 238, 0.35);
}

.btn-seller-secondary:hover {
    background: rgba(67, 97, 238, 0.06);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .seller-card-body {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .seller-card-cta {
        grid-column: 1 / -1;
        flex-direction: row;
        min-width: 0;
    }

    .view-shop-btn-mini,
    .chat-btn-mini {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .seller-card-header {
        padding: 16px 18px 12px;
    }

    .seller-card-body {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 18px;
        gap: 18px;
    }

    .seller-card-tagline {
        max-width: none;
    }

    .seller-stat-grid {
        justify-content: center;
    }

    .seller-card-cta {
        flex-direction: column;
        width: 100%;
    }
}

.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;
}
/* ============================================================
    PRODUCT PAGE — Redesigned (from productpage.css)
    Clean, modern e-commerce look with green accent palette
    ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ===== Design Tokens ===== */
:root {
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;

    --primary:        var(--green-500);
    --primary-hover:  var(--green-600);
    --primary-shadow: rgba(34, 197, 94, 0.35);

    --accent:       #0ea5e9;
    --danger:       #ef4444;
    --warning:      #f59e0b;
    --star-color:   #facc15;

    --text:         #111827;
    --text-muted:   #6b7280;
    --text-light:   #9ca3af;

    --bg:           #f9fafb;
    --card:         #ffffff;
    --border:       #e5e7eb;
    --border-light: #f3f4f6;

    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-full: 999px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg:  0 10px 32px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.05);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset / Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

h1, h2, h3, h4, h5 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
}

/* ===== Layout ===== */
.main-content {
    margin-left: auto;
    margin-right: auto;
    max-width: 1360px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 24px 48px;
}

/* ===== Product Container (matches seller + reviews accent) ===== */
.product-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: linear-gradient(110deg, #ffffff 0%, #ffffff 48%, #f8f9ff 72%, #f0f4ff 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(67, 97, 238, 0.1);
    box-shadow: 0 8px 32px rgba(67, 97, 238, 0.08), var(--shadow-md);
    padding: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 36px;
}

.product-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 50%, rgba(67, 97, 238, 0.14) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.product-container > * {
    position: relative;
    z-index: 2;
}

/* ===== Back Button ===== */
.back-button {
    position: absolute;
    top: 24px;
    left: 24px;
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: var(--transition);
    z-index: 10;
    text-decoration: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.back-button:hover {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--text);
    transform: translateX(-2px);
}

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

/* ===== Image Section ===== */
.product-images {
    flex: 1 1 420px;
    min-width: 0;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.image-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #ffffff 0%, var(--green-50) 40%, #f0f4ff 100%);
    border: 1px solid rgba(67, 97, 238, 0.12);
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md);
    padding: 12px;
}

.image-loading-spinner {
    position: absolute;
    color: var(--primary-color, #4361ee);
    font-size: 2rem;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.95);
    color: var(--text);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    box-sizing: border-box;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    z-index: 2;
}

.image-nav:hover {
    background: var(--yellow);
    color: var(--text);
    border-color: var(--yellow);
    box-shadow: var(--shadow-md);
}

.prev-main { left: 12px; }
.next-main { right: 12px; }

/* ===== Thumbnails ===== */
.thumbnail-container {
    width: 100%;
    max-width: 520px;
}

.thumbnails-wrapper {
    overflow: hidden;
    width: 100%;
}

.thumbnail-wrapper {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
    padding: 4px 2px;
}

.thumbnail {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    object-fit: cover;
    transition: var(--transition);
    border: 2px solid transparent;
    background: var(--green-50);
    flex-shrink: 0;
}

.thumbnail:hover {
    border-color: var(--yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.thumbnail.active {
    border-color: #374151;
    box-shadow: 0 0 0 3px #f3f4f6;
}

.thumbnail-nav {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.thumbnail-nav:hover {
    background: var(--yellow);
    color: var(--text);
    border-color: var(--yellow);
}

/* ===== Product Details ===== */
.product-details {
    flex: 1 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 4px 8px 0;
}

.product-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

/* ===== Rating Summary (in product details) ===== */
.product-rating-summary {
    margin-bottom: 14px;
}

.rating-overview { display: flex; align-items: center; }

.average-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

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

.stars i {
    font-size: 1rem;
    color: #e5e7eb;
}

.stars i.filled { color: var(--star-color); }

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

/* ===== Category pill (legacy; detail page uses .detail-badge) ===== */
.product-category:not(.detail-badge) {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 18px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ===== Price ===== */
.product-price-container {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--danger);
    line-height: 1;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.02em;
}

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

.product-price.discounted-price {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--danger);
}

.discount-badge {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    align-self: center;
}

/* ===== Seller / Shipping info ===== */
.seller-info,
.shipping-info {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* ===== Description ===== */
.variations-section {
    margin: 20px 0;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    border: 1px solid var(--border-light);
}

.variation-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

/* ===== Quantity ===== */
.quantity-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
}

.quantity-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    width: fit-content;
}

.qty-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qty-btn:hover {
    background: var(--yellow);
    color: var(--text);
}

.quantity-input {
    width: 52px;
    height: 40px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text);
    appearance: textfield;
    -moz-appearance: textfield;
    outline: none;
}

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

.stock-left {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

/* ===== Add to Cart Button ===== */
.add-to-cart {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
    padding: 13px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.03em;
}

.add-to-cart:hover {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* ===== BUY NOW BUTTON — BLUE ===== */
.buy-now {
    background: linear-gradient(135deg, var(--primary-color, #4361ee) 0%, #3a56d4 100%);
    color: #fff;
    border: none;
    padding: 15px 22px;
    font-size: 1rem;
    font-weight: 800;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0 6px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.35), 0 2px 6px rgba(67, 97, 238, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-family: 'Plus Jakarta Sans', sans-serif;
    position: relative;
    overflow: hidden;
}

.buy-now::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
    pointer-events: none;
}

.buy-now:hover {
    background: linear-gradient(135deg, #3a56d4 0%, #3530a8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(67, 97, 238, 0.45), 0 4px 10px rgba(67, 97, 238, 0.25);
}

.buy-now:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.buy-now i {
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.buy-now.out-of-stock-btn {
    background: #e5e7eb !important;
    color: var(--text-light) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

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

/* ===== Voucher Countdown ===== */
.desktop-voucher-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.desktop-voucher-label { font-weight: 500; }

.desktop-voucher-countdown {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--green-50);
    border: 1px solid var(--green-100);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--green-700);
    font-size: 0.8rem;
}

.desktop-voucher-info .desktop-voucher-countdown::before {
    content: 'Ends in ';
    font-weight: 500;
    color: var(--text-muted);
}

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

.share-section span {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.share-link {
    font-size: 1.3rem;
    color: var(--text-light);
    transition: var(--transition);
    text-decoration: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
}

.share-link:hover {
    transform: translateY(-2px);
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--text);
}

/* ===== Mobile sticky Buy Now ===== */
.mobile-sticky-buy { display: none; }

/* ===== Out of Stock ===== */
.out-of-stock-image {
    filter: grayscale(40%);
    opacity: 0.75;
}

.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: var(--radius-lg);
}

.out-of-stock-overlay span {
    background: var(--danger);
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-primary  { background: var(--green-100); color: var(--green-700); }
.badge-success  { background: #ecfdf5; color: #065f46; }
.badge-warning  { background: #fffbeb; color: #92400e; }

/* ===== Customer Reviews Section ===== */
.reviews-section.comments-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(110deg, #ffffff 0%, #ffffff 48%, #f8f9ff 72%, #f0f4ff 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(67, 97, 238, 0.08), var(--shadow-md);
    padding: 32px 36px 40px;
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.reviews-section .reviews-header,
.reviews-section .reviews-dashboard,
.reviews-section .reviews-grid,
.reviews-section .reviews-pagination {
    position: relative;
    z-index: 2;
}

.reviews-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at 100% 50%, rgba(67, 97, 238, 0.14) 0%, transparent 45%);
}

.reviews-header {
    position: relative;
    margin-bottom: 28px;
}

.reviews-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    margin: 12px 0 6px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.reviews-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 520px;
}

/* Dashboard: score + breakdown + chips */
.reviews-dashboard {
    position: relative;
    display: grid;
    grid-template-columns: minmax(200px, 240px) 1fr;
    grid-template-rows: auto auto;
    gap: 24px 32px;
    margin-bottom: 32px;
    padding: 24px 28px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.reviews-score-panel {
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 16px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-light);
}

.reviews-score-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-bottom: 10px;
}

.reviews-score-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 3.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
}

.reviews-score-stars {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.reviews-score-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.reviews-score-meta strong {
    color: var(--text);
    font-weight: 700;
}

.reviews-recommend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green-700);
    background: var(--green-50);
    border-radius: var(--radius-full);
    border: 1px solid var(--green-100);
}

.reviews-recommend i {
    color: var(--green-500);
    font-size: 0.85rem;
}

/* Shared star styles */
.review-star {
    color: #e5e7eb;
    transition: color 0.2s ease, transform 0.2s ease;
}

.review-star.filled,
.review-star.half,
.comment-rating .review-star.filled,
.comment-rating i.filled {
    color: var(--star-color, #facc15);
}

.review-star.half {
    color: var(--star-color, #facc15);
}

.review-star--lg { font-size: 1.35rem; }
.review-star--sm { font-size: 0.72rem; }
.review-star--xs { font-size: 0.62rem; }

.reviews-breakdown {
    min-width: 0;
}

.reviews-breakdown-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.reviews-bar-row.filter-btn {
    display: grid;
    grid-template-columns: 88px 1fr 36px;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
    transition: var(--transition);
}

.reviews-bar-row.filter-btn:hover {
    background: rgba(255, 214, 0, 0.12);
    border-color: rgba(255, 214, 0, 0.4);
}

.reviews-bar-row.filter-btn.active {
    background: rgba(67, 97, 238, 0.08);
    border-color: rgba(67, 97, 238, 0.25);
}

.reviews-bar-stars {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
}

.reviews-bar-track {
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.reviews-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fde047, var(--yellow));
    border-radius: var(--radius-full);
    transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}

.reviews-bar-count {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: right;
}

.reviews-filter-wrap {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

.reviews-filter-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.reviews-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reviews-chip.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.reviews-chip.filter-btn i {
    font-size: 0.7rem;
    color: var(--star-color);
}

.reviews-chip.filter-btn:hover {
    border-color: var(--yellow);
    background: rgba(255, 214, 0, 0.15);
}

.reviews-chip.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color, #4361ee), #3a56d4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(67, 97, 238, 0.35);
}

.reviews-chip.filter-btn.active i {
    color: #fde047;
}

/* ===== Comment Form ===== */
.comment-form {
    background: var(--bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

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

.rating-input label {
    cursor: pointer;
    font-size: 1.6rem;
    color: #e5e7eb;
    transition: color 0.15s;
    margin-right: 4px;
}

.rating-input input[type="radio"]:checked ~ label { color: var(--star-color); }
.rating-input label:hover,
.rating-input label:hover ~ label { color: var(--star-color); }

.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 110px;
    transition: var(--transition);
    background: var(--card);
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    line-height: 1.6;
}

.form-group textarea:focus {
    border-color: var(--yellow);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 214, 0, 0.25);
}

.submit-comment {
    background: #374151;
    color: #fff;
    border: none;
    padding: 11px 22px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.04em;
}

.submit-comment:hover {
    background: var(--yellow);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== Review list (Shopee / Lazada style) ===== */
.comments-list.reviews-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.review-item.comment {
    padding: 14px 16px 16px;
    background: #fff;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    transition: background 0.15s ease;
}

.review-item.comment:last-child {
    border-bottom: none;
}

.review-item.comment:hover {
    transform: none;
    box-shadow: none;
    background: #fafafa;
}

.review-item__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.review-item__avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
}

.review-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-item__avatar .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
}

.review-item__meta {
    flex: 1;
    min-width: 0;
}

.review-item__meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.review-item__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.review-item__date {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 400;
    color: #999;
    white-space: nowrap;
}

.review-item__stars {
    display: flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
}

.review-item__stars .review-star--sm,
.review-item__stars i {
    font-size: 0.72rem;
}

.review-item__stars .review-star.filled,
.review-item__stars i.filled,
.review-item__stars i.fas.fa-star {
    color: #f5a623;
}

.review-item__stars .review-star.empty,
.review-item__stars i.empty,
.review-item__stars i.far.fa-star {
    color: #ddd;
}

.review-item__body {
    margin: 0;
    padding: 0 0 0 46px;
}

.reviews-section .review-item .comment-body,
.review-item__text {
    margin: 0;
    padding: 0 !important;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #333;
    word-break: break-word;
    text-align: left;
}

.review-item__photos-wrap {
    margin-top: 10px;
    width: 100%;
}

.review-item__text + .review-item__photos-wrap {
    margin-top: 10px;
}

.review-item__photos-wrap:first-child {
    margin-top: 0;
}

.review-item__photos {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.review-item__photos::-webkit-scrollbar {
    height: 4px;
}

.review-item__photos::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.review-item__photo {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    cursor: zoom-in;
    background: #f5f5f5;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.review-item__photo:hover {
    border-color: #90caf9;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.review-item__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.review-item__photo:active {
    opacity: 0.85;
}

/* Legacy selectors — keep filter JS working */
.review-card.comment,
.review-card-top.comment-header {
    /* mapped via .review-item */
}

.comment-body p {
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* ===== Empty reviews state ===== */
.no-comments.reviews-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 56px 24px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.reviews-empty-icon {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.reviews-empty-icon i {
    font-size: 1.5rem;
    color: #e5e7eb;
}

.reviews-empty h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 8px;
}

.reviews-empty p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Edit Comment Form ===== */
.edit-comment-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 14px;
    max-width: 100%;
    overflow: hidden;
}

.edit-comment-form .edit-rating {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.media-management { margin-top: 12px; }

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

.media-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: visible;
}

.media-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.remove-media {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1.5px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    border-color: var(--yellow);
    color: var(--text);
    background: var(--yellow);
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.form-actions button {
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.form-actions button[type="button"] {
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}

.form-actions button[type="button"]:hover {
    background: var(--yellow);
    border-color: var(--yellow);
}

.form-actions button[type="submit"] {
    background: #374151;
    border: none;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.form-actions button[type="submit"]:hover {
    background: var(--yellow);
    color: var(--text);
    transform: translateY(-1px);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--card);
    border: 1.5px solid var(--border);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--yellow);
    color: var(--text);
    background: var(--yellow);
}

.pagination a.active,
.reviews-pagination a.active {
    background: linear-gradient(135deg, var(--primary-color, #4361ee), #3a56d4);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

/* ===== Loading Spinner ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.image-loading-spinner i {
    animation: spin 1s linear infinite;
}

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

.comment.hidden-comment { display: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .main-content {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 24px 20px 40px;
        box-sizing: border-box;
        overflow-x: clip;
    }

    .product-container {
        flex-direction: column;
        align-items: stretch;
        gap: 28px;
        padding: 28px 20px 24px;
        padding-top: 56px;
    }

    .product-images,
    .product-details {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .product-images {
        align-items: stretch;
    }

    .image-slider,
    .thumbnail-container {
        width: 100%;
        max-width: 100%;
    }

    .back-button {
        top: 16px;
        left: 16px;
    }

    .comments-container,
    .reviews-section.comments-container {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px 14px 32px;
        gap: 20px;
    }

    .product-container {
        padding: 20px 16px 20px;
        padding-top: 52px;
        gap: 22px;
        border-radius: var(--radius-md);
    }

    .back-button {
        top: 12px;
        left: 12px;
        padding: 7px 12px;
        font-size: 0.82rem;
    }

    .product-details {
        padding: 4px 0 0 !important;
    }

    .product-title,
    .product-title-row .product-title {
        font-size: clamp(1.28rem, 4.8vw, 1.55rem);
    }

    .product-price,
    .product-price.discounted-price {
        font-size: clamp(1.55rem, 5.5vw, 1.9rem);
    }

    .product-price.product-price-current,
    .product-price-current {
        font-size: clamp(1.55rem, 5.5vw, 2rem) !important;
    }

    .product-price.product-price-was,
    .product-price-was {
        font-size: 1.05rem !important;
    }

    .product-meta-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 0;
    }

    .product-meta-stats .meta-divider {
        display: none;
    }

    .product-meta-stats .meta-item {
        width: 100%;
        white-space: normal;
    }

    .product-inline-rating .rating-count {
        white-space: normal;
    }

    .thumbnails-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .thumbnail-wrapper {
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .thumbnail {
        width: 64px;
        height: 64px;
    }

    .image-nav {
        width: 34px;
        height: 34px;
    }

    .product-purchase-row {
        flex-wrap: nowrap;
        justify-content: stretch;
    }

    .product-purchase-row .add-to-cart,
    .product-purchase-row .buy-now {
        flex: 1 1 0;
        min-width: 0;
    }

    .product-purchase-row .buy-now {
        margin: 0;
    }

    .reviews-dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 20px;
        padding: 20px;
    }

    .reviews-score-panel {
        grid-row: auto;
    }

    .reviews-bar-row.filter-btn {
        grid-template-columns: 76px 1fr 32px;
    }

    .comments-list.reviews-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 12px 10px 28px;
    }

    .product-container {
        padding: 16px 12px 16px;
        padding-top: 48px;
        gap: 18px;
    }

    .product-purchase-row {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        margin: 8px 0 24px;
    }

    .product-purchase-row .add-to-cart,
    .product-purchase-row .buy-now {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 14px 12px;
        min-height: 48px;
    }

    .product-purchase-row .buy-now {
        margin: 0 !important;
        font-size: 0.9rem;
        letter-spacing: 0.05em;
    }

    .product-purchase-row .buy-now:active {
        transform: scale(0.98);
    }

    .product-purchase-row--single .buy-now {
        width: 100%;
        margin: 0 !important;
    }

    .reviews-section.comments-container {
        padding: 20px 16px;
    }

    .reviews-dashboard {
        padding: 18px 16px;
        gap: 18px;
    }

    .review-item.comment {
        padding: 12px 14px 14px;
    }

    .review-item__body {
        padding-left: 0;
    }

    .review-item__text,
    .reviews-section .review-item .comment-body {
        padding-left: 0 !important;
    }

    .review-item__photo {
        width: 64px;
        height: 64px;
    }

    .reviews-filter-chips {
        flex-wrap: wrap;
    }

    .thumbnail {
        width: 56px;
        height: 56px;
    }

    .comment-header { flex-wrap: wrap; }
    .user-avatar { margin-bottom: 4px; }

    .edit-comment-form { padding: 16px; }
    .edit-comment-form .edit-rating { gap: 4px; }
    .edit-comment-form .edit-rating label {
        font-size: 1.3rem;
        flex: 0 0 calc(20% - 4px);
        text-align: center;
    }
    .media-management,
    .media-upload,
    .upload-btn { width: 100%; }

    .reviews-section.comments-container {
        padding: 20px 14px 24px;
    }
}

@media (max-width: 400px) {
    .product-price.product-price-current,
    .product-price-current {
        font-size: 1.45rem !important;
    }

    .product-price-container .discount-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .product-details .share-link {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .edit-comment-form .edit-rating label {
        font-size: 1.15rem;
        flex: 0 0 calc(20% - 3px);
    }
}

/* Keep these from original for compatibility */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 10, 163, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    background: var(--card);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.lightbox-close:hover { background: var(--danger); color: #fff; }

/* Center Font Awesome chevrons inside circular nav buttons (override FA inline-block) */
.image-slider-controls .image-nav,
i.thumbnail-nav {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box;
  padding: 0 !important;
  margin: 0;
  line-height: 1 !important;
  vertical-align: middle;
}

i.image-nav::before,
i.thumbnail-nav::before {
  display: block;
  line-height: 1;
  position: relative;
  top: 1px;
}

/* Product detail page — info column layout */
.product-details {
    padding: 16px 20px 12px !important;
    gap: 0;
}

.product-details .product-category.detail-badge {
    margin: 0 0 12px;
}

.product-title-row {
    margin-bottom: 14px;
}

.product-title-row .product-title {
    margin: 0;
    width: 100%;
    line-height: 1.3;
    word-break: break-word;
}

.product-inline-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.product-inline-rating .stars {
    display: flex;
    gap: 2px;
}

.product-inline-rating .stars i {
    font-size: 0.85rem;
    color: #e5e7eb;
}

.product-inline-rating .stars i.filled {
    color: var(--star-color, #f59e0b);
}

.product-inline-rating .rating-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text, #1f2937);
}

.product-inline-rating .rating-count {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}

.product-details .product-price-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 14px;
    margin-bottom: 10px;
}

.product-price.product-price-current,
.product-price-current {
    color: var(--yellow, #ffd600) !important;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
    text-decoration: none !important;
}

.product-price.product-price-was,
.product-price-was {
    font-size: 1.2rem;
    font-weight: 500;
    color: #9ca3af !important;
    text-decoration: line-through;
    margin: 0;
}

.product-price-container .discount-badge {
    background: rgba(255, 214, 0, 0.2);
    color: #1a1a2e;
    border: 1px solid var(--yellow, #ffd600);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    margin: 0;
}

.product-description-block {
    margin: 0 0 20px;
}

.product-description-wrap {
    position: relative;
}

.product-description-wrap.is-collapsed .product-description-inner {
    max-height: 4.8em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}

.product-description-wrap.is-collapsed .product-description {
    display: block;
    overflow: visible;
}

.product-description-wrap.is-expanded .product-description-inner {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    -webkit-mask-image: none;
    mask-image: none;
}

.product-description-wrap.is-expanded .product-description {
    display: block;
    overflow: visible;
}

.product-description-inner {
    transition: max-height 0.25s ease;
}

.product-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text, #374151);
    margin: 0;
}

.product-description-toggle {
    margin-top: 8px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary-color, #4361ee);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.product-description-toggle:hover {
    color: #3a56d4;
    text-decoration: underline;
}

.product-meta-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 24px;
    padding: 14px 0;
    border-top: 1px solid var(--border-light, #e5e7eb);
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted, #6b7280);
}

.product-meta-stats .meta-item {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    white-space: nowrap;
}

.product-meta-stats .meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}

.product-meta-stats .meta-item strong,
.product-meta-stats .stock-left {
    font-weight: 700;
    color: var(--text, #1f2937);
}

.product-meta-stats .seller-link {
    color: var(--primary-color, #4361ee);
    font-weight: 600;
    text-decoration: none;
}

.product-meta-stats .seller-link:hover {
    color: #3a56d4;
    text-decoration: underline;
}

.product-details .variations-section.product-group-variants {
    margin-top: 0;
    margin-bottom: 20px;
}

.product-purchase-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    margin: 8px 0 28px;
    width: 100%;
}

.product-purchase-row .add-to-cart,
.product-purchase-row .buy-now {
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    width: auto;
}

.product-purchase-row--single .buy-now {
    flex: 1 1 0;
}

.product-details .share-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 14px;
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.product-details .share-link {
    color: #1a1a2e;
    background: rgba(255, 214, 0, 0.35);
    border: 1px solid var(--yellow, #ffd600);
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition, all 0.2s ease);
    flex-shrink: 0;
}

.product-details .share-link:hover {
    background: var(--yellow, #ffd600);
    border-color: var(--yellow, #ffd600);
    color: #1a1a2e;
    transform: translateY(-2px);
}

/* Keep Font Awesome glyphs visible (button font-family overrides break icons) */
.product-details i[class*="fa-"],
.product-purchase-row i[class*="fa-"],
.product-images i[class*="fa-"],
.back-button i[class*="fa-"] {
    font-style: normal;
    line-height: 1;
    display: inline-block;
    position: relative;
    z-index: 1;
}

.product-details i.fa-solid,
.product-details i.fas,
.product-purchase-row i.fa-solid,
.product-purchase-row i.fas,
.back-button i.fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

.product-details i.fa-brands,
.product-details i.fab,
.product-details .share-link i {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400;
}

.product-purchase-row .add-to-cart i,
.product-purchase-row .buy-now i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.product-images {
    display: flex;
    flex-direction: column;
}

/* Group PDP: hide thumbnail strip; options below main image drive the gallery */
.product-images--group .thumbnail-container {
    display: none !important;
}

.product-images .image-slider .image-carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.product-images .image-carousel-indicators[hidden] {
    display: none !important;
}

.product-images .carousel-indicator-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: auto;
}

.product-images .carousel-indicator {
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease, opacity 0.25s ease;
    opacity: 0.85;
}

.product-images .carousel-indicator:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.75);
}

.product-images .carousel-indicator.is-active {
    width: 22px;
    background: var(--yellow, #ffd600);
    opacity: 1;
    box-shadow: 0 0 10px rgba(255, 214, 0, 0.5);
}

.product-images .carousel-indicator-count {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.product-group-variants-below-images {
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.product-group-variants-below-images .variation-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-group-variants-below-images .group-variant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.product-group-variants-below-images .group-variant-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    min-height: 0;
}

.product-group-variants-below-images .group-variant-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.product-group-variants-below-images .group-variant-option.selected {
    border-color: #001a6e;
    background: #f0f4ff;
}

.product-group-variants-below-images .group-variant-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
    flex-shrink: 0;
}

.product-group-variants-below-images .group-variant-name {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
}

.product-group-variants-below-images .group-variant-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 0.68rem;
    line-height: 1.2;
}

.product-group-variants-below-images .group-variant-price {
    color: #ca8a04;
    font-weight: 700;
}

.product-group-variants-below-images .group-variant-stock {
    color: #64748b;
}

/* Main image — fixed frame with overlay controls (prev/next center, enlarge top-right) */
.product-images .image-slider {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
}

.product-images .image-slider-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.product-images .image-slider-media .main-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    padding: 12px;
    box-sizing: border-box;
}

.product-images .image-slider-media .image-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.product-images .image-slider-controls {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.product-images .image-slider-controls .image-nav,
.product-images .image-slider-controls .image-enlarge-btn {
    position: absolute;
    pointer-events: auto;
    margin: 0;
    padding: 0;
    border: none;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: none;
    box-sizing: border-box;
    line-height: 1;
    font-size: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text, #1f2937);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.product-images .image-slider-controls .image-nav {
    top: 50%;
    bottom: auto;
    left: auto;
    right: auto;
    transform: translateY(-50%);
}

.product-images .image-slider-controls .prev-main {
    left: 12px;
}

.product-images .image-slider-controls .next-main {
    right: 12px;
}

.product-images .image-enlarge-btn {
    top: 12px;
    right: 12px;
    transform: none;
    font-size: 15px;
}

.product-images .image-slider-controls .image-nav:hover,
.product-images .image-enlarge-btn:hover {
    background: var(--yellow, #facc15);
}

.product-images .image-slider-controls .image-nav i,
.product-images .image-enlarge-btn i {
    pointer-events: none;
}

.product-image-lightbox.lightbox {
    cursor: zoom-out;
    z-index: 10100;
}

.product-image-lightbox .lightbox-close {
    position: fixed;
    top: max(16px, env(safe-area-inset-top, 16px));
    right: max(16px, env(safe-area-inset-right, 16px));
    z-index: 10105;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    margin: 0;
    border: 2px solid rgba(15, 23, 42, 0.12);
    border-radius: 50%;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.product-image-lightbox .lightbox-close:hover,
.product-image-lightbox .lightbox-close:focus-visible {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    transform: scale(1.06);
    outline: none;
}

.product-image-lightbox .lightbox-nav {
    z-index: 10104;
    background: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    border: 2px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.product-image-lightbox .lightbox-nav:hover {
    background: #fff;
    color: #1565c0;
}

.product-image-lightbox .lightbox-stage {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 90vh;
    pointer-events: none;
}

.product-image-lightbox .lightbox-content {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 90vh;
}

.product-image-lightbox.lightbox .lightbox-content img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.product-image-lightbox .lightbox-counter {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    color: var(--yellow, #ffd600);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: rgba(0, 0, 0, 0.72);
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 0, 0.45);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    z-index: 10002;
    pointer-events: none;
    white-space: nowrap;
}

/* ===== Share modal (SweetAlert2) ===== */
.share-swal-popup {
    border-radius: 20px !important;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2), 0 8px 20px rgba(67, 97, 238, 0.12) !important;
    border: 1px solid rgba(67, 97, 238, 0.12) !important;
}

.share-swal-html {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

.share-swal-close {
    top: 14px !important;
    right: 14px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: #374151 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

.share-swal-close:hover {
    background: #fff !important;
    color: #111827 !important;
    transform: scale(1.05);
}

.share-modal {
    text-align: left;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.share-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 52px 22px 24px;
    color: #fff;
    overflow: hidden;
}

.share-modal-header-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.15) 0%, transparent 45%);
    pointer-events: none;
}

.share-modal-header--facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d5dbf 100%);
}

.share-modal-header--instagram {
    background: linear-gradient(135deg, #f77737 0%, #e1306c 45%, #833ab4 100%);
}

.share-modal-header--tiktok {
    background: linear-gradient(135deg, #25f4ee 0%, #111827 40%, #fe2c55 100%);
}

.share-modal-header--default {
    background: linear-gradient(135deg, var(--primary-color, #4361ee) 0%, #3a56d4 100%);
}

.share-modal-icon-wrap {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.share-modal-header-text {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.share-modal-eyebrow {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.share-modal-title {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.share-modal-body {
    padding: 22px 24px 24px;
    background: #fff;
}

.share-modal-lead {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.55;
}

.share-modal-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #6b7280);
}

/* Read-only preview (not an editable input) */
.share-modal-preview {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    cursor: default;
    user-select: none;
    pointer-events: none;
    opacity: 0.92;
}

.share-modal-preview-message,
.share-modal-preview-link {
    margin: 0;
    font-family: inherit;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #9ca3af;
}

.share-modal-preview-message {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.share-modal-preview-link {
    font-size: 0.8rem;
    color: #a1a1aa;
    word-break: break-all;
}

.share-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.share-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.share-modal-btn span {
    line-height: 1.2;
}

.share-modal-btn--copy {
    background: #fff;
    color: var(--text, #111827);
    border: 1.5px solid var(--border, #e5e7eb);
}

.share-modal-btn--copy:hover {
    background: var(--bg, #f9fafb);
    border-color: var(--primary-color, #4361ee);
    color: var(--primary-color, #4361ee);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.share-modal-btn--open {
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.share-modal-btn--open.share-modal-btn--facebook {
    background: linear-gradient(135deg, #1877f2, #0d5dbf);
}

.share-modal-btn--open.share-modal-btn--instagram {
    background: linear-gradient(135deg, #e1306c, #833ab4);
}

.share-modal-btn--open.share-modal-btn--tiktok {
    background: linear-gradient(135deg, #111827, #fe2c55);
}

.share-modal-btn--open:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.share-modal-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted, #6b7280);
    background: #f9fafb;
    border-radius: 10px;
    border: 1px dashed var(--border, #e5e7eb);
}

.share-modal-tip i {
    color: var(--primary-color, #4361ee);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.share-modal-tip-text {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.share-modal-tip-text strong {
    color: var(--text, #374151);
    font-weight: 700;
}

.share-toast-popup {
    border-radius: 14px !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

@media (max-width: 480px) {
    .share-modal-actions {
        grid-template-columns: 1fr;
    }

    .share-modal-header {
        padding: 20px 48px 18px 18px;
    }

    .share-modal-body {
        padding: 18px;
    }
}

/* —— Purchase sheet (Add to Cart / Buy Now) —— */
@keyframes purchaseModalBackdropIn {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

@keyframes purchaseModalSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes purchaseModalPop {
    from { opacity: 0; transform: translateY(28px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes purchaseModalCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes purchaseModalShine {
    0% { transform: translateX(-120%) skewX(-18deg); }
    100% { transform: translateX(220%) skewX(-18deg); }
}

body.purchase-modal-open {
    overflow: hidden;
}

.purchase-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
}

.purchase-modal[hidden] {
    display: none !important;
}

.purchase-modal:not([hidden]) {
    pointer-events: auto;
}

.purchase-modal__backdrop {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(0, 26, 110, 0.55) 100%);
    opacity: 0;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: opacity 0.3s ease, backdrop-filter 0.35s ease;
}

.purchase-modal--open .purchase-modal__backdrop {
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: purchaseModalBackdropIn 0.35s ease forwards;
}

.purchase-modal__sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(680px, calc(100vw - 32px));
    max-height: min(92vh, 760px);
    background: linear-gradient(165deg, #ffffff 0%, #f8faff 48%, #f0f4ff 100%);
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(67, 97, 238, 0.12);
    border-bottom: none;
    box-shadow:
        0 -12px 48px rgba(0, 26, 110, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    padding: 4px 0 0;
}

.purchase-modal--open .purchase-modal__sheet {
    transform: translateY(0);
    animation: purchaseModalSheetUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.purchase-modal__sheet-glow {
    position: absolute;
    top: -40px;
    right: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 214, 0, 0.35) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.purchase-modal__handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #cbd5e1, #94a3b8, #cbd5e1);
    margin: 14px auto 6px;
    flex-shrink: 0;
    opacity: 0.85;
}

.purchase-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 28px 20px;
    position: relative;
    z-index: 1;
}

.purchase-modal__footer {
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 28%);
    padding-top: 12px;
}

.purchase-modal__footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(67, 97, 238, 0.2), transparent);
}

.purchase-modal__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 28px 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.purchase-modal__header-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--yellow, #ffd600) 0%, #ffe566 100%);
    color: #001a6e;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(255, 214, 0, 0.45);
    flex-shrink: 0;
}

.purchase-modal__header-text {
    flex: 1;
    min-width: 0;
}

.purchase-modal__eyebrow {
    margin: 0 0 2px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #4361ee;
}

.purchase-modal__heading {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.purchase-modal__close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.purchase-modal__close:hover {
    background: #fff;
    color: #001a6e;
}

.purchase-modal__product-card {
    display: flex;
    gap: 18px;
    padding: 20px;
    margin-bottom: 18px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(67, 97, 238, 0.1);
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.08);
    animation: purchaseModalCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.purchase-modal__image-btn {
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    border-radius: 14px;
    position: relative;
}

.purchase-modal__image-btn:hover .purchase-modal__image-zoom {
    opacity: 1;
}

.purchase-modal__image-btn:focus-visible {
    outline: 2px solid #4361ee;
    outline-offset: 3px;
}

.purchase-modal__image-frame {
    display: block;
    width: 112px;
    height: 112px;
    border-radius: 14px;
    overflow: hidden;
    padding: 3px;
    background: linear-gradient(135deg, #4361ee 0%, #ffd600 100%);
    box-shadow: 0 6px 18px rgba(67, 97, 238, 0.25);
    position: relative;
}

.purchase-modal__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 11px;
    background: #f8fafc;
}

.purchase-modal__image-zoom {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0.85;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.purchase-modal__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.purchase-modal__name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.purchase-modal__price {
    margin: 0;
    font-size: 1.28rem;
    font-weight: 800;
    background: linear-gradient(135deg, #001a6e 0%, #4361ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.purchase-modal__stock {
    margin: 0;
}

.purchase-modal__stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.purchase-modal__stock-pill--ok {
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.25);
}

.purchase-modal__stock-pill--out {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.purchase-modal__qty-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    background: #fff;
    border-radius: 16px;
    border: 1px dashed rgba(67, 97, 238, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: purchaseModalCardIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.purchase-modal__qty-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.purchase-modal__qty-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4361ee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.purchase-modal__qty-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.purchase-modal__qty-hint {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
}

.purchase-modal__qty-controls {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    overflow: hidden;
    background: #f8fafc;
    border: 2px solid rgba(67, 97, 238, 0.15);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.1);
    flex-shrink: 0;
}

.purchase-modal__qty-minus,
.purchase-modal__qty-plus {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #4361ee;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.purchase-modal__qty-minus:hover:not(:disabled),
.purchase-modal__qty-plus:hover:not(:disabled) {
    background: rgba(67, 97, 238, 0.1);
    color: #001a6e;
}

.purchase-modal__qty-minus:active:not(:disabled),
.purchase-modal__qty-plus:active:not(:disabled) {
    transform: scale(0.92);
}

.purchase-modal__qty-minus:disabled,
.purchase-modal__qty-plus:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.purchase-modal__qty-input {
    width: 52px;
    height: 40px;
    border: none;
    border-left: 1px solid rgba(67, 97, 238, 0.12);
    border-right: 1px solid rgba(67, 97, 238, 0.12);
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    background: #fff;
    -moz-appearance: textfield;
    font-family: inherit;
}

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

.purchase-modal__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
}

.purchase-modal--mode-cart .purchase-modal__btn--buy {
    display: none !important;
}

.purchase-modal--mode-buy .purchase-modal__btn--cart {
    display: none !important;
}

.purchase-modal--mode-cart .purchase-modal__btn--cart,
.purchase-modal--mode-buy .purchase-modal__btn--buy {
    flex: 1 1 100%;
    max-width: 100%;
    justify-content: center;
}

.purchase-modal__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    margin: 0;
    min-height: 58px;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, filter 0.15s ease, background 0.2s ease;
    text-align: center;
}

.purchase-modal__btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.purchase-modal__btn-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.purchase-modal__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.purchase-modal__btn--cart {
    background: linear-gradient(135deg, #ffd600 0%, #ffe566 55%, #ffd600 100%);
    color: #1a1a2e;
    border: 2px solid #e6c200;
    box-shadow:
        0 6px 20px rgba(255, 214, 0, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.08);
}

.purchase-modal__btn--cart .purchase-modal__btn-icon {
    background: rgba(26, 26, 46, 0.12);
    color: #1a1a2e;
}

.purchase-modal__btn--cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffe566 0%, #fff0a3 55%, #ffe566 100%);
    transform: translateY(-2px);
    box-shadow:
        0 10px 28px rgba(255, 214, 0, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.1);
}

.purchase-modal__btn--buy {
    background: linear-gradient(135deg, #001a6e 0%, #4361ee 55%, #3a56d4 100%);
    color: #fff;
    border: none;
    box-shadow: 0 8px 24px rgba(67, 97, 238, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.purchase-modal__btn--buy .purchase-modal__btn-icon {
    background: rgba(191, 219, 254, 0.35);
    color: #fff;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.purchase-modal__btn--buy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(67, 97, 238, 0.5);
    filter: brightness(1.05);
}

.purchase-modal__btn-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
    pointer-events: none;
    animation: purchaseModalShine 2.8s ease-in-out infinite;
}

.purchase-modal__btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* Purchase modal — mobile */
@media (max-width: 576px) {
    .purchase-modal__sheet {
        max-width: 100%;
        max-height: min(94vh, 820px);
        border-radius: 20px 20px 0 0;
    }

    .purchase-modal__header {
        gap: 10px;
        padding: 8px 20px 16px;
    }

    .purchase-modal__header-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .purchase-modal__heading {
        font-size: 0.98rem;
    }

    .purchase-modal__eyebrow {
        font-size: 0.68rem;
    }

    .purchase-modal__close {
        width: 36px;
        height: 36px;
    }

    .purchase-modal__body {
        padding: 6px 20px 16px;
    }

    .purchase-modal__footer::before {
        left: 20px;
        right: 20px;
    }

    .purchase-modal__product-card {
        flex-wrap: wrap;
        gap: 14px;
        padding: 16px;
        margin-bottom: 14px;
    }

    .purchase-modal__image-frame {
        width: 88px;
        height: 88px;
    }

    .purchase-modal__name {
        font-size: 0.9rem;
    }

    .purchase-modal__price {
        font-size: 1.15rem;
    }

    .purchase-modal__qty-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px 18px;
    }

    .purchase-modal__qty-controls {
        align-self: center;
    }

    .purchase-modal__actions {
        padding: 14px 20px;
        padding-bottom: max(22px, env(safe-area-inset-bottom, 0px));
    }

    .purchase-modal__btn {
        min-height: 54px;
        padding: 12px 20px;
        gap: 10px;
    }

    .purchase-modal__btn-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .purchase-modal__btn-title {
        font-size: 1.08rem;
    }

    .purchase-modal--mode-cart .purchase-modal__btn--cart .purchase-modal__btn-title,
    .purchase-modal--mode-buy .purchase-modal__btn--buy .purchase-modal__btn-title {
        font-size: 1.12rem;
    }
}

@media (max-width: 380px) {
    .purchase-modal__body {
        padding: 6px 16px 14px;
    }

    .purchase-modal__header {
        padding: 8px 16px 14px;
    }

    .purchase-modal__actions {
        padding: 12px 16px;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    }

    .purchase-modal__footer::before {
        left: 16px;
        right: 16px;
    }

    .purchase-modal__btn-title {
        font-size: 1rem;
    }

    .purchase-modal__product-card {
        justify-content: center;
        text-align: center;
    }

    .purchase-modal__info {
        align-items: center;
        width: 100%;
    }

    .purchase-modal__stock-pill {
        justify-content: center;
    }
}

@media (min-width: 640px) {
    .purchase-modal {
        align-items: center;
        padding: 32px;
    }

    .purchase-modal__handle {
        display: none;
    }

    .purchase-modal__sheet {
        border-radius: 24px;
        border-bottom: 1px solid rgba(67, 97, 238, 0.12);
        max-width: 680px;
        max-height: min(92vh, 760px);
        transform: translateY(24px) scale(0.94);
        opacity: 0;
        transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
    }

    .purchase-modal__header {
        padding: 16px 32px 24px;
    }

    .purchase-modal__body {
        padding: 12px 32px 24px;
    }

    .purchase-modal__footer::before {
        left: 32px;
        right: 32px;
    }

    .purchase-modal__actions {
        padding: 20px 32px;
        padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
    }

    .purchase-modal__btn-title {
        font-size: 1.28rem;
    }

    .purchase-modal__btn-icon {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
    }

    .purchase-modal--open .purchase-modal__sheet {
        transform: translateY(0) scale(1);
        opacity: 1;
        animation: purchaseModalPop 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }
}