/* Reglas criticas del home: certificaciones y cinta de clientes.
   Separadas para evitar que un CSS cacheado en hosting deje estas secciones sin layout. */

.clients-heading {
  text-align: center;
  margin-bottom: 18px;
  padding-top: 60px;
}

.clients-heading .eyebrow {
  justify-content: center;
}

.clients-heading h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.clients-marquee {
  position: relative;
  overflow: hidden;
  padding: 36px 0;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.clients-marquee__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 60px;
  width: max-content;
  min-width: max-content;
  animation: scrollClients 38s linear infinite;
}

.clients-marquee:hover .clients-marquee__track {
  animation-play-state: paused;
}

.clients-marquee__item {
  flex: 0 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.clients-marquee__item img {
  display: block;
  max-height: 56px;
  max-width: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.4s var(--ease), opacity 0.4s var(--ease), transform 0.3s var(--ease);
}

.clients-marquee__item:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

@keyframes scrollClients {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.cert-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
  display: flex;
  flex-direction: column;
}

.cert-card:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 181, 188, 0.4);
  box-shadow: var(--shadow-md);
}

.cert-card__media {
  position: relative;
  height: 240px;
  background: linear-gradient(180deg, #f8fbfc 0%, #eef4f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.cert-card__media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s var(--ease);
  filter: drop-shadow(0 4px 12px rgba(11, 33, 42, 0.08));
}

.cert-card:hover .cert-card__media img {
  transform: scale(1.04);
}

.cert-card__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(11, 33, 42, 0.85);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 2;
}

.cert-card:hover .cert-card__zoom {
  opacity: 1;
  transform: scale(1);
}

.cert-card__zoom svg {
  width: 16px;
  height: 16px;
}

.cert-card__body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cert-card__body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 6px;
}

.cert-card__body p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .certs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .certs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cert-card__media {
    height: 200px;
  }

  .clients-marquee__item {
    height: 56px;
  }

  .clients-marquee__item img {
    max-height: 44px;
    max-width: 130px;
  }
}

@media (max-width: 640px) {
  .certs-grid {
    grid-template-columns: 1fr;
  }
}
