/*======================================
    Social Proof Popup — Prueba Social Flotante
    Notificación de compras/despachos recientes
========================================*/
.social-proof {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 97; /* Debajo de WhatsApp (100) y popup-urgencia (998) */
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 410px;
  width: calc(100% - 95px); /* Espacio reservado para WhatsApp */
  background: #ffffff;
  border-radius: 14px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition:
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.35s ease;
  will-change: transform, opacity;
  pointer-events: none;
}

.social-proof.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Acento lateral verde vibrante */
.social-proof__accent {
  width: 5px;
  min-width: 5px;
  background: linear-gradient(180deg, #00df61 0%, #00a844 100%);
  flex-shrink: 0;
}

/* Cuerpo principal */
.social-proof__body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 34px 12px 14px;
  flex: 1;
  min-width: 0;
}

/* Ícono circular con check de verificación */
.social-proof__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: #00c853;
  color: #ffffff;
  border-radius: 50%;
  font-size: 18px;
  flex-shrink: 0;
}

/* Bloque de información */
.social-proof__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

/* Línea principal: nombre del producto */
.social-proof__product {
  font-size: 13px;
  font-weight: 800;
  color: #000000;
  line-height: 1.3;
  white-space: normal;
  word-break: normal;
}

/* Línea secundaria: ciudad + método (NUNCA se corta con elipsis) */
.social-proof__location {
  font-size: 12px;
  font-weight: 600;
  color: #333333;
  margin-top: 2px;
  line-height: 1.35;
  white-space: normal;
  word-break: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Verificado / hace X tiempo */
.social-proof__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #008736;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
  white-space: normal;
  flex-wrap: wrap;
}

.social-proof__meta i {
  font-size: 11px;
}

/* Botón de cierre — Área táctil accesible conforme WCAG 2.5.5 / 2.5.8 y Google Lighthouse (>= 48px) */
.social-proof__close {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #888888;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.65;
  transition: opacity 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.social-proof__close:hover,
.social-proof__close:focus-visible {
  opacity: 1;
  color: #000000;
  outline: none;
}

/* Barra de progreso visual (muestra el tiempo restante antes de ocultar) */
.social-proof__progress {
  position: absolute;
  bottom: 0;
  left: 5px; /* Ancho del acento */
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.social-proof__progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00df61, #00a844);
  transform-origin: left;
  animation: socialProofCountdown 8s linear forwards;
}

@keyframes socialProofCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .social-proof {
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 96px);
    width: calc(100% - 96px);
    border-radius: 12px;
  }

  .social-proof__body {
    padding: 10px 32px 10px 12px;
    gap: 10px;
  }

  .social-proof__icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    font-size: 15px;
  }

  .social-proof__product {
    font-size: 12px;
  }

  .social-proof__location {
    font-size: 11px;
    line-height: 1.3;
  }

  .social-proof__meta {
    font-size: 10px;
    line-height: 1.25;
  }
}

@media (max-width: 374px) {
  .social-proof {
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 92px);
    width: calc(100% - 92px);
  }

  .social-proof__body {
    padding: 8px 30px 8px 10px;
  }
}

/* Reducir movimiento para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .social-proof {
    transition: opacity 0.2s ease, visibility 0.2s ease;
    transform: none;
  }
  .social-proof.is-visible {
    transform: none;
  }
  .social-proof__progress-bar {
    animation: none;
  }
}
