/* ==========================================================================
   AURORA JOIAS - PRODUTO: ABAS, ESTRELAS E AVALIAÇÕES
   Estilos próprios (os estilos nativos do WooCommerce estão desativados).
   ========================================================================== */

:root {
  --star-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23dfd8ca' d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
  --star-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23c5a880' d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
  --rv-line: #ece7de;
  --rv-bg: #fbfaf8;
  --rv-text: #1b1b1b;
  --rv-muted: #6b665d;
  --rv-gold-ink: #8a6d3b;
  --rv-ring: 0 0 0 4px rgba(197, 168, 128, 0.28);
}

/* ---------- Estrelas de nota (exibição) ---------- */
.star-rating {
  position: relative;
  display: inline-block;
  width: 5.6em;
  height: 1.12em;
  font-size: 16px;
  line-height: 1;
  overflow: hidden;
  vertical-align: middle;
  letter-spacing: 0;
  background: var(--star-off) repeat-x 0 50% / 1.12em 1.12em;
}
.star-rating::before,
.star-rating span::before { content: none; }
.star-rating span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-indent: -999em;        /* texto "Avaliado com X de 5" fica só p/ leitores de tela */
  background: var(--star-on) repeat-x 0 50% / 1.12em 1.12em;
}

/* Nota no resumo do produto */
.woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.woocommerce-product-rating .star-rating { margin: 0; font-size: 17px; }
.woocommerce-review-link { font-size: 13px; color: var(--rv-muted); text-decoration: underline; text-underline-offset: 3px; }
.woocommerce-review-link:hover { color: var(--rv-gold-ink); }

/* ---------- Abas ---------- */
.woocommerce-tabs ul.tabs {
  display: flex;
  gap: 36px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  overflow: visible;               /* remove a barra de rolagem vertical indesejada */
  border-bottom: 1px solid var(--rv-line);
}
.woocommerce-tabs ul.tabs li { margin: 0; padding: 0; list-style: none; }
.woocommerce-tabs ul.tabs li a {
  display: block;
  padding: 16px 2px;
  margin-bottom: -1px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--rv-muted);
  border-bottom: 2px solid transparent;
  transition: color .25s ease, border-color .25s ease;
}
.woocommerce-tabs ul.tabs li a:hover { color: var(--rv-text); }
.woocommerce-tabs ul.tabs li.active a { color: var(--rv-text); border-bottom-color: #c5a880; }
.woocommerce-tabs ul.tabs li a:focus-visible { outline: 2px solid var(--rv-gold-ink); outline-offset: 2px; }
.woocommerce-Tabs-panel { max-width: 860px; font-size: 15px; line-height: 1.75; color: #3a3833; }
.woocommerce-Tabs-panel > h2:first-child { margin: 0 0 18px; font-size: 26px; }

/* ---------- Avaliações: título e estado vazio ---------- */
#reviews .woocommerce-Reviews-title {
  margin: 0 0 20px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--rv-text);
}
#reviews .woocommerce-noreviews {
  margin: 0 0 28px;
  padding: 26px 24px;
  text-align: center;
  font-size: 15px;
  color: var(--rv-muted);
  background: var(--rv-bg);
  border: 1px dashed #d9d3c7;
  border-radius: 12px;
}

/* ---------- Lista de avaliações ---------- */
#reviews ol.commentlist {
  display: grid;
  gap: 16px;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
}
#reviews ol.commentlist li { margin: 0; padding: 0; list-style: none; }
#reviews .comment_container {
  display: flex;
  gap: 18px;
  padding: 24px;
  background: var(--rv-bg);
  border: 1px solid var(--rv-line);
  border-radius: 12px;
}
#reviews .comment_container img.avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
#reviews .comment-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#reviews .comment-text .star-rating { float: none; display: block; margin: 0 0 2px; font-size: 15px; }
#reviews .comment-text p { margin: 0; }
#reviews .comment-text .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--rv-muted); }
#reviews .woocommerce-review__author { font-size: 15px; font-weight: 600; color: var(--rv-text); }
#reviews .woocommerce-review__dash { display: none; }
#reviews .woocommerce-review__published-date { font-size: 12.5px; }
#reviews .woocommerce-review__verified {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 3px 9px;
  color: #1f6b25;
  background: #e9f5ea;
  border-radius: 999px;
}
#reviews .description { font-size: 15px; line-height: 1.7; color: #3a3833; }

/* ---------- Formulário de avaliação ---------- */
#review_form_wrapper #respond {
  padding: 32px;
  background: var(--rv-bg);
  border: 1px solid var(--rv-line);
  border-radius: 14px;
}
#reviews #reply-title {
  display: block;
  margin: 0 0 22px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--rv-text);
}
#reviews #commentform {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 20px;
}
#reviews #commentform > p { margin: 0; }
#reviews #commentform .comment-notes,
#reviews #commentform .comment-form-rating,
#reviews #commentform .comment-form-comment,
#reviews #commentform .comment-form-cookies-consent,
#reviews #commentform .form-submit { grid-column: 1 / -1; }
#reviews #commentform label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--rv-text);
}
#reviews #commentform .required { color: #c62828; }
#reviews #commentform input[type="text"],
#reviews #commentform input[type="email"],
#reviews #commentform textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--rv-text);
  background: #fff;
  border: 1px solid #d9d3c7;
  border-radius: 12px;
  box-shadow: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#reviews #commentform textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
#reviews #commentform input:hover,
#reviews #commentform textarea:hover { border-color: #c5a880; }
#reviews #commentform input:focus,
#reviews #commentform textarea:focus { outline: none; border-color: #c5a880; box-shadow: var(--rv-ring); }
#reviews #commentform .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 10px; }
#reviews #commentform .comment-form-cookies-consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: #c5a880; }
#reviews #commentform .comment-form-cookies-consent label { margin: 0; font-weight: 400; color: var(--rv-muted); }
#reviews .comment-notes { font-size: 13px; color: var(--rv-muted); }

/* Seletor de estrelas interativo (o WooCommerce troca o <select> por p.stars via JS) */
.comment-form-rating p.stars { margin: 6px 0 0; line-height: 1; }
.comment-form-rating p.stars span { display: inline-flex; gap: 6px; }
.comment-form-rating p.stars a {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  overflow: hidden;
  white-space: nowrap;
  text-indent: -999em;             /* esconde "1 de 5 estrelas" (continua acessível) */
  border-radius: 8px;
  transition: transform .2s ease;
}
.comment-form-rating p.stars a::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--star-off) center / contain no-repeat;
  transition: transform .2s ease;
}
/* estado selecionado */
.comment-form-rating p.stars.selected a.active::before { background-image: var(--star-on); }
.comment-form-rating p.stars.selected a.active ~ a::before { background-image: var(--star-off); }
.comment-form-rating p.stars.selected a:not(.active)::before { background-image: var(--star-on); }
/* hover (vem depois: tem prioridade sobre o selecionado) */
.comment-form-rating p.stars:hover a::before { background-image: var(--star-on); }
.comment-form-rating p.stars:hover a:hover ~ a::before { background-image: var(--star-off); }
.comment-form-rating p.stars a:hover::before { transform: scale(1.12); }
.comment-form-rating p.stars a:focus-visible { outline: 2px solid var(--rv-gold-ink); outline-offset: 1px; }
/* fallback sem JS: select visível e estilizado */
.comment-form-rating select#rating { width: auto; min-width: 220px; min-height: 48px; padding: 0 14px; border: 1px solid #d9d3c7; border-radius: 12px; background: #fff; }

/* Botão enviar */
#reviews #commentform .form-submit { display: flex; justify-content: flex-end; }
#reviews #commentform input#submit,
#reviews #commentform .form-submit .submit {
  min-height: 52px;
  padding: 0 40px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #1b1b1b;
  background: #c5a880;
  border: 1px solid #c5a880;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(179, 147, 104, 0.35);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
#reviews #commentform input#submit:hover {
  background: #b39368;
  border-color: #b39368;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(179, 147, 104, 0.45);
}
#reviews #commentform input#submit:focus-visible { outline: 2px solid var(--rv-gold-ink); outline-offset: 2px; }
#reviews .woocommerce-verification-required { font-size: 14px; color: var(--rv-muted); padding: 18px 20px; background: var(--rv-bg); border-radius: 12px; border: 1px dashed #d9d3c7; }

/* ---------- Responsivo ---------- */
@media (max-width: 640px) {
  .woocommerce-tabs ul.tabs {
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .woocommerce-tabs ul.tabs::-webkit-scrollbar { display: none; }
  .woocommerce-tabs ul.tabs li a { white-space: nowrap; }
  #reviews .woocommerce-Reviews-title { font-size: 24px; }
  #review_form_wrapper #respond { padding: 22px 18px; border-radius: 12px; }
  #reviews #reply-title { font-size: 21px; }
  #reviews #commentform { grid-template-columns: minmax(0, 1fr); }
  #reviews #commentform .form-submit { justify-content: stretch; }
  #reviews #commentform input#submit { width: 100%; }
  #reviews .comment_container { padding: 18px; gap: 14px; }
  #reviews .comment_container img.avatar { width: 42px; height: 42px; }
  .comment-form-rating p.stars a { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .comment-form-rating p.stars a,
  .comment-form-rating p.stars a::before,
  #reviews #commentform input,
  #reviews #commentform textarea,
  #reviews #commentform input#submit { transition: none !important; transform: none !important; }
}
