/* Отзывы покупателей */
.reviews-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.reviews-link:hover, .reviews-footer a:hover { color: var(--ink-soft); }
.home-reviews {
  max-width: 1480px;
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(36px, 5vw, 72px);
}
.home-review-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 40px);
}
.review-entry {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.review-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.review-byline strong { font-weight: 600; overflow-wrap: anywhere; }
.review-byline time, .reviews-message { color: var(--muted); font-size: 14px; }
.review-stars { font-size: 16px; line-height: 1.1; letter-spacing: .1em; }
.review-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.home-review-list .review-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reviews-message:empty { display: none; }
.reviews-page { background: #fff; display: flex; flex-direction: column; }
.reviews-top { border-bottom: 1px solid var(--line); background: #fff; }
.reviews-main, .reviews-footer {
  width: 100%;
  max-width: 1200px;
  padding-inline: var(--gutter);
  margin-inline: auto;
}
.reviews-main { flex: 1; padding-block: clamp(30px, 5vw, 76px); }
.reviews-title-row { margin-bottom: clamp(22px, 4vw, 48px); }
.reviews-title-row h1 { font: 500 clamp(36px, 5vw, 66px)/1.05 var(--text); letter-spacing: -.05em; }
.review-form-jump { display: none; }
.reviews-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: clamp(28px, 6vw, 96px);
  align-items: start;
}
.published-reviews > .reviews-message:first-of-type { margin-block: 12px; }
.review-form {
  display: grid;
  gap: 15px;
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
  background: var(--concrete);
  scroll-margin-top: 14px;
}
.review-form h2, .review-form h3 { font: 500 clamp(24px, 2.5vw, 32px)/1.15 var(--text); letter-spacing: -.03em; }
.review-form > p { font-size: 14px; color: var(--ink-soft); }
.review-form > label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.review-form input[type="text"], .review-form textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background-color: #fff; color: var(--ink); padding: 10px 12px; font: 400 16px/1.4 var(--text);
}
.review-form textarea { resize: vertical; }
.review-form .button { justify-self: start; }
.review-form .reviews-message[data-error] { color: var(--alert); }
.reviews-footer { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-block: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
@media (max-width: 700px) {
  .home-review-list, .reviews-layout { grid-template-columns: 1fr; gap: 0; }
  .review-form { margin-top: 24px; }
  .review-form-jump { display: inline-flex; }
  .reviews-title-row { margin-bottom: 12px; }
}

.review-rating { margin: 0; padding: 0; border: 0; min-width: 0; }
.review-rating legend, .review-files-title { padding: 0; font-size: 14px; font-weight: 500; }
.review-rating-options { display: flex; margin-top: 2px; width: fit-content; max-width: 100%; }
.review-rating-choice { position: relative; width: 44px; height: 44px; cursor: pointer; }
.review-rating-choice input, .review-attach-button input {
  position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.review-rating-choice span { display: grid; width: 100%; height: 100%; place-items: center; font: 34px/1 system-ui, sans-serif; }
.review-rating-choice span::before { content: '☆'; }
.review-rating-choice:has(:checked) span::before,
.review-rating-choice:has(~ .review-rating-choice :checked) span::before { content: '★'; }
@media (hover: hover) {
  .review-rating-options:not(:has(:focus-visible)):has(.review-rating-choice:hover) .review-rating-choice span::before { content: '☆'; }
  .review-rating-options:not(:has(:focus-visible)):has(.review-rating-choice:hover) .review-rating-choice:hover span::before,
  .review-rating-options:not(:has(:focus-visible)):has(.review-rating-choice:hover) .review-rating-choice:has(~ .review-rating-choice:hover) span::before { content: '★'; }
}
.review-rating-choice input:focus-visible + span, .review-attach-button:has(:focus-visible) {
  outline: 2px solid var(--ink); outline-offset: 1px; border-radius: var(--r-sm);
}
.review-attachments { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.review-files-title small { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 400; }
.review-attach-button {
  position: relative; display: inline-flex; min-height: 44px; align-items: center;
  padding: 0 14px; border: 1px solid var(--ink); border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
}
.review-attach-button:hover { background: #fff; }
.review-attach-button:has(:disabled) { opacity: .55; }
.review-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.review-photos:empty { display: none; }
.review-photo, .review-preview { display: block; width: 76px; height: 76px; background: var(--concrete); }
.review-photo img, .review-preview img { width: 100%; height: 100%; object-fit: cover; }
.review-preview { position: relative; }
.review-remove-photo {
  position: absolute; top: 0; right: 0; width: 36px; height: 36px; border: 0; padding: 0;
  background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.review-remove-photo span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #fff; font: 20px/1 var(--text); }
.review-photo-dialog { width: fit-content; max-width: calc(100vw - 24px); padding: 54px 12px 12px; }
.review-photo-dialog img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(90dvh - 66px); margin: auto; }

.product-reviews {
  margin-top: clamp(40px, 6vw, 88px);
  padding-top: clamp(24px, 4vw, 48px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.product-review-summary { margin-top: 10px; font-size: 15px; font-weight: 500; }
.product-review-summary:empty { display: none; }
.product-reviews .reviews-layout { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: clamp(28px, 4vw, 64px); }
.product-reviews .review-form { scroll-margin-top: 90px; }
.review-product-link, .moderation-product { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.review-product-link { justify-self: start; text-decoration: underline; text-underline-offset: 3px; }
.review-product-link:hover { color: var(--ink); }
@media (max-width: 700px) {
  .product-reviews .reviews-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .product-reviews .section-heading { flex-wrap: wrap; row-gap: 2px; }
}
