/* ==========================================
   ProstoStihi.ru — Reviews Page Styles
   ========================================== */

/* ========================================
   CONTAINER (не конфликтует с Tailwind .container)
   ======================================== */
.reviews-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.reviews-section {
  padding: 80px 0;
}

/* ========================================
   БЛОК 1 — HERO
   ======================================== */
.reviews-hero {
  padding: 50px 0 25px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.reviews-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 20%, rgba(139, 92, 246, 0.06), transparent 70%);
  pointer-events: none;
}

.reviews-hero h1 {
  max-width: 700px;
  margin: 0 auto 16px;
}

.reviews-hero .reviews-sub {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========================================
   БЛОК 2 — СЕТКА ОТЗЫВОВ
   ======================================== */
.reviews-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.reviews-gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  aspect-ratio: 1 / 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.reviews-gallery-item:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lift);
}

.reviews-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reviews-gallery-item .reviews-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  background: #F0F0F0;
  user-select: none;
}

/* Overlay при hover */
.reviews-gallery-item .reviews-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.reviews-gallery-item:hover .reviews-overlay {
  opacity: 1;
}

.reviews-gallery-item .reviews-overlay svg {
  width: 40px;
  height: 40px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* ========================================
   ЛАЙТБОКС
   ======================================== */
.reviews-lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.reviews-lightbox-overlay.open {
  display: flex;
}

.reviews-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reviews-lightbox-content img,
.reviews-lightbox-content .reviews-placeholder-lg {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* Кнопки навигации */
.reviews-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease;
  z-index: 10;
}

.reviews-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

.reviews-lightbox-nav.prev {
  left: -68px;
}

.reviews-lightbox-nav.next {
  right: -68px;
}

.reviews-lightbox-nav svg {
  width: 28px;
  height: 28px;
}

.reviews-lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
  padding: 4px;
}

.reviews-lightbox-close:hover {
  opacity: 1;
}

.reviews-lightbox-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-family: var(--font-body);
}

/* ========================================
   БЛОК 3 — ФИНАЛЬНЫЙ CTA
   ======================================== */
.reviews-final-cta {
  background: var(--gradient-diagonal);
  border-radius: 20px;
  padding: 64px 48px;
  text-align: center;
  color: #fff;
}

.reviews-final-cta h2 {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.reviews-final-cta p {
  font-size: 16px;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.reviews-final-cta .reviews-cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   КНОПКИ
   ======================================== */
.reviews-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  text-align: center;
  text-decoration: none;
}

.reviews-btn-white {
  background: #fff;
  color: var(--purple);
  border: none;
}

.reviews-btn-white:hover {
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.reviews-btn-ghost-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.reviews-btn-ghost-white:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* ========================================
   МОДАЛЬНОЕ ОКНО
   ======================================== */
.reviews-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.reviews-modal-overlay.open {
  display: flex;
}

.reviews-modal {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  animation: reviewsModalIn 0.25s ease;
}

@keyframes reviewsModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.reviews-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.reviews-modal-close:hover { color: var(--fg); }

.reviews-modal h3 {
  font-size: 24px;
  margin-bottom: 8px;
  text-align: center;
}

.reviews-modal p {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */
@media (max-width: 1023px) {
  .reviews-gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .reviews-lightbox-nav.prev { left: -48px; }
  .reviews-lightbox-nav.next { right: -48px; }
}

@media (max-width: 767px) {
  .reviews-gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .reviews-lightbox-overlay { padding: 16px; }
  .reviews-lightbox-nav { width: 44px; height: 44px; }
  .reviews-lightbox-nav.prev { left: -20px; }
  .reviews-lightbox-nav.next { right: -20px; }
  .reviews-lightbox-nav svg { width: 22px; height: 22px; }
  .reviews-lightbox-close { top: -40px; font-size: 28px; }
}

@media (max-width: 639px) {
  .reviews-section { padding: 48px 0; }
  .reviews-hero { padding-top: 40px; padding-bottom: 24px; }
  .reviews-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .reviews-final-cta { padding: 40px 24px; border-radius: 16px; }
  .reviews-final-cta .reviews-cta-buttons { flex-direction: column; align-items: center; }
  .reviews-final-cta .reviews-cta-buttons .reviews-btn { width: 100%; max-width: 300px; }
  .reviews-modal { padding: 28px 20px 24px; }
}

@media (max-width: 359px) {
  .reviews-container { padding: 0 12px; }
  .reviews-gallery-grid { grid-template-columns: 1fr 1fr; }
}
