/* NF Product Reviews (PDP tabs + standalone) */

.nf-product-reviews {
  --green:        #48b15a;
  --green-dark:   #178a47;
  --green-bg:     #f0faf4;
  --border:       #e5e7eb;
  --border-hover: #b8ddc8;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --pill-bg:      #f3f3f3;
  --card-bg:      #F9F9FA;
  --radius-card:  12px;
  --radius-pill:  999px;
}

.nf-product-reviews-wrap .nf-product-reviews {
  max-width: 100%;
}

.nf-product-reviews--loading {
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Stars */
.nf-product-reviews .prs-stars {
  display: flex;
  gap: 0;
  font-size: 1.125rem;
  line-height: 1;
}

.nf-product-reviews .prs-stars--inline {
  font-size: 1.125rem;
  gap: 2px;
}

.nf-product-reviews .prs-star {
  display: inline-block;
  color: var(--green);
}

.nf-product-reviews .prs-star-full {
  color: var(--green);
}

.nf-product-reviews .prs-star-empty {
  color: #e0e0e0;
}

/* Summary header (tabs / legacy) */
.nf-product-reviews__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.nf-product-reviews__rating-main {
  text-align: center;
  flex: 1 1 200px;
}

.nf-product-reviews__score {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.nf-product-reviews__score-max {
  font-size: 2.5rem;
  font-weight: 400;
}

.nf-product-reviews__based-on {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Filterable list layout (reference design) */
.nf-product-reviews--filterable {
  background: #fff;
  color: var(--text);
}

.nf-product-reviews--filterable .nf-product-reviews__toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--nf-space-sm, 1rem);
  margin: 0;
}

.nf-product-reviews--filterable .nf-product-reviews__toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nf-space-md, 1.5rem);
  flex-wrap: nowrap;
}

.nf-product-reviews--filterable .nf-product-reviews__topics-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.nf-product-reviews--filterable .nf-product-reviews__topics-row {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  flex-wrap: nowrap;
  gap: var(--nf-space-2xs, 0.5rem);
}

.nf-product-reviews--filterable .nf-product-reviews__topic-pills {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  gap: var(--nf-space-2xs, 0.5rem);
}

.nf-product-reviews--filterable .nf-product-reviews__topic-pill {
  appearance: none;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.2;
  padding: 0.5rem 1rem;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nf-product-reviews--filterable .nf-product-reviews__topic-pill:hover,
.nf-product-reviews--filterable .nf-product-reviews__topic-pill.is-active {
  background: #e8e8e8;
}

.nf-product-reviews--filterable .nf-product-reviews__topic-pill.is-collapsed {
  display: none;
}

.nf-product-reviews--filterable .nf-product-reviews__topic-pills.is-expanded .nf-product-reviews__topic-pill.is-collapsed {
  display: inline-flex;
}

.nf-product-reviews--filterable .nf-product-reviews__topics-more {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.nf-product-reviews--filterable .nf-product-reviews__sort-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin: 0;
}

.nf-product-reviews--filterable .nf-product-reviews__sort-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  cursor: pointer;
}

.nf-product-reviews--filterable .nf-product-reviews__sort-current {
  color: var(--text);
  font-weight: 500;
}

.nf-product-reviews--filterable .nf-product-reviews__sort-wrap::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.15rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg) translateY(-1px);
  pointer-events: none;
}

.nf-product-reviews--filterable .nf-product-reviews__select--sort {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.nf-product-reviews--filterable .nf-product-reviews__select--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nf-product-reviews--filterable .nf-product-reviews__rule--toolbar {
  margin: 1rem 0 0;
}

.nf-product-reviews--filterable .nf-product-reviews__item {
  display: grid;
  grid-template-columns: minmax(8rem, 22%) 1fr;
  gap: 2rem;
  align-items: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 1.5rem 0;
  margin: 0;
}

.nf-product-reviews--filterable .nf-product-reviews__rule--item {
  display: block;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.nf-product-reviews--filterable .nf-product-reviews__meta-col {
  flex: unset;
  max-width: none;
}

.nf-product-reviews--filterable .nf-product-reviews__author-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nf-product-reviews--filterable .nf-product-reviews__author {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text);
}

.nf-product-reviews--filterable .nf-product-reviews__flag {
  font-size: 1rem;
  line-height: 1;
}

.nf-product-reviews--filterable .nf-product-reviews__verified {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.nf-product-reviews--filterable .nf-product-reviews__verified-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #111;
  color: #fff;
  flex-shrink: 0;
}

.nf-product-reviews--filterable .nf-product-reviews__verified-icon svg {
  display: block;
}

.nf-product-reviews--filterable .nf-product-reviews__row-title {
  margin-bottom: 0.5rem;
}

.nf-product-reviews--filterable .nf-product-reviews__text {
  margin: 0;
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.55;
}

.nf-product-reviews--filterable .nf-product-reviews__text p {
  margin: 0;
}

.nf-product-reviews--filterable .nf-product-reviews__photo {
  margin: 0.75rem 0 0;
}

.nf-product-reviews--filterable .nf-product-reviews__photo img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 4px;
}

.nf-product-reviews--filterable .nf-product-reviews__pagination {
  margin-top: 1.5rem;
}

.nf-product-reviews--filterable .nf-product-reviews__page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.nf-product-reviews--filterable .nf-product-reviews__page-btn--nav {
  font-size: 1.125rem;
  color: var(--text);
}

.nf-product-reviews--filterable .nf-product-reviews__page-btn:hover:not(:disabled):not(.is-current) {
  background: transparent;
  color: var(--text);
}

.nf-product-reviews--filterable .nf-product-reviews__page-btn.is-current {
  background: var(--green);
  color: #fff;
}

/* Legacy toolbar (non-filterable / tabs) */
.nf-product-reviews__toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.nf-product-reviews__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.nf-product-reviews__sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.nf-product-reviews__sort-label {
  color: #374151;
  white-space: nowrap;
}

.nf-product-reviews__select {
  min-width: 10rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.nf-product-reviews__rule {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 1rem;
}

/* Legacy review cards */
.nf-product-reviews__item {
  border: 1px solid #ebebeb;
  border-radius: 16px;
  background: #fff;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1.25rem;
}

.nf-product-reviews__rule--item {
  display: none;
}

.nf-product-reviews__meta-col {
  flex: 0 0 140px;
  max-width: 35%;
}

.nf-product-reviews__body-col {
  flex: 1 1 auto;
  min-width: 0;
}

.nf-product-reviews__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.nf-product-reviews__author {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
}

.nf-product-reviews__verified {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--green);
}

.nf-product-reviews__verified-icon {
  margin-right: 0.15rem;
}

.nf-product-reviews__row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.nf-product-reviews__numeric {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.nf-product-reviews__date {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.nf-product-reviews__text {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.5;
}

.nf-product-reviews__empty {
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding: 1rem 0;
}

/* Pagination */
.nf-product-reviews__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.nf-product-reviews__page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nf-product-reviews__page-btn:hover:not(:disabled):not(.is-current) {
  border-color: var(--border-hover);
  background: var(--green-bg);
  color: var(--green-dark);
}

.nf-product-reviews__page-btn.is-current {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  cursor: default;
}

.nf-product-reviews__page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nf-product-reviews__page-btn--nav {
  font-size: 1.25rem;
}

.nf-product-reviews__page-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--text-muted);
  user-select: none;
}

/* Mobile */
@media (max-width: 768px) {
  .nf-product-reviews__summary {
    gap: 0.5rem;
  }

  .nf-product-reviews__rating-main {
    flex: 1 1 100%;
    text-align: center;
  }

  .nf-product-reviews__score {
    font-size: 2rem;
  }

  .nf-product-reviews .prs-stars {
    font-size: 24px;
    justify-content: center;
  }

  .nf-product-reviews__toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nf-product-reviews__filters {
    width: 100%;
    justify-content: space-between;
  }

  .nf-product-reviews__sort-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .nf-product-reviews__select {
    flex: 1;
    min-width: 0;
  }

  .nf-product-reviews__item {
    flex-direction: column;
    padding: 0.875rem 1rem;
  }

  .nf-product-reviews__meta-col {
    max-width: 100%;
    flex: 0 0 auto;
  }

  .nf-product-reviews__date {
    margin-left: 0;
  }

  .nf-product-reviews__page-btn {
    min-width: 34px;
    height: 34px;
  }

  div#reviews {
    padding: 1rem;
  }

  .nf-product-reviews__score-max {
    font-size: 2rem;
  }

  .nf-product-reviews--filterable .nf-product-reviews__toolbar-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--nf-space-sm, 0.75rem);
  }

  .nf-product-reviews--filterable .nf-product-reviews__topics-row {
    flex-wrap: wrap;
    width: 100%;
  }

  .nf-product-reviews--filterable .nf-product-reviews__topic-pills {
    flex-wrap: wrap;
  }

  .nf-product-reviews--filterable .nf-product-reviews__sort-wrap {
    margin-left: 0;
    align-self: flex-end;
  }

  .nf-product-reviews--filterable .nf-product-reviews__item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.25rem 0;
  }
}
