/* ════════════════════════════════════════════════════
   REVIEWS — premium social proof (Яндекс + 2ГИС)
   Откат: удалите reviews.css и reviews.js из index.html
════════════════════════════════════════════════════ */

#reviews {
  align-items: flex-start;
  overflow: hidden;
  position: relative;
}

#reviews::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  width: min(92vw, 1100px);
  height: 420px;
  background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(255, 79, 0, 0.07), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

#reviews .scene-inner {
  position: relative;
  z-index: 1;
}

.reviews-head {
  align-items: flex-end;
  margin-bottom: clamp(32px, 4.5vw, 56px);
}

.reviews-ratings {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-shrink: 0;
}

.rev-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: clamp(148px, 16vw, 188px);
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.05) 0%, transparent 42%),
    linear-gradient(165deg, #161514 0%, #0d0d0c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 56px rgba(0, 0, 0, 0.42);
  text-decoration: none;
  transition:
    border-color 0.32s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.32s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.32s ease;
}

@media (hover: hover) and (pointer: fine) {
  .rev-rating:hover {
    border-color: rgba(255, 79, 0, 0.32);
    transform: translateY(-3px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 30px 64px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(255, 79, 0, 0.08);
  }
}

.rev-rating-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.rev-rating-brand {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg3);
}

.rev-rating-num {
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--fg);
}

.rev-rating-stars {
  display: inline-flex;
  gap: 3px;
  color: var(--accent);
}

.rev-rating-stars svg,
.rev-stars svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.rev-rating-meta {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg3);
}

.rev-rating-src {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg2);
}

.rev-rating-arr {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.rev-rating:hover .rev-rating-arr {
  transform: translateX(4px);
}

.rev-rating--gis2 .rev-rating-brand {
  color: rgba(255, 255, 255, 0.42);
}

/* ── лента карточек ── */
.reviews-rail-wrap {
  position: relative;
  width: calc(100% + var(--wall) * 2);
  margin-left: calc(var(--wall) * -1);
  padding: 10px 0 6px;
}

.reviews-rail-wrap::before,
.reviews-rail-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(56px, 9vw, 140px);
  z-index: 2;
  pointer-events: none;
}

.reviews-rail-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 12%, transparent 100%);
}

.reviews-rail-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 12%, transparent 100%);
}

.reviews-rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px calc(var(--wall) + 10px) 24px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: calc(var(--wall) + 10px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.reviews-rail::-webkit-scrollbar {
  display: none;
}

.reviews-rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.rev-card {
  position: relative;
  flex: 0 0 clamp(300px, 34vw, 400px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 272px;
  padding: 22px 24px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, transparent 38%),
    linear-gradient(168deg, #151413 0%, #0b0b0a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 60px rgba(0, 0, 0, 0.45);
  transition:
    border-color 0.32s ease,
    transform 0.32s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.32s ease;
  overflow: hidden;
}

.rev-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 79, 0, 0.06) 0%, transparent 42%);
  opacity: 0;
  transition: opacity 0.32s ease;
}

@media (hover: hover) and (pointer: fine) {
  .rev-card:hover {
    border-color: rgba(255, 79, 0, 0.24);
    transform: translateY(-4px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 36px 72px rgba(0, 0, 0, 0.52);
  }

  .rev-card:hover::after {
    opacity: 1;
  }
}

.rev-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}

.rev-source {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rev-card--gis2 .rev-source {
  border-color: rgba(255, 255, 255, 0.1);
}

.rev-verified {
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 79, 0, 0.85);
}

.rev-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--accent);
}

.rev-quote {
  position: relative;
  flex: 1;
  font-size: 15px;
  line-height: 1.68;
  color: rgba(255, 255, 255, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-top: 2px;
}

.rev-quote::before {
  content: '\201C';
  position: absolute;
  left: -4px;
  top: -22px;
  font-size: 48px;
  line-height: 1;
  font-weight: 900;
  color: rgba(255, 79, 0, 0.16);
  pointer-events: none;
}

.rev-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rev-ava {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(255, 79, 0, 0.09);
  border: 1px solid rgba(255, 79, 0, 0.2);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.rev-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.rev-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rev-date {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  color: var(--fg3);
  text-transform: uppercase;
}

.reviews-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 0 calc(var(--wall) + 10px);
}

.reviews-hint {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg3);
}

.rev-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.rev-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.rev-all-link:hover {
  color: var(--accent-hi);
  gap: 12px;
}

.rev-all-link--gis2 {
  color: var(--fg2);
}

.rev-all-link--gis2:hover {
  color: var(--fg);
}

/* скелетон */
.reviews-rail.is-loading .rev-card {
  pointer-events: none;
}

.rev-card.rev-skeleton {
  min-height: 272px;
  background: var(--card-bg);
}

.rev-card.rev-skeleton .rev-quote,
.rev-card.rev-skeleton .rev-foot {
  opacity: 0.35;
}

.rev-card.rev-skeleton .rev-quote {
  height: 80px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.rev-card.rev-skeleton .rev-foot {
  border-top-color: transparent;
}

@media (max-width: 900px) {
  .reviews-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .reviews-ratings {
    width: 100%;
  }

  .rev-rating {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .reviews-rail-wrap {
    width: 100%;
    margin-left: 0;
  }

  .reviews-rail {
    padding-left: 20px;
    padding-right: 20px;
    scroll-padding-left: 20px;
  }

  .reviews-foot {
    padding: 0 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .reviews-rail-wrap::before,
  .reviews-rail-wrap::after {
    width: 40px;
  }

  .reviews-ratings {
    flex-direction: column;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rev-card,
  .rev-rating,
  .rev-rating-arr,
  .rev-card::after {
    transition: none !important;
  }
}