/* kit_efectos.css · efectos de los bloques de portada (Kit, 21/11/2026; no se edita en el producto).
   Cada bloque lleva data-efecto="<clave>"; kit_efectos.js le pone .ke-visto cuando entra en pantalla.
   Colores: --ke-acento (por defecto el acento del producto) y --ke-suave. Todo se apaga con prefers-reduced-motion. */
[data-efecto] { --ke-acento: var(--acento, #8B5CF6); --ke-suave: var(--tenue, #64748B); --ke-borde: var(--borde, #E2E8F0); --ke-fondo: var(--fondo2, #fff); }

/* sube: lista que sube sola (la fila nueva entra arriba) */
.ke-sube { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; overflow: hidden; }
.ke-sube > li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px;
                background: var(--ke-fondo); border: 1px solid var(--ke-borde); font-size: 13.5px; min-width: 0; }
.ke-sube > li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ke-sube > li small { color: var(--ke-suave); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ke-sube > li.ke-entra { animation: ke-entra .6s cubic-bezier(.2, .7, .2, 1); }
@keyframes ke-entra { from { opacity: 0; transform: translateY(-14px); } }
.ke-pulso { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; display: inline-block; margin-right: 6px; box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: ke-pulso 2s infinite; }
@keyframes ke-pulso { 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }

/* contador: el número real ya viene escrito; solo se anima al verse */
.ke-num { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -.03em; }

/* reloj: 24 puntos, uno por hora; se encienden en orden al verse */
.ke-reloj { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.ke-reloj i { aspect-ratio: 1; border-radius: 50%; background: var(--ke-borde); position: relative; transition: background .3s, transform .3s; }
.ke-reloj i[data-on] { background: color-mix(in srgb, var(--ke-acento) 25%, var(--ke-borde)); }
.ke-visto .ke-reloj i[data-on] { background: var(--ke-acento); transform: scale(1.08); transition-delay: calc(var(--k, 0) * 60ms); }
.ke-reloj-pie { display: flex; justify-content: space-between; max-width: 420px; font-size: 12px; color: var(--ke-suave); margin-top: 4px; }

/* linea: línea que se dibuja con sus pasos completados */
.ke-linea { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; display: grid; gap: 10px; }
.ke-linea::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: currentColor; opacity: .25; }
.ke-linea::after { content: ""; position: absolute; left: 7px; top: 6px; width: 2px; height: 0; background: var(--ke-acento); transition: height 1.6s ease; }
.ke-visto .ke-linea::after { height: calc(100% - 12px); }
.ke-linea li { position: relative; opacity: .35; transition: opacity .4s; transition-delay: calc(var(--k, 0) * 250ms); }
.ke-linea li::before { content: "✓"; position: absolute; left: -22px; top: 1px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
                       font-size: 10px; color: #fff; background: var(--ke-acento); }
.ke-visto .ke-linea li { opacity: 1; }

/* carrusel: tarjetas que pasan solas, se deslizan con el dedo */
.ke-carrusel { position: relative; }
.ke-pista { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
            scrollbar-width: none; padding-bottom: 4px; }
.ke-pista::-webkit-scrollbar { display: none; }
.ke-pista > * { scroll-snap-align: start; }
.ke-puntos { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.ke-puntos button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--ke-borde); cursor: pointer; }
.ke-puntos button[aria-current="true"] { background: var(--ke-acento); width: 20px; border-radius: 99px; }

/* giran: tarjetas con frente y vuelta */
.ke-giran { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ke-carta { perspective: 900px; min-height: 150px; cursor: pointer; }
.ke-carta > div { position: relative; height: 100%; min-height: 150px; transition: transform .7s; transform-style: preserve-3d; }
.ke-carta.ke-vuelta > div { transform: rotateY(180deg); }
.ke-cara { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; padding: 14px;
           background: var(--ke-fondo); border: 1px solid var(--ke-borde); overflow: hidden; }
.ke-cara.ke-atras { transform: rotateY(180deg); border-color: var(--ke-acento); }

/* cuenta: cuenta regresiva */
.ke-cuenta { display: flex; gap: 8px; flex-wrap: wrap; }
.ke-cuenta > div { min-width: 64px; text-align: center; padding: 8px 6px; border-radius: 12px; background: var(--ke-fondo); border: 1px solid var(--ke-borde); }
.ke-cuenta b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; color: var(--ke-acento); line-height: 1.1; }
.ke-cuenta small { font-size: 12px; color: var(--ke-suave); }

/* mes: tabla con el mes resaltado */
.ke-mes { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ke-mes th, .ke-mes td { padding: 5px 6px; border-bottom: 1px solid var(--ke-borde); text-align: center; white-space: nowrap; }
.ke-mes th:first-child, .ke-mes td:first-child { text-align: left; }
.ke-mes tr.ke-hoy td { background: color-mix(in srgb, var(--ke-acento) 14%, transparent); font-weight: 700; }
.ke-mes-caja { overflow-x: auto; max-height: 360px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--ke-borde); }

/* acordeón: uno abierto a la vez */
.ke-acordeon details { border-bottom: 1px solid var(--ke-borde); }
.ke-acordeon details[open] > *:not(summary) { animation: ke-abre .3s ease; }
@keyframes ke-abre { from { opacity: 0; transform: translateY(-4px); } }

/* cinta: corre sola */
.ke-cinta { overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ke-cinta > div { display: inline-flex; gap: 10px; animation: ke-cinta 30s linear infinite; }
.ke-cinta span { border: 1px solid var(--ke-borde); background: var(--ke-fondo); border-radius: 99px; padding: 5px 14px; font-size: 14px; color: var(--ke-suave); }
@keyframes ke-cinta { to { transform: translateX(-50%); } }

/* juntar: varios íconos que se juntan en uno */
.ke-juntar { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: center; }
.ke-juntar .ke-pieza { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--ke-suave); text-align: center;
                       transition: transform 1s cubic-bezier(.6, 0, .2, 1), opacity .8s; transition-delay: calc(var(--k, 0) * 80ms); }
.ke-juntar .ke-pieza i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ke-fondo); border: 1px solid var(--ke-borde); font-style: normal; font-size: 20px; }
.ke-juntar .ke-uno { grid-column: 1 / -1; justify-self: center; display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 14px;
                     background: var(--ke-acento); color: #fff; font-weight: 700; opacity: 0; transform: scale(.8); transition: opacity .6s 1s, transform .6s 1s; }
.ke-visto .ke-juntar .ke-pieza { transform: translateY(46px) scale(.6); opacity: .25; }
.ke-visto .ke-juntar .ke-uno { opacity: 1; transform: none; }

/* zoom: la imagen se acerca despacio */
.ke-zoom { overflow: hidden; border-radius: 14px; }
.ke-zoom img { display: block; width: 100%; height: auto; transform: scale(1); transition: transform 12s ease-out; }
.ke-visto .ke-zoom img { transform: scale(1.06); }

@media (max-width: 600px) { .ke-juntar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
  [data-efecto] *, [data-efecto] *::before, [data-efecto] *::after { animation: none !important; transition: none !important; }
  .ke-linea li { opacity: 1; } .ke-linea::after { height: calc(100% - 12px); }
  .ke-juntar .ke-pieza { transform: none !important; opacity: 1 !important; } .ke-juntar .ke-uno { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- efectos de uso (22/11/2026, super plan F4)
   Barra de carga, botón que guarda, eliminar con deshacer, avisos, login, esqueleto y transición entre páginas.
   Colores: --ke-acento sale del acento del producto; sin él, violeta neutro. */
:root { --ke-acento: var(--acento, var(--k-marca, #8B5CF6)); }

/* barra fina arriba mientras carga la página siguiente */
#ke-barra { position: fixed; z-index: 9999; top: 0; left: 0; height: 3px; width: 0; background: var(--ke-acento); opacity: 0; pointer-events: none;
            box-shadow: 0 0 8px var(--ke-acento); transition: opacity .2s; }
#ke-barra.ke-barra-on { opacity: 1; animation: ke-barra 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes ke-barra { 0% { width: 0; } 20% { width: 45%; } 100% { width: 92%; } }

/* botón que guarda: un círculo que gira y luego la marca de listo */
.ke-guardando, .ke-guardado { position: relative; pointer-events: none; }
.ke-guardando { color: transparent !important; }
.ke-guardando::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
                       border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) rgba(255,255,255,.9) transparent;
                       animation: ke-gira .7s linear infinite; }
.ke-guardado::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; background: inherit; border-radius: inherit; animation: ke-pop .3s ease; }
@keyframes ke-gira { to { transform: rotate(360deg); } }
@keyframes ke-pop { from { transform: scale(.6); opacity: 0; } }

/* eliminar: la fila se encoge y se va; con «Deshacer» vuelve */
.ke-saliendo { overflow: hidden; animation: ke-sale .32s ease forwards; pointer-events: none; }
@keyframes ke-sale { 0% { opacity: 1; max-height: var(--ke-alto, 200px); } 60% { opacity: 0; transform: translateX(24px); } 100% { opacity: 0; max-height: 0; margin-block: 0; padding-block: 0; border-width: 0; transform: translateX(24px); } }

/* avisos: uno solo, abajo al centro, por encima de la barra del celular */
#ke-avisos { position: fixed; z-index: 9998; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
             width: max-content; max-width: min(460px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 760px) { #ke-avisos { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }
.ke-aviso { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #111827; color: #F9FAFB;
            font-size: 14px; line-height: 1.35; box-shadow: 0 12px 28px -12px rgba(0,0,0,.55); animation: ke-aviso .22s ease; }
.ke-aviso--ok { border-left: 4px solid #16A34A; }
.ke-aviso--mal { border-left: 4px solid #DC2626; }
.ke-aviso button { flex: none; border: 0; background: transparent; color: #FDE68A; font: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; min-height: 32px; }
.ke-aviso.ke-sale { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes ke-aviso { from { opacity: 0; transform: translateY(10px); } }

/* login: la tarjeta entra suave; el error tiembla una vez */
.ke-login { animation: ke-login .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes ke-login { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.ke-tiembla { animation: ke-tiembla .42s ease; }
@keyframes ke-tiembla { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* esqueleto: el lugar del dato mientras llega */
.ke-esqueleto { display: block; min-height: 1em; border-radius: 6px; color: transparent !important;
                background: linear-gradient(90deg, rgba(148,163,184,.18) 25%, rgba(148,163,184,.34) 50%, rgba(148,163,184,.18) 75%) 0 0 / 200% 100%;
                animation: ke-brillo 1.2s linear infinite; }
@keyframes ke-brillo { to { background-position: -200% 0; } }

/* transición entre páginas del mismo sitio (los navegadores que no la tienen, la ignoran) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@media (prefers-reduced-motion: reduce) {
  #ke-barra.ke-barra-on { animation: none; width: 92%; }
  .ke-guardando::after, .ke-esqueleto { animation: none; }
  .ke-saliendo { animation-duration: .01s; }
  .ke-aviso, .ke-login, .ke-tiembla, .ke-guardado::after { animation: none; }
  @view-transition { navigation: none; }
}
