/*
 * Selleronix Tag Suite: the review pages (/reviews/write: the form, the item list, the thank-you and the link messages).
 *
 * These pages are their own small document, without the theme (no theme or tracking script may read the signed link), so this
 * file is all their styling. It follows the KLEN product-videos design language (docs/superpowers/design/product-videos-design.md):
 * navy ink #082B49, muted #4F6475 (6.2:1 on white), soft surface #F2F6F9, border #D5E1EA, radii 10 and 14 px, the 4/8/12/16/24
 * spacing scale, controls at least 44 px with an 8 px gap, and a visible 2 px focus ring. Stars (ruling C13): a chosen or hovered star is
 * filled with the owner's star colour (--review-star-fill, the token of the reviews block, set by the page from Settings > Reviews;
 * amber-800 #8A4A12 when none is set) and has no outline; an empty star is slate-200 with a 1 px ink-muted outline (#4F6475, 6.2:1 on
 * white), so an input's boundary stays above 3:1 (WCAG 1.4.11) and the state is not carried by colour alone.
 * Error red #B42318 is 6.6:1 on white and 5.7:1 on its soft background. Sizes are literal px (the 44 px checks read them).
 */

.sx-rw-body {
  margin: 0;
  background: #F2F6F9;
  color: #082B49;
  font: 400 16px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.sx-rw-body *,
.sx-rw-body *::before,
.sx-rw-body *::after {
  box-sizing: border-box;
}

/* ---- header ---------------------------------------------------------------------------------------------------------------- */

.sx-rw-header {
  background: #FFFFFF;
  border-bottom: 1px solid #D5E1EA;
  padding: 8px 16px;
}

.sx-rw-header__shop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #082B49;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.sx-rw-header__logo {
  display: block;
  max-height: 40px;
  width: auto;
}

/* ---- page and card --------------------------------------------------------------------------------------------------------- */

.sx-rw {
  display: block;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.sx-rw__card {
  background: #FFFFFF;
  border: 1px solid #D5E1EA;
  border-radius: 14px;
  padding: 24px 16px;
}

@media (min-width: 600px) {
  .sx-rw {
    padding-top: 24px;
  }

  .sx-rw__card {
    padding: 24px;
  }
}

.sx-rw__title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}

.sx-rw__subtitle {
  margin: 24px 0 8px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

.sx-rw__lead,
.sx-rw__message-text {
  margin: 0 0 16px;
}

.sx-rw__hint {
  margin: 4px 0 0;
  color: #4F6475;
  font-size: 14px;
  font-weight: 400;
}

.sx-rw a {
  color: #082B49;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- the product being reviewed ---------------------------------------------------------------------------------------------- */

.sx-rw__product {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}

.sx-rw__thumb {
  flex: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #FFFFFF;
  border: 1px solid #D5E1EA;
  border-radius: 10px;
}

.sx-rw__product-name {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sx-rw__variant {
  display: block;
  margin: 0;
  color: #4F6475;
  font-size: 14px;
}

/* ---- fields ---------------------------------------------------------------------------------------------------------------- */

.sx-rw__field {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.sx-rw__label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-weight: 600;
}

.sx-rw__input,
.sx-rw__textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  color: #082B49;
  background: #FFFFFF;
  border: 1px solid #4F6475;
  border-radius: 10px;
  font: inherit;
}

.sx-rw__textarea {
  min-height: 144px;
  resize: vertical;
}

.sx-rw__input:disabled {
  color: #4F6475;
  background: #F2F6F9;
}

.sx-rw__input[aria-invalid="true"],
.sx-rw__textarea[aria-invalid="true"] {
  border-color: #B42318;
  border-width: 2px;
}

.sx-rw__counter {
  margin: 4px 0 0;
  color: #4F6475;
  font-size: 14px;
  text-align: right;
}

.sx-rw__counter.is-over,
.sx-rw__counter.is-under {
  color: #B42318;
}

/* ---- stars: a native radio group; the inputs stay focusable under their 44 px labels ------------------------------------- */

.sx-rw__star-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sx-rw__star-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.sx-rw__star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #D5E1EA;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

/* Hover only where a pointer can hover: on touch, :hover sticks after a tap and would leave stars lit that are not chosen. */
@media (hover: hover) {
  .sx-rw__star:hover {
    background: #F2F6F9;
    color: var(--review-star-fill, #8A4A12);
  }

  .sx-rw__star:hover .sx-rw__star-icon {
    stroke: none;
  }
}

.sx-rw__star-icon {
  display: block;
  width: 32px;
  height: 32px;
  fill: currentColor;
  stroke: #4F6475;
  stroke-width: 1;
}

.sx-rw__star.is-on {
  color: var(--review-star-fill, #8A4A12);
}

.sx-rw__star.is-on .sx-rw__star-icon {
  stroke: none;
}

/* Without the script: light the chosen star and the ones before it where :has() exists; a hovered star lights the ones before it too. */
@supports selector(:has(*)) {
  .sx-rw__star-row:has(> .sx-rw__star-input[value="1"]:checked) > .sx-rw__star:nth-of-type(-n+1),
  .sx-rw__star-row:has(> .sx-rw__star-input[value="2"]:checked) > .sx-rw__star:nth-of-type(-n+2),
  .sx-rw__star-row:has(> .sx-rw__star-input[value="3"]:checked) > .sx-rw__star:nth-of-type(-n+3),
  .sx-rw__star-row:has(> .sx-rw__star-input[value="4"]:checked) > .sx-rw__star:nth-of-type(-n+4),
  .sx-rw__star-row:has(> .sx-rw__star-input[value="5"]:checked) > .sx-rw__star:nth-of-type(-n+5) {
    color: var(--review-star-fill, #8A4A12);
  }

  .sx-rw__star-row:has(> .sx-rw__star-input[value="1"]:checked) > .sx-rw__star:nth-of-type(-n+1) .sx-rw__star-icon,
  .sx-rw__star-row:has(> .sx-rw__star-input[value="2"]:checked) > .sx-rw__star:nth-of-type(-n+2) .sx-rw__star-icon,
  .sx-rw__star-row:has(> .sx-rw__star-input[value="3"]:checked) > .sx-rw__star:nth-of-type(-n+3) .sx-rw__star-icon,
  .sx-rw__star-row:has(> .sx-rw__star-input[value="4"]:checked) > .sx-rw__star:nth-of-type(-n+4) .sx-rw__star-icon,
  .sx-rw__star-row:has(> .sx-rw__star-input[value="5"]:checked) > .sx-rw__star:nth-of-type(-n+5) .sx-rw__star-icon {
    stroke: none;
  }

  @media (hover: hover) {
    .sx-rw__star:has(~ .sx-rw__star:hover) {
      color: var(--review-star-fill, #8A4A12);
    }

    .sx-rw__star:has(~ .sx-rw__star:hover) .sx-rw__star-icon {
      stroke: none;
    }
  }
}

/* ---- choices: shown as, consent ------------------------------------------------------------------------------------------- */

.sx-rw__choice,
.sx-rw__check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}

.sx-rw__check {
  align-items: flex-start;
  padding: 10px 0;
}

.sx-rw__choice input,
.sx-rw__check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #082B49;
}

.sx-rw__check input {
  margin-top: 1px;
}

.sx-rw__name-input {
  margin: 0 0 8px 34px;
  width: calc(100% - 34px);
}

.sx-rw__fixed-name {
  margin: 0;
  font-weight: 600;
}

/* ---- buttons and links ---------------------------------------------------------------------------------------------------- */

.sx-rw__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 44px;
  min-height: 48px;
  padding: 12px 24px;
  color: #FFFFFF;
  background: #082B49;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sx-rw__button:disabled {
  background: #4F6475;
  cursor: progress;
}

.sx-rw .sx-rw__link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  color: #082B49;
  background: #FFFFFF;
  border: 1px solid #082B49;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.sx-rw__link-button {
  min-height: 44px;
}

.sx-rw-header__shop:focus-visible,
.sx-rw a:focus-visible,
.sx-rw__link-button:focus-visible,
.sx-rw__button:focus-visible,
.sx-rw__input:focus-visible,
.sx-rw__textarea:focus-visible,
.sx-rw__choice input:focus-visible,
.sx-rw__check input:focus-visible,
.sx-rw__file:focus-visible,
.sx-rw__star-input:focus-visible + .sx-rw__star {
  outline: 2px solid #082B49;
  outline-offset: 2px;
}

/* ---- photos: thumbnails of what was added, then the native file input (44 px) ---------------------------------------------- */

.sx-rw__photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.sx-rw__photo-list:empty {
  display: none;
}

.sx-rw__photo {
  position: relative;
  width: 88px;
  height: 88px;
  overflow: hidden;
  background: #F2F6F9;
  border: 1px solid #D5E1EA;
  border-radius: 10px;
}

.sx-rw__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sx-rw__photo.is-busy::after {
  content: "";
  position: absolute;
  inset: 32px;
  border: 3px solid #D5E1EA;
  border-top-color: #082B49;
  border-radius: 50%;
  animation: sx-rw-spin 0.9s linear infinite;
}

@keyframes sx-rw-spin {
  to {
    transform: rotate(360deg);
  }
}

.sx-rw__file {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
  color: #082B49;
  font: inherit;
}

.sx-rw__file:disabled {
  color: #4F6475;
}

/* ---- lists of items ------------------------------------------------------------------------------------------------------- */

.sx-rw__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sx-rw__list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #D5E1EA;
}

.sx-rw__list-text {
  flex: 1 1 160px;
  min-width: 0;
}

.sx-rw__others-list {
  margin: 0;
  padding: 0 0 0 20px;
}

.sx-rw__others-list li {
  margin: 0 0 8px;
}

.sx-rw__others-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.sx-rw__badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  color: #11633D;
  background: #E3F1EA;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* ---- the shop's reply to the buyer's own review ---- */

.sx-rw__reply {
  margin: 0 0 24px;
  padding: 12px 16px;
  color: #082B49;
  background: #F2F6F9;
  border-left: 3px solid #082B49;
  border-radius: 10px;
}

.sx-rw__reply-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.sx-rw__reply-text {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ---- messages ------------------------------------------------------------------------------------------------------------- */

.sx-rw__errors {
  margin: 0 0 24px;
  padding: 12px 16px;
  color: #082B49;
  background: #FDECEA;
  border: 1px solid #B42318;
  border-radius: 10px;
}

.sx-rw__errors:focus {
  outline: 2px solid #082B49;
  outline-offset: 2px;
}

.sx-rw__errors-title {
  margin: 0 0 4px;
  color: #B42318;
  font-weight: 700;
}

.sx-rw__errors ul {
  margin: 0;
  padding-left: 20px;
}

.sx-rw__error {
  margin: 4px 0 0;
  color: #B42318;
  font-size: 14px;
  font-weight: 600;
}

.sx-rw__thanks-box {
  margin: 0 0 16px;
  padding: 12px 16px;
  color: #11633D;
  background: #E3F1EA;
  border-radius: 10px;
  font-weight: 600;
}

/* ---- helpers -------------------------------------------------------------------------------------------------------------- */

.sx-rw__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The honeypot: off screen for people, still a field for bots. */
.sx-rw__hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .sx-rw-body *,
  .sx-rw-body *::before,
  .sx-rw-body *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
