/* CommerceTuned palette */
.ct-testimonials{
  background:#8CC53E;
  padding:48px 0;
}

.ct-testimonials__inner{
  max-width:1200px;
  margin:0 auto;
  padding:0 24px;
}

/* Grid: 3 desktop / 2 tablet / 1 mobile */
.ct-testimonials__grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:24px;
  align-items:stretch;
}

@media (max-width: 1024px){
  .ct-testimonials__grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .ct-testimonials__grid{ grid-template-columns:1fr; }
}

.ct-tcard{
  background:#FFFFFF;
  border:1px solid #E5E7EB;
  border-top:3px solid #8CC53E;
  border-radius:14px;
  padding:22px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* Quote */
.ct-tcard__quote{
  margin:0;
  color:#1A1A1A;
  font-size:16px;
  line-height:1.6;
  font-style: italic;
}

.ct-tcard__quote p{
  margin:0;
}

/* Meta */
.ct-tcard__name{
  color:#1A1A1A;
  font-weight:700;
  font-size:14px;
  line-height:1.3;
}

.ct-tcard__context{
  color:#404042;
  font-size:13px;
  line-height:1.4;
  margin-top:4px;
}

/* Brand row pinned to bottom */
.ct-tcard__brand{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  padding-top:8px;

  min-width:0; /* importante en flex para evitar overflows raros */
}

/* Logos normalizados */
.ct-tcard__logo{
  max-height:26px;
  max-width:160px;
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  filter:grayscale(1);
  opacity:0.9;
}

@media (max-width: 640px){
  .ct-tcard__logo{
    max-height:22px;
    max-width:140px;
  }
}

/* Badge (cuando no hay logo): nunca debe salirse de la card */
.ct-tcard__badge{
  display:inline-block;
  font-size:12px;
  line-height:1.2;
  color:#404042;
  border:1px solid #E5E7EB;
  background:#F6F7F8;
  padding:6px 10px;

  max-width:100%;
  min-width:0;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;

  border-radius:12px;
}

/* Nota bajo el grid */
.ct-testimonials__note{
  margin-top:18px;
  color:#FFFFFF;
  font-size:13px;
  line-height:1.4;
  opacity:0.95;
}

/* Mejor layout cuando hay 1 o 2 testimonials */
.ct-testimonials__grid--count-1{
  grid-template-columns:minmax(0, 520px);
  justify-content:center;
}

.ct-testimonials__grid--count-2{
  grid-template-columns:repeat(2, minmax(0, 520px));
  justify-content:center;
}

@media (max-width: 1024px){
  .ct-testimonials__grid--count-2{
    grid-template-columns:1fr;
  }
}

/* See more / See less (sin JS) */
.ct-tcard__quoteWrap{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ct-tcard__toggle{
  display:none;
}

/* Se clampa solo si el PHP añade esta clase */
.ct-tcard__quote--clamp{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp: var(--ct-clamp, 6);
  overflow:hidden;
}

/* Expandir al marcar el checkbox */
.ct-tcard__toggle:checked ~ .ct-tcard__quote--clamp{
  display:block;
  -webkit-line-clamp: unset;
  overflow:visible;
}

/* Botón */
.ct-tcard__toggleBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:#3F7C00;
  cursor:pointer;
  user-select:none;
}

.ct-tcard__toggleBtn:hover{
  text-decoration:underline;
}

.ct-tcard__less{ display:none; }
.ct-tcard__toggle:checked ~ .ct-tcard__toggleBtn .ct-tcard__more{ display:none; }
.ct-tcard__toggle:checked ~ .ct-tcard__toggleBtn .ct-tcard__less{ display:inline; }

/* (Opcional) Si en el futuro añades una clase para mostrar siempre completo */
.ct-testimonials--full .ct-tcard__quote--clamp{
  display:block;
  -webkit-line-clamp: unset;
  overflow:visible;
}
.ct-testimonials--full .ct-tcard__toggleBtn{
  display:none;
}
