/* testimonios.css - layout horizontal sin col-* (cerrado 234px, abierto 354px, gap 37px) */

.tb-testimonios-list {
  display: flex;
  flex-direction: row;
  gap: 37px; /* separación solicitada */
  align-items: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth; /* NUEVO: scroll suave */
}

/* contenedor de cada item (hijo directo del flex) */
.tb-item-wrapper {
  flex: 0 0 234px; /* por seguridad: cada item wrapper toma ancho cerrado */
  width: 234px;
  transition: all 0.42s cubic-bezier(0.165, 0.84, 0.44, 1); /* NUEVO: transición más suave */
  will-change: width, flex-basis, transform; /* Optimización */
}

/* el wrapper contiene la card real (.tb-card--wrapper) que recibe la clase is-open */
.tb-card--wrapper {
  background: transparent;
  border-radius: 18px;
  overflow: visible;
  position: relative;
  transition: all 0.38s ease-out; /* NUEVO: transición suave */
}

/* cuando el item está abierto, expandimos el wrapper y el item-wrapper también */
.tb-item-wrapper .tb-card--wrapper.is-open,
.tb-item-wrapper.is-open {
}

/* En el JS aplicamos .is-open sobre .tb-card--wrapper; convertimos ese estado para el item-wrapper también */
.tb-card--wrapper.is-open {
  z-index: 12;
  border: none !important;
}

/* Para que el ancho real cambie al abrir, usamos una regla que aplica si el .tb-card--wrapper tiene .is-open:
   seleccionamos su contenedor padre .tb-item-wrapper y cambiamos su ancho */
.tb-card--wrapper.is-open {
  /* nothing here, la regla que cambia el ancho está abajo con selector padre */
}

/* Selector padre cuando el child .tb-card--wrapper tiene is-open:
   (CSS no permite seleccionar padre con un selector puro; por eso en JS también añadimos .is-open al .tb-item-wrapper.
   Asegúrate que tu JS añade .is-open tanto a .tb-card--wrapper como a .tb-item-wrapper — el JS que te di ya añade sobre .tb-card--wrapper.
   Para robustez, el siguiente CSS cubre ambos casos. ) */

/* estado en el wrapper del item */
.tb-item-wrapper.is-open,
.tb-item-wrapper .tb-card--wrapper.is-open + * {
}

/* NUEVO: Animación para la expansión */
.tb-item-wrapper.is-open {
  flex: 0 0 354px;
  width: 354px;
  transform: translateY(-6px); /* Efecto de elevación */
}

/* Closed/CLOSED VIEW (height 234px) */
.tb-card-closed-view {
  border-radius: 40px 0;
  height: 340px; /* CAMBIADO: de 234px a 313px */
  background-color: #222;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.32s ease;
}

/* overlay contraste */
.tb-card-closed-view::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28) 10%,
    rgba(0, 0, 0, 0.52) 70%
  );
  border-radius: none !important;
  transition: all 0.32s ease;
}

/* NUEVO: Efecto hover en estado cerrado */
.tb-item-wrapper:not(.is-open) .tb-card-closed-view:hover {
  transform: translateY(-4px);
}

.tb-item-wrapper:not(.is-open) .tb-card-closed-view:hover::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 10%,
    rgba(0, 0, 0, 0.6) 70%
  );
}

/* NUEVO: Estilos para las 5 estrellas separadas */
.tb-stars-wrap {
  z-index: 3;
  display: flex;
  gap: 6px; /* separación de 6px entre estrellas */
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.tb-star {
  width: 13px;
  height: 13px;
  display: block;
  user-select: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
}

/* closed content: nombre, cargo y excerpt */
.tb-closed-content {
  position: absolute;
  left: 27px;
  bottom: 38px;
  z-index: 3;
  color: #fff;
  max-width: calc(100% - 54px);
  transition: all 0.3s ease;
}

.tb-closed-title {
  font-family: Futura Now Headline;
  font-style: Bold;
  font-size: 20px;
  leading-trim: NONE;
  line-height: 120%;
  letter-spacing: -2%;
  margin-bottom: 0 ;
}

.tb-closed-desc {
  margin-top: 6px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.95);
}

.tb-closed-desc strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

.tb-closed-excerpt {
  font-family: Futura Now Headline;
font-weight: Body/Font Weight Regular;
font-style: Regular;
font-size: 16px;
leading-trim: NONE;
line-height: 140%;
letter-spacing: 0%;

}

/* EXPANDED VIEW - min-height 354px */
.tb-card-expanded-view {
  display: none;
  background: #f7f7f7;
  border-radius: 40px 0;
  padding: 18px;
  min-height: 340px; /* CAMBIADO: de min-height 354px a 313px */
  height: 340px; /* AÑADIR: establecer altura fija */
  position: relative;
  cursor: default;
  overflow: hidden;
  animation: fadeInUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.tb-item-wrapper:focus-within {
  outline: 3px solid rgba(13, 110, 253, 0.08);
  border-radius: 14px;
  background-color: transparent;
  outline: none;
}
.tb-card--wrapper {
  border: none !important;
  background: transparent !important;
  outline: none !important;
}
.tb-item-wrapper:focus-within {
  outline: none;
}
/* NUEVO: Animación para la entrada de la vista expandida */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Show/Hide control */
.tb-item-wrapper.is-open .tb-card-closed-view {
  display: none;
}

.tb-item-wrapper.is-open .tb-card-expanded-view {
  display: block;
}

/* NUEVO: Layout modificado para el expanded view */
.tb-expanded-inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tb-person-thumb {
  width: 82px;
  flex: 0 0 82px;
}

.tb-person-thumb img {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  border: 3px solid #fff;
  transition: all 0.3s ease;
}

.tb-person-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: #efefef;
}

/* NUEVO: Contenedor para la información de la persona y empresa */
.tb-expanded-main {
  flex: 1 1 auto;
}

/* NUEVO: Estructura modificada - AHORA EN BLOQUE (2 FILAS) */
.tb-expanded-top {
  display: block; /* Cambiado a block para 2 filas */
}

.tb-person-name {
  font-family: Roboto;
  font-weight: 700;
  font-style: Bold;
  font-size: 20px;
  leading-trim: NONE;
  line-height: 152%;
  letter-spacing: 3%;
  color: #000;
  margin-bottom: 14px;
}

.tb-person-cargo {
  font-size: 14px;
  color: #666;
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.tb-company-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tb-brand-logo {
  max-height: 38px;
  max-width: 120px;
  display: block;
  object-fit: contain;
}

.tb-brand-name {
  font-family: Roboto;
  font-weight: 700;
  font-style: Bold;
  font-size: 20px;
  leading-trim: NONE;
  line-height: 100%;
  letter-spacing: 3%;
  color: #d8712f;
}

/* quote */
.tb-quote {
  font-family: Futura Now Headline;
  font-style: Regular;
  font-size: 15px;
  leading-trim: NONE;
  line-height: 132%;
  letter-spacing: 0%;
  color: #000000;
}

/* NUEVO: Animación para el texto */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* focus */
.tb-item-wrapper:focus-within {
  border-radius: none !important ;
}

/* NUEVO: Animación suave para el scroll */
.tb-testimonios-list::-webkit-scrollbar {
  height: 8px;
}

.tb-testimonios-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.tb-testimonios-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.tb-testimonios-list::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
/* Comillas personalizadas */
.tb-quote-open,
.tb-quote-close {
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 48px;
  line-height: 152%; /* Esto es 72.96px (48 * 1.52) */
  letter-spacing: 3%; /* Esto es 1.44px (48 * 0.03) */
  color: #000000;
  position: absolute;
  pointer-events: none;
}

/* Comilla de apertura - cerca del título */
.tb-quote-open {
  left: -8px;
  top: -25px; /* Posicionada más arriba para estar cerca del título */
}

/* Comilla de cierre - al final del texto */
.tb-quote-close {
  right: 5px;
  bottom: -45px;
}

/* Asegura que el contenido del quote tenga espacio para las comillas */
.tb-quote {
  position: relative;
  color: #222;
  font-size: 15px;
  line-height: 1.7;
  animation: fadeIn 0.5s ease 0.1s both;
  margin-top: 17px;
}

/* Elimina las comillas anteriores si existen */
.tb-quote::before,
.tb-quote::after {
  display: none;
}

/* Ajusta el contenedor expandido para que el quote tenga suficiente espacio */
.tb-card-expanded-view {
  min-height: 340px;
  height: 340px;
  padding: 21px 10px 19px 26px;
  /* ... otros estilos ... */
}

/* Si necesitas que el título esté más cerca de la comilla, ajusta esto: */
.tb-person-name {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 800;
  color: #111;
  position: relative;
  z-index: 2; /* Asegura que esté sobre la comilla */
}
/* Responsive: en pantallas pequeñas apilamos vertical */
@media (max-width: 920px) {
  .tb-testimonios-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex-wrap: nowrap;
    overflow: visible;
    scroll-behavior: auto;
  }

  /* EN MÓVIL/TABLET: TODOS LOS ITEMS ABIERTOS */
  .tb-item-wrapper {
    flex: 0 0 auto;
    width: 100%;
    /* Forzar estado abierto */
    flex: 0 0 100% !important;
    width: 100% !important;
    transform: translateY(0);
  }

  /* Mostrar siempre la vista expandida en móvil */
  .tb-item-wrapper .tb-card-closed-view {
    display: none !important;
  }

  .tb-item-wrapper .tb-card-expanded-view {
    display: block !important;
  }

  /* Para simular el estado abierto */
  .tb-item-wrapper .tb-card--wrapper {
    border: none !important;
  }

  .tb-card-closed-view {
    height: auto;
    min-height: 280px;
  }

  .tb-card-expanded-view {
    min-height: auto;
    height: auto;
  }

  .tb-company-info {
    margin-left: 0;
    flex-wrap: wrap;
  }

  /* Animaciones más suaves en móvil */
  .tb-item-wrapper {
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  }
}