/* V10.3.1 MOVIMIENTO FUNCIONAL · Coffee Rush STA
   Entrada → cola → mostrador → cobro → salida. La escena representa la economía; no la calcula. */

.shop-wrap .queue{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  display:block!important;
  overflow:visible!important;
  pointer-events:none;
  z-index:12!important;
}

.shop-wrap .queue .customer{
  position:absolute!important;
  left:var(--scene-x,-4%)!important;
  top:var(--scene-y,88%)!important;
  bottom:auto!important;
  flex:none!important;
  margin:0!important;
  z-index:var(--scene-z,12)!important;
  width:60px!important;
  height:90px!important;
  opacity:1;
  transform:translate(-50%,-100%) scale(var(--scene-scale,1))!important;
  transform-origin:center bottom!important;
  transition:
    left .52s cubic-bezier(.22,.72,.26,1),
    top .52s cubic-bezier(.22,.72,.26,1),
    transform .52s cubic-bezier(.22,.72,.26,1),
    opacity .34s ease!important;
  will-change:left,top,transform,opacity;
}

.shop-wrap .queue .customer.scene-no-transition{
  transition:none!important;
}

.shop-wrap .queue .customer.scene-entering{opacity:0;}
.shop-wrap .queue .customer.scene-waiting{opacity:1;}
.shop-wrap .queue .customer.scene-at-service{filter:drop-shadow(0 8px 7px rgba(21,50,90,.16));}
.shop-wrap .queue .customer.scene-receiving{transform:translate(-50%,-100%) translateY(-3px) scale(var(--scene-scale,1))!important;}
.shop-wrap .queue .customer.scene-leaving{opacity:.94;}
.shop-wrap .queue .customer.scene-lost-exit{opacity:.48;filter:grayscale(.18) saturate(.72);}

/* La escala anterior por :nth-child deja de intervenir: la profundidad la determina cada slot de cola. */
.shop-wrap .queue .customer:nth-child(2n),
.shop-wrap .queue .customer:nth-child(3n){
  transform:translate(-50%,-100%) scale(var(--scene-scale,1))!important;
}
.shop-wrap .queue .customer.scene-receiving:nth-child(2n),
.shop-wrap .queue .customer.scene-receiving:nth-child(3n){
  transform:translate(-50%,-100%) translateY(-3px) scale(var(--scene-scale,1))!important;
}

/* El barista ya no hace bob permanente: solo cambia de estado cuando una venta visual está ocurriendo. */
.shop-wrap .barista.busy{animation:none!important;}
.shop-wrap .barista{
  transition:transform .22s ease,filter .22s ease!important;
  transform-origin:center bottom!important;
}
.shop-wrap .barista.scene-preparing{
  transform:translateX(-50%) translateX(-5px) rotate(-1.5deg)!important;
  filter:drop-shadow(0 8px 7px rgba(21,50,90,.17));
}
.shop-wrap .barista.scene-serving{
  transform:translateX(-50%) translateX(7px) rotate(1.5deg)!important;
  filter:drop-shadow(0 9px 8px rgba(21,50,90,.18));
}
.shop-wrap .barista.scene-serving .scene-barista-svg{
  transform:translateY(-2px) scale(1.015);
}
.shop-wrap .barista .scene-barista-svg{transition:transform .22s ease,filter .22s ease;}

/* Feedback de caja deliberadamente sobrio. */
.shop-wrap .scene-register{overflow:visible!important;}
.shop-wrap .scene-register-value.scene-cash-pulse{
  transform:scale(1.055);
  border-color:rgba(23,132,72,.38);
  background:#f0fcf7;
}
.shop-wrap .scene-sale-amount{
  position:absolute;
  left:50%;
  bottom:78%;
  z-index:4;
  transform:translateX(-50%);
  padding:3px 7px;
  border-radius:999px;
  background:rgba(240,252,247,.96);
  border:1px solid rgba(23,132,72,.22);
  color:#0f6d46;
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
  pointer-events:none;
  animation:sceneSaleAmount .68s ease-out both;
}
@keyframes sceneSaleAmount{
  0%{opacity:0;transform:translate(-50%,7px) scale(.96)}
  22%{opacity:1;transform:translate(-50%,0) scale(1)}
  72%{opacity:1}
  100%{opacity:0;transform:translate(-50%,-12px) scale(.98)}
}

/* Pausa táctica: la escena queda visualmente congelada sin esconder el problema. */
.shop-wrap.scene-motion-paused .queue .customer,
.shop-wrap.scene-motion-paused .barista{
  transition-duration:.01ms!important;
}

body.reduce-animations .shop-wrap .queue .customer{transition-duration:.01ms!important;}
body.reduce-animations .shop-wrap .scene-sale-amount{animation:none!important;opacity:1;}
@media (prefers-reduced-motion: reduce){
  .shop-wrap .queue .customer{transition-duration:.01ms!important;}
  .shop-wrap .scene-sale-amount{animation:none!important;opacity:1;}
}

@media(max-width:900px){
  .shop-wrap .queue .customer{width:52px!important;height:78px!important;}
}
@media(max-width:560px){
  .shop-wrap .queue .customer{width:42px!important;height:63px!important;}
  .shop-wrap .scene-sale-amount{font-size:8px;padding:2px 5px;}
}

/* V10.3.2 CONSECUENCIAS VISIBLES · presión, pérdida y feedback operativo */
.shop-wrap .queue .customer.scene-impatient .scene-customer-svg{
  filter:drop-shadow(0 7px 6px rgba(150,73,36,.16)) saturate(.92);
  transform:translateY(1px) rotate(-1.2deg);
}
.shop-wrap .queue .customer.scene-impatient::after{
  content:"";
  position:absolute;
  right:-3px;
  top:4px;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#e9a23b;
  border:2px solid #fff;
  box-shadow:0 2px 5px rgba(61,52,40,.18);
}
.shop-wrap[data-queue-pressure="medium"] .queue::before,
.shop-wrap[data-queue-pressure="high"] .queue::before{
  content:"Cola creciendo";
  position:absolute;
  left:7%;
  bottom:6%;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,248,231,.94);
  border:1px solid rgba(208,151,45,.25);
  color:#7b5a12;
  font-size:9px;
  font-weight:900;
  letter-spacing:.01em;
}
.shop-wrap[data-queue-pressure="high"] .queue::before{
  content:"Presión de servicio";
  background:rgba(255,239,235,.96);
  border-color:rgba(190,74,58,.25);
  color:#963b31;
}
.shop-wrap .scene-lost-label{
  position:absolute;
  left:10%;
  bottom:26%;
  z-index:20;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(255,244,241,.97);
  border:1px solid rgba(190,74,58,.25);
  color:#963b31;
  font-size:9px;
  font-weight:900;
  pointer-events:none;
  animation:sceneLostLabel .98s ease-out both;
}
@keyframes sceneLostLabel{
  0%{opacity:0;transform:translateY(7px) scale(.96)}
  18%{opacity:1;transform:none}
  72%{opacity:1}
  100%{opacity:0;transform:translateY(-8px)}
}
.shop-wrap .stock-row.low,
.shop-wrap .stock-row.just{border-color:rgba(208,151,45,.34);background:#fffaf0}
.shop-wrap .stock-row.critical{border-color:rgba(190,74,58,.36);background:#fff4f1;box-shadow:0 0 0 2px rgba(190,74,58,.06)}
.shop-wrap .stock-row.critical .cr-icon{color:#a43f34}
.shop-wrap .stock-row.stock-limiting::after{
  content:"LIMITA";
  grid-column:1/-1;
  justify-self:start;
  margin-top:2px;
  padding:2px 4px;
  border-radius:999px;
  background:#a43f34;
  color:#fff;
  font-size:6px;
  font-weight:950;
  letter-spacing:.05em;
}
.shop-wrap .customer.customer-happy .scene-customer-svg{filter:drop-shadow(0 7px 6px rgba(23,132,72,.15)) saturate(1.06)}
.shop-wrap .customer.customer-angry .scene-customer-svg{filter:drop-shadow(0 7px 6px rgba(164,63,52,.14)) saturate(.82)}
body.reduce-animations .shop-wrap .scene-lost-label{animation:none!important;opacity:1}
@media(prefers-reduced-motion:reduce){.shop-wrap .scene-lost-label{animation:none!important;opacity:1}}
@media(max-width:560px){
  .shop-wrap[data-queue-pressure] .queue::before{font-size:7px;padding:3px 5px;bottom:2%}
  .shop-wrap .scene-lost-label{font-size:7px;left:6%;bottom:24%}
}
