/**
 * Отзывы с Яндекс Карт и 2ГИС на главной.
 *
 * Обычный css, а не scss из src/: node-зависимости темы больше не ставятся
 * (maskit@1.0.13 удалён из npm), поэтому dist/bundle.css пересобрать нельзя.
 * Переменные и слайдер берём из основной темы.
 */

.reviews {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.reviews__text {
  color: var(--gray);
  font-size: 16px;
  line-height: 1.6em;
}

/* плашки с общим рейтингом: по одной на сервис */

.reviews__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.reviews__source {
  flex: 1 1 300px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 25px 30px;
  cursor: pointer;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: border-color 0.3s, background-color 0.3s;
}

.reviews__source:hover {
  border-color: var(--theme);
}

/* выбранный сервис: в слайдере остались только его отзывы */

.reviews__source--active {
  border-color: var(--theme);
  background-color: var(--surface-alt);
}

.reviews__source:focus-visible {
  outline: 2px solid var(--theme);
  outline-offset: 2px;
}

/* строка сброса фильтра, показывается только когда сервис выбран */

.reviews__filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: -25px;
  font-size: 14px;
  color: var(--gray-light);
}

.reviews__filter[hidden] {
  display: none;
}

.reviews__filter__reset {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  color: var(--theme);
  transition: opacity 0.3s;
}

.reviews__filter__reset:hover {
  opacity: 0.7;
}

.reviews__source__value {
  font-family: druk;
  font-size: 44px;
  line-height: 1em;
  color: var(--white);
}

.reviews__source__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reviews__source__label {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
}

.reviews__source__count {
  font-size: 14px;
  color: var(--gray-light);
}

.reviews__source__action {
  margin-left: auto;
  padding-left: 20px;
  font-size: 14px;
  text-align: right;
  color: var(--theme);
}

/* карточка отзыва */

.review {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

.review__header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.review__avatar {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background-color: var(--surface-alt);
  font-size: 20px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--gray-light);
}

.review__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.review__author {
  font-size: 16px;
  font-weight: 500;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review__date {
  font-size: 13px;
  color: var(--gray-light);
}

/* откуда отзыв: цвета сервисов, чтобы не хостить их логотипы */

.review__source {
  margin-left: auto;
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--white);
  background-color: var(--gray-dark);
}

.review__source--yandex {
  background-color: #fc3f1d;
}

.review__source--2gis {
  background-color: #19aa1e;
}

.stars {
  display: flex;
  gap: 5px;
}

.stars__item {
  width: 15px;
  color: var(--border-color);
}

.stars__item--active {
  color: #ffb800;
}

.stars__item .icon {
  width: 100%;
}

/* длинные отзывы схлопнуты: кнопку показывает reviews.js, если текст не влез */

.review__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6em;
  color: var(--gray-dark);
}

.review__text__body {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review__text--full .review__text__body {
  display: block;
  overflow: visible;
}

.review__text__more {
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--theme);
  transition: opacity 0.3s;
}

.review__text__more:hover {
  opacity: 0.7;
}

.review__text__more[hidden] {
  display: none;
}

/* стрелки как в «Документах»: swiper обрезает всё, что вынесено за его край,
   поэтому круги лежат внутри ленты, поверх крайних карточек */

.reviews__slider .swiper {
  padding-bottom: 5px;
}

.reviews__slider .slider__buttons .swiper-button-prev,
.reviews__slider .slider__buttons .swiper-button-next {
  width: 50px;
  height: 50px;
  margin-top: 0;
  transform: translateY(-50%);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: var(--white);
  transition: all 0.3s;
}

.reviews__slider .slider__buttons .swiper-button-prev:after,
.reviews__slider .slider__buttons .swiper-button-next:after {
  font-size: 16px;
}

.reviews__slider .slider__buttons .swiper-button-prev:hover,
.reviews__slider .slider__buttons .swiper-button-next:hover {
  background-color: var(--white);
  /* --black в тёмной теме почти белый, иконка бы пропала на белом круге */
  color: var(--surface-contrast);
}

.reviews__slider .slider__buttons .swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.reviews__slider .slider__buttons .swiper-button-prev {
  left: 10px;
}

.reviews__slider .slider__buttons .swiper-button-next {
  right: 10px;
}

@media (max-width: 991px) {
  .reviews {
    gap: 30px;
  }
  .reviews__source {
    padding: 20px;
    gap: 15px;
  }
  .reviews__source__value {
    font-size: 36px;
  }
  .reviews__source__action {
    display: none;
  }
  .reviews__slider .slider__buttons {
    display: none;
  }
}

@media (max-width: 768px) {
  .review {
    padding: 25px 20px;
    gap: 15px;
  }
  .reviews__source {
    flex: 1 1 100%;
  }
}
