/* 
* Testimonios
* -----------------------------------------------------
* La rejilla la gobierna Owl Carousel (ver js/carousel.js):
* 4 fichas en escritorio, 2 por debajo de 1200px y 1 por debajo de 768px.
*/

#testimonios {
  align-items: center;
  background-color: var(--bg-color);
  display: flex;
  height: 100vh;
  min-height: 900px;
  padding-block: 80px;
  /* el carril de la derecha queda libre para el contador de secciones (.dots) */
  padding-inline: 88px;
  width: 100%;
}

#testimonios .container {
  padding-inline: 0;
}

/* Owl deja el carrusel en display:none hasta inicializarse. Mientras tanto
   (y si fallara el JS) se muestra como rejilla para no dejar la sección vacía */
#testimonios .testimonios-grid:not(.owl-loaded) {
  display: grid;
  gap: 0 48px;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}

/* Owl fuerza width:100% en las imágenes de sus items: aquí no interesa */
#testimonios .owl-carousel .owl-item img {
  display: block;
  max-height: 100%;
  max-width: 175px;
  object-fit: contain;
  width: auto;
}

/* Alto fijo para que todos los logos compartan la misma línea base */
.testimonio__logo {
  align-items: center;
  display: flex;
  height: 84px;
  justify-content: center;
  margin-bottom: 40px;
}

.testimonio__logo img {
  max-height: 100%;
  max-width: 175px;
  object-fit: contain;
  width: auto;
}

.testimonio__texto {
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.2px;
  line-height: 1.6;
  margin: 0 0 32px;
}

.testimonio__nombre {
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: normal;
  margin: 0 0 10px;
}

.testimonio__cargo {
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.5px;
  line-height: normal;
  margin: 0;
}

/* Paginación de Owl: el .owl-dots global de carousel.css va en position:absolute,
   aquí debe quedar en el flujo, bajo las fichas */
#testimonios .owl-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 48px;
  position: static;
  transform: none;
  width: 100%;
}

/* el id de la regla anterior gana a `.owl-carousel .owl-dots.disabled` de Owl,
   hay que repetir aquí el ocultado cuando todas las fichas caben a la vez */
#testimonios .owl-dots.disabled {
  display: none;
}

#testimonios .owl-dots .owl-dot {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  height: 9px;
  margin: 0;
  width: 9px;
}

#testimonios .owl-dots .owl-dot.active {
  background: var(--white);
  border-color: var(--white);
}

/* 1200-1439px: siguen siendo 4 fichas pero en columnas estrechas */
@media (width <=1439px) {
  .testimonio__logo {
    height: 68px;
    margin-bottom: 28px;
  }

  .testimonio__logo img,
  #testimonios .owl-carousel .owl-item img {
    max-width: 140px;
  }

  .testimonio__texto {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .testimonio__nombre {
    font-size: 17px;
  }

  .testimonio__cargo {
    font-size: 13px;
  }

  #testimonios .owl-dots {
    margin-top: 32px;
  }
}

/* Por debajo de 1200px Owl pasa a 2 fichas: las columnas se ensanchan
   y el texto puede recuperar tamaño */
@media (width <=1199px) {

  #testimonios .testimonios-grid:not(.owl-loaded) {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonio__logo {
    height: 84px;
    margin-bottom: 40px;
  }

  .testimonio__logo img,
  #testimonios .owl-carousel .owl-item img {
    max-width: 175px;
  }

  .testimonio__texto {
    font-size: 16px;
    line-height: 1.65;
  }

  .testimonio__nombre {
    font-size: 19px;
  }

  .testimonio__cargo {
    font-size: 14px;
  }
}

/* Por debajo de 768px Owl muestra una sola ficha */
@media (width <=992px) {
  #testimonios {
    padding-inline: 48px;
  }
}

@media (width <=767px) {
  #testimonios {
    min-height: 400px;
    padding-block: 40px;
  }
}

/* por debajo de 480px el contador lateral se oculta: no hay que reservarle sitio */
@media (width <=480px) {
  #testimonios {
    padding-inline: 24px;
  }

  #testimonios .testimonios-grid:not(.owl-loaded) {
    grid-template-columns: 1fr;
  }

  /* medida de línea cómoda cuando la ficha ocupa todo el ancho */
  .testimonio {
    margin-inline: auto;
    max-width: 460px;
  }
}

/* Pantallas de poca altura: la sección se ajusta al viewport para que la
   firma de cada testimonio nunca quede cortada por el scroll snap.
   Va al final para imponerse a las reglas de ancho anteriores */
@media (height <=900px) {
  #testimonios {
    min-height: 0;
    padding-block: 48px;
  }

  .testimonio__logo {
    height: 64px;
    margin-bottom: 24px;
  }

  .testimonio__texto {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 20px;
  }

  .testimonio__nombre {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .testimonio__cargo {
    font-size: 12px;
  }

  #testimonios .owl-dots {
    margin-top: 24px;
  }
}
