/* =============================================
   RESEÑAS — css/reviews.css
   Módulo activable desde js/reviews.js
   (REVIEWS_ENABLED = true / false)
============================================= */

.reviews {
  background: var(--black);
  padding-bottom: 4rem;
}

/* ─── Header de sección (igual que las demás secciones) ─── */

.reviews-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 4rem;
}

.reviews-head .s-rule { margin: 0 auto; }

/* ─── Layout de dos columnas ─── */

.reviews-inner {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 4.5rem;
  align-items: center;
}

/* ─── Columna izquierda ─── */

.reviews-intro-body {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.95;
  color: #CCCCCC;
}

/* ─── Columna derecha: carrusel ─── */

.reviews-carousel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* Fila: [flecha] [tarjeta] [flecha] */
.rev-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.rev-viewport {
  flex: 1;
  /* clip-path clips horizontal overflow (slide animation) but allows card to grow downward */
  clip-path: inset(0 0 -600px 0);
  border-radius: 0.9rem;
  min-width: 0;
}

.rev-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* ─── Tarjeta estilo Google ─── */

.rev-card {
  flex: 0 0 100%;
  background: #111111;
  border-radius: 0.9rem;
  padding: 1.6rem 1.6rem 1.4rem;
  box-sizing: border-box;
  color: var(--white);
  border: 2px solid rgba(201, 169, 110, 0.42);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.5), 0 0 0 0px rgba(201, 169, 110, 0);
}

.rev-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 0.85rem;
}

.rev-star {
  width: 18px;
  height: 18px;
}

.rev-text-wrap {
  margin-bottom: 1.3rem;
}

.rev-text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(245, 245, 245, 0.72);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  /* hold space for exactly 4 lines even on short texts → uniform card height */
  min-height: calc(4 * 0.875rem * 1.7);
}

.rev-text.expanded {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  min-height: 0;
}

/* Used by JS to measure true text height before clamping is applied */
.rev-text.measuring {
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  min-height: 0 !important;
}

.rev-read-more {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold);
  cursor: pointer;
  font-family: inherit;
  display: none; /* no button on desktop/iPad */
}

/* Fila del autor */
.rev-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rev-author-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rev-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  font-family: Arial, sans-serif;
}

.rev-author-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
}

.rev-author-time {
  display: block;
  font-size: 0.775rem;
  color: rgba(245, 245, 245, 0.4);
}

/* ─── Flechas de navegación ─── */

.rev-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
}

.rev-btn:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.rev-btn svg {
  width: 16px;
  height: 16px;
}

/* ─── Indicadores (dots) ─── */

.rev-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
}

.rev-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}

.rev-dot.active {
  background: var(--gold);
  transform: scale(1.3);
}

/* ─── Google logo ─── */

/* ─── Avatares (bolitas con inicial) ─── */

.rev-avatar {
  filter: saturate(0.80) brightness(0.75);
}

/* ─── Responsive ─── */

@media (max-width: 960px) {
  .reviews-inner {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .reviews-intro-body {
    text-align: center;
    margin-bottom: 0;
  }
}

@media (max-width: 520px) {
  .reviews {
    padding-bottom: 6rem;
  }

  /* button only exists on mobile — always holds its space for uniform card height */
  .rev-read-more {
    display: block;
    visibility: hidden;
    pointer-events: none;
  }

  .rev-read-more.visible {
    visibility: visible;
    pointer-events: auto;
  }

  /* when expanded, clamp at 8 lines with … then "Leer menos" stays visible */
  .rev-text.expanded {
    -webkit-line-clamp: 8;
  }

  .rev-card {
    padding: 1.25rem 1.2rem 1.1rem;
  }

  .rev-btn {
    width: 32px;
    height: 32px;
  }
}
