/*
 * Index: animación "Link del menú para Delivery" (pedido por WhatsApp).
 * Dos celulares: el del cliente arma y envía el pedido; el WhatsApp del local
 * lo recibe. La base común (tarjeta, escala, toque) está en landing_animacion.css.
 * El mensaje que llega es el mismo formato que arma carta/views (wsp_cart).
 */

/* ------------------------------------------------------------- teléfonos */
.tdw-tel {
  position: absolute;
  top: 6px;
  width: 212px;
  height: 432px;
  padding: 7px;
  border-radius: 38px;
  background: #18181b;
  box-shadow: 0 0 0 3px #c98a63, 0 0 0 4px #9a5f40, 0 26px 50px rgba(28, 34, 48, .28);
}
.tdw-pantalla {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 31px;
  /* Recorte firme: con sólo overflow + border-radius, Chrome deja de recortar
     las esquinas mientras anima una capa interna y por unos cuadros el
     contenido se dibuja encima del marco del celular. */
  clip-path: inset(0 round 31px);
  isolation: isolate;
  background: #fff;
  color: #1f2330;
  font-size: 9.5px;
}
.tdw-status {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 26px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 18px 0 22px;
  font-size: 9px;
}
.tdw-status span { display: flex; gap: 3px; font-size: 9px; }
.tdw-isla { position: absolute; left: 50%; top: 7px; z-index: 7; width: 58px; height: 16px; margin-left: -29px; border-radius: 999px; background: #000; }
.tdw-rotulo {
  position: absolute;
  top: 450px;
  width: 212px;
  text-align: center;
  color: #4b5563;
  font: 800 12px/1 "Nunito", sans-serif;
}
.tdw-rotulo i { color: #e85f32; margin-right: 4px; }

/* Pantallas: se cambia con clases en el <figure> (tdw-a-* para el cliente, tdw-b-* para el local). */
.tdw-p {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  bottom: 0;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity .35s, transform .4s cubic-bezier(.2, .8, .2, 1);
}
.tdw-a-link .tdw-p--link,
.tdw-a-menu .tdw-p--menu,
.tdw-a-pedido .tdw-p--pedido,
.tdw-a-wsp .tdw-p--wsp,
.tdw-b-chats .tdw-p--chats,
.tdw-b-chat .tdw-p--chat { opacity: 1; transform: none; }

.tdw-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e85f32, #b8322a);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f3b6a0;
  color: #fff;
  font: 900 15px/1 "Nunito", sans-serif;
}
.tdw-avatar--chico { width: 34px; height: 34px; font-size: 12px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.tdw-avatar--wsp { width: 24px; height: 24px; font-size: 9px; box-shadow: none; }

/* ------------------------------------------------- 1. perfil con el link */
.tdw-p--link { padding: 14px 14px 0; }
.tdw-perfil { display: flex; align-items: center; gap: 12px; }
.tdw-perfil b { display: block; font-size: 12px; }
.tdw-perfil small { color: #6b7280; }
.tdw-bio { margin: 12px 0 8px; line-height: 1.45; }
.tdw-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 700;
  transition: transform .15s, background .2s;
}
.tdw-link.is-press { transform: scale(.94); background: #dbe7ff; }
.tdw-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 16px -14px 0; }
.tdw-posts i { display: block; aspect-ratio: 1; padding: 10px; background: #f4ece4; }
.tdw-posts svg { display: block; width: 100%; height: 100%; }
.tdw-post--b { background: linear-gradient(135deg, #e85f32, #f6a07f) !important; }
.tdw-post--c { background: linear-gradient(135deg, #6b4423, #a8743f) !important; }

/* ------------------------------------------------------------- 2. menú */
.tdw-portada {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 56px;
  padding: 0 12px;
  background: linear-gradient(120deg, #5c3d1e, #8b5a2b);
  color: #fff;
}
.tdw-portada b { display: block; font-size: 12px; }
.tdw-portada small { opacity: .85; font-size: 8.5px; }
.tdw-cats { display: flex; gap: 14px; padding: 9px 12px 0; border-bottom: 1px solid #eee; font-weight: 600; color: #8a8f98; }
.tdw-cats > * { padding-bottom: 6px; }
.tdw-cats b { color: #5c3d1e; border-bottom: 2px solid #5c3d1e; }
.tdw-prods { padding: 0 12px; }
.tdw-prod {
  position: relative;
  display: flex;
  align-items: center;
  height: 64px;
  border-bottom: 1px solid #f0f0f0;
}
.tdw-prod-txt { flex: 1; }
.tdw-prod-txt b { display: block; font-size: 10.5px; }
.tdw-prod-txt em { font-style: normal; font-weight: 700; color: #5c3d1e; }
.tdw-thumb { width: 46px; height: 46px; flex: none; padding: 3px; border-radius: 9px; background: #f7f1ea; }
.tdw-thumb svg { display: block; width: 100%; height: 100%; }
.tdw-agregar, .tdw-stepper { position: absolute; right: 54px; top: 50%; transform: translateY(-50%); }
.tdw-agregar {
  padding: 4px 9px;
  border-radius: 999px;
  background: #5c3d1e;
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  transition: transform .15s, opacity .2s;
}
.tdw-agregar.is-press { transform: translateY(-50%) scale(.9); }
.tdw-stepper { display: flex; align-items: center; gap: 6px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.tdw-stepper i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #5c3d1e;
  color: #fff;
  font-style: normal;
  font-weight: 700;
  transition: transform .15s;
}
.tdw-stepper i.is-press { transform: scale(.85); }
.tdw-prod.is-en-carrito .tdw-agregar { opacity: 0; }
.tdw-prod.is-en-carrito .tdw-stepper { opacity: 1; }

.tdw-carrito {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 7px 7px 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(28, 34, 48, .18);
  font-size: 9px;
  transform: translateY(70px);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.tdw-carrito.is-on { transform: none; }
.tdw-ver { padding: 5px 9px; border-radius: 7px; background: #1f9d55; color: #fff; font-weight: 700; transition: transform .15s; }
.tdw-ver.is-press { transform: scale(.92); }
.tdw-carrito .is-salto { display: inline-block; animation: tdw-salto .35s ease-out; }
@keyframes tdw-salto { 50% { transform: scale(1.18); color: #1f9d55; } }

.tdw-velo { position: absolute; inset: 0; z-index: 4; background: rgba(20, 22, 28, .35); opacity: 0; transition: opacity .3s; }
.tdw-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 16px;
  border-radius: 16px 16px 0 0;
  background: #fff;
  transform: translateY(105%);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.tdw-sheet b { font-size: 12px; }
.tdw-sheet small, .tdw-label { color: #6b7280; font-weight: 600; font-size: 8.5px; }
.tdw-p--menu.is-sheet .tdw-velo { opacity: 1; }
.tdw-p--menu.is-sheet .tdw-sheet { transform: none; }
.tdw-input {
  display: flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1.5px solid #d6dae1;
  font-size: 9.5px;
}
.tdw-caret { display: inline-block; width: 1px; height: 11px; margin-left: 1px; background: #1f2330; animation: tdw-caret .8s steps(1) infinite; }
@keyframes tdw-caret { 50% { opacity: 0; } }
.tdw-sheet-btn {
  margin-top: 4px;
  padding: 7px;
  border-radius: 9px;
  background: #5c3d1e;
  color: #fff;
  font-weight: 700;
  text-align: center;
  transition: transform .15s;
}
.tdw-sheet-btn.is-press { transform: scale(.95); }

/* ------------------------------------------------------- 3. tu pedido */
.tdw-p--pedido { padding: 0 12px; }
.tdw-cab-simple { padding: 12px 0 8px; font-size: 13px; font-weight: 700; }
.tdw-cab-simple i { color: #9aa3b2; margin-right: 4px; }
.tdw-resumen { display: grid; gap: 3px; padding: 8px 10px; border-radius: 10px; background: #f7f8fa; }
.tdw-resumen small { margin-top: 4px; color: #5c3d1e; font-weight: 700; font-size: 8.5px; text-transform: uppercase; letter-spacing: .05em; }
.tdw-resumen div { display: flex; justify-content: space-between; align-items: flex-start; }
.tdw-resumen em { display: block; color: #b45309; font-style: normal; font-size: 8.5px; }
.tdw-label { display: block; margin: 12px 0 5px; }
.tdw-input--nota { min-height: 30px; }
.tdw-total { display: flex; justify-content: space-between; margin: 14px 0 12px; padding-top: 10px; border-top: 1px dashed #d6dae1; font-size: 12px; }
.tdw-enviar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border-radius: 11px;
  background: #25d366;
  color: #fff;
  font-weight: 800;
  font-size: 9.5px;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(37, 211, 102, .3);
  transition: transform .15s;
}
.tdw-enviar.is-press { transform: scale(.95); }

/* --------------------------------------------------------------- WhatsApp */
.tdw-wsp-cab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 10px;
  background: #008069;
  color: #fff;
  font-size: 10.5px;
}
.tdw-chat {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 8px;
  background: #efeae2 radial-gradient(rgba(0, 0, 0, .04) 1px, transparent 1.5px) 0 0 / 12px 12px;
}
.tdw-burbuja {
  position: relative;
  max-width: 88%;
  padding: 6px 8px 14px;
  border-radius: 9px;
  font-size: 8.8px;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
.tdw-burbuja small { position: absolute; right: 7px; bottom: 3px; color: #667781; font-size: 7.5px; }
.tdw-burbuja small i { color: #53bdeb; }
.tdw-burbuja--enviada { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 2px; }
.tdw-burbuja--recibida { background: #fff; border-top-left-radius: 2px; }

/* Cliente: el mensaje ya escrito, listo para enviar */
.tdw-compose {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 8px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  transition: opacity .3s, transform .35s;
}
.tdw-compose-txt {
  flex: 1;
  padding: 7px 9px;
  border-radius: 14px;
  background: #fff;
  font-size: 8px;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
.tdw-send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  font-size: 12px;
  transition: transform .15s;
}
.tdw-send.is-press { transform: scale(.85); }
#tdwEnviada { opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .3s, transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.tdw-p--wsp.is-enviado #tdwEnviada { opacity: 1; transform: none; }
.tdw-p--wsp.is-enviado .tdw-compose { opacity: 0; transform: translateY(14px); }

/* Local: lista de chats */
.tdw-chats-cab { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 6px; }
.tdw-chats-cab b { color: #008069; font-size: 14px; }
.tdw-chats-cab span { display: flex; gap: 10px; color: #54656f; font-size: 11px; }
.tdw-buscar { display: block; margin: 0 10px 6px; padding: 6px 10px; border-radius: 999px; background: #f0f2f5; color: #8a8f98; }
.tdw-lista { display: flex; flex-direction: column; }
.tdw-fila { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.tdw-fila > div { flex: 1; min-width: 0; }
.tdw-fila b { display: block; font-size: 9.5px; }
.tdw-fila small { display: block; color: #667781; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdw-fila em { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: #667781; font-style: normal; font-size: 7.5px; }
.tdw-fila em i { min-width: 15px; padding: 1px 4px; border-radius: 999px; background: #25d366; color: #fff; font-style: normal; font-weight: 700; text-align: center; }
.tdw-fila--nueva em { color: #1fa855; font-weight: 700; }
.tdw-av {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #dfe5e7;
  color: #fff;
  font-size: 14px;
}
.tdw-av--b { background: #9bb7c4; }
.tdw-av--c { background: #e3b778; }
.tdw-av--d { background: #a7c49b; }
.tdw-av--wsp { width: 24px; height: 24px; font-size: 11px; }
.tdw-fila--nueva { max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; background: #f0fdf4; transition: max-height .4s, padding .4s; }
.tdw-anim.is-llego .tdw-fila--nueva { max-height: 50px; padding-top: 8px; padding-bottom: 8px; }

.tdw-noti {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 30px;
  z-index: 8;
  display: flex;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 14px;
  background: rgba(250, 250, 252, .97);
  box-shadow: 0 10px 24px rgba(28, 34, 48, .25);
  transform: translateY(-120px);
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.1);
}
.tdw-noti div { min-width: 0; }
.tdw-noti small { display: block; color: #8a8f98; font-size: 7.5px; }
.tdw-noti b { display: block; font-size: 9px; }
.tdw-noti span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 8.5px; color: #374151; }
.tdw-noti-ico { display: flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 7px; background: #25d366; color: #fff; font-size: 14px; }
.tdw-anim.is-noti .tdw-noti { transform: none; }

/* Local: el pedido recibido, línea por línea */
.tdw-p--chat .tdw-burbuja--recibida { opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .35s; }
.tdw-anim.is-recibido .tdw-p--chat .tdw-burbuja--recibida { opacity: 1; transform: none; }
.tdw-l { border-radius: 3px; transition: background .3s; }
.tdw-l--cat { margin-top: 5px; font-weight: 700; }
.tdw-l--det, .tdw-l--tot { margin-top: 5px; }
.tdw-l--tot { font-weight: 700; }
.tdw-l--acl { color: #b45309; }
.tdw-l.is-marca { background: rgba(37, 211, 102, .18); }
.tdw-ok {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: #1f9d55;
  font-weight: 700;
  font-size: 8.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .3s, transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.tdw-anim.is-ok .tdw-ok { opacity: 1; transform: none; }
.tdw-respuesta { opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .35s; }
.tdw-anim.is-respuesta .tdw-respuesta { opacity: 1; transform: none; }

/* El pedido viajando entre celulares */
.tdw-vuelo {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: -15px 0 0 -13px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(37, 211, 102, .45);
  opacity: 0;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(.45, .05, .25, 1);
}
.tdw-vuelo.is-on { opacity: 1; }

/* Toque en la pantalla */
.tdw-toque { width: 26px; height: 26px; filter: none; }
.tdw-dedo {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  margin: -11px 0 0 -9px;
  border-radius: 50%;
  background: rgba(28, 34, 48, .28);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.tdw-toque .tma-click { left: 4px; top: 2px; }

/* Sin animación: el pedido ya recibido en el WhatsApp del local. */
.tdw-anim.is-estatico .tdw-vuelo { display: none; }
