/*
 * marca.css — tipografía y movimiento de las páginas de clientes de nvg.mx (oct 2026; el panel de administración no la carga).
 * Tipos: Manrope para leer, Outfit para títulos y cifras (precios, saldo), con dígitos de ancho fijo para que un número
 * que cambia no «baile». Movimiento solo como respuesta a lo que hace el cliente (agregar al carrito, abrir una ventana,
 * saldo que cambia, compra lista); nada se anima solo al cargar: el panel se abre muchas veces al día.
 * Si cambias este archivo, sube el ?v= de los <link>.
 */

:root {
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);          /* entradas y respuestas: arranca rápido */
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);      /* algo que se mueve dentro de la pantalla */
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);       /* hojas que suben desde abajo (como iOS) */
    --fuente-texto: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fuente-cifra: 'Outfit', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Tipografía ── */
body { font-family: var(--fuente-texto); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, .service-title, .section-title, .rc .rc-cab h3 { font-family: var(--fuente-cifra); letter-spacing: -0.01em; }
.service-price, .cart-total-price, .confirm-total-price, .credit-display-header span, .stat-num, .stat-mini .num {
    font-family: var(--fuente-cifra);
    font-variant-numeric: tabular-nums;
}

/* ── Catálogo: sin animación de entrada en cada tarjeta (se veía en cada visita y hacía sentir lento el panel) ── */
.service-card { animation: none !important; }
@media (hover: none) { .service-card:hover { transform: none; } }   /* en el celular el «hover» se quedaba pegado al tocar */

/* ── Ventanas: entran desde un poco más chicas, rápido; el fondo se oscurece con un fundido ── */
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes cartFadeIn   { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes velo { from { opacity: 0; } to { opacity: 1; } }
.description-content, .transfer-content, .crypto-content, .purchases-content {
    animation-duration: 0.24s !important;
    animation-timing-function: var(--ease-out) !important;
}
.cart-content { animation: cartFadeIn 0.24s var(--ease-out) !important; }
.cart-modal, .purchases-modal, .transfer-modal, .crypto-modal, .confirm-modal { animation: velo 0.2s ease; }
.cart-modal, .purchases-modal { background: rgba(15, 23, 42, 0.5) !important; }

/* Celular: carrito y compras son hojas que suben desde abajo, al alcance del pulgar. */
@keyframes hojaSube { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 640px) {
    .purchases-modal, .cart-modal { align-items: flex-end !important; padding: 0 !important; }
    .purchases-content, .cart-content {
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        max-height: 88vh !important;
        border-radius: 20px 20px 0 0 !important;
        border-bottom: 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
        animation: hojaSube 0.38s var(--ease-drawer) both !important;
    }
    .cart-header { border-radius: 18px 18px 0 0; }
}

/* ── Avisos: aparecen y se van con un fundido corto (antes desaparecían de golpe) ── */
@keyframes avisoEntra { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.notification { animation: avisoEntra 0.26s var(--ease-out) !important; transition: opacity 0.18s ease, transform 0.18s ease; }
.notification.sale { opacity: 0; transform: translateY(-6px); }
@media (max-width: 640px) { .notification { left: 16px; right: 16px; top: 12px; } }

/* ── Agregar al carrito: el botón confirma y el carrito reacciona ── */
@keyframes paloma { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes globo  { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes empuje { 0% { transform: none; } 30% { transform: translateY(-3px) rotate(-8deg); } 65% { transform: rotate(5deg); } 100% { transform: none; } }
.add-button.agregado { background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important; border-color: #059669 !important; color: #fff !important;
                       box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px -10px rgba(5,150,105,.7) !important; }
.add-button.agregado i { display: inline-block !important; }
.add-button.agregado i { animation: paloma 0.3s var(--ease-out); }
#cartBadge.pop { animation: globo 0.34s var(--ease-out); }
.floating-cart.empuje .cart-icon { display: inline-block; animation: empuje 0.42s var(--ease-out); }

/* ── Saldo que cambia: un aro verde que se abre una vez desde la píldora del saldo ── */
@keyframes saldoAro { from { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45); } to { box-shadow: 0 0 0 12px rgba(5, 150, 105, 0); } }
.credit-display-header.cambio { animation: saldoAro 0.9s var(--ease-out); }

/* ── Compra completada: el único momento con algo de celebración. Comprobante breve (lo que pagó y su saldo) y una
      barra que avanza mientras se abren sus cuentas (dura lo mismo que la espera antes de recargar). ── */
.compra-lista {
    position: fixed; inset: 0; z-index: 3000;
    display: grid; place-items: center; padding: 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: velo 0.22s ease;
}
.compra-lista .cl-tarjeta {
    position: relative; overflow: hidden;
    width: min(360px, 100%); padding: 2rem 1.6rem 1.25rem; text-align: center;
    background: #fff; border-radius: 24px;
    box-shadow: 0 30px 70px -24px rgba(15, 23, 42, 0.55), 0 0 0 1px rgba(15, 23, 42, 0.04);
    animation: clEntra 0.42s var(--ease-out) both;
}
/* Un brillo verde muy tenue arriba de la tarjeta */
.compra-lista .cl-tarjeta::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 130px; pointer-events: none;
    background: radial-gradient(120% 100% at 50% 0%, rgba(16, 185, 129, 0.14), rgba(16, 185, 129, 0) 70%);
}
@keyframes clEntra { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
.compra-lista .cl-sello {
    position: relative; width: 68px; height: 68px; margin: 0 auto 1rem; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(160deg, #34d399 0%, #059669 100%);
    box-shadow: 0 10px 24px -8px rgba(5, 150, 105, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: clSello 0.5s var(--ease-out) 0.08s both;
}
.compra-lista .cl-sello::after {       /* aro que se abre una sola vez */
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    animation: clAro 0.9s var(--ease-out) 0.35s both;
}
@keyframes clSello { 0% { opacity: 0; transform: scale(0.5); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes clAro { from { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); } to { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); } }
.compra-lista svg { width: 34px; height: 34px; display: block; }
.compra-lista path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
                     stroke-dasharray: 40; stroke-dashoffset: 40; animation: trazo 0.34s var(--ease-out) 0.36s forwards; }
@keyframes trazo { to { stroke-dashoffset: 0; } }
.compra-lista strong { position: relative; display: block; font-family: var(--fuente-cifra); font-size: 1.38rem; font-weight: 700; color: #0f172a; letter-spacing: -0.015em; }
.compra-lista p { position: relative; margin: 0.3rem 0 0; font-size: 0.93rem; color: #64748b; line-height: 1.45; }
.compra-lista .cl-recibo {
    margin: 1.1rem 0 0; padding: 0.75rem 0.95rem; border-radius: 14px;
    background: #f8fafc; border: 1px solid #eef1f6; text-align: left;
    animation: clSube 0.4s var(--ease-out) 0.22s both;
}
.compra-lista .cl-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 0.9rem; color: #64748b; }
.compra-lista .cl-fila + .cl-fila { margin-top: 0.45rem; padding-top: 0.45rem; border-top: 1px dashed #e2e8f0; }
.compra-lista .cl-fila b { font-family: var(--fuente-cifra); font-variant-numeric: tabular-nums; font-size: 1rem; font-weight: 700; color: #0f172a; }
.compra-lista .cl-pie { margin-top: 1rem; animation: clSube 0.4s var(--ease-out) 0.3s both; }
.compra-lista .cl-pie span { display: block; font-size: 0.8rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.01em; }
.compra-lista .cl-barra { display: block; height: 4px; margin-top: 0.5rem; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.compra-lista .cl-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #059669);
                            transform-origin: left; transform: scaleX(0); animation: clBarra 1.9s cubic-bezier(0.4, 0, 0.6, 1) forwards; }
@keyframes clSube { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes clBarra { to { transform: scaleX(1); } }

/* Después de comprar, la caja con los datos de lo comprado entra rápido y se marca un momento. */
@keyframes recienComprada { from { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.55); } to { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0); } }
.credentials-compact { animation-duration: 0.28s !important; animation-timing-function: var(--ease-out) !important; }
.credentials-compact.recien { animation: modalSlideIn 0.28s var(--ease-out), recienComprada 1.6s ease 0.35s both !important; }

/* Menos movimiento pedido por el sistema: lo esencial se ve, sin trazos ni rebotes. */
@media (prefers-reduced-motion: reduce) {
    .compra-lista path { stroke-dashoffset: 0; animation: none; }
    .compra-lista .cl-tarjeta, .compra-lista .cl-sello, .compra-lista .cl-sello::after, .compra-lista .cl-recibo, .compra-lista .cl-pie { animation: none; }
    .compra-lista .cl-barra i { animation-timing-function: linear; }
}
