/* ============ Секция отзывов ============ */
.reviews-section { padding: var(--s-6) 0 var(--s-9); background: var(--bg-soft); }
.reviews-section h2 { margin: 0 0 var(--s-4); }
.reviews-section .eyebrow { display: inline-block; margin-bottom: var(--s-2); }

.reviews-grid {
  display: grid; grid-template-columns: 1fr; gap: var(--s-4);
  margin-bottom: var(--s-6);
}
.reviews-grid.is-grouped {
  display: block; grid-template-columns: none; gap: 0;
}
@media (min-width: 720px)  { .reviews-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .reviews-grid { grid-template-columns: repeat(3, 1fr); } }

.review-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-4) var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.review-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s-3); flex-wrap: wrap;
}
.review-author {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--ink); line-height: 1.2;
}
.review-stars { color: var(--star); font-size: 14px; letter-spacing: 1px; line-height: 1; }
.review-date { font-size: 12px; color: var(--ink-3); }
.review-content {
  font-size: 14px; color: var(--ink-2); line-height: 1.55;
  margin: 0;
}
.review-content--clamp {
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-more {
  align-self: flex-start; font-size: 13px; color: var(--accent);
  background: none; border: 0; cursor: pointer; padding: 0;
  font-weight: 600; font-family: var(--font-display);
}
.reviews-empty {
  text-align: center; color: var(--ink-3); padding: var(--s-5) 0;
}
.reviews-loading {
  text-align: center; color: var(--ink-3); font-size: 14px;
  padding: var(--s-5) 0;
}

/* ============ Ветка ответов ============ */
.review-thread {
  margin-top: var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.review-reply {
  padding: var(--s-3) var(--s-4);
  background: var(--bg-soft);
  border-left: 3px solid var(--ink-3);
  border-radius: 0 8px 8px 0;
}
.review-reply--admin {
  background: linear-gradient(0deg, rgba(232,93,31,0.04), rgba(232,93,31,0.04)), var(--bg-card);
  border-left: 3px solid var(--accent);
  box-shadow: inset 0 0 0 1px rgba(232,93,31,0.18);
}
.review-reply-head {
  display: flex; justify-content: flex-start; align-items: center;
  gap: var(--s-2); margin-bottom: 6px; flex-wrap: wrap;
}
.review-reply-head .review-date { margin-left: auto; }
.review-reply-logo {
  width: 22px; height: 22px; border-radius: 50%;
  flex-shrink: 0;
}
.review-reply-badge {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-family: var(--font-display); font-weight: 700;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  letter-spacing: 0.04em; line-height: 1.4;
}
.review-reply-author {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--ink); line-height: 1.2;
}
.review-reply--admin .review-reply-author { color: var(--accent); }
.review-reply-text {
  font-size: 14px; color: var(--ink-2); line-height: 1.55; margin: 0;
  white-space: pre-wrap;
}

.review-reply-actions {
  margin-top: var(--s-3);
  display: flex; justify-content: flex-end;
}
.review-reply-btn {
  background: none; border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.review-reply-btn:hover { border-color: var(--accent); color: var(--accent); }
.reply-inline-form {
  margin-top: var(--s-3); padding: var(--s-4);
  background: var(--bg-soft); border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: var(--s-2);
  border: 1px solid var(--line);
}

/* ============ Форма отзыва ============ */
.review-form-wrap {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-5);
  max-width: 720px;
}
.review-form-head { margin-bottom: var(--s-3); }
.review-form-hint {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--s-2);
  font-size: 13px; color: var(--good);
  background: rgba(31,138,91,0.10);
  padding: 4px 12px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600;
}

/* ============ Группы: Вопросы / Отзывы ============ */
.reviews-group { margin-bottom: var(--s-6); }
.reviews-group:last-child { margin-bottom: 0; }
.reviews-group-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 18px; color: var(--ink);
  margin: 0 0 var(--s-4); display: inline-flex; align-items: center; gap: var(--s-2);
}
.reviews-group--questions .reviews-group-title { color: var(--trust); }
.reviews-group-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--ink-2);
  border-radius: 999px; font-size: 13px; font-weight: 700;
  padding: 2px 10px; min-width: 28px; line-height: 1.4;
}
.reviews-group--questions .reviews-group-count {
  background: rgba(15,76,129,0.12); color: var(--trust);
}
.reviews-grid-inner {
  display: grid; grid-template-columns: 1fr; gap: var(--s-4);
}
@media (min-width: 720px)  { .reviews-grid-inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .reviews-grid-inner { grid-template-columns: repeat(3, 1fr); } }

/* ----- Переключатель Отзыв / Вопрос ----- */
.review-kind-toggle {
  display: inline-flex; gap: 0;
  background: var(--bg-soft);
  border-radius: 999px; padding: 4px;
  margin-bottom: var(--s-4);
}
.review-kind-btn {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 18px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: var(--ink-3);
  transition: background .15s, color .15s, box-shadow .15s;
}
.review-kind-btn:hover { color: var(--ink); }
.review-kind-btn.is-active {
  background: var(--bg-card); color: var(--accent);
  box-shadow: 0 1px 4px rgba(20,15,5,0.08);
}

/* Hidden-поля при переключении на вопрос */
.review-form .review-stars-input[hidden],
.review-form .review-photo-field[hidden] { display: none !important; }

/* Бейдж «Вопрос» в карточке ленты */
.review-kind-badge {
  display: inline-flex; align-items: center;
  background: var(--bg-soft); color: var(--ink-2);
  font-family: var(--font-display); font-weight: 700;
  font-size: 11px; padding: 2px 10px; border-radius: 999px;
  letter-spacing: 0.04em;
}
.review-kind-badge--q { background: rgba(15,76,129,0.10); color: var(--trust); }
.review-card.is-question { border-left: 3px solid var(--trust); }

.review-form-head h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  margin: 0 0 var(--s-2); color: var(--ink); line-height: 1.2;
}
.review-form-head p { font-size: 13px; color: var(--ink-3); margin: 0; }

.review-form {
  display: grid; grid-template-columns: 1fr; gap: var(--s-3);
}
.review-stars-input {
  display: flex; gap: 4px; align-items: center;
}
.review-stars-input input[type=radio] { display: none; }
.review-stars-input label {
  font-size: 30px; color: #d4d4d4; cursor: pointer; line-height: 1;
  transition: color .12s ease, transform .12s ease;
}
.review-stars-input label:hover,
.review-stars-input label.is-active,
.review-stars-input label.is-active ~ label.is-active {
  color: var(--star);
}
.review-stars-input.is-set label { color: #d4d4d4; }
.review-stars-input.is-set label.is-active,
.review-stars-input.is-set label.is-active ~ label.is-active { color: var(--star); }

.review-field {
  display: flex; flex-direction: column; gap: 6px;
}
.review-field label {
  font-size: 12px; color: var(--ink-3); font-weight: 600; font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.review-field input,
.review-field textarea {
  width: 100%; padding: 10px 14px;
  font-family: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
  transition: border-color .12s ease;
}
.review-field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.review-field input:focus,
.review-field textarea:focus {
  outline: none; border-color: var(--accent);
}
/* Honeypot */
.review-hp {
  position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0;
}
.review-consent {
  font-size: 12px; color: var(--ink-3); line-height: 1.4;
  display: flex; gap: 8px; align-items: flex-start;
}
.review-consent input { margin-top: 2px; flex-shrink: 0; }
.review-consent a { color: var(--accent); }

.review-captcha { min-height: 0; transition: min-height .2s ease; }
.review-captcha.is-loading { min-height: 70px; }

.review-submit {
  align-self: flex-start; min-width: 180px;
}
.review-submit[disabled] { opacity: 0.5; cursor: not-allowed; }

.review-msg {
  font-size: 14px; padding: 10px 14px; border-radius: 10px;
  display: none;
}
.review-msg.is-ok    { display: block; background: rgba(16,185,129,0.08); color: #047857; }
.review-msg.is-err   { display: block; background: rgba(239,68,68,0.08);  color: #b91c1c; }

.review-success {
  text-align: center; padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3); align-items: center;
}
.review-success h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 22px;
  margin: 0; color: var(--good, #10B981);
}
.review-success p { font-size: 15px; color: var(--ink-3); margin: 0; }

/* ============ Photo upload ============ */
.review-photo-field input[type=file] {
  font-family: inherit; font-size: 14px;
  padding: 8px; border: 1px dashed var(--line); border-radius: 10px;
  background: var(--bg); cursor: pointer;
}
.review-photo-field input[type=file]::file-selector-button {
  border: 0; background: var(--bg-soft); color: var(--ink);
  padding: 6px 12px; border-radius: 8px; margin-right: 12px;
  font-family: inherit; font-weight: 600; cursor: pointer;
}
.review-photo-preview {
  position: relative; margin-top: 8px;
  display: inline-block; max-width: 200px;
}
.review-photo-preview img {
  width: 100%; height: auto; border-radius: 10px;
  border: 1px solid var(--line);
}
.review-photo-remove {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: var(--ink); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.review-photo-remove:hover { background: var(--accent); }

/* ============ Photo in review card ============ */
.review-photo-thumb {
  border: 0; padding: 0; background: none; cursor: zoom-in;
  width: 100%; max-height: 220px; overflow: hidden;
  border-radius: 10px;
}
.review-photo-thumb img {
  width: 100%; height: auto; max-height: 220px;
  object-fit: cover; display: block;
  transition: transform .2s ease;
}
.review-photo-thumb:hover img { transform: scale(1.03); }

/* ============ Lightbox ============ */
.review-lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,18,14,0.92);
  display: grid; place-items: center;
  padding: 32px; cursor: zoom-out;
  animation: lightboxIn .15s ease;
}
@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }
.review-lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.review-lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.15); color: #fff;
  font-size: 24px; cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(8px);
}
.review-lightbox-close:hover { background: rgba(255,255,255,0.25); }
