/* ==========================================================================
   Product Reviews (PDP) — MR Cigar
   Styles the reviews accordion, carousel, card, form and WCML cross-language UI.
   Star rendering (.mc-stars SVG) lives in base.css. This sheet is PDP-only.
   Design: Figma node 3003-331 (carousel of grey cards, black stars).

   NOTE: WooCommerce's default stylesheet (woocommerce.css) is enqueued site-
   wide and the <body> carries the `woocommerce` class, so WC's high-specificity
   review rules (e.g. `.woocommerce #reviews #comments .comment-text {border…}`)
   would otherwise paint an inner box and restyle the list. The OVERRIDES block
   below neutralises them with !important — that's deliberate, not laziness.
   ========================================================================== */

/* The shared accordion caps height at 800px; reviews (carousel) need more. */
.pdp-accordion--reviews .pdp-accordion__body:not([hidden]) {
  max-height: 4000px;
}

/* ── Neutralise WooCommerce's default review styles inside our card ──────── */
.pdp-reviews .commentlist {
  margin: 0 !important;
  padding: 0 !important;
}
.pdp-reviews .commentlist li.review,
.pdp-reviews .commentlist li.comment {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
.pdp-reviews .review-card__inner {
  display: flex !important;
  border: 0 !important;
  background: #ededed !important;
}
.pdp-reviews .comment-text {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
.pdp-reviews .commentlist .avatar {
  display: none !important;
}

/* Accessibility helper: hide the WC reviews title visually (design has none) */
.pdp-reviews .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Summary (stars + average) in the accordion label when reviews pass the gate.
   margin-right:auto left-groups it next to the label and pushes the +/- icon
   to the far right (Figma layout). */
.pdp-reviews-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 18px;
  margin-right: auto;
}
.pdp-reviews-summary .mc-stars {
  font-size: 16px;          /* ≈ label text size */
}
.pdp-reviews-summary__avg {
  font-family: "Helvetica Neue", sans-serif;
  font-size: 16px;
  color: #242323;
}

/* ── Reviews carousel (Figma: horizontal cards + side arrows) ───────────── */
.pdp-reviews-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 8px;
}
.pdp-reviews-carousel__viewport {
  flex: 1 1 auto;
  min-width: 0;          /* allow the flex child to shrink so cards don't overflow */
}
.pdp-reviews-carousel__arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #ededed;
  color: #6b6b6b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.pdp-reviews-carousel__arrow:hover {
  background: #e0e0e0;
  color: #242323;
}

/* The WooCommerce comment list IS the scroll track */
.pdp-reviews .commentlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;             /* Firefox */
  -ms-overflow-style: none;          /* IE/Edge */
}
.pdp-reviews .commentlist::-webkit-scrollbar { display: none; }

.pdp-reviews .commentlist li.review,
.pdp-reviews .commentlist li.comment {
  flex: 0 0 100%;
  scroll-snap-align: start;
  margin: 0;
}

/* Hide the gravatar — kept in markup so the woocommerce_review_before/WCML
   hooks still fire, but the design has no avatar. */
.pdp-reviews .commentlist .avatar { display: none; }

/* Review card (Figma: light grey #ededed, large radius, tall) */
.review-card__inner {
  background: #ededed;
  border-radius: 16px;
  padding: 26px 28px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}
.review-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.review-card__author {
  font-family: "Helvetica Neue", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #242323;
}
.review-card__verified {
  font-size: 11px;
  color: #2e7d32;
  font-weight: 500;
}
.review-card__content {
  flex: 1 1 auto;
}
.review-card__content .description p,
.review-card__content p {
  font-size: 14px;
  line-height: 22px;
  color: #3a3a3a;
  margin: 0 0 8px;
}
.review-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
/* Author + stars grouped together on the left (Figma: "- Rafael (UK) ★★★★☆") */
.review-card__by {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.review-card__by .mc-stars {
  font-size: 14px;          /* ≈ author text size */
}
.review-card__author {
  font-family: "Helvetica Neue", sans-serif;
  font-size: 15px;
  font-weight: 400;         /* not bold (Figma) */
  color: #242323;
}
.review-card__date {
  font-size: 12px;
  color: #6f6f6f;
}

.pdp-reviews .woocommerce-noreviews {
  font-size: 14px;
  color: #6b6b6b;
}

/* WCML per-review language flag + "show reviews in all languages" link */
.pdp-reviews .wcml_comment_flag,
.pdp-reviews #lang-comments-link {
  font-size: 12px;
  color: #6b6b6b;
}
.pdp-reviews #lang-comments-link a,
.pdp-reviews a.all-languages-reviews,
.pdp-reviews a.current-language-reviews {
  color: #c8a45c;
  text-decoration: underline;
}

/* ── Review form ────────────────────────────────────────────────────────── */
.pdp-reviews #review_form_wrapper {
  margin-top: 20px;
}
.pdp-reviews .comment-reply-title {
  display: block;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #242323;
  margin-bottom: 14px;
}
.pdp-reviews .comment-form p {
  margin: 0 0 14px;
}
.pdp-reviews .comment-form label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.26px;
  color: #242323;
  margin-bottom: 6px;
}
.pdp-reviews .comment-form input[type="text"],
.pdp-reviews .comment-form input[type="email"],
.pdp-reviews .comment-form textarea,
.pdp-reviews .comment-form select {
  width: 100%;
  max-width: 480px;
  padding: 11px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 0;
  background: #fff;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 14px;
  color: #242323;
}
.pdp-reviews .comment-form textarea {
  min-height: 120px;
  resize: vertical;
}
.pdp-reviews .required {
  color: #b3261e;
}
.pdp-reviews .must-log-in,
.pdp-reviews .woocommerce-verification-required,
.pdp-reviews .woocommerce-review-already {
  font-size: 14px;
  color: #6b6b6b;
}
.pdp-reviews .must-log-in a {
  color: #c8a45c;
  text-decoration: underline;
}

/* Interactive star input (WC's wc-single-product script turns the select into
   p.stars). Provide a font-independent fallback using unicode stars. */
.pdp-reviews p.stars {
  display: inline-block;
  margin: 0 0 14px;
}
.pdp-reviews p.stars a {
  position: relative;
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  margin-right: 2px;
  text-indent: -9999px;
  text-decoration: none;
}
.pdp-reviews p.stars a::before {
  content: "\2605";
  position: absolute;
  inset: 0;
  text-indent: 0;
  font-size: 20px;
  line-height: 1.2;
  color: #d9d9d9;
  transition: color .15s;
}
/* Fill 1..N. On hover: hovering the row fills all, then siblings AFTER the
   hovered star drop back. On click (WC adds .selected + .active on the clicked
   star): the active star and every star BEFORE it (a:not(.active)) fill, and
   the ones AFTER (.active ~ a) drop back — the :not(.active) rule is what was
   missing, which left only the clicked star highlighted. */
.pdp-reviews p.stars:hover a::before,
.pdp-reviews p.stars.selected a.active::before,
.pdp-reviews p.stars.selected a:not(.active)::before {
  color: #c8a45c;
}
.pdp-reviews p.stars.selected a.active ~ a::before,
.pdp-reviews p.stars:hover a:hover ~ a::before {
  color: #d9d9d9;
}

.pdp-reviews .comment-form-rating select#rating {
  /* Hidden once the JS star widget is active; visible as a fallback if not. */
  max-width: 200px;
}

.pdp-reviews .form-submit .submit,
.pdp-reviews button.submit {
  display: inline-block;
  margin-top: 4px;
  padding: 13px 28px;
  background: #242323;
  color: #fff;
  border: none;
  font-family: "Helvetica Neue", sans-serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.pdp-reviews .form-submit .submit:hover,
.pdp-reviews button.submit:hover {
  background: #000;
}
