/* Entrada "Agente comprador con IA": animaciones propias.
   Solo se mueven si la persona no pidió menos movimiento (sistema o panel de accesibilidad).
   El estado sin animación es el final: se lee igual. */

.trazo { background: linear-gradient(var(--violeta), var(--violeta)) no-repeat 0 100% / 100% 3px; padding-bottom: 2px; color: var(--blanco); }

.demo { margin: 0 0 1.6em; padding: 18px; border: 1px solid var(--linea); border-radius: 16px; background: var(--negro-2); }
.demo figcaption { margin-top: 12px; }
.demo-t { margin: 0 0 12px; font: 400 0.72rem var(--f-mono); color: var(--gris); text-transform: uppercase; letter-spacing: 0.06em; }

/* 1. Costo total: dos tiendas, barras apiladas */
.costo-fila { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: 10px; margin-bottom: 10px; font: 400 0.82rem var(--f-mono); color: var(--blanco); }
.costo-barra { display: flex; height: 22px; gap: 3px; }
.costo-barra i { display: block; height: 100%; border-radius: 6px; transform-origin: left; }
.costo-barra .precio { background: var(--violeta); }
.costo-barra .envio { background: rgba(142,108,255,0.6); }
.costo-barra .cuotas { background: rgba(142,108,255,0.4); }
.costo-barra .riesgo { background: rgba(142,108,255,0.22); }
.a .precio { width: 40%; } .a .envio { width: 22%; } .a .cuotas { width: 14%; } .a .riesgo { width: 16%; }
.b .precio { width: 48%; } .b .envio { width: 8%; } .b .cuotas { width: 4%; } .b .riesgo { width: 6%; }
.costo-gana { display: inline-block; margin-left: 6px; color: var(--violeta-claro); }
.costo-ref { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font: 400 0.72rem var(--f-mono); color: var(--gris); }
.costo-ref span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; background: var(--c); vertical-align: -1px; }
.costo-ref .r1 { --c: var(--violeta); } .costo-ref .r2 { --c: rgba(142,108,255,0.6); } .costo-ref .r3 { --c: rgba(142,108,255,0.4); } .costo-ref .r4 { --c: rgba(142,108,255,0.22); }

/* 2. El freno en el checkout */
.freno-fila { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--linea); font: 400 0.88rem var(--f-mono); color: var(--blanco); }
.freno-total { font-weight: 700; border-bottom: 0; }
.freno-num { display: grid; text-align: right; }
.freno-num i { grid-area: 1 / 1; font-style: normal; }
.freno-num .antes { opacity: 0; }
.freno-barra { position: relative; height: 10px; margin: 16px 0 30px; border-radius: 6px; background: rgba(255,255,255,0.08); }
.freno-barra i { position: absolute; inset: 0 auto 0 0; width: 93%; border-radius: 6px; background: var(--violeta); transform-origin: left; }
.freno-tope { position: absolute; top: -6px; bottom: -6px; left: 90%; border-left: 2px dashed var(--blanco); }
.freno-tope span { position: absolute; top: calc(100% + 4px); left: 0; transform: translateX(-50%); font: 400 0.68rem var(--f-mono); color: var(--gris); white-space: nowrap; }
.freno-aviso { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: var(--violeta); color: var(--negro); font: 700 0.8rem var(--f-mono); }

@media (prefers-reduced-motion: no-preference) {
  html:not(.a-quieto) .trazo { background-size: 0% 3px; transition: background-size 1.1s cubic-bezier(.2,.8,.2,1) .35s; }
  html:not(.a-quieto) .visto .trazo { background-size: 100% 3px; }

  html:not(.a-quieto) .costo.visto .costo-barra i { animation: crece 7s cubic-bezier(.2,.8,.2,1) infinite both; }
  html:not(.a-quieto) .costo.visto .envio { animation-delay: .5s !important; }
  html:not(.a-quieto) .costo.visto .cuotas { animation-delay: 1s !important; }
  html:not(.a-quieto) .costo.visto .riesgo { animation-delay: 1.5s !important; }
  html:not(.a-quieto) .costo.visto .costo-gana { animation: aparece 7s ease-out infinite; }

  html:not(.a-quieto) .freno.visto .freno-envio { animation: aparece-envio 8s ease-out infinite; }
  html:not(.a-quieto) .freno.visto .freno-num .antes { animation: sale 8s ease-in-out infinite; }
  html:not(.a-quieto) .freno.visto .freno-num .ahora { animation: entra 8s ease-in-out infinite; }
  html:not(.a-quieto) .freno.visto .freno-barra i { animation: sube 8s cubic-bezier(.5,0,.3,1) infinite; }
  html:not(.a-quieto) .freno.visto .freno-aviso { animation: frena 8s cubic-bezier(.3,1.5,.5,1) infinite; }
}
@keyframes crece { 0% { transform: scaleX(0); } 14%, 90% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes aparece { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes aparece-envio { 0%, 20% { opacity: 0; } 28%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sale { 0%, 30% { opacity: 1; } 38%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes entra { 0%, 30% { opacity: 0; } 38%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sube { 0%, 30% { transform: scaleX(0.903); } 44%, 96% { transform: scaleX(1); } 100% { transform: scaleX(0.903); } }
@keyframes frena { 0%, 48% { opacity: 0; transform: scale(0.8); } 56%, 92% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.8); } }

@media (max-width: 560px) {
  .costo-fila { grid-template-columns: 1fr; gap: 4px; }
}
