/* Xanavi: reviews (banner/header: inline in partials/header.blade.php) */

.front-page__reviews-kicker {
  margin: 8px 0 24px;
  font-size: 15px;
  line-height: 1.45;
  color: #4a3f55;
  text-align: left;
}

.front-page__reviews-more {
  margin-top: 8px;
}

.front-page__reviews-more[hidden] {
  display: none !important;
}

.front-page__reviews-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.front-page__reviews-show-more {
  display: block;
  margin: 24px auto 0;
  padding: 10px 22px;
  border: 1px solid #6d59c6;
  border-radius: 8px;
  background: #fff;
  color: #6d59c6;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.3;
  transition: background 0.2s ease, color 0.2s ease;
}

.front-page__reviews-show-more:hover,
.front-page__reviews-show-more:focus {
  background: #6d59c6;
  color: #fff;
  outline: none;
}

.front-page__reviews-show-more:focus-visible {
  outline: 2px solid #6d59c6;
  outline-offset: 2px;
}

/* Раскрытый текст отзыва: не растягивает страницу — скролл внутри карточки */
.front-page__reviews_item-text.is-open {
  max-height: min(70vh, 26rem) !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: block !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.front-page__reviews_item-text.is-open::-webkit-scrollbar {
  width: 6px;
}

.front-page__reviews_item-text.is-open::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35);
  border-radius: 6px;
}

/* Плавающая кнопка: на body; видимость только по классу (без [hidden]) */
.xanavi-reviews-fab {
  position: fixed !important;
  z-index: 2147483000;
  left: max(16px, env(safe-area-inset-left, 0px));
  right: auto;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  padding: 14px 22px;
  margin: 0;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #fff !important;
  cursor: pointer;
  background: linear-gradient(145deg, #7b66e8 0%, #5a46c4 45%, #4a3aa8 100%);
  box-shadow:
    0 4px 14px rgba(74, 58, 168, 0.35),
    0 14px 40px rgba(109, 89, 198, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.xanavi-reviews-fab.xanavi-reviews-fab--visible {
  display: block !important;
  opacity: 1;
  pointer-events: auto;
  animation: xanaviFabPulse 2.2s ease-in-out infinite;
  max-width: min(92vw, 22rem);
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  padding: 12px 18px;
}

/* Если класс --visible не успел примениться из JS, показываем FAB (:has) */
body:has(.front-page__reviews .front-page__reviews_item-text.is-open) #xanavi-reviews-collapse-fab,
body:has(.front-page__reviews .front-page__reviews_item-text p.visible) #xanavi-reviews-collapse-fab,
body:has(#front-page-reviews-more:not([hidden])) #xanavi-reviews-collapse-fab {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: xanaviFabPulse 2.2s ease-in-out infinite;
}

/* Дубликат в секции не используем: одна fixed-кнопка внизу экрана (в т.ч. после «Показать ещё») */
.xanavi-reviews-sticky-wrap {
  display: none !important;
}

.xanavi-reviews-sticky-wrap .xanavi-reviews-fab {
  pointer-events: auto;
  position: relative;
  left: auto;
  right: auto;
  transform: none;
  max-width: min(100%, 22rem);
}

.xanavi-reviews-fab--sticky:active {
  transform: scale(0.98);
}

@keyframes xanaviFabPulse {
  0%,
  100% {
    box-shadow:
      0 4px 14px rgba(74, 58, 168, 0.35),
      0 14px 40px rgba(109, 89, 198, 0.45);
  }
  50% {
    box-shadow:
      0 6px 22px rgba(74, 58, 168, 0.55),
      0 18px 52px rgba(109, 89, 198, 0.65);
  }
}

.xanavi-reviews-fab:hover,
.xanavi-reviews-fab:focus {
  filter: brightness(1.06);
  box-shadow:
    0 6px 20px rgba(74, 58, 168, 0.4),
    0 18px 48px rgba(109, 89, 198, 0.5);
  outline: none;
}

.xanavi-reviews-fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (min-width: 560px) {
  .xanavi-reviews-fab:active {
    transform: scale(0.97);
  }
}

