/* =========================================================================
   /woocommerce: the plugin → enrich → AI sessions loop, and the portal shots.
   Pure CSS on one 12s cycle; reduced motion shows the finished state.
   ========================================================================= */

.wf {
  --wf-cycle: 12s;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 8px;
}
.wf-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 18px 20px;
  min-width: 0;
}
.wf-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--indigo-1);
}
.wf-tag .wf-n {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}
.wf-card h3 {
  margin: 10px 0 12px;
  font-size: 17px;
  color: var(--ink);
}

/* 1. WordPress: product rows tick to "Sent" one after another */
.wf-wp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--body);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.wf-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #15803d;
}
.wf-live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: wf-pulse 1.6s ease-in-out infinite;
}
.wf-rows {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.wf-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 10px;
}
.wf-sent {
  font-size: 12px;
  font-weight: 600;
  color: var(--indigo-2);
  background: var(--indigo-soft);
  border-radius: 999px;
  padding: 2px 9px;
  opacity: 0;
  animation: wf-sent var(--wf-cycle) infinite;
}
.wf-rows li:nth-child(2) .wf-sent {
  animation-delay: 0.35s;
}
.wf-rows li:nth-child(3) .wf-sent {
  animation-delay: 0.7s;
}

/* Arrows between cards: a dot travels along each */
.wf-arrow {
  position: relative;
  align-self: center;
  width: 44px;
  height: 2px;
  background: var(--line);
}
.wf-arrow::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  opacity: 0;
  animation: wf-travel var(--wf-cycle) infinite;
}
.wf-arrow.a2::after {
  animation-name: wf-travel-2;
}

/* 2. CortexCommerce: a thin description becomes an enriched one */
.wf-before,
.wf-after {
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 10px;
  padding: 10px 12px;
}
.wf-before {
  color: var(--muted);
  background: var(--bg-soft);
  text-decoration-color: transparent;
  animation: wf-strike var(--wf-cycle) infinite;
}
.wf-after {
  margin-top: 8px;
  color: var(--ink);
  background: var(--indigo-soft);
  border: 1px solid #dfe2ff;
  clip-path: inset(0 100% 0 0);
  animation: wf-write var(--wf-cycle) infinite;
}
.wf-approve {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border-radius: 999px;
  padding: 5px 12px;
  opacity: 0;
  transform: scale(0.9);
  animation: wf-approve var(--wf-cycle) infinite;
}

/* 3. AI sessions: bars grow once the enriched pages are live */
.wf-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 118px;
  margin-top: 12px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}
.wf-bars span {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: var(--grad-bright);
  height: var(--h0);
  animation: wf-grow var(--wf-cycle) infinite;
}
.wf-bars span:nth-child(1) {
  --h0: 14%;
  --h1: 16%;
}
.wf-bars span:nth-child(2) {
  --h0: 12%;
  --h1: 22%;
}
.wf-bars span:nth-child(3) {
  --h0: 16%;
  --h1: 38%;
}
.wf-bars span:nth-child(4) {
  --h0: 13%;
  --h1: 56%;
}
.wf-bars span:nth-child(5) {
  --h0: 15%;
  --h1: 74%;
}
.wf-bars span:nth-child(6) {
  --h0: 14%;
  --h1: 92%;
}
.wf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.wf-legend span {
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.wf-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

@keyframes wf-pulse {
  50% {
    opacity: 0.35;
  }
}
@keyframes wf-sent {
  0%,
  6% {
    opacity: 0;
  }
  10%,
  92% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes wf-travel {
  0%,
  12% {
    left: 0;
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  24% {
    left: calc(100% - 10px);
    opacity: 1;
  }
  26%,
  100% {
    left: calc(100% - 10px);
    opacity: 0;
  }
}
@keyframes wf-travel-2 {
  0%,
  56% {
    left: 0;
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  68% {
    left: calc(100% - 10px);
    opacity: 1;
  }
  70%,
  100% {
    left: calc(100% - 10px);
    opacity: 0;
  }
}
@keyframes wf-strike {
  0%,
  28% {
    text-decoration: line-through;
    text-decoration-color: transparent;
    opacity: 1;
  }
  34%,
  92% {
    text-decoration: line-through;
    text-decoration-color: var(--muted);
    opacity: 0.6;
  }
  100% {
    text-decoration-color: transparent;
    opacity: 1;
  }
}
@keyframes wf-write {
  0%,
  30% {
    clip-path: inset(0 100% 0 0);
  }
  46%,
  92% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}
@keyframes wf-approve {
  0%,
  48% {
    opacity: 0;
    transform: scale(0.9);
  }
  52%,
  92% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
  }
}
@keyframes wf-grow {
  0%,
  66% {
    height: var(--h0);
  }
  86%,
  94% {
    height: var(--h1);
  }
  100% {
    height: var(--h0);
  }
}

@media (max-width: 900px) {
  .wf {
    grid-template-columns: 1fr;
  }
  .wf-arrow {
    justify-self: center;
    width: 2px;
    height: 30px;
  }
  .wf-arrow::after {
    left: -4px;
    animation-name: wf-travel-down;
  }
  .wf-arrow.a2::after {
    animation-name: wf-travel-down-2;
  }
}
@keyframes wf-travel-down {
  0%,
  12% {
    top: 0;
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  24% {
    top: calc(100% - 10px);
    opacity: 1;
  }
  26%,
  100% {
    top: calc(100% - 10px);
    opacity: 0;
  }
}
@keyframes wf-travel-down-2 {
  0%,
  56% {
    top: 0;
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  68% {
    top: calc(100% - 10px);
    opacity: 1;
  }
  70%,
  100% {
    top: calc(100% - 10px);
    opacity: 0;
  }
}

/* Reduced motion: the finished state, no movement */
@media (prefers-reduced-motion: reduce) {
  .wf *,
  .wf *::before,
  .wf *::after {
    animation: none !important;
  }
  .wf-sent,
  .wf-approve {
    opacity: 1;
    transform: none;
  }
  .wf-after {
    clip-path: none;
  }
  .wf-before {
    text-decoration: line-through;
    text-decoration-color: var(--muted);
    opacity: 0.6;
  }
  .wf-bars span {
    height: var(--h1);
  }
}

/* ---------- Portal screenshots ---------- */
.wf-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 34px;
}
.wf-shot {
  margin: 0;
}
.wf-frame {
  padding: clamp(14px, 3vw, 28px);
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 0% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, var(--indigo-soft), transparent 60%), var(--bg-soft);
  border: 1px solid var(--line-soft);
}
.wf-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.wf-shot figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--body);
}
.wf-shot figcaption strong {
  color: var(--ink);
}
@media (max-width: 900px) {
  .wf-shots {
    grid-template-columns: 1fr;
  }
}
.wf-shot-stack {
  display: grid;
  gap: 22px;
  align-content: start;
}
