/**
 * HELICORP Sapo Product Reviews Stylesheet
 * Mirrored UI logic from HeLiCorp Storefront & ZMA
 * Scope: #helicorp-product-reviews, .helicorp-reviews-container, .helicorp-star-badge
 */

/* Container and layout */
.helicorp-reviews-container {
  display: block;
  width: 100%;
  margin: 1.5rem 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
  line-height: 1.5;
  box-sizing: border-box;
}

.helicorp-reviews-container * {
  box-sizing: border-box;
}

/* Header */
.helicorp-reviews-header {
  margin-bottom: 1.5rem;
}

.helicorp-reviews-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.25rem 0;
}

.helicorp-reviews-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* Summary Card */
.helicorp-reviews-summary {
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .helicorp-reviews-summary {
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
  }
}

.helicorp-summary-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  text-align: center;
}

.helicorp-summary-score {
  font-size: 2.5rem;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.helicorp-summary-score span {
  font-size: 1.25rem;
  font-weight: 600;
  color: #9ca3af;
}

.helicorp-stars-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0.5rem 0 0.25rem;
  color: #f59e0b;
}

.helicorp-stars-row svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

.helicorp-summary-count {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* Distribution Bars */
.helicorp-distribution-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.helicorp-dist-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #4b5563;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.15s;
}

.helicorp-dist-row:hover {
  background-color: #f3f4f6;
}

.helicorp-dist-label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: 2.75rem;
  font-weight: 600;
}

.helicorp-dist-label svg {
  width: 0.75rem;
  height: 0.75rem;
  fill: #f59e0b;
  color: #f59e0b;
}

.helicorp-dist-track {
  flex: 1;
  height: 0.5rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.helicorp-dist-fill {
  height: 100%;
  background-color: #f59e0b;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.helicorp-dist-count {
  width: 2.5rem;
  text-align: right;
  color: #6b7280;
}

/* Filter Bar */
.helicorp-reviews-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.helicorp-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.helicorp-pill-btn {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.helicorp-pill-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.helicorp-pill-btn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.helicorp-sort-select {
  font-size: 0.8125rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  background-color: #ffffff;
  color: #374151;
  cursor: pointer;
  outline: none;
}

.helicorp-sort-select:focus {
  border-color: #9ca3af;
}

/* Review Items List */
.helicorp-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.helicorp-review-card {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f3f4f6;
}

.helicorp-review-card:last-child {
  border-bottom: none;
}

.helicorp-review-author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}

.helicorp-author-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: #e0e7ff;
  color: #4338ca;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}

.helicorp-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.helicorp-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.helicorp-author-name-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.helicorp-author-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
}

.helicorp-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 600;
}

.helicorp-verified-badge svg {
  width: 0.75rem;
  height: 0.75rem;
  fill: currentColor;
}

.helicorp-review-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.helicorp-review-variant {
  color: #6b7280;
}

.helicorp-review-content {
  font-size: 0.875rem;
  color: #374151;
  margin: 0.5rem 0;
  line-height: 1.6;
  white-space: pre-line;
}

/* Media attachments */
.helicorp-review-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.helicorp-review-media-thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.5rem;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  transition: transform 0.15s, opacity 0.15s;
}

.helicorp-review-media-thumb:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

.helicorp-review-media-video {
  width: 16rem;
  max-width: 100%;
  max-height: 16rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

/* Shop Reply Box */
.helicorp-shop-reply {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  background-color: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.8125rem;
}

.helicorp-shop-reply-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.helicorp-shop-reply-title svg {
  width: 0.875rem;
  height: 0.875rem;
  fill: currentColor;
}

.helicorp-shop-reply-body {
  color: #334155;
  line-height: 1.5;
}

.helicorp-shop-reply-date {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: #94a3b8;
}

/* Pagination / Load more */
.helicorp-reviews-pagination {
  text-align: center;
  margin-top: 1.5rem;
}

.helicorp-loadmore-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.helicorp-loadmore-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.helicorp-loadmore-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty, Unavailable, Error, and Loading States */
.helicorp-reviews-empty,
.helicorp-reviews-unavailable,
.helicorp-reviews-error,
.helicorp-reviews-loading {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.helicorp-reviews-error {
  color: #b91c1c;
}

.helicorp-retry-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.helicorp-retry-btn:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}
/* Star Badge (PDP & Catalog) */
.helicorp-star-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
}

.helicorp-star-badge .hc-badge-star {
  width: 0.875rem;
  height: 0.875rem;
  fill: #f59e0b;
  color: #f59e0b;
}

.helicorp-star-badge .hc-badge-count {
  font-weight: 400;
  color: #6b7280;
}

/* Lightbox */
.helicorp-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.helicorp-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.helicorp-lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

#section-review > .container > .card {
  border: 0;
  box-shadow: none;
}