/* ======================================================
   CONTENEDOR GENERAL
====================================================== */
.reviews-section {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin-top: 0.5rem;
  gap: 3rem;
  padding: 0 1.5rem;
  position: relative;
}

/* ============================================================
   SECCIÓN DE TESTIMONIOS 
   ============================================================ */

.testimonials-section {
  position: relative;
  overflow: hidden;
  max-width: 1500px;
  margin: auto;
  padding: 6rem;
}


/* ============================================================
   HEADER DE TESTIMONIOS
   ============================================================ */

.testimonials-header {
  text-align: left;
  margin-bottom: 5.5rem;
  padding: 0 1rem;
}

.testimonials-header .section-badge {
  display: inline-block;
  background: rgba(26, 61, 46, 0.08);
  padding: 0.3rem 1.5rem;
  border-radius: 50px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
  border: 1px solid rgba(26, 61, 46, 0.08);
  margin-bottom: 0.75rem;
}

.testimonials-header h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.4rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  letter-spacing: 1px;
}

.testimonials-header h2 span {
  color: var(--accent);
  position: relative;
}

.testimonials-header .testimonials-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.5rem auto 1.2rem;
  max-width: 200px;
}

.testimonials-header .testimonials-divider .line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent));
  opacity: 0.3;
  border-radius: 2px;
}

.testimonials-header .testimonials-divider .line:last-child {
  background: linear-gradient(90deg, var(--accent), transparent);
}

.testimonials-header .testimonials-divider .icon {
  font-size: 1.2rem;
  opacity: 0.5;
  animation: pulse-leaf 3s ease-in-out infinite;
}

.testimonials-header p {
  max-width: 600px;
  text-align: left;
  font-weight: bold;
  font-size: 2.5rem;
  color: var(--text-sub);
  line-height: 1.7;
  font-family: "Fraunces", serif;
}

/* ======================================================
   RESUMEN GOOGLE
====================================================== */
#reviews-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
  flex-shrink: 0;
}

.rating-stars {
  color: #fbbc04;
  font-size: 1.6rem;
  letter-spacing: 4px;
}

.rating h2 {
  margin: 0.5rem 0;
  font-size: 4.5rem;
  
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -1px;
 
  font-family: "Lato", sans-serif;
   
    font-weight: 700;
    letter-spacing: -0.03em;
  
}

.rating-count {
  margin: 0;
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.6;
}

.rating-count strong {
  color: var(--accent);
  font-weight: 600;
}

/* ======================================================
   BOTÓN GOOGLE GRANDE
====================================================== */
.google-button {
  display: inline-block;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.google-button img {
  width: 140px;

  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.google-button:hover img {
  transform: scale(1.1);
}

.google-button:hover {
  opacity: 0.8;
}

/* ======================================================
   SWIPER
====================================================== */
.reviews-swiper {
  position: relative;
  overflow: hidden;
  flex: 1;
  padding: 0.5rem 0.25rem;
}

.reviews-swiper .swiper-wrapper {
  align-items: stretch;
}

/* ======================================================
   TARJETAS
====================================================== */
.testimonial-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.75rem;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid rgba(170, 195, 135, 0.18);

  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  min-height: 280px;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  border-color: rgba(26, 115, 232, 0.15);
}

/* ======================================================
   ESTRELLAS
====================================================== */
.stars {
  display: flex;
  gap: 2px;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.star {
  color: #fbbc04;
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.star.empty {
  color: #ddd;
}

.testimonial-card:hover .star {
  animation: starPop 0.3s ease forwards;
}

.testimonial-card:hover .star:nth-child(2) {
  animation-delay: 0.05s;
}
.testimonial-card:hover .star:nth-child(3) {
  animation-delay: 0.1s;
}
.testimonial-card:hover .star:nth-child(4) {
  animation-delay: 0.15s;
}
.testimonial-card:hover .star:nth-child(5) {
  animation-delay: 0.2s;
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* ======================================================
   CONTENEDOR DE TEXTO CON LEER MÁS
====================================================== */
.testimonial-text-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.testimonial-text-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.testimonial-text-content {
  display: -webkit-box;

  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: none;
  max-height: 100px;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cuando está expandido, mostrar todo */
.testimonial-card.expanded .testimonial-text-content {
  max-height: none;
  overflow: visible;
}

.testimonial-text {
  margin: 0;
  color: var(--text-p);
  line-height: 1.7;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ======================================================
   BOTÓN LEER MÁS
====================================================== */
.read-more-btn {
  display: none;
  background: none !important;
  border: none !important;
  color: #1a73e8 !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.5rem 0 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  z-index: 10 !important;
  background-color: transparent !important;
  width: auto !important;
  font-family: inherit !important;
  margin-top: 0.25rem !important;
  text-decoration: none !important;
  align-self: flex-start !important;
}

.read-more-btn:hover {
  color: #1557b0 !important;
  transform: translateX(4px) !important;
}

.read-more-btn:focus-visible {
  outline: 2px solid #1a73e8 !important;
  outline-offset: 2px !important;
  border-radius: 4px !important;
}

.read-more-btn[aria-expanded="true"]::after {
  content: " ↑" !important;
}

.read-more-btn[aria-expanded="false"]::after {
  content: " ↓" !important;
}

/* ======================================================
   FOOTER DE LA TARJETA
====================================================== */
.testimonial-footer {
  display: flex;
  align-items: center;
  gap: 14px;

  border-top: none;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #f0f0f0;
  transition: border-color 0.3s ease;
}

.testimonial-card:hover .testimonial-avatar {
  border-color: #1a73e8;
}

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

.testimonial-author {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.testimonial-author h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.testimonial-date {
  margin-top: 2px;
  color: #9aa0a6;
  font-size: 0.8rem;
  font-weight: 400;
}

/* Logo de Google en el footer */
.logo-google-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-left: auto;
  opacity: 1;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

/* ======================================================
   FLECHAS DE NAVEGACIÓN
====================================================== */
.reviews-prev,
.reviews-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(26, 61, 46, 0.85);
  border: 1px solid rgba(26, 61, 46, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 1.2rem;
  color: #3c4043;
  user-select: none;
}

.reviews-prev::before {
  content: "‹";
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 300;
}

.reviews-next::before {
  content: "›";
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 300;
}

.reviews-prev {
  left: -18px;
}

.reviews-next {
  right: -18px;
}

.reviews-prev:hover,
.reviews-next:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: #1a73e8;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 20px rgba(26, 115, 232, 0.3);
}

.reviews-prev:active,
.reviews-next:active {
  transform: translateY(-50%) scale(0.95);
}

.reviews-prev.swiper-button-disabled,
.reviews-next.swiper-button-disabled {
  opacity: 0;
  cursor: not-allowed;
  pointer-events: none;
}

/* ======================================================
   ANIMACIONES DE APARICIÓN
====================================================== */
.testimonial-card {
  opacity: 0;
  animation: cardAppear 0.6s ease forwards;
}

.testimonial-card:nth-child(1) {
  animation-delay: 0.05s;
}
.testimonial-card:nth-child(2) {
  animation-delay: 0.1s;
}
.testimonial-card:nth-child(3) {
  animation-delay: 0.15s;
}
.testimonial-card:nth-child(4) {
  animation-delay: 0.2s;
}
.testimonial-card:nth-child(5) {
  animation-delay: 0.25s;
}
.testimonial-card:nth-child(6) {
  animation-delay: 0.3s;
}
.testimonial-card:nth-child(7) {
  animation-delay: 0.35s;
}
.testimonial-card:nth-child(8) {
  animation-delay: 0.4s;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================================
   UTILIDADES
====================================================== */
#reviews-summary:empty {
  display: none;
}

.reviews-section {
  scroll-margin-top: 2rem;
}

.testimonial-card:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}
/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---------- TABLET / PANTALLAS MEDIANAS ---------- */
@media (max-width: 1024px) {
  .reviews-section {
    gap: 2rem;
    padding: 0 1.25rem;
  }

  .testimonials-header {
    margin-bottom: 3.5rem;
    padding: 0;
  }

  .testimonials-header h2 {
    font-size: 2.2rem;
  }

  .testimonials-header p {
    max-width: 100%;
    font-size: 2rem;
    line-height: 1.4;
  }

  #reviews-summary {
    min-width: 240px;
  }

  .rating h2 {
    font-size: 4rem;
  }

  .reviews-prev {
    left: -12px;
  }

  .reviews-next {
    right: -12px;
  }

  .testimonial-card {
    padding: 1.5rem;
    min-height: 250px;
  }
}

/* ---------- TABLET VERTICAL / MÓVIL ---------- */
@media (max-width: 900px) {
  .reviews-section {
    flex-direction: column;
    align-items: stretch;
    gap: 2.5rem;
    width: 100%;
    padding: 0 1rem;
  }

  /* Header */
  .testimonials-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 0;
  }

  .testimonials-header h2 {
    font-size: 2rem;
    line-height: 1.15;
    margin-bottom: 0.5rem;
  }

  .testimonials-header p {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.5rem;
    line-height: 1.4;
  }

  .testimonials-header .testimonials-divider {
    margin: 0.75rem auto 1rem;
  }

  /* Resumen Google */
  #reviews-summary {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .rating {
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 1.5rem;
  }

  .rating h2 {
    font-size: 3.8rem;
  }

  .rating-stars {
    font-size: 1.4rem;
    letter-spacing: 3px;
  }

  /* Carrusel */
  .reviews-swiper {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0;
  }

  /* Ocultar flechas */
  .reviews-prev,
  .reviews-next {
    display: none;
  }

  /* Tarjetas */
  .testimonial-card {
    min-height: 240px;
    padding: 1.5rem;
    border-radius: 18px;
  }

  .testimonial-card:hover {
    transform: translateY(-4px);
  }

  .testimonial-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .read-more-btn {
    font-size: 0.85rem !important;
    padding: 0.4rem 0 !important;
  }
}

/* ---------- MÓVIL ---------- */
@media (max-width: 600px) {
  .reviews-section {
    gap: 2rem;
    padding: 0 0.75rem;
  }

  /* Header */
  .testimonials-header {
    margin-bottom: 2rem;
  }

  .testimonials-header .section-badge {
    padding: 0.3rem 1rem;
    font-size: 0.65rem;
    letter-spacing: 2px;
  }

  .testimonials-header h2 {
    font-size: 1.75rem;
    line-height: 1.15;
    letter-spacing: 0.5px;
  }

  .testimonials-header p {
    font-size: 1.15rem;
    line-height: 1.45;
  }

  .testimonials-header .testimonials-divider {
    max-width: 150px;
    gap: 0.6rem;
  }

  .testimonials-header .testimonials-divider .icon {
    font-size: 1rem;
  }

  /* Google */
  .rating {
    padding: 1rem;
    max-width: 100%;
  }

  .rating h2 {
    font-size: 3.2rem;
  }

  .rating-stars {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }

  .rating-count {
    font-size: 0.85rem;
  }

  .google-button img {
    width: 120px;
  }

  /* Carrusel */
  .reviews-swiper {
    padding: 0;
    overflow: hidden;
  }

  /* Tarjetas */
  .testimonial-card {
    min-height: 0;
    padding: 1.25rem;
    border-radius: 16px;
  }

  .stars {
    margin-bottom: 0.5rem;
  }

  .star {
    font-size: 1rem;
  }

  .testimonial-text {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .testimonial-footer {
    gap: 10px;
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .testimonial-avatar {
    width: 40px;
    height: 40px;
  }

  .testimonial-author h4 {
    font-size: 0.85rem;
  }

  .testimonial-date {
    font-size: 0.75rem;
  }

  .logo-google-img {
    width: 20px;
    height: 20px;
  }
}

/* ---------- MÓVIL PEQUEÑO ---------- */
@media (max-width: 400px) {
  .reviews-section {
    padding: 0 0.5rem;
  }

  .testimonials-header h2 {
    font-size: 1.55rem;
  }

  .testimonials-header p {
    font-size: 1rem;
  }

  .testimonial-card {
    padding: 1rem;
  }

  .rating h2 {
    font-size: 2.8rem;
  }

  .rating-stars {
    font-size: 1.05rem;
  }

  .testimonial-text {
    font-size: 0.85rem;
  }
}

/* ---------- ACCESIBILIDAD / TOUCH ---------- */
@media (hover: none) {
  .testimonial-card:hover {
    transform: none;
  }

  .testimonial-card:hover .star {
    animation: none;
  }

  .google-button:hover img {
    transform: none;
  }

  .reviews-prev:hover,
  .reviews-next:hover {
    transform: translateY(-50%);
  }
}

/* ---------- REDUCIR ANIMACIONES ---------- */
@media (prefers-reduced-motion: reduce) {
  .testimonial-card,
  .star,
  .google-button img,
  .reviews-prev,
  .reviews-next {
    animation: none !important;
    transition: none !important;
  }
}
