/*
 * Index: animación "Tu carta impresa, siempre actualizada" (editor_carta).
 * La base común (tarjeta, ventana, cursor, escala) está en landing_animacion.css.
 */

/* ---------------------------------------------- barra y panel del editor */
.tci-guardado { color: #9fe0b8; font-size: 11px; font-weight: 600; }
.tci-btn-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  background: #e85f32;
  font-size: 11px;
  font-weight: 700;
  transition: transform .15s, filter .15s, box-shadow .2s;
}
.tci-btn-print.is-press { transform: scale(.93); filter: brightness(.9); box-shadow: 0 0 0 5px rgba(232, 95, 50, .3); }
.tci-panel {
  position: absolute;
  left: 46px;
  top: 40px;
  bottom: 0;
  width: 150px;
  padding: 14px 12px;
  background: #fff;
  border-right: 1px solid #e3e6eb;
  z-index: 2;
  transform: translateX(-105%);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.tci-panel-tit { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #5b6474; margin-bottom: 10px; }
.tci-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tci-thumb {
  display: block;
  aspect-ratio: 1;
  padding: 5px;
  border-radius: 9px;
  background: #f7f8fa;
  border: 1px solid #e3e6eb;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tci-thumb svg { display: block; width: 100%; height: 100%; }
.tci-thumb.is-hover { transform: scale(1.06); border-color: #3d7cff; box-shadow: 0 0 0 3px rgba(61, 124, 255, .18); }

/* ---------------------------------------------------- paso 1: plantillas */
.tci-plantillas {
  position: absolute;
  left: 0;
  right: 0;
  top: 92px;
  display: flex;
  justify-content: center;
  gap: 16px;
  transition: opacity .4s, transform .5s;
}
.tci-pl { width: 100px; text-align: center; transition: transform .25s, opacity .35s; }
.tci-pl > span { display: block; margin-top: 8px; font-size: 11px; font-weight: 600; color: #374151; }
.tci-pl-mini {
  position: relative;
  height: 140px;
  padding: 16px 12px;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(28, 34, 48, .12);
  outline: 2.5px solid transparent;
  outline-offset: 3px;
  transition: outline-color .2s, box-shadow .25s;
}
.tci-pl-mini b { display: block; width: 60%; height: 7px; margin: 0 auto 12px; border-radius: 2px; }
.tci-pl-mini i { display: block; height: 3px; margin-bottom: 8px; border-radius: 2px; opacity: .55; }
.tci-pl-mini i:nth-child(3) { width: 80%; }
.tci-pl-mini i:nth-child(5) { width: 70%; }
.tci-pl-mini--clasica { background: #fbf7ef; box-shadow: inset 0 0 0 4px #fbf7ef, inset 0 0 0 5px #b08d57, 0 6px 16px rgba(28, 34, 48, .12); }
.tci-pl-mini--clasica b { background: #2b2118; }
.tci-pl-mini--clasica i { background: #9c7a45; }
.tci-pl-mini--moderna { background: #fff; border-top: 5px solid #e85f32; }
.tci-pl-mini--moderna b { background: #111; margin-left: 0; }
.tci-pl-mini--moderna i { background: #777; }
.tci-pl-mini--bistro { background: #173a2e; }
.tci-pl-mini--bistro b { background: #f3ead7; }
.tci-pl-mini--bistro i { background: #c9a96e; }
.tci-pl-mini--pizarra { background: #23292b; }
.tci-pl-mini--pizarra b { background: #fff; }
.tci-pl-mini--pizarra i { background: #f2c94c; }
.tci-pl.is-hover { transform: translateY(-5px); }
.tci-pl.is-hover .tci-pl-mini { box-shadow: 0 14px 28px rgba(28, 34, 48, .2); }
.tci-pl.is-elegida .tci-pl-mini { outline-color: #e85f32; }

/* ------------------------------------------------------- la carta (A4) */
.tci-pagina {
  position: absolute;
  left: 179px;
  top: 14px;
  width: 236px;
  height: 334px;
  background: #fbf7ef;
  box-shadow: 0 2px 4px rgba(28, 34, 48, .08), 0 14px 34px rgba(28, 34, 48, .16);
  color: #2b2118;
  font-family: "Lora", serif;
  opacity: 0;
  transform: scale(.94);
  transition: opacity .5s, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.tci-marco {
  position: absolute;
  inset: 7px;
  border: 3px double #b08d57;
  opacity: 0;
  transition: opacity .5s .1s;
}
.tci-p-tit {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  text-align: center;
  font: 700 21px/1 "Playfair Display", serif;
}
.tci-p-slogan { position: absolute; left: 0; right: 0; top: 50px; text-align: center; font-size: 7.5px; font-style: italic; color: #6b5d4f; }
.tci-p-orn { position: absolute; left: 0; right: 0; top: 61px; text-align: center; font-size: 11px; color: #b08d57; }
.tci-sec { position: absolute; left: 22px; }
.tci-sec--pizzas { top: 82px; width: 192px; }
.tci-sec--pastas { top: 174px; width: 192px; transition: width .7s cubic-bezier(.3, .7, .2, 1); }
.tci-sec-tit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: #9c7a45;
  font: 700 8.5px/1 "Playfair Display", serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.tci-sec-tit::before,
.tci-sec-tit::after { content: ""; flex: 1; border-top: 1px solid #b08d57; }
.tci-fila {
  display: flex;
  align-items: baseline;
  margin-bottom: 6.5px;
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.tci-fila > i { flex: 1; min-width: 8px; margin: 0 4px; border-bottom: 1.2px dotted rgba(43, 33, 24, .5); transform: translateY(-2px); }
.tci-fila > em { position: relative; font-style: normal; }

/* Precio que se actualiza */
.tci-precio-viejo,
.tci-precio-nuevo { display: inline-block; transition: opacity .35s, transform .35s; }
.tci-precio-nuevo { position: absolute; right: 0; top: 0; opacity: 0; transform: translateY(6px); }
.tci-pagina.is-precio-nuevo .tci-precio-viejo { opacity: 0; transform: translateY(-6px); }
.tci-pagina.is-precio-nuevo .tci-precio-nuevo { opacity: 1; transform: none; }
.tci-pagina.is-precio-nuevo #tciPrecio::after {
  content: "";
  position: absolute;
  inset: -3px -5px;
  border-radius: 4px;
  background: rgba(31, 157, 85, .2);
  animation: tci-flash 1.6s ease-out forwards;
}
@keyframes tci-flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* Revelado progresivo del contenido */
.tci-rev { opacity: 0; transform: translateY(5px); transition: opacity .35s, transform .35s; }
.tci-rev.is-on { opacity: 1; transform: none; }
.tci-pie { position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 7px; font-size: 6.5px; line-height: 1.35; color: #6b5d4f; }
.tci-qr {
  width: 28px;
  height: 28px;
  background:
    linear-gradient(#2b2118, #2b2118) 0 0 / 9px 9px no-repeat,
    linear-gradient(#2b2118, #2b2118) 100% 0 / 9px 9px no-repeat,
    linear-gradient(#2b2118, #2b2118) 0 100% / 9px 9px no-repeat,
    repeating-conic-gradient(#2b2118 0 25%, transparent 0 50%) 0 0 / 5px 5px;
  border: 2px solid #fbf7ef;
  outline: 1px solid #e7dcc8;
}

/* Foto agregada en el paso 3 */
.tci-foto {
  position: absolute;
  left: 146px;
  top: 176px;
  width: 68px;
  height: 68px;
  padding: 4px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(43, 33, 24, .18);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s, transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.tci-foto svg { display: block; width: 100%; height: 100%; }
.tci-foto-badge {
  position: absolute;
  left: -6px;
  top: -6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e85f32;
  color: #fff;
  font: 800 6.5px/1.3 "Nunito", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tci-pagina.is-foto .tci-foto { opacity: 1; transform: none; }

/* Selección, tiradores y guías (como en el editor) */
.tci-sel {
  position: absolute;
  inset: -4px;
  border: 1.5px solid #3d7cff;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .2s;
}
.tci-h {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border: 1.5px solid #3d7cff;
  border-radius: 2px;
  background: #fff;
}
.tci-foto .tci-h:nth-child(1) { left: 0; top: 0; }
.tci-foto .tci-h:nth-child(2) { left: 100%; top: 0; }
.tci-foto .tci-h:nth-child(3) { left: 100%; top: 100%; }
.tci-foto .tci-h:nth-child(4) { left: 0; top: 100%; }
.tci-h--e { left: 100%; top: 50%; width: 6px; height: 14px; margin: -7px 0 0 -3px; }
.tci-pagina.is-sel-pastas .tci-sel--pastas,
.tci-pagina.is-sel-foto .tci-foto .tci-sel { opacity: 1; }
.tci-guia { position: absolute; background: #ff2f86; opacity: 0; transition: opacity .15s; }
.tci-guia--v { left: 214px; top: 0; bottom: 0; width: 1px; }
.tci-guia--h { left: 0; right: 0; top: 176px; height: 1px; }
.tci-pagina.is-guias .tci-guia { opacity: 1; }

/* --------------------------------------------- aviso de precio (paso 2) */
.tci-aviso {
  position: absolute;
  right: 12px;
  top: 40px;
  width: 162px;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d9f0e2;
  box-shadow: 0 12px 28px rgba(28, 34, 48, .16);
  font-size: 10px;
  line-height: 1.35;
  color: #374151;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .35s, transform .45s cubic-bezier(.2, .8, .2, 1);
}
.tci-aviso > i {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e9f7ef;
  color: #1f9d55;
  font-size: 13px;
}
.tci-aviso b { display: block; color: #1f9d55; font-weight: 700; }
.tci-aviso span { display: block; font-weight: 600; color: #111827; white-space: nowrap; }
.tci-aviso small { display: block; color: #8b93a1; font-size: 8.5px; }
.tci-anim.is-aviso .tci-aviso { opacity: 1; transform: none; }

/* -------------------------------------------------- paso 4: impresión */
.tci-impresora {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 210px;
  height: 300px;
  margin-left: -105px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .4s, transform .5s cubic-bezier(.2, .8, .2, 1);
}
.tci-salida {
  position: absolute;
  left: 32px;
  bottom: 66px;
  width: 146px;
  height: 214px;
  overflow: hidden;
}
.tci-papel {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 146px;
  height: 207px;
  overflow: hidden;
  background: #fbf7ef;
  box-shadow: 0 2px 8px rgba(28, 34, 48, .15);
  transform: translateY(100%);
  transition: transform 2s cubic-bezier(.4, .1, .3, 1);
}
.tci-anim .tci-papel > .tci-pagina.tci-copia {
  left: 0;
  top: 0;
  opacity: 1;
  transform: scale(.6186);
  transform-origin: 0 0;
  box-shadow: none;
  transition: none;
}
.tci-imp-cuerpo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(#3b4252, #262c38);
  box-shadow: 0 14px 30px rgba(28, 34, 48, .3);
}
.tci-imp-ranura {
  position: absolute;
  left: 26px;
  right: 26px;
  top: 8px;
  height: 6px;
  border-radius: 3px;
  background: #11151d;
}
.tci-imp-luz {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28c840;
  box-shadow: 0 0 8px #28c840;
  animation: tci-luz .5s ease-in-out infinite alternate;
}
@keyframes tci-luz { to { opacity: .35; } }
.tci-listo {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: #1f9d55;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(28, 34, 48, .2);
  opacity: 0;
  transform: translate(-50%, 8px) scale(.9);
  transition: opacity .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.tci-listo b { padding: 1px 6px; border-radius: 4px; background: #e85f32; color: #fff; font-size: 9px; }
.tci-anim.is-impresion .tci-pagina:not(.tci-copia) { opacity: 0; transform: scale(.9) translateY(-10px); }
.tci-anim.is-impresion .tci-impresora { opacity: 1; transform: none; }
.tci-anim.is-papel .tci-papel { transform: none; }
.tci-anim.is-listo .tci-listo { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* -------------------------------------------------------------- estados */
.tci-anim.is-carta .tci-plantillas { opacity: 0; transform: scale(.96); }
.tci-anim.is-carta .tci-pagina { opacity: 1; transform: none; }
.tci-anim.is-carta .tci-marco { opacity: 1; }
.tci-anim.is-panel .tci-panel { transform: none; }
.tci-pastas-angosta .tci-sec--pastas { width: 112px; }

/* Foto arrastrada */
.tci-fantasma {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  width: 56px;
  height: 56px;
  margin: -18px 0 0 -40px;
  padding: 4px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(28, 34, 48, .3);
  opacity: 0;
  transform: translate(0, 0) rotate(-6deg);
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(.45, .05, .25, 1);
}
.tci-fantasma svg { display: block; width: 100%; height: 100%; }
.tci-fantasma.is-on { opacity: .92; }

/* Sin animación (prefers-reduced-motion): la carta terminada. */
.tci-anim.is-estatico .tci-aviso { display: none; }
.tci-anim.is-estatico .tci-rev { opacity: 1; transform: none; }
