/*
 * SST Product Reviews — PDP stylesheet
 *
 * The theme sets woocommerce_enqueue_styles to an empty array, so no
 * WooCommerce core CSS reaches the page: every rule the review UI needs lives
 * here. class-sst-reviews-core.php enqueues this file when it exists and falls
 * back to an inline copy of section 1 when it does not, so section 1 is kept
 * byte-for-byte equivalent to that fallback.
 *
 * Cloudflare Enterprise ignores ?ver= in the cache key for static assets, so
 * any change to this stylesheet must ship under a NEW filename (-r3, -r4, …).
 * The retired reviews-pdp.css stays on disk: its URL is cached and must never
 * be reused.
 *
 * Colours follow the theme tokens (--sst-accent #9e2c5f, --sst-ink #121212,
 * --sst-muted #5f5f5f, --sst-line #ececec) with literal fallbacks, because the
 * tokens only exist once the theme stylesheet has loaded.
 *
 * Tabs: the theme already styles .woocommerce-tabs. The rules below are the
 * same underlined-tab design at the same specificity, so they act as a
 * baseline when the theme rule is missing and never fight it when it is not.
 */

/* ------------------------------------------------------------------ *
 * 1. Base — carried over from SST_Reviews_Core::fallback_css()
 * ------------------------------------------------------------------ */

.star-rating{position:relative;display:inline-block;line-height:1;font-size:16px;letter-spacing:2px}
.star-rating::before{content:"\2605\2605\2605\2605\2605";color:#d8d8d8}
.star-rating>span{position:absolute;left:0;top:0;overflow:hidden;white-space:nowrap;font-size:0}
.star-rating>span::before{content:"\2605\2605\2605\2605\2605";color:#f0a500;font-size:16px;letter-spacing:2px}
.woocommerce-Reviews{max-width:760px}
.woocommerce-Reviews .commentlist{list-style:none;margin:0;padding:0}
.woocommerce-Reviews .commentlist li{border-bottom:1px solid #eee;padding:16px 0;margin:0}
.woocommerce-Reviews .commentlist .comment_container{display:flex;gap:12px}
.woocommerce-Reviews .commentlist img.avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0}
.woocommerce-Reviews .comment-text{flex:1}
.woocommerce-Reviews .comment-text .meta{color:#767676;font-size:13px;margin:4px 0 8px}
.woocommerce-Reviews .comment-text .woocommerce-review__verified{color:#1a8917;font-size:12px}
.woocommerce-Reviews .comment-form-rating{margin:8px 0}
.woocommerce-Reviews .comment-form-rating label{display:block;margin-bottom:4px;font-weight:600}
.woocommerce-Reviews p.stars{display:inline-block;font-size:22px;line-height:1;margin:0 0 8px}
.woocommerce-Reviews p.stars a{display:inline-block;text-decoration:none;color:#d8d8d8;width:1em;overflow:hidden;white-space:nowrap}
.woocommerce-Reviews p.stars a::before{content:"\2605"}
.woocommerce-Reviews p.stars:hover a{color:#f0a500}
.woocommerce-Reviews p.stars a:hover~a{color:#d8d8d8}
.woocommerce-Reviews p.stars.selected a{color:#f0a500}
.woocommerce-Reviews p.stars.selected a.active~a{color:#d8d8d8}
.woocommerce-Reviews .comment-form label{font-weight:600}
.woocommerce-Reviews .comment-form textarea,.woocommerce-Reviews .comment-form input[type=text],.woocommerce-Reviews .comment-form input[type=email]{width:100%;border:1px solid #ccc;border-radius:6px;padding:10px;margin:4px 0 12px;font:inherit}
.woocommerce-Reviews .form-submit input[type=submit]{background:#111;color:#fff;border:0;border-radius:999px;padding:12px 28px;font-weight:600;cursor:pointer}
.woocommerce-Reviews .form-submit input[type=submit]:hover{background:#333}
.woocommerce-noreviews{color:#767676}

/* ------------------------------------------------------------------ *
 * 2. Product tabs — underlined tab bar (Description / Additional
 *    information / Reviews). Deliberately generic and quiet: these rules
 *    also apply to the two tabs that already ship.
 * ------------------------------------------------------------------ */

.woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0 0 18px;
  padding: 0 0 6px;
  list-style: none;
  border-bottom: 1px solid var(--sst-line, #ececec);
}

.woocommerce-tabs ul.tabs li {
  margin: 0;
  padding-bottom: 6px;
  list-style: none;
  border: 0;
}

.woocommerce-tabs ul.tabs li::before,
.woocommerce-tabs ul.tabs li::marker {
  content: none;
}

.woocommerce-tabs ul.tabs a {
  display: inline-block;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
  color: var(--sst-muted, #5f5f5f);
}

.woocommerce-tabs ul.tabs a:hover,
.woocommerce-tabs ul.tabs a:focus {
  color: var(--sst-ink, #121212);
}

.woocommerce-tabs ul.tabs li.active a {
  color: var(--sst-accent, #9e2c5f);
  border-bottom: 2px solid var(--sst-accent, #9e2c5f);
  padding-bottom: 8px;
}

.woocommerce-tabs ul.tabs a:focus-visible {
  outline: 2px solid var(--sst-focus, #1f6feb);
  outline-offset: 3px;
}

.woocommerce-tabs .panel > :first-child {
  margin-top: 0;
}

/* ------------------------------------------------------------------ *
 * 3. Summary star rating (above the price) and the "N reviews" link
 * ------------------------------------------------------------------ */

.woocommerce div.product .woocommerce-product-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1;
}

.woocommerce div.product .woocommerce-product-rating .star-rating {
  font-size: 15px;
}

.woocommerce div.product .woocommerce-product-rating .woocommerce-review-link {
  color: var(--sst-muted, #5f5f5f);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.woocommerce div.product .woocommerce-product-rating .woocommerce-review-link:hover {
  color: var(--sst-ink, #121212);
}

/* ------------------------------------------------------------------ *
 * 4. Review list
 * ------------------------------------------------------------------ */

.woocommerce-Reviews {
  color: var(--sst-ink, #121212);
}

.woocommerce-Reviews .woocommerce-Reviews-title {
  margin: 0 0 14px;
  font-size: 20px;
}

.woocommerce-Reviews .commentlist > li {
  border-bottom: 1px solid var(--sst-line, #ececec);
  padding: 18px 0;
  margin: 0;
  list-style: none;
}

.woocommerce-Reviews .commentlist > li:first-child {
  padding-top: 0;
}

.woocommerce-Reviews .commentlist > li:last-child {
  border-bottom: 0;
}

.woocommerce-Reviews .commentlist .comment-text .star-rating {
  /* Must be a shrink-to-fit box: WooCommerce clips the gold stars with an
   * inline width:N% on the inner span, relative to this container. A full-
   * width block made 20% wider than the whole 5-star strip, so every rating
   * rendered as 5 gold stars. display:table keeps the own-line layout while
   * shrinking to the ::before star strip. */
  display: table;
  margin: 0 0 6px;
}

.woocommerce-Reviews .comment-text .meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--sst-muted, #5f5f5f);
}

.woocommerce-Reviews .comment-text .woocommerce-review__author {
  color: var(--sst-ink, #121212);
  font-weight: 600;
}

.woocommerce-Reviews .comment-text .woocommerce-review__dash {
  color: #c9c9c9;
}

.woocommerce-Reviews .comment-text .description {
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.woocommerce-Reviews .comment-text .description > :first-child {
  margin-top: 0;
}

.woocommerce-Reviews .comment-text .description > :last-child {
  margin-bottom: 0;
}

.woocommerce-Reviews .comment-text .woocommerce-review__awaiting-approval {
  color: var(--sst-accent, #9e2c5f);
  font-style: normal;
}

/* Verified purchase badge (WooCommerce prints this from the `verified` meta) */
.woocommerce-Reviews .comment-text .woocommerce-review__verified {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #b7e0bd;
  background: #f1faf2;
  color: #1a8917;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* Pagination, when reviews outgrow one page */
.woocommerce-Reviews .woocommerce-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.woocommerce-Reviews .woocommerce-pagination a,
.woocommerce-Reviews .woocommerce-pagination span {
  display: inline-block;
  min-width: 32px;
  padding: 6px 10px;
  border: 1px solid var(--sst-line, #ececec);
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  color: var(--sst-muted, #5f5f5f);
}

.woocommerce-Reviews .woocommerce-pagination .current {
  border-color: var(--sst-accent, #9e2c5f);
  color: var(--sst-accent, #9e2c5f);
  font-weight: 700;
}

.woocommerce-noreviews {
  margin: 0;
  padding: 18px 0;
  color: var(--sst-muted, #5f5f5f);
  font-size: 14px;
}

.woocommerce-verification-required {
  margin: 14px 0 0;
  color: var(--sst-muted, #5f5f5f);
  font-size: 13px;
}

/* ------------------------------------------------------------------ *
 * 5. Store response card
 * ------------------------------------------------------------------ */

.woocommerce-Reviews .commentlist ul.children {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.woocommerce-Reviews .commentlist ul.children > li {
  list-style: none;
  border: 0;
  border-bottom: 0;
  margin: 10px 0 0;
  padding: 0;
}

.woocommerce-Reviews .comment_container.sst-review-reply {
  display: block;
  border-left: 3px solid var(--sst-accent, #9e2c5f);
  border-radius: 0 8px 8px 0;
  background: var(--sst-soft, #faf3f7);
  padding: 12px 16px;
}

.sst-review-reply .sst-review-reply__head {
  margin: 0 0 4px;
  color: var(--sst-accent, #9e2c5f);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sst-review-reply .meta {
  margin: 0 0 6px;
  font-size: 12px;
}

.sst-review-reply .description {
  font-size: 14px;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ *
 * 6. Review media — thumbnail grid, video, lightbox
 * ------------------------------------------------------------------ */

.sst-review-media {
  margin: 12px 0 0;
}

.sst-review-media__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  max-width: 470px;
}

.sst-review-media__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 0;
  border: 1px solid var(--sst-line, #ececec);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sst-gray, #f7f7f7);
  cursor: zoom-in;
  -webkit-appearance: none;
  appearance: none;
}

.sst-review-media__thumb:hover {
  border-color: var(--sst-accent, #9e2c5f);
}

.sst-review-media__thumb:focus-visible {
  outline: 2px solid var(--sst-focus, #1f6feb);
  outline-offset: 2px;
}

.sst-review-media__thumb img,
.sst-review-media__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sst-review-media__video {
  margin: 10px 0 0;
  max-width: 470px;
}

.sst-review-media__video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
  border-radius: 8px;
  background: #000;
}

/* wp-admin comment column */
.sst-review-media-admin {
  margin: 6px 0 0;
}

/* Lightbox (built by the inline script in class-sst-reviews-display.php) */
body.sst-review-lightbox-open {
  overflow: hidden;
}

.sst-review-lightbox {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: rgba(0, 0, 0, .84);
}

.sst-review-lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
}

.sst-review-lightbox__close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.sst-review-lightbox__close:hover {
  background: rgba(255, 255, 255, .28);
}

.sst-review-lightbox__close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * 7. Incentive disclosure (regulatory — must stay legible, never hidden
 *    behind a tooltip or a link)
 * ------------------------------------------------------------------ */

.sst-review-disclosure {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--sst-gray, #f7f7f7);
  color: var(--sst-muted, #5f5f5f);
  font-size: 12px;
  line-height: 1.6;
}

.sst-review-disclosure p {
  margin: 0;
}

.sst-review-disclosure__note {
  margin-top: 4px;
}

/* ------------------------------------------------------------------ *
 * 8. WooCommerce's own review form (still reachable for logged-in buyers)
 * ------------------------------------------------------------------ */

#review_form_wrapper {
  margin-top: 24px;
}

#review_form .comment-reply-title {
  display: block;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.woocommerce-Reviews .comment-form {
  max-width: 560px;
}

.woocommerce-Reviews .comment-form textarea:focus,
.woocommerce-Reviews .comment-form input[type=text]:focus,
.woocommerce-Reviews .comment-form input[type=email]:focus {
  border-color: var(--sst-accent, #9e2c5f);
  outline: none;
}

.woocommerce-Reviews .comment-form .comment-notes,
.woocommerce-Reviews .comment-form .comment-form-cookies-consent label {
  color: var(--sst-muted, #5f5f5f);
  font-size: 12px;
  font-weight: 400;
}

.woocommerce-Reviews .comment-form .required {
  color: var(--sst-accent, #9e2c5f);
}

/* ------------------------------------------------------------------ *
 * 9. Responsive — single column below 600px
 * ------------------------------------------------------------------ */

@media (max-width: 600px) {
  .woocommerce-Reviews {
    max-width: 100%;
  }

  .woocommerce-tabs ul.tabs {
    gap: 14px;
  }

  .woocommerce-tabs ul.tabs a {
    font-size: 13px;
  }

  .woocommerce-Reviews .commentlist .comment_container {
    gap: 10px;
  }

  .woocommerce-Reviews .commentlist img.avatar {
    width: 32px;
    height: 32px;
  }

  .woocommerce-Reviews .comment-text .description {
    font-size: 14px;
  }

  .sst-review-media__grid,
  .sst-review-media__video {
    max-width: 100%;
  }

  .sst-review-media__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .woocommerce-Reviews .comment-form {
    max-width: 100%;
  }

  .sst-review-lightbox {
    padding: 16px 10px;
  }
}
