/* =========================================================================
   ETERNAL SPORTS - avaliacoes.css
   Estrelas, seção de avaliações da página de produto e a página /avaliar.
   Carregado só por produto.html e avaliar.html (fica fora do style.css pra
   não precisar subir a versão do CSS em todas as páginas do site). Usa os
   tokens do style.css, então acompanha o tema claro/escuro sozinho.
   ========================================================================= */

:root { --star: #F2A100; }

/* ---------- Estrelas (SVG, com preenchimento parcial pra média) ---------- */
.stars { display: inline-block; width: 6rem; height: 1.2rem; vertical-align: middle; flex-shrink: 0; }
.stars--sm { width: 5rem; height: 1rem; }
.stars-bg { fill: var(--border-strong); }
.stars-fg { fill: var(--star); }

/* Resumo logo abaixo do nome do produto (só aparece com avaliação) */
.rating-summary {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem;
  margin-top: .75rem; font-size: .9rem; color: var(--text-muted);
}
.rating-summary strong { color: var(--text); font-weight: 700; }
.rating-summary-count { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.rating-summary:hover .rating-summary-count { color: var(--lime); text-decoration-color: currentColor; }

/* ---------- Seção de avaliações do produto ---------- */
.product-reviews { border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 1rem); }
.reviews-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1.25rem 2rem; margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.reviews-score { display: flex; align-items: center; gap: 1rem; }
.reviews-score-num { font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--text); }
.reviews-score-total { font-size: .85rem; color: var(--text-muted); margin-top: .3rem; }

.reviews-list {
  display: grid; gap: var(--gap); align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.review {
  display: flex; flex-direction: column; gap: .85rem;
  padding: 1.25rem; background: var(--surface); border: 1px solid var(--border);
}
.review-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.review-date { font-size: .78rem; color: var(--text-faint); }
.review-text { color: var(--text); font-size: .95rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.review-photos { display: flex; flex-wrap: wrap; gap: .5rem; }
.review-photo {
  width: 72px; height: 72px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
}
.review-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.review-photo:hover img { transform: scale(1.07); }
.review-author { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; font-size: .85rem; color: var(--text-muted); }
.review-author strong { color: var(--text); font-weight: 600; }
.review-verified { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; color: var(--lime); }
.review-verified svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.reviews-more { margin-top: 2rem; display: flex; justify-content: center; }

/* Ampliar foto */
.lightbox {
  position: fixed; inset: 0; z-index: calc(var(--z-toast) + 10);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(0, 0, 0, .92);
}
.lightbox img { max-width: min(96vw, 1100px); max-height: 86vh; object-fit: contain; }
.lightbox-btn {
  position: absolute; width: 46px; height: 46px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255, 255, 255, .14); font-size: 1.5rem; line-height: 1;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .28); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- Página /avaliar ---------- */
.review-page { max-width: 760px; }

.review-state {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem; text-align: center;
  border: 1px solid var(--border); background: var(--surface);
}
.review-state h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); color: var(--text); }
.review-state p { max-width: 460px; }
.review-state-icon { width: 44px; height: 44px; color: var(--lime); fill: none; stroke: currentColor; stroke-width: 1.8; }
.review-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: .5rem; }

.review-item { margin: 0 0 1.25rem; padding: 1.25rem; min-width: 0; border: 1px solid var(--border); background: var(--surface); }
.review-item-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.review-item-img { flex: none; width: 84px; height: 84px; overflow: hidden; background: var(--surface-2); }
.review-item-img img { width: 100%; height: 100%; object-fit: cover; }
.review-item-name { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.05; text-transform: uppercase; color: var(--text); }
.review-item-hint { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }

.star-input { display: flex; gap: .15rem; margin-left: -.35rem; }
.star-input button { width: 50px; height: 50px; padding: 7px; }
.star-input svg { width: 100%; height: 100%; fill: var(--border-strong); transition: fill .12s ease, transform .12s ease; }
.star-input button.is-on svg { fill: var(--star); }
.star-input button:active svg { transform: scale(.9); }
.star-input-label { min-height: 1.5rem; margin-top: .15rem; font-size: .95rem; font-weight: 600; color: var(--text); }

.review-field { display: block; margin-top: 1.1rem; }
.review-field > span, .review-photos-label {
  display: block; margin-bottom: .5rem; font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.review-field textarea {
  display: block; width: 100%; min-height: 112px; padding: .8rem .9rem; resize: vertical;
  font: inherit; line-height: 1.5; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
}
.review-field textarea::placeholder { color: var(--text-faint); }
.review-opt { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.review-field-count { margin-top: .35rem; font-size: .75rem; text-align: right; color: var(--text-faint); }

.review-photos-input { margin-top: 1.1rem; }
.photo-grid { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.photo-grid:empty { display: none; }
.photo-thumb { position: relative; width: 84px; height: 84px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--border); }
.photo-thumb button {
  position: absolute; top: 0; right: 0; width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(0, 0, 0, .78); font-size: 1.1rem; line-height: 1;
}
.photo-thumb button:hover { background: var(--lime); }
.review-hint { margin-top: .5rem; font-size: .78rem; color: var(--text-faint); }
.review-photos-input .btn svg { fill: none; stroke: currentColor; stroke-width: 2; }

.review-form-erro { margin-bottom: 1rem; padding: .8rem 1rem; font-size: .9rem; color: #C8102E; border: 1px solid #C8102E; }
.review-form-note { margin-top: 1rem; font-size: .8rem; color: var(--text-faint); text-align: center; }

@media (max-width: 479px) {
  .review-item { padding: 1rem; }
  .review-item-img { width: 68px; height: 68px; }
  .star-input button { width: 46px; height: 46px; }
  .photo-thumb { width: 76px; height: 76px; }
}
