/* Updated: 2026-02-03 */
/* Traceability section (Ban4 - animated pipeline) */
.traceability-section { 
  background: #FFFFFF; 
  padding: 56px 0 64px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.traceability-section .section-title { text-align: center; max-width: 900px; margin: 0 auto 8px; }
.traceability-section .section-text { text-align: center; max-width: 800px; margin: 0 auto 48px; color: #6B7280; }

/* Pipeline container */
.traceability-pipeline { 
  position: relative; 
  display: flex; 
  justify-content: center; 
  align-items: flex-start; 
  gap: 60px; 
  max-width: 1600px; 
  margin: 0 auto; 
  padding: 0 20px;
  overflow-x: visible;
  overflow-y: visible;
}

/* Continuous line behind all stages (from first to last icon) */
.traceability-pipeline::before {
  content: '';
  position: absolute;
  top: 32px;
  left: calc(10% + 32px);
  right: calc(10% + 32px);
  height: 3px;
  background: #E5E7EB;
  z-index: 1;
}

/* Stage item */
.trace-stage { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  flex: 0 0 auto;
  width: 180px;
  position: relative;
  z-index: 2;
}

/* Circle icon container */
.trace-circle { 
  width: 64px; 
  height: 64px; 
  border-radius: 50%; 
  display: grid; 
  place-items: center; 
  font-size: 26px; 
  background: #E5E7EB; 
  color: #9CA3AF; 
  margin-bottom: 16px;
  transition: background-color 0.6s ease, color 0.6s ease, box-shadow 0.6s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  position: relative;
  z-index: 3;
}

.trace-stage:hover .trace-circle { 
  background: #10B981; 
  color: #FFFFFF; 
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Stage title and text */
.trace-title { 
  font-weight: 700; 
  color: #111827; 
  margin-bottom: 6px; 
  text-align: center; 
  font-size: 0.95rem;
  transition: none;
}

.trace-description { 
  font-size: 0.85rem; 
  color: #6B7280; 
  text-align: center; 
  line-height: 1.4;
  font-weight: 400;
}

.trace-stage:hover .trace-title { color: #10B981; }

/* Animation keyframes - 6 etapas, 2s cada una + 2s reset = 14s loop */
.trace-stage:nth-child(1) .trace-circle,
.trace-stage:nth-child(1) .trace-description,
.trace-stage:nth-child(1) .trace-connector { 
  animation: colorActivate1 14s infinite; 
}
@keyframes colorActivate1 {
  0%, 20% { background-color: #10B981; color: #FFFFFF; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
  20.001%, 100% { background-color: #E5E7EB; color: #9CA3AF; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
}

.trace-stage:nth-child(2) .trace-circle,
.trace-stage:nth-child(2) .trace-title,
.trace-stage:nth-child(2) .trace-description,
.trace-stage:nth-child(2) .trace-connector { 
  animation: colorActivate2 14s infinite; 
}
@keyframes colorActivate2 {
  0%, 20% { background-color: #E5E7EB; color: #9CA3AF; }
  20.001%, 40% { background-color: #10B981; color: #FFFFFF; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
  40.001%, 100% { background-color: #E5E7EB; color: #9CA3AF; }
}

.trace-stage:nth-child(3) .trace-circle,
.trace-stage:nth-child(3) .trace-title,
.trace-stage:nth-child(3) .trace-description,
.trace-stage:nth-child(3) .trace-connector { 
  animation: colorActivate3 14s infinite; 
}
@keyframes colorActivate3 {
  0%, 40% { background-color: #E5E7EB; color: #9CA3AF; }
  40.001%, 60% { background-color: #10B981; color: #FFFFFF; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
  60.001%, 100% { background-color: #E5E7EB; color: #9CA3AF; }
}

.trace-stage:nth-child(4) .trace-circle,
.trace-stage:nth-child(4) .trace-title,
.trace-stage:nth-child(4) .trace-description,
.trace-stage:nth-child(4) .trace-connector { 
  animation: colorActivate4 14s infinite; 
}
@keyframes colorActivate4 {
  0%, 60% { background-color: #E5E7EB; color: #9CA3AF; }
  60.001%, 80% { background-color: #10B981; color: #FFFFFF; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
  80.001%, 100% { background-color: #E5E7EB; color: #9CA3AF; }
}

.trace-stage:nth-child(5) .trace-circle,
.trace-stage:nth-child(5) .trace-title,
.trace-stage:nth-child(5) .trace-description,
.trace-stage:nth-child(5) .trace-connector { 
  animation: colorActivate5 14s infinite; 
}
@keyframes colorActivate5 {
  0%, 80% { background-color: #E5E7EB; color: #9CA3AF; }
  80.001%, 100% { background-color: #10B981; color: #FFFFFF; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .traceability-section {
    padding-top: 50px;
    padding-bottom: 0;
    margin-top: -32px;
  }

  .traceability-section .section-title,
  .traceability-section .section-text {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

@media (max-width: 480px) {
  .traceability-section {
    padding-top: 50px;
    padding-bottom: 0;
    margin-top: -32px;
  }

  .traceability-section .section-title,
  .traceability-section .section-text {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

.trace-stage:nth-child(6) .trace-circle,
.trace-stage:nth-child(6) .trace-title,
.trace-stage:nth-child(6) .trace-description,
.trace-stage:nth-child(6) .trace-connector { 
  animation: colorActivate6 14s infinite; 
}
@keyframes colorActivate6 {
  0%, 71.428% { background-color: #E5E7EB; color: #9CA3AF; }
  71.429%, 85.714% { background-color: #10B981; color: #FFFFFF; box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4); }
  85.715%, 100% { background-color: #E5E7EB; color: #9CA3AF; }
}

/* Title color animations */
.trace-stage:nth-child(1) .trace-title { animation: titleActivate1 14s infinite; }
@keyframes titleActivate1 {
  0%, 20% { color: #10B981; }
  20.001%, 100% { color: #111827; }
}

.trace-stage:nth-child(2) .trace-title { animation: titleActivate2 14s infinite; }
@keyframes titleActivate2 {
  0%, 20% { color: #111827; }
  20.001%, 40% { color: #10B981; }
  40.001%, 100% { color: #111827; }
}

.trace-stage:nth-child(3) .trace-title { animation: titleActivate3 14s infinite; }
@keyframes titleActivate3 {
  0%, 40% { color: #111827; }
  40.001%, 60% { color: #10B981; }
  60.001%, 100% { color: #111827; }
}

.trace-stage:nth-child(4) .trace-title { animation: titleActivate4 14s infinite; }
@keyframes titleActivate4 {
  0%, 60% { color: #111827; }
  60.001%, 80% { color: #10B981; }
  80.001%, 100% { color: #111827; }
}

.trace-stage:nth-child(5) .trace-title { animation: titleActivate5 14s infinite; }
@keyframes titleActivate5 {
  0%, 80% { color: #111827; }
  80.001%, 100% { color: #10B981; }
}

.trace-stage:nth-child(6) .trace-title { animation: titleActivate6 14s infinite; }
@keyframes titleActivate6 {
  0%, 71.428% { color: #111827; }
  71.429%, 85.714% { color: #10B981; }
  85.715%, 100% { color: #111827; }
}

/* Description weight animations (normal to bold) */
.trace-stage:nth-child(1) .trace-description { animation: descWeight1 14s infinite; }
@keyframes descWeight1 {
  0%, 20% { font-weight: 700; }
  20.001%, 100% { font-weight: 400; }
}

.trace-stage:nth-child(2) .trace-description { animation: descWeight2 14s infinite; }
@keyframes descWeight2 {
  0%, 20% { font-weight: 400; }
  20.001%, 40% { font-weight: 700; }
  40.001%, 100% { font-weight: 400; }
}

.trace-stage:nth-child(3) .trace-description { animation: descWeight3 14s infinite; }
@keyframes descWeight3 {
  0%, 40% { font-weight: 400; }
  40.001%, 60% { font-weight: 700; }
  60.001%, 100% { font-weight: 400; }
}

.trace-stage:nth-child(4) .trace-description { animation: descWeight4 14s infinite; }
@keyframes descWeight4 {
  0%, 60% { font-weight: 400; }
  60.001%, 80% { font-weight: 700; }
  80.001%, 100% { font-weight: 400; }
}

.trace-stage:nth-child(5) .trace-description { animation: descWeight5 14s infinite; }
@keyframes descWeight5 {
  0%, 80% { font-weight: 400; }
  80.001%, 100% { font-weight: 700; }
}

.trace-stage:nth-child(6) .trace-description { animation: descWeight6 14s infinite; }
@keyframes descWeight6 {
  0%, 71.428% { font-weight: 400; }
  71.429%, 85.714% { font-weight: 700; }
  85.715%, 100% { font-weight: 400; }
}

/* Connector animation */
.trace-stage:nth-child(1) .trace-connector { animation: connectorActivate1 14s infinite; }
@keyframes connectorActivate1 {
  0%, 14.285% { background: linear-gradient(to right, #10B981 0%, #E5E7EB 100%); }
  14.286%, 100% { background: #E5E7EB; }
}

.trace-stage:nth-child(2) .trace-connector { animation: connectorActivate2 14s infinite; }
@keyframes connectorActivate2 {
  0%, 14.285% { background: #E5E7EB; }
  14.286%, 28.571% { background: linear-gradient(to right, #10B981 0%, #E5E7EB 100%); }
  28.572%, 100% { background: #E5E7EB; }
}

.trace-stage:nth-child(3) .trace-connector { animation: connectorActivate3 14s infinite; }
@keyframes connectorActivate3 {
  0%, 28.571% { background: #E5E7EB; }
  28.572%, 42.857% { background: linear-gradient(to right, #10B981 0%, #E5E7EB 100%); }
  42.858%, 100% { background: #E5E7EB; }
}

.trace-stage:nth-child(4) .trace-connector { animation: connectorActivate4 14s infinite; }
@keyframes connectorActivate4 {
  0%, 42.857% { background: #E5E7EB; }
  42.858%, 57.142% { background: linear-gradient(to right, #10B981 0%, #E5E7EB 100%); }
  57.143%, 100% { background: #E5E7EB; }
}

.trace-stage:nth-child(5) .trace-connector { animation: connectorActivate5 14s infinite; }
@keyframes connectorActivate5 {
  0%, 57.142% { background: #E5E7EB; }
  57.143%, 71.428% { background: linear-gradient(to right, #10B981 0%, #E5E7EB 100%); }
  71.429%, 100% { background: #E5E7EB; }
}

/* Footer note */
.traceability-section .section-text.footer-note { 
  text-align: center; 
  margin-top: 32px; 
  color: #9CA3AF; 
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1100px) {
  .traceability-pipeline { gap: 40px; }
  .traceability-pipeline::before { left: calc(15% + 28px); right: calc(15% + 28px); top: 28px; }
  .trace-stage { width: 150px; }
  .trace-circle { width: 56px; height: 56px; font-size: 22px; }
}

@media (max-width: 768px) {
  .traceability-pipeline { 
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0 16px;
    overflow-x: visible;
  }
  
  /* Vertical line for mobile */
  .traceability-pipeline::before {
    top: 32px;
    bottom: 32px;
    left: 50%;
    right: auto;
    width: 3px;
    height: auto;
    transform: translateX(-50%);
  }
  
  .trace-stage { width: 100%; max-width: 300px; flex-shrink: 0; }
  .trace-circle { width: 50px; height: 50px; font-size: 20px; }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  .trace-circle,
  .trace-title,
  .trace-description { transition: none; }
}
