/* ==============================================
   HIDER · reviews.css
   Sección de reseñas en página de producto
   ============================================== */

/* ── Wrapper de la sección ───────────────────── */
.reviews-section {
  padding: 64px 0 80px;
  border-top: 1px solid var(--line-soft);
}

.reviews-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.reviews-head h2 {
  font-size: clamp(28px, 3vw, 40px);
}

/* ── Resumen de rating ───────────────────────── */
.reviews-summary {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding: 28px 32px;
  background: var(--cream);
  border-radius: var(--r-lg);
}

.reviews-summary__score {
  text-align: center;
  min-width: 100px;
}

.reviews-summary__avg {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: var(--brown-deep);
  font-family: var(--font-display);
}

.reviews-summary__stars {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin: 8px 0 4px;
  color: var(--gold, #c9a84c);
}

.reviews-summary__count {
  font-size: 13px;
  color: var(--muted);
}

.reviews-summary__bars {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rating-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.rating-bar__label {
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.rating-bar__track {
  flex: 1;
  height: 6px;
  background: var(--line-soft);
  border-radius: 99px;
  overflow: hidden;
}

.rating-bar__fill {
  height: 100%;
  background: var(--brown);
  border-radius: 99px;
  transition: width 0.6s var(--ease);
}

.rating-bar__count {
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Lista de reseñas ────────────────────────── */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 40px;
}

.review-card {
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.review-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.review-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-card__author {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-card__verified {
  font-size: 11px;
  font-weight: 500;
  color: var(--success, #2d7a4f);
  background: rgba(45, 122, 79, 0.08);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.review-card__date {
  font-size: 13px;
  color: var(--muted);
}

.review-card__stars {
  display: flex;
  gap: 2px;
  color: var(--gold, #c9a84c);
  flex-shrink: 0;
}

.review-card__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 6px;
}

.review-card__body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}

/* ── Empty state ─────────────────────────────── */
.reviews-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 15px;
}

.reviews-empty svg {
  display: block;
  margin: 0 auto 16px;
  opacity: 0.3;
}

/* ── Formulario de nueva reseña ──────────────── */
.reviews-form-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line-soft);
}

.reviews-form-section h3 {
  font-size: 22px;
  margin-bottom: 24px;
}

.reviews-form__auth-msg {
  background: var(--cream);
  border-radius: var(--r);
  padding: 20px 24px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.reviews-form__auth-msg a {
  color: var(--brown);
  font-weight: 600;
  text-decoration: underline;
}

/* Star picker */
.star-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.star-picker__star {
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #c9b49a;
  transition: color 0.15s, transform 0.1s;
}

.star-picker__star:hover {
  transform: scale(1.1);
}

/* CSS override sobre el atributo fill="none" del SVG */
.star-picker__star svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5px;
  transition: fill 0.12s;
}

.star-picker__star.active svg path,
.star-picker__star.hover svg path {
  fill: #c9a84c;
  stroke: #c9a84c;
}

.star-picker__star svg {
  width: 100%;
  height: 100%;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}

.review-form .form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.review-form .form-field input,
.review-form .form-field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s;
  resize: vertical;
}

.review-form .form-field input:focus,
.review-form .form-field textarea:focus {
  outline: none;
  border-color: var(--brown);
}

.review-form .form-field textarea {
  min-height: 110px;
}

.review-form__rating-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ── Dark mode ───────────────────────────────── */
[data-theme="dark"] .reviews-summary {
  background: var(--surface, #1e1a17);
}

[data-theme="dark"] .reviews-form__auth-msg {
  background: var(--surface, #1e1a17);
  color: var(--muted);
}

[data-theme="dark"] .review-form .form-field input,
[data-theme="dark"] .review-form .form-field textarea {
  background: var(--surface, #1e1a17);
  border-color: var(--line-soft);
  color: var(--ink);
}

[data-theme="dark"] .star-picker__star {
  color: #6b5a47;
}

[data-theme="dark"] .star-picker__star.active svg path,
[data-theme="dark"] .star-picker__star.hover svg path {
  fill: #e8c060;
  stroke: #e8c060;
}

[data-theme="dark"] .review-card__stars {
  color: #e8c060;
}

[data-theme="dark"] .reviews-summary__stars {
  color: #e8c060;
}

[data-theme="dark"] .rating-bar__fill {
  background: #e8c060;
}

/* ── Responsive móvil ────────────────────────── */
@media (max-width: 768px) {
  /* En mobile el header de la card se apila: evita colisión con botones sociales */
  .review-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .review-card__stars {
    order: -1; /* estrellas arriba del nombre en mobile */
  }

  /* Evitar que las estrellas de la card queden bajo los botones sociales flotantes */
  .reviews-section {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .reviews-section {
    padding: 40px 0 60px;
  }

  .reviews-summary {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
  }

  .reviews-summary__score {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    min-width: auto;
  }

  .reviews-summary__avg {
    font-size: 44px;
  }

  .reviews-summary__bars {
    min-width: 0;
    width: 100%;
  }

  .review-form {
    max-width: 100%;
  }

  .star-picker__star {
    width: 44px;
    height: 44px;
  }

  .reviews-form-section {
    margin-top: 32px;
    padding-top: 28px;
  }
}
