/**
 * Product detail page — reviews section overrides (ported from fumotde single-product.css)
 * Loaded only on is_product(). Colors mapped to vozolde purple theme.
 *
 * @package vozolde
 */

#reviews-list {
  scroll-margin-top: calc(var(--header-h, 72px) + 16px);
}

/* Star colors: filled gold, empty gray */
.review-stars-filled,
.pdp-stars .review-stars-filled {
  color: #f5a623;
  letter-spacing: 2px;
}
.review-stars-empty,
.pdp-stars .review-stars-empty {
  color: #d2d5dd;
  letter-spacing: 2px;
}

.review-images,
.review-images a,
.review-images img {
  max-width: 100%;
}

.review-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Match fumotde PDP: constrain to review-card column (~300px), prevent flex overflow on large originals */
.review-images img {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-width: 0;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid hsl(var(--border));
  background: #fff;
}

.vs-star.active svg {
  fill: #f5a512;
}

.vs-review-form-section {
  margin-top: 28px;
}

#review_form_wrapper {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 14px;
  padding: 26px 22px;
  box-shadow: 0 10px 28px rgba(10, 18, 32, 0.06);
}

#review_form .comment-reply-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  margin-bottom: 18px;
}

.vs-review-form .comment-form-field,
.vs-review-form .comment-form-rating,
.vs-review-form .comment-form-images {
  margin-bottom: 14px;
}

.vs-review-form .comment-form-rating label,
.vs-review-form .comment-form-field label {
  display: inline-block;
  font-size: 0.84rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
  font-weight: 600;
}

.vs-review-form input[type="text"],
.vs-review-form input[type="email"],
.vs-review-form textarea {
  width: 100%;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.92rem;
  color: hsl(var(--foreground));
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.vs-review-form textarea {
  min-height: 128px;
  resize: vertical;
}

.vs-review-form input[type="text"]:focus,
.vs-review-form input[type="email"]:focus,
.vs-review-form textarea:focus {
  outline: 0;
  border-color: rgba(113, 73, 192, 0.72);
  box-shadow: 0 0 0 3px rgba(113, 73, 192, 0.12);
}

.vs-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  background: #f8f6ff;
}

.vs-star {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d2d5dd;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease;
}

.vs-star svg {
  width: 20px;
  height: 20px;
}

.vs-star:hover {
  transform: translateY(-1px);
}

.vs-star.active {
  color: #f5a623;
}

.vs-rating-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

.vs-rating-stars-wrapper .stars {
  display: none;
}

.vs-image-upload-wrapper {
  border: 1px dashed hsl(var(--border));
  border-radius: 12px;
  padding: 12px;
  background: #fcfcfd;
}

.vs-image-upload-wrapper #comment_images {
  display: none;
}

.vs-image-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
}

.vs-image-upload-btn:hover {
  border-color: rgb(var(--primary));
  color: rgb(var(--primary));
}

#comment_images {
  display: block;
  margin-top: 10px;
  font-size: 0.82rem;
}

.comment-images-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
}

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

.comment-image-preview-item {
  position: relative;
  width: 64px;
  height: 64px;
}

.comment-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
}

.comment-image-preview-item .remove-image {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

.vs-review-submit {
  min-height: 42px;
  min-width: 180px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgb(var(--primary));
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.vs-review-submit:hover {
  opacity: 0.9;
}

.vs-review-submit:disabled,
.vs-review-submit.is-loading {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.vs-review-notice {
  margin-top: 16px;
  padding: 12px;
  background: #fff8e8;
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  font-size: 0.84rem;
  color: #856404;
}

.vs-review-notice-success {
  background: #ebfbf1;
  border-left-color: #2eaf69;
  color: #1e6a42;
}

.review-empty {
  padding: 28px 24px;
  border: 1px dashed hsl(var(--border));
  border-radius: 12px;
  background: linear-gradient(180deg, hsl(var(--card)) 0%, #f8f6ff 100%);
  margin: 24px 0;
  text-align: center;
}

.review-empty h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: hsl(var(--foreground));
}

.review-empty p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}

.review-empty .btn {
  margin-top: 14px;
}

@media (max-width: 768px) {
  #review_form_wrapper {
    padding: 18px 14px;
  }

  #reviews-list .pdp-section h2 {
    font-size: 1.3rem;
  }

  #reviews-list .review-grid {
    column-count: 2;
    column-width: auto;
    column-gap: 12px;
  }

  #reviews-list .review-card {
    padding: 14px;
    margin-bottom: 12px;
  }
}
