/* Demo "wholesale-network" (hero de /mayoristas). Base: ll-anim.css + variables de fl-phone.css.
   Lienzo 560x520. Clases que pone el JS: tienda .is-on (conectada) / .is-stocked (ya tiene el producto) /
   .is-sale; paquetes .is-go (viajan) / .is-done (se ocultan). data-state="paid" = stock 47 + reparto. */

.lla-wn {
  --wn-line: #c7cfdd; --wn-you: #4f46e5; --wn-them: #16a34a;
  --lla-brand: #4f46e5; --lla-cursor-ring: rgba(79, 70, 229, .55);
  max-width: 560px;
}
html[data-theme="dark"] .lla-wn { --wn-line: #3b4558; --wn-you: #818cf8; --wn-them: #4ade80; }

.lla .lla-wn__stage { --lla-w: 560; --lla-h: 520; }

.lla-wn__lines { position: absolute; inset: 0; z-index: 1; overflow: visible; }
.lla-wn__line-base { fill: none; stroke: var(--wn-line); stroke-width: 2; stroke-dasharray: 5 6; }
.lla-wn__line {
  fill: none; stroke: var(--wn-you); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .7s var(--lla-ease);
}
.lla-wn__line.is-on { stroke-dashoffset: 0; }

.lla-wn__chip {
  position: absolute; left: 24px; top: 92px; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 12px; background: var(--lla-float-bg); color: var(--lla-float-text);
  box-shadow: var(--lla-float-shadow); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  animation: lla-fl-float 5s ease-in-out infinite;
}
.lla-wn__chip .bi { color: var(--wn-you); font-size: 16px; }

/* Tarjetas (mayorista, tiendas, reparto) */
.lla-wn__hub, .lla-wn__store, .lla-wn__split {
  position: absolute; z-index: 4; border-radius: 16px; background: var(--lla-float-bg); color: var(--lla-float-text);
  box-shadow: var(--lla-float-shadow);
}
.lla-wn__hub { left: 24px; top: 186px; width: 190px; padding: 12px; border: 2px solid var(--wn-you); }
.lla-wn__hub-head, .lla-wn__store-head { display: flex; align-items: center; gap: 9px; }
.lla-wn__hub-head b, .lla-wn__store-name b { display: block; font-size: 13px; font-weight: 800; }
.lla-wn__hub-head small, .lla-wn__store-name small { display: block; font-size: 10.5px; opacity: .7; }
.lla-wn__hub-icon, .lla-wn__store-icon {
  flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-size: 16px;
}
.lla-wn__hub-icon { background: linear-gradient(135deg, #6366f1, #4338ca); }
.lla-wn__store-icon { background: linear-gradient(135deg, #22c55e, #15803d); width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }

.lla-wn__prod { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px; border-radius: 11px; background: var(--lla-surface); }
html[data-theme="dark"] .lla-wn__prod, html[data-theme="dark"] .lla-wn__store-prod { background: rgba(255, 255, 255, .05); }
.lla-wn__thumb { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(160deg, #fef3c7, #fde68a); color: #b45309; font-size: 15px; }
.lla-wn__thumb--sm { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.lla-wn__prod-txt b { display: block; font-size: 12px; }
.lla-wn__prod-txt small { display: block; font-size: 10.5px; opacity: .75; }

.lla-wn__stock { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; opacity: .85; }
.lla-wn__num { position: relative; display: inline-grid; font-size: 14px; font-weight: 800; color: var(--wn-you); }
.lla-wn__num > span { grid-area: 1 / 1; transition: opacity .3s, transform .35s var(--lla-ease); }
.lla-wn__n47 { opacity: 0; transform: translateY(8px); }
.lla-wn[data-state="paid"] .lla-wn__n48 { opacity: 0; transform: translateY(-8px); }
.lla-wn[data-state="paid"] .lla-wn__n47 { opacity: 1; transform: none; }

/* Tiendas */
.lla-wn__store { left: 326px; width: 224px; padding: 10px; opacity: .55; transition: opacity .4s var(--lla-ease), box-shadow .4s; }
.lla-wn__store--1 { top: 46px; }
.lla-wn__store--2 { top: 216px; }
.lla-wn__store--3 { top: 386px; }
.lla-wn__store.is-on { opacity: 1; }
.lla-wn__store-name { min-width: 0; flex: 1; }
.lla-wn__store-name b, .lla-wn__store-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lla-wn__badge { display: inline-grid; font-size: 9.5px; font-weight: 700; }
.lla-wn__badge > span { grid-area: 1 / 1; padding: 3px 7px; border-radius: 999px; text-align: center; transition: opacity .3s; }
.lla-wn__badge-wait { background: rgba(148, 163, 184, .2); color: var(--lla-muted); }
.lla-wn__badge-ok { background: rgba(22, 163, 74, .14); color: var(--wn-them); opacity: 0; }
.lla-wn__store.is-on .lla-wn__badge-wait { opacity: 0; }
.lla-wn__store.is-on .lla-wn__badge-ok { opacity: 1; }

.lla-wn__store-prod {
  display: flex; align-items: center; gap: 6px; height: 0; margin-top: 0; padding: 0 7px; overflow: hidden; border-radius: 9px; background: var(--lla-surface);
  font-size: 11px; opacity: 0; transition: height .4s var(--lla-ease), margin .4s var(--lla-ease), opacity .3s;
}
.lla-wn__store.is-stocked .lla-wn__store-prod { height: 38px; margin-top: 8px; opacity: 1; }
.lla-wn__store-pname { flex: 1; font-weight: 600; }
.lla-wn__tag { padding: 2px 6px; border-radius: 6px; background: rgba(79, 70, 229, .12); color: var(--wn-you); font-size: 9.5px; font-weight: 700; }
.lla-wn__store-prod strong { font-size: 12.5px; font-weight: 800; }

.lla-wn__sale {
  position: absolute; right: -6px; top: -14px; display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  background: var(--wn-them); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap;
  opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .3s, transform .4s var(--lla-ease);
}
.lla-wn__store.is-sale { box-shadow: 0 0 0 2px var(--wn-them), var(--lla-float-shadow); }
.lla-wn__store.is-sale .lla-wn__sale { opacity: 1; transform: none; }

/* Reparto */
.lla-wn__split { left: 24px; top: 368px; width: 250px; padding: 11px 13px; opacity: 0; transform: translateY(12px); transition: opacity .4s var(--lla-ease), transform .45s var(--lla-ease); }
.lla-wn[data-state="paid"] .lla-wn__split { opacity: 1; transform: none; }
.lla-wn__split-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: 11.5px; font-weight: 800; }
.lla-wn__split-head .bi { color: var(--wn-you); font-size: 14px; }
.lla-wn__split-row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 11.5px; }
.lla-wn__split-row b { font-weight: 800; }
.lla-wn__dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.lla-wn__dot--you { background: var(--wn-you); }
.lla-wn__dot--them { background: var(--wn-them); }

/* Paquetes por las curvas */
.lla-wn__packet {
  position: absolute; left: 0; top: 0; z-index: 6; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; background: var(--wn-you); color: #fff; font-size: 13px;
  box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .6);
  offset-distance: 0%; offset-rotate: 0deg; offset-anchor: 50% 50%;
  opacity: 0; transition: offset-distance 1.1s var(--lla-ease), opacity .2s;
}
.lla-wn__packet--pay { border-radius: 50%; background: var(--wn-them); box-shadow: 0 6px 14px -4px rgba(22, 163, 74, .6); }
.lla-wn__packet.is-go { offset-distance: 100%; opacity: 1; }
.lla-wn__packet.is-done { opacity: 0; }
@supports not (offset-distance: 0%) { .lla-wn__packet { display: none; } }

@container (max-width: 399px) {
  .lla-wn__chip { display: none; }
}
.lla-wn__layer { position: absolute; inset: 0; }
