:root {
  --sw-review-primary: var(--sw-color-text-main, #000000);
  --sw-review-star-fill: #ffc107;
  --sw-review-star-empty: var(--sw-color-text-muted, #e4e5e9);
  --sw-review-bg-light: var(--sw-color-surface, #f9f9f9);
  --sw-review-border: var(--sw-border, #e0e0e0);
  --sw-review-radius: var(--sw-radius-md, 6px);
}

/* Reviews Wrapper overrides */
.sw-reviews {
  font-family: inherit;
  margin-top: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.sw-reviews-header {
  margin-bottom: 1.5rem;
}

.sw-reviews-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.sw-reviews-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sw-stars-display {
  display: inline-block;
  position: relative;
  color: var(--sw-review-star-empty);
  letter-spacing: 2px;
  line-height: 1;
  font-size: 1.25rem;
}

.sw-stars-display .sw-stars-fill {
  color: var(--sw-review-star-fill);
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sw-stars-small {
  font-size: 0.9rem;
}

.sw-average-rating {
  font-size: 1.125rem;
  font-weight: 600;
}

.sw-total-reviews {
  color: var(--sw-color-text-muted); /* using global token if available, or fallback */
  font-size: 0.875rem;
}

.sw-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.sw-review-item {
  border: 1px solid var(--sw-review-border);
  border-radius: var(--sw-review-radius);
  padding: 1.25rem;
  background-color: var(--sw-color-surface, #ffffff);
}

.sw-review-meta {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.sw-review-avatar {
  width: 40px;
  height: 40px;
  background-color: var(--sw-review-bg-light);
  border: 1px solid var(--sw-review-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.sw-review-author-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sw-review-author-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.sw-review-date {
  margin-left: auto;
  font-size: 0.875rem;
}

.sw-review-content {
  line-height: 1.5;
  font-size: 0.95rem;
}

.sw-no-reviews {
  text-align: center;
  padding: 2rem;
  background-color: var(--sw-review-bg-light);
  border-radius: var(--sw-review-radius);
  border: 1px dashed var(--sw-review-border);
}

.sw-no-reviews-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.sw-no-reviews h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

.sw-no-reviews p {
  margin: 0;
  font-size: 0.9rem;
}

.sw-review-form-title {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.sw-review-form-container {
  margin-top: 2rem;
}

.review-form-group {
  margin-bottom: 1rem;
}

/* Star Rating Input */
.sw-star-rating-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.1rem;
}

.sw-star-rating-input input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sw-star-rating-input label {
  color: var(--sw-review-star-empty);
  font-size: 1.75rem;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.sw-star-rating-input input:checked ~ label,
.sw-star-rating-input label:hover,
.sw-star-rating-input label:hover ~ label {
  color: var(--sw-review-star-fill);
}
