/* Profundidad, estados y movimiento: los mismos en la web de clientes y en el panel del negocio.
   Se suma a /estilos.css. Todo el movimiento se apaga si el celular tiene activado "reducir movimiento". */
:root{--sombra:0 1px 2px rgb(60 30 15/.06),0 6px 18px rgb(60 30 15/.07);--sombra-alta:0 2px 4px rgb(60 30 15/.08),0 12px 28px rgb(60 30 15/.12);--verde:#1e6b3a;--verde-suave:#e6f2ea;--rapido:cubic-bezier(.2,.8,.2,1)}
.cabecera{view-transition-name:cabecera;position:sticky;top:0;z-index:5;background:rgb(255 255 255/.86);backdrop-filter:saturate(1.6) blur(12px);-webkit-backdrop-filter:saturate(1.6) blur(12px);padding-top:max(12px,env(safe-area-inset-top))}
.atras,.carro,.esquina{border-radius:14px}
.atras:hover,.carro:hover,.esquina:hover{background:var(--suave)}

/* Botones: responden al toque */
.boton{transition:transform .12s var(--rapido),background-color .15s,border-color .15s,box-shadow .2s;box-shadow:0 1px 0 rgb(0 0 0/.04)}
.boton:not(.secundario):not(:disabled){box-shadow:0 2px 0 var(--teja-oscuro),0 8px 18px rgb(192 57 43/.22)}
.boton:active:not(:disabled){transform:scale(.97)}
.boton[aria-busy="true"]{position:relative;color:transparent!important}
.boton[aria-busy="true"]::after{content:"";position:absolute;inset:0;margin:auto;width:20px;height:20px;border-radius:50%;border:2.5px solid currentColor;border-color:var(--blanco) var(--blanco) transparent transparent}
.boton.secundario[aria-busy="true"]::after{border-color:var(--negro) var(--negro) transparent transparent}

/* Aviso de "hecho" */
.hecho{display:flex;align-items:center;gap:10px;box-shadow:var(--sombra-alta)}
.hecho svg{flex:none;width:20px;height:20px;padding:2px;border-radius:50%;background:var(--blanco);fill:none;stroke:var(--negro);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}

/* Tarjetas */
.opcion{box-shadow:var(--sombra);border-color:transparent;transition:transform .18s var(--rapido),box-shadow .18s,border-color .18s}
.opcion:hover{box-shadow:var(--sombra-alta)}
.opcion:active{transform:scale(.985)}
.opcion.simple{box-shadow:none;border-color:var(--linea)}

/* Tilde de "hecho" en el centro de la pantalla */
.exito{position:fixed;inset:0;z-index:20;display:grid;place-content:center;justify-items:center;gap:14px;background:rgb(255 255 255/.82);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.exito svg{width:96px;height:96px;fill:none;stroke-linecap:round;stroke-linejoin:round}
.exito circle{stroke:var(--verde);stroke-width:3;fill:var(--verde-suave)}
.exito path{stroke:var(--verde);stroke-width:4}
.exito p{font-size:1.3rem;font-weight:700}

/* Esqueleto mientras carga */
.esq{border-radius:12px;background:linear-gradient(90deg,#efebe6 25%,#f8f6f3 45%,#efebe6 65%);background-size:300% 100%}
.esq-titulo{height:34px;width:55%}
.esq-caja{height:92px;margin-top:22px;border-radius:14px}
.esq-fila{height:64px;margin-top:12px;border-radius:14px}

/* La cabecera queda fija arriba: los campos no quedan tapados al enfocarlos */
main input,main select,main textarea,.error-campo{scroll-margin-top:96px}

@media (prefers-reduced-motion:no-preference){
  /* Cambio de pantalla: adelante entra desde la derecha, atrás desde la izquierda */
  ::view-transition-old(root),::view-transition-new(root){animation-duration:.3s;animation-timing-function:var(--rapido)}
  html[data-dir="adelante"]::view-transition-old(root){animation-name:salir-izquierda}
  html[data-dir="adelante"]::view-transition-new(root){animation-name:entrar-derecha}
  html[data-dir="atras"]::view-transition-old(root){animation-name:salir-derecha}
  html[data-dir="atras"]::view-transition-new(root){animation-name:entrar-izquierda}
  ::view-transition-group(*){animation-duration:.34s;animation-timing-function:var(--rapido)}
  @keyframes entrar-derecha{from{opacity:0;transform:translateX(28px)}}
  @keyframes entrar-izquierda{from{opacity:0;transform:translateX(-28px)}}
  @keyframes salir-izquierda{to{opacity:0;transform:translateX(-28px)}}
  @keyframes salir-derecha{to{opacity:0;transform:translateX(28px)}}
  /* Sin View Transitions (navegadores viejos) */
  main.entra>*{animation:aparecer .32s var(--rapido) both}
  @keyframes aparecer{from{opacity:0;transform:translateY(8px)}}

  .hecho{animation:bajar .45s cubic-bezier(.2,.9,.3,1.25) both}
  @keyframes bajar{from{opacity:0;transform:translateY(-12px) scale(.96)}}
  .boton[aria-busy="true"]::after{animation:girar .7s linear infinite}
  @keyframes girar{to{transform:rotate(360deg)}}
  .lista li.nueva{animation:resaltar 1.1s ease-out}
  @keyframes resaltar{0%{background:#fbe3de}100%{background:transparent}}
  .sacude{animation:sacudir .35s ease-in-out}
  @keyframes sacudir{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
  .esq{animation:brillo 1.3s linear infinite;animation-delay:calc(var(--i,0)*80ms)}
  @keyframes brillo{from{background-position:100% 0}to{background-position:-200% 0}}
  .exito{animation:aparecer-capa .2s ease-out both}
  .exito.sale{animation:desaparecer .2s ease-in both}
  @keyframes aparecer-capa{from{opacity:0}}
  @keyframes desaparecer{to{opacity:0}}
  .exito svg{animation:pop .45s cubic-bezier(.2,.9,.3,1.4) both}
  @keyframes pop{from{transform:scale(.5)}}
  .exito circle{stroke-dasharray:150;stroke-dashoffset:150;animation:trazo .45s ease-out forwards}
  .exito path{stroke-dasharray:40;stroke-dashoffset:40;animation:trazo .3s .3s ease-out forwards}
  @keyframes trazo{to{stroke-dashoffset:0}}
  .exito p{animation:aparecer .3s .25s var(--rapido) both}
}

/* ---------- Web de clientes ---------- */
.avance{view-transition-name:avance}
.carro span{view-transition-name:carrito;box-shadow:0 0 0 2px var(--blanco)}
.foto{box-shadow:var(--sombra);border-color:transparent;transition:transform .18s var(--rapido),box-shadow .18s,border-color .18s}
.foto:hover{box-shadow:var(--sombra-alta)}
.foto:active,.fila-oferta:active,.item:active{transform:scale(.985)}
.foto img{transition:transform .4s var(--rapido)}
.foto:hover img{transform:scale(1.04)}
.chip{transition:transform .12s var(--rapido),background-color .18s,border-color .18s,color .18s}
.chip:active{transform:scale(.94)}
.cantidad button{transition:background-color .15s,transform .1s}
.cantidad button:active{background:var(--linea);transform:scale(.92)}
.oferta{box-shadow:0 10px 26px rgb(192 57 43/.16);border-color:transparent}
.oferta h2{background:linear-gradient(140deg,#d24536 0%,var(--teja) 50%,var(--teja-oscuro) 100%)}
.fila-oferta{transition:background-color .15s,transform .12s var(--rapido)}
.fila-oferta i{transition:transform .2s var(--rapido)}
.fila-oferta:hover i{transform:rotate(90deg)}
.desplegar svg{transition:transform .25s var(--rapido)}
.lista .panel{box-shadow:inset 0 0 0 1px var(--linea)}
.selector{box-shadow:inset 0 0 0 1px var(--linea)}
.catalogo{box-shadow:var(--sombra)}
.item{transition:background-color .15s,color .15s}
.dibujo{box-shadow:inset 0 0 0 1px var(--linea)}
.aviso-carro{display:flex;align-items:center;gap:10px;box-shadow:var(--sombra)}
.gracias{margin:auto 0;display:grid;justify-items:center;gap:18px;text-align:center;padding-bottom:12vh}
.gracias svg{width:104px;height:104px;fill:none;stroke-linecap:round;stroke-linejoin:round}
.gracias circle{stroke:var(--verde);stroke-width:3;fill:var(--verde-suave)}
.gracias path{stroke:var(--verde);stroke-width:4}
@media (prefers-reduced-motion:no-preference){
  .carro span.late{animation:latir .5s cubic-bezier(.2,.9,.3,1.4)}
  @keyframes latir{30%{transform:scale(1.45)}}
  .lista .panel.abre{animation:abrir .28s var(--rapido) both;transform-origin:top}
  @keyframes abrir{from{opacity:0;transform:translateY(-6px) scaleY(.96)}}
  .aviso-carro{animation:bajar .45s cubic-bezier(.2,.9,.3,1.25) both}
  .gracias svg{animation:pop .5s cubic-bezier(.2,.9,.3,1.4) both}
  .gracias circle{stroke-dasharray:150;stroke-dashoffset:150;animation:trazo .5s .1s ease-out forwards}
  .gracias path{stroke-dasharray:40;stroke-dashoffset:40;animation:trazo .35s .5s ease-out forwards}
  .gracias h1{animation:aparecer .4s .45s var(--rapido) both}
  /* Mensaje: "escribiendo…" y después aparece la burbuja */
  .escribiendo{display:flex;gap:4px;justify-self:end;align-self:start;padding:12px 14px;background:#dcf5d0;border-radius:14px 4px 14px 14px;animation:irse 0s .9s forwards}
  .escribiendo i{width:7px;height:7px;border-radius:50%;background:#6b8f62;animation:punto .9s ease-in-out infinite}
  .escribiendo i:nth-child(2){animation-delay:.15s}.escribiendo i:nth-child(3){animation-delay:.3s}
  @keyframes punto{0%,60%,100%{transform:translateY(0);opacity:.5}30%{transform:translateY(-4px);opacity:1}}
  @keyframes irse{to{opacity:0;visibility:hidden}}
  .burbuja{animation:burbuja .45s .9s cubic-bezier(.2,.9,.3,1.25) both;transform-origin:top right}
  @keyframes burbuja{from{opacity:0;transform:scale(.85) translateY(6px)}}
}
