/* ==========================================================================
   Demo viva "cart-recovery" (hero de /carritos-abandonados): el cliente deja su
   carrito, 2 h después le llega el correo real de recuperación con cupón, vuelve
   desde el botón, paga con el descuento y el carrito queda recuperado.
   Markup: resources/views/web/partials/anim/cart-recovery.blade.php
   Estados en la raíz:
     data-phone   cart | lock | checkout | done   (pantalla del celular)
     data-later   chip "2 h después" · data-mail correo visible · data-win resultado
     data-cursor  puntero visible
   Tienda y correo no tienen modo oscuro: solo halo y sombra.
   ========================================================================== */

/* ---------- Paleta ---------- */
.lla-cr {
  --lla-text: #111827;
  --lla-muted: #64748b;
  --lla-border: #e7eaf3;
  --lla-success: #15803d;
  --lla-shadow: 0 32px 64px -24px rgba(22, 34, 58, .38), 0 10px 24px -10px rgba(22, 34, 58, .18);
  --lla-glow-a: rgba(219, 39, 119, .14);
  --lla-glow-b: rgba(55, 125, 255, .14);
  --lla-cursor-fill: #1e2022;
  --lla-cursor-edge: #ffffff;
  --lla-cursor-ring: rgba(55, 125, 255, .55);

  /* Color de marca de la tienda de ejemplo ($primaryColor del correo) */
  --lla-brand: #db2777;
  --lla-brand-soft: #fdf2f8;
}
html[data-theme="dark"] .lla-cr {
  --lla-glow-a: rgba(219, 39, 119, .12);
  --lla-glow-b: rgba(77, 159, 255, .12);
  --lla-shadow: 0 32px 64px -24px rgba(0, 0, 0, .8), 0 10px 24px -10px rgba(0, 0, 0, .55);
}

/* ---------- Escena ---------- */
.lla-cr { max-width: 700px; margin-inline: auto; color: var(--lla-text); line-height: 1.3; text-align: left; }
.lla .lla-cr__stage { --lla-w: 700; --lla-h: 520; }
.lla-cr :where(b, small, strong, em, i, p, s, ins) { margin: 0; font-size: inherit; font-style: normal; color: inherit; }
.lla-cr .bi::before { vertical-align: 0; }
.lla-cr__glow { position: absolute; border-radius: 50%; pointer-events: none; }
.lla-cr__glow--a { left: -40px; top: 40px; width: 380px; height: 420px; background: radial-gradient(closest-side, var(--lla-glow-a), transparent); }
.lla-cr__glow--b { left: 300px; top: 30px; width: 440px; height: 460px; background: radial-gradient(closest-side, var(--lla-glow-b), transparent); }

/* ---------- Celular ---------- */
.lla-cr__phone { position: absolute; left: 24px; top: 26px; width: 228px; height: 474px; padding: 8px; border-radius: 42px; background: #0a0a0c; box-shadow: inset 0 0 0 2px #8a8e97, inset 0 0 0 3.5px #2b2d33, var(--lla-shadow); }
.lla-cr__screen { position: relative; height: 100%; overflow: hidden; border-radius: 34px; background: #fff; }
.lla-cr__island { position: absolute; top: 9px; left: 50%; z-index: 6; width: 64px; height: 19px; border-radius: 999px; background: #000; transform: translateX(-50%); }
.lla-cr__home { position: absolute; bottom: 7px; left: 50%; z-index: 6; width: 36%; height: 4px; border-radius: 999px; background: rgba(0, 0, 0, .85); transform: translateX(-50%); transition: background-color .3s; }
.lla-cr[data-phone="lock"] .lla-cr__home { background: #fff; }

.lla-cr__shop, .lla-cr__lock, .lla-cr__done { position: absolute; inset: 0; transition: opacity .45s var(--lla-ease), transform .5s var(--lla-ease); }
.lla-cr__shop { display: flex; flex-direction: column; padding: 38px 12px 16px; }
.lla-cr__nav { display: flex; align-items: center; gap: 7px; padding-bottom: 9px; border-bottom: 1px solid #f1f2f5; font-size: 11.5px; }
.lla-cr__logo { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lla-brand); color: #fff; font-size: 9px; font-weight: 800; }
.lla-cr__nav b { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.lla-cr__nav > .bi { position: relative; margin-left: auto; color: var(--lla-brand); font-size: 15px; }
.lla-cr__nav > .bi em { position: absolute; right: -6px; top: -5px; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #111827; color: #fff; font-size: 8.5px; font-weight: 700; }
.lla-cr__h { margin: 11px 0 8px !important; font-size: 15px !important; font-weight: 800; }
.lla-cr__item { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; padding: 7px; border: 1px solid #eef0f3; border-radius: 12px; }
.lla-cr__item > i { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--lla-brand-soft); font-size: 22px; }
.lla-cr__item > span { display: flex; flex-direction: column; min-width: 0; }
.lla-cr__item b { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.lla-cr__item small { color: var(--lla-muted); font-size: 10px; }
.lla-cr__item strong { margin-left: auto; font-size: 11px; font-weight: 700; }
.lla-cr__sum { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; padding-top: 8px; border-top: 1px dashed #d6dbe4; font-size: 11px; }
.lla-cr__coupon { display: none; align-items: center; gap: 5px; padding: 5px 8px; border: 1px dashed #86efac; border-radius: 8px; background: #f0fdf4; color: var(--lla-success); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.lla-cr__coupon em { margin-left: auto; }
.lla-cr__line { display: flex; justify-content: space-between; }
.lla-cr__line--disc { display: none; color: var(--lla-success); }
.lla-cr__line b { font-size: 12.5px; font-weight: 800; }
.lla-cr__line s { text-decoration: none; }
.lla-cr__line ins { display: none; text-decoration: none; }
.lla-cr__pay { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; padding: 10px; border-radius: 12px; background: var(--lla-brand); color: #fff; font-size: 12.5px; font-weight: 700; transition: transform .15s var(--lla-ease), filter .15s; }
.lla-cr__pay.is-pressed { transform: scale(.97); filter: brightness(.9); }
.lla-cr[data-phone="checkout"] :is(.lla-cr__coupon) { display: flex; animation: lla-cr-in .45s var(--lla-ease); }
.lla-cr[data-phone="checkout"] .lla-cr__line--disc { display: flex; }
.lla-cr[data-phone="checkout"] .lla-cr__line s { color: var(--lla-muted); font-size: 10.5px; font-weight: 500; text-decoration: line-through; }
.lla-cr[data-phone="checkout"] .lla-cr__line ins { display: inline; }

.lla-cr__lock { display: flex; flex-direction: column; align-items: center; padding: 56px 10px 0; background: radial-gradient(120% 70% at 20% 0%, #7c3aed, transparent 60%), linear-gradient(170deg, #312e81, #9d174d 60%, #ea580c); color: #fff; opacity: 0; }
.lla-cr__time { font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.lla-cr__notif { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 22px; padding: 9px; border-radius: 16px; background: rgba(255, 255, 255, .85); color: var(--lla-text); box-shadow: 0 8px 18px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(-14px); transition: opacity .4s var(--lla-ease) .35s, transform .5s var(--lla-ease) .35s; }
.lla-cr__notif > span:first-child { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #3b82f6; color: #fff; font-size: 14px; }
.lla-cr__notif > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.lla-cr__notif b { overflow: hidden; font-size: 10.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.lla-cr__notif small { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.lla-cr__notif em { align-self: flex-start; color: var(--lla-muted); font-size: 9px; }

.lla-cr__done { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #fff; opacity: 0; transform: scale(.96); }
.lla-cr__done > span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #dcfce7; color: var(--lla-success); font-size: 34px; }
.lla-cr__done b { font-size: 16px; font-weight: 800; }
.lla-cr__done small { color: var(--lla-muted); font-size: 12px; }

.lla-cr[data-phone="lock"] .lla-cr__shop, .lla-cr[data-phone="done"] .lla-cr__shop { opacity: 0; }
.lla-cr[data-phone="lock"] .lla-cr__lock { opacity: 1; }
.lla-cr[data-phone="lock"][data-mail] .lla-cr__notif { opacity: 1; transform: none; }
.lla-cr[data-phone="done"] .lla-cr__done { opacity: 1; transform: none; }
.lla-cr[data-phone="done"] .lla-cr__done > span { animation: lla-cr-pop .5s var(--lla-ease); }

/* ---------- 2 h después ---------- */
.lla-cr__later { position: absolute; left: 270px; top: 26px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #1e1b4b; color: #e0e7ff; font-size: 12px; font-weight: 700; box-shadow: 0 8px 18px -8px rgba(30, 27, 75, .6); opacity: 0; transform: translateY(-6px); transition: opacity .4s var(--lla-ease), transform .4s var(--lla-ease); }
.lla-cr__later .bi { color: #fde68a; }
.lla-cr[data-later] .lla-cr__later { opacity: 1; transform: none; }

/* ---------- Correo ---------- */
.lla-cr__mail { position: absolute; left: 284px; top: 56px; width: 400px; overflow: hidden; border: 1px solid var(--lla-border); border-radius: 14px; background: #f7f7fb; box-shadow: var(--lla-shadow); opacity: 0; transform: translateX(24px); transition: opacity .5s var(--lla-ease), transform .55s var(--lla-ease); }
.lla-cr[data-mail] .lla-cr__mail { opacity: 1; transform: none; }
.lla-cr__mailbar { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--lla-border); background: #fff; }
.lla-cr__mailbar .bi { color: #3b82f6; font-size: 16px; }
.lla-cr__mailbar span { display: flex; flex-direction: column; min-width: 0; }
.lla-cr__mailbar b { font-size: 12px; font-weight: 700; }
.lla-cr__mailbar small { overflow: hidden; color: var(--lla-muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.lla-cr__email { margin: 10px 14px; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1); }
.lla-cr__ehead { padding: 9px 14px; border-bottom: 3px solid var(--lla-brand); color: var(--lla-brand); font-size: 13px; font-weight: 700; }
.lla-cr__ebody { padding: 10px 16px 14px; }
.lla-cr__etitle { margin-bottom: 3px !important; color: #0f172a; font-size: 14px !important; font-weight: 700; }
.lla-cr__ehello { margin-bottom: 6px !important; color: #475569; font-size: 11px !important; }
.lla-cr__etext { color: #334155; font-size: 10.5px !important; line-height: 1.4; }
.lla-cr__etable { width: 100%; margin: 7px 0 6px; border-collapse: collapse; font-size: 10.5px; }
.lla-cr__etable th { padding: 4px 6px; border-bottom: 2px solid #e2e8f0; background: #f8fafc; color: #64748b; font-size: 8.5px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.lla-cr__etable th:last-child, .lla-cr__etable td:last-child { text-align: right; }
.lla-cr__etable td { padding: 3px 6px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.lla-cr__etable td:first-child { width: 34px; }
.lla-cr__etable td span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: #f1f5f9; font-size: 15px; }
.lla-cr__etable td b { color: #1e293b; font-weight: 600; }
.lla-cr__etable td:nth-child(3) { color: #64748b; }
.lla-cr__etable td:last-child { font-weight: 600; }
.lla-cr__etotal td { padding-top: 6px; border-top: 2px solid #e2e8f0; border-bottom: none; color: #0f172a; font-weight: 700 !important; text-align: right; }
.lla-cr__gift { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-bottom: 9px; padding: 7px 10px; border: 1px solid #86efac; border-radius: 8px; background: #f0fdf4; text-align: center; }
.lla-cr__gift b { color: var(--lla-success); font-size: 10px; font-weight: 600; }
.lla-cr__gift small { color: #374151; font-size: 9.5px; }
.lla-cr__gift em { padding: 3px 12px; border: 2px dashed #86efac; border-radius: 6px; background: #fff; color: var(--lla-success); font-size: 13px; font-weight: 700; letter-spacing: 2px; }
.lla-cr__gift .lla-cr__once { color: #6b7280; font-size: 8.5px; }
.lla-cr__ebtn { display: table; margin: 0 auto; padding: 8px 22px; border-radius: 6px; background: var(--lla-brand); color: #fff; font-size: 11.5px; font-weight: 600; transition: transform .15s var(--lla-ease), filter .15s; }
.lla-cr__ebtn.is-pressed { transform: scale(.96); filter: brightness(.9); }

/* ---------- Resultado ---------- */
.lla-cr__win { position: absolute; left: 470px; top: 14px; display: flex; align-items: center; gap: 9px; padding: 9px 14px 9px 10px; border: 1px solid var(--lla-border); border-radius: 14px; background: #fff; box-shadow: var(--lla-shadow); opacity: 0; transform: translateY(-8px) scale(.96); transition: opacity .4s var(--lla-ease), transform .5s var(--lla-ease); }
.lla-cr__win > span:first-child { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #dcfce7; color: var(--lla-success); font-size: 16px; }
.lla-cr__win > span:last-child { display: flex; flex-direction: column; }
.lla-cr__win b { font-size: 12px; font-weight: 700; }
.lla-cr__win small { color: var(--lla-success); font-size: 12px; font-weight: 700; }
.lla-cr[data-win] .lla-cr__win { opacity: 1; transform: none; }
.lla-cr[data-win] .lla-cr__later { opacity: 0; }

.lla-cr[data-fade] :is(.lla-cr__mail, .lla-cr__win, .lla-cr__later) { opacity: 0; }

/* ---------- Puntero ---------- */
.lla-cr__cursor { position: absolute; top: 0; left: 0; z-index: 10; width: 22px; height: 22px; pointer-events: none; opacity: 0; transform: translate(560px, 470px); transition: transform .6s var(--lla-ease), opacity .3s var(--lla-ease); }
.lla-cr[data-cursor] .lla-cr__cursor { opacity: 1; }
.lla-cr__cursor svg { position: relative; display: block; width: 22px; height: 22px; fill: var(--lla-cursor-fill); stroke: var(--lla-cursor-edge); stroke-width: 1.4; stroke-linejoin: round; }
.lla-cr__cursor-ring { position: absolute; left: -10px; top: -12px; width: 28px; height: 28px; border: 2px solid var(--lla-cursor-ring); border-radius: 50%; opacity: 0; }
.lla-cr__cursor.is-tap svg { animation: lla-cr-press .3s var(--lla-ease); }
.lla-cr__cursor.is-tap .lla-cr__cursor-ring { animation: lla-cr-ripple .5s var(--lla-ease); }

/* ---------- Angosto: celular arriba a la izquierda, correo debajo ---------- */
@container (max-width: 479px) {
  .lla .lla-cr__stage { --lla-w: 420; --lla-h: 860; }
  .lla-cr__phone { left: 96px; top: 50px; }
  .lla-cr__later { left: 10px; top: 8px; }
  .lla-cr__win { left: 200px; top: 4px; }
  .lla-cr__mail { left: 10px; top: 430px; }
}

@keyframes lla-cr-in { from { transform: translateY(-6px); } to { transform: none; } }
@keyframes lla-cr-pop { 0% { transform: scale(.5); } 70% { transform: scale(1.15); } 100% { transform: none; } }
@keyframes lla-cr-press { 50% { transform: scale(.85); } }
@keyframes lla-cr-ripple {
  0% { opacity: .9; transform: scale(.4); }
  100% { opacity: 0; transform: scale(1.4); }
}
