/* —— Reviews —— */
.reviews-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: stretch;
  min-height: min(480px, 70vh);
}

.reviews-summary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(20px, 2.5vw, 28px) clamp(16px, 2vw, 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm, 0 8px 24px rgba(15, 18, 40, 0.04));
  min-width: 0;
}

.reviews-summary-label {
  margin: 0;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
}

.reviews-scores {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.reviews-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reviews-score-row + .reviews-score-row {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.reviews-score {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 2.2ch;
}

.reviews-score-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.reviews-stars {
  display: flex;
  gap: 2px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.reviews-stars .star-empty {
  color: var(--border-strong);
}

.reviews-based {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-3);
}

.reviews-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reviews-bars[hidden],
.reviews-bars-based[hidden] {
  display: none !important;
}

.reviews-bars-based {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.reviews-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.reviews-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.reviews-bar-label {
  font-size: 13px;
  color: var(--text-2);
  min-width: 0;
}

.reviews-bar-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  min-width: 0;
}

.reviews-bar-fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: var(--accent);
}

.reviews-bar-fill--amber {
  background: var(--amber);
}

.reviews-bar-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.reviews-bar-based {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.reviews-write-btn {
  margin-top: auto;
  width: 100%;
  min-height: 48px;
  justify-content: center;
  white-space: normal;
  height: auto;
  text-align: center;
  padding-inline: 16px;
}

.reviews-feed-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.reviews-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 12px;
  border-bottom: 0;
}

.reviews-mf-tabs {
  margin-bottom: 0;
}

.reviews-mf-tabs .mf-tab:not(.active) {
  border: 1px solid var(--border);
  color: var(--text-2);
}

.reviews-mf-tabs .mf-tab:not(.active):hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.reviews-mf-tabs .mf-tab span {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 4px;
}

.reviews-mf-tabs .mf-tab.active span {
  opacity: 0.9;
}

.reviews-feed-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.reviews-feed-title span {
  font-weight: 500;
  color: var(--text-3);
}

.reviews-feed-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.reviews-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.reviews-pane[hidden] {
  display: none !important;
}

.reviews-feed {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: clamp(320px, 52vh, 480px);
  max-height: clamp(360px, 56vh, 520px);
  overflow: hidden; /* no scrollbar — motion via track transform */
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
}

.reviews-feed.is-dragging {
  cursor: grabbing;
}

.reviews-feed-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 3;
  pointer-events: none;
}

.reviews-feed-fade--top {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}

.reviews-feed-fade--bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--bg), transparent);
}

.reviews-feed-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 12px;
  will-change: transform;
}

/* —— Video reviews: phone 9:16 infinite rail —— */
.reviews-video {
  position: relative;
  height: clamp(320px, 52vh, 480px);
  max-height: clamp(360px, 56vh, 520px);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 6%,
    #000 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 6%,
    #000 94%,
    transparent 100%
  );
}

.reviews-video.is-dragging {
  cursor: grabbing;
}

.reviews-video-track {
  display: flex;
  gap: 14px;
  align-items: center;
  height: 100%;
  width: max-content;
  padding: 8px 12px;
  will-change: transform;
}

.review-video-card {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  width: clamp(148px, 20vw, 176px);
  aspect-ratio: 9 / 16;
  height: auto;
  max-height: calc(100% - 4px);
  border-radius: 22px;
  overflow: hidden;
  cursor: inherit;
  position: relative;
  text-align: left;
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 18, 40, 0.14);
  background: #1a1d2e;
  isolation: isolate;
}

.review-video-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.review-video-card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(165deg, var(--tone-a), var(--tone-b) 55%, var(--tone-c));
  z-index: 0;
}

.review-video-card[data-tone="a"] {
  --tone-a: #2f6bff;
  --tone-b: #1a3a8f;
  --tone-c: #0f172a;
}

.review-video-card[data-tone="b"] {
  --tone-a: #0d9488;
  --tone-b: #115e59;
  --tone-c: #0f172a;
}

.review-video-card[data-tone="c"] {
  --tone-a: #ea580c;
  --tone-b: #9a3412;
  --tone-c: #1c1917;
}

.review-video-card[data-tone="d"] {
  --tone-a: #7c3aed;
  --tone-b: #4c1d95;
  --tone-c: #0f172a;
}

.review-video-card-frame {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  z-index: 3;
  pointer-events: none;
}

.review-video-card-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.review-video-card-dur {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}

.review-video-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: grid;
  place-items: center;
  transition: transform 160ms ease;
}

.review-video-card-play::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #0f172a;
}

.review-video-card:hover .review-video-card-play,
.review-video-card:focus-visible .review-video-card-play {
  transform: scale(1.06);
}

.review-video-card-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 48px 14px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 10%, transparent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.review-video-card-who {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.review-video-card-who span {
  font-weight: 500;
  opacity: 0.8;
}

.review-video-card-quote {
  display: -webkit-box;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.95;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-video-card-stars {
  display: block;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: #fbbf24;
}

#review-video-modal {
  align-items: center;
  z-index: 11000;
}

#review-video-modal.show {
  display: flex;
}

#review-video-modal[hidden] {
  display: none !important;
}

.review-video-modal {
  width: min(720px, 100%);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  margin: auto;
}

.review-video-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.review-video-meta {
  width: 100%;
  max-width: 320px;
}

.review-video-phone {
  width: min(220px, 56vw);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px rgba(15, 18, 40, 0.2);
  background: #0f172a;
}

.review-video-phone[data-tone="a"] {
  --tone-a: #2f6bff;
  --tone-b: #1a3a8f;
  --tone-c: #0f172a;
}

.review-video-phone[data-tone="b"] {
  --tone-a: #0d9488;
  --tone-b: #115e59;
  --tone-c: #0f172a;
}

.review-video-phone[data-tone="c"] {
  --tone-a: #ea580c;
  --tone-b: #9a3412;
  --tone-c: #1c1917;
}

.review-video-phone[data-tone="d"] {
  --tone-a: #7c3aed;
  --tone-b: #4c1d95;
  --tone-c: #0f172a;
}

.review-video-phone-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 16px;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(165deg, var(--tone-a), var(--tone-b) 55%, var(--tone-c));
  color: #fff;
}

.review-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
}

.review-video-play::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #0f172a;
}

.review-video-quote {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.review-video-modal-title {
  margin: 0 0 6px;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.review-video-modal-sub {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-2);
}

.review-video-modal-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.review-card {
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-shrink: 0;
}

[data-theme="dark"] .review-card {
  background: var(--surface-2);
}

.review-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.review-card-who {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-card-where {
  font-weight: 400;
  color: var(--text-3);
}

.review-card-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.review-card-stars {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.review-card-title {
  margin: 0 0 6px;
  font-size: clamp(14px, 1.2vw, 15px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-wrap: pretty;
}

.review-card-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}

#review-modal {
  align-items: center;
  z-index: 11000;
}

#review-modal.show {
  display: flex;
}

#review-modal[hidden] {
  display: none !important;
}

html.review-modal-open,
html.review-modal-open body {
  overflow: hidden;
  touch-action: none;
}

.review-modal {
  width: min(480px, 100%);
  max-height: min(92vh, 820px);
  overflow-y: auto;
  margin: auto;
}

.review-modal-title {
  margin: 0 0 8px;
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.review-modal-lead {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-category-ratings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.review-category-lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.review-category-field {
  gap: 4px;
}

.review-category-field .review-star-picker button {
  min-width: 40px;
  min-height: 40px;
  font-size: 22px;
}

.review-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.review-field > span,
.review-stars-field legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.review-field input,
.review-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.review-field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.review-field input:focus-visible,
.review-field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.review-field-optional {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.review-field input.review-video-input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: transparent;
}

.review-video-field {
  position: relative;
}

.review-video-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
}

.review-video-pick {
  min-height: 40px;
}

.review-video-hint,
.review-video-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-3);
  word-break: break-word;
}

.review-video-meta {
  color: var(--text-2);
  font-weight: 600;
}

.review-video-clear {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 44px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.review-star-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.review-star-picker button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px;
  min-width: 44px;
  min-height: 44px;
  font-size: 28px;
  line-height: 1;
  color: var(--border-strong);
  cursor: pointer;
}

.review-star-picker button.is-on,
.review-star-picker button[aria-checked="true"] {
  color: var(--accent);
}

.review-form-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 13px;
  color: var(--text-3);
}

.review-form-status.is-ok {
  color: var(--green);
}

.review-form-status.is-err {
  color: var(--red);
}

.review-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.review-form-actions .btn {
  min-height: 44px;
}

/* Laptop / small desktop: still 2 cols, tighter */
@media (max-width: 1100px) {
  .reviews-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 18px;
  }

  .reviews-bars li {
    grid-template-columns: 80px minmax(0, 1fr) 28px;
  }
}

/* Tablet: stack */
@media (max-width: 900px) {
  .reviews-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .reviews-summary {
    gap: 16px;
  }

  .reviews-write-btn {
    margin-top: 8px;
  }

  .reviews-feed {
    height: min(420px, 55vh);
    max-height: min(420px, 55vh);
  }

  .reviews-video {
    height: min(420px, 55vh);
    max-height: min(420px, 55vh);
  }

  .reviews-feed-fade--top {
    top: 0;
  }

  .reviews-feed-hint {
    display: none;
  }
}

@media (max-width: 768px) {
  #reviews.section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .reviews-score-row {
    flex-wrap: wrap;
  }

  .reviews-feed {
    height: min(380px, 50vh);
    max-height: min(380px, 50vh);
  }

  .reviews-video {
    height: min(380px, 50vh);
    max-height: min(380px, 50vh);
  }

  .reviews-video-track {
    gap: 10px;
  }

  .review-card {
    padding: 14px 14px;
  }

  .review-card-top {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .reviews-bar-label,
  .reviews-bar-val {
    font-size: 12px;
  }

  .reviews-summary {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .reviews-feed-track {
    padding: 16px 4px;
    gap: 10px;
  }

  .review-form-actions {
    flex-direction: column-reverse;
  }

  .review-form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .review-modal {
    max-height: min(92vh, 720px);
    padding: 24px 18px;
  }
}

@media (max-height: 720px) and (min-width: 901px) {
  .reviews-layout {
    min-height: 0;
  }

  .reviews-feed {
    height: min(360px, 48vh);
    max-height: min(360px, 48vh);
  }

  .reviews-video {
    height: min(360px, 48vh);
    max-height: min(360px, 48vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reviews-feed,
  .reviews-video {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .reviews-feed-fade--top,
  .reviews-feed-fade--bottom {
    display: none;
  }
}

.reviews-video-track.is-real {
  width: 100%;
  justify-content: center;
  align-items: center;
}

.review-video-card.is-file {
  background: #0f172a;
  cursor: pointer;
  touch-action: pan-x;
}

.review-video-card.is-playing .review-video-card-play,
.review-video-card.is-playing .review-video-card-top,
.review-video-card.is-playing .review-video-card-foot {
  opacity: 0;
  pointer-events: none;
}

.review-video-card.is-playing .review-video-card-media {
  pointer-events: auto;
  z-index: 1;
}

.review-video-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.review-video-player {
  width: min(280px, 100%);
  aspect-ratio: 9 / 16;
  max-height: min(70vh, 560px);
  border-radius: 24px;
  background: #0f172a;
  display: block;
  object-fit: cover;
}

.review-video-modal-title {
  overflow: visible;
  text-wrap: balance;
}

@media (max-width: 900px) {
  .reviews-video {
    container-type: inline-size;
    height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x;
    cursor: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .reviews-video-track.is-real {
    width: max-content;
    height: auto;
    justify-content: flex-start;
    align-items: stretch;
    padding: 4px 16px 4px 4px;
    gap: 12px;
  }

  .reviews-video-track.is-real .review-video-card {
    width: calc(100cqi - 44px);
    max-height: none;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
}
