/* Página «Productos» («Soluciones UroData»): una franja por solución, con su texto a un lado y su ventana
   animada al otro, alternando (productos/demo_*.html + productos.js), y el cierre «¿Cuál se ajusta…?». */

/* ========== CABECERA: ATAJOS A CADA SOLUCIÓN ========== */
.solucion-atajos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2.25rem;
    animation: udFadeUp 0.9s 0.3s ease-out both;
}

.solucion-atajo {
    padding: 0.5rem 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.solucion-atajo:hover {
    background: white;
    border-color: white;
    color: var(--ud-navy-2);
    text-decoration: none;
}

/* ========== FRANJAS ========== */
.producto-fila {
    padding: 5rem 0;
    scroll-margin-top: 100px;   /* al llegar desde un atajo, el menú fijo de arriba no tapa el texto */
}

.producto-fila-cuerpo {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 4rem;
    align-items: center;
}

.producto-fila--invertida .producto-fila-texto {
    order: 2;
}

.producto-para {
    margin: 0 0 0.6rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ud-blue-dark);
}

.producto-cabecera {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
}

.producto-nombre {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--ud-navy-2);
}

.producto-texto {
    margin: 1rem 0 0;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--ud-ink);
}

.producto-detalle {
    margin: 1rem 0 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--ud-muted);
}

/* «Gratis» en verde; «De pago», en gris */
.producto-estado {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border: 1px solid #cfd8e1;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--ud-muted);
}

.producto-estado--gratis {
    border-color: transparent;
    background: rgba(77, 187, 110, 0.15);
    color: #2f9a55;
}

/* Recuadro de los diccionarios con que se codifica cada dato */
.solucion-recuadro {
    margin-top: 1.5rem;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(77, 187, 110, 0.3);
    border-radius: 14px;
    background: #f1faf4;
}

.solucion-recuadro p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--ud-ink);
}

.solucion-recuadro b {
    color: var(--ud-navy-2);
}

.solucion-diccionarios {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.solucion-diccionarios span {
    padding: 0.2rem 0.65rem;
    border: 1px solid #cfd8e1;
    border-radius: 50px;
    background: white;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: var(--ud-navy-2);
}

/* Lo que incluye, con su check (verde en Conecta, como su etiqueta) */
.solucion-puntos {
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.solucion-puntos li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-top: 0.7rem;
    line-height: 1.55;
    color: var(--ud-ink);
}

.solucion-puntos i {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.1rem;
    border-radius: 50%;
    background: rgba(18, 181, 255, 0.14);
    font-size: 0.65rem;
    color: var(--ud-blue-dark);
}

.producto-fila--conecta .solucion-puntos i {
    background: rgba(77, 187, 110, 0.16);
    color: #2f9a55;
}

.solucion-puntos b {
    color: var(--ud-navy-2);
}

.solucion-nota {
    margin: 1.4rem 0 0;
    font-size: 0.92rem;
    color: var(--ud-muted);
}

.solucion-nota b {
    color: #2f9a55;
}

.solucion-boton {
    margin-top: 1.6rem;
}

.solucion-leyenda {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    text-align: right;
    color: #8a97a6;
}

/* ========== CIERRE ========== */
.solucion-cierre {
    text-align: center;
}

.solucion-cierre .ud-section-lead {
    margin-bottom: 2rem;
}

/* ========== VENTANAS ========== */
/* Oscuras como la plataforma: cajas un poco más claras sobre el azul de la ventana */
.demo .ud-mockup {
    box-shadow: 0 30px 70px rgba(10, 25, 41, 0.3);
}

.demo-titulo {
    margin-left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 10px;
    color: rgba(255, 255, 255, 0.55);
}

.demo-cuerpo {
    min-height: 360px;
    padding: 1.25rem;
    font-size: 0.85rem;
    text-align: left;
    color: rgba(255, 255, 255, 0.9);
}

.demo-caja {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.demo-cabecera {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.demo-cabecera b {
    font-size: 0.85rem;
    color: white;
}

.demo-cabecera > span {
    font-size: 0.72rem;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

.demo-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 1px;
    vertical-align: -0.15em;
    background: var(--ud-blue-dark);
    animation: demoParpadeo 1s steps(1) infinite;
}

@keyframes demoParpadeo {
    50% { opacity: 0; }
}

/* Barra de avance: se llena al llegar su bloque (is-on) */
.demo-barra {
    height: 6px;
    overflow: hidden;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
}

.demo-barra span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ud-blue), var(--ud-green));
    transition: width 1.2s ease;
}

.is-on > .demo-barra span,
.is-on .demo-barra span {
    width: var(--valor);
}

/* UroData: la búsqueda de EMI (morado, como en la app), las cifras, las barras y el aviso de seguimiento */
.tablero-emi {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.4rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: white;
    font-size: 0.82rem;
    color: var(--ud-ink);
}

.tablero-emi-marca {
    flex: none;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: white;
}

.tablero-cifras {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.tablero-cifra {
    padding: 0.75rem;
}

.tablero-cifra b {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
}

.tablero-cifra small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
}

.tablero-cifra em {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 700;
    color: var(--ud-green);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tablero-cifra.is-on em {
    opacity: 1;
}

.tablero-grafico {
    margin-top: 0.75rem;
    padding: 0.85rem;
}

.tablero-barras {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.45rem;
    align-items: end;
}

.tablero-barra {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 120px;
    text-align: center;
}

.tablero-barra span {
    display: block;
    height: 0;
    border-radius: 4px 4px 0 0;
    background: rgba(18, 181, 255, 0.35);
    transition: height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tablero-barra.is-destacada span {
    background: linear-gradient(180deg, #5fd0ff 0%, var(--ud-blue) 100%);
}

.tablero-barra.is-on span {
    height: calc(var(--alto) * 96px);
}

.tablero-barra small {
    margin-top: 0.35rem;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.45);
}

.tablero-pie {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(18, 181, 255, 0.35);
    border-radius: 10px;
    background: rgba(18, 181, 255, 0.08);
    font-size: 0.75rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tablero-pie.is-on {
    opacity: 1;
    transform: none;
}

.tablero-pie b {
    color: white;
}

.tablero-ver {
    font-weight: 700;
    white-space: nowrap;
    color: var(--ud-blue);
}

/* Conecta: cada proyecto de la comunidad con sus centros, su estado y su equipo */
.comunidad-proyectos {
    display: grid;
    gap: 0.6rem;
}

.comunidad-proyecto {
    padding: 0.8rem 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.comunidad-proyecto.is-on {
    opacity: 1;
    transform: none;
}

.comunidad-proyecto > b {
    display: block;
    font-size: 0.85rem;
    color: white;
}

.comunidad-linea {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.comunidad-linea > span:first-child {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.comunidad-estado {
    padding: 0.12rem 0.55rem;
    border-radius: 50px;
    background: rgba(77, 187, 110, 0.16);
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
    color: #7ddc9b;
}

.comunidad-estado--en-curso {
    background: rgba(18, 181, 255, 0.16);
    color: #6fd2ff;
}

.comunidad-equipo {
    display: flex;
    margin-left: auto;
}

.comunidad-equipo i {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    margin-left: -0.35rem;
    border: 2px solid #0d2136;
    border-radius: 50%;
    background: var(--color);
    font-size: 0.55rem;
    font-style: normal;
    font-weight: 800;
    color: white;
}

.comunidad-equipo i:first-child {
    margin-left: 0;
}

.comunidad-equipo .comunidad-mas {
    background: rgba(255, 255, 255, 0.18);
}

/* Puente: la base va a UroData y cada variable sale con su nombre clínico y su diccionario */
.puente-flujo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.puente-caja {
    padding: 0.7rem 0.8rem;
}

.puente-caja b {
    display: block;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    color: white;
}

.puente-caja small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
}

.puente-caja--destino {
    border-color: rgba(18, 181, 255, 0.35);
}

.puente-flecha {
    font-size: 1.1rem;
    color: var(--ud-blue);
}

.puente-flujo.is-on .puente-flecha {
    animation: puenteFlecha 1.2s ease-in-out infinite;
}

@keyframes puenteFlecha {
    0%, 100% { opacity: 0.6; transform: translateX(-3px); }
    50% { opacity: 1; transform: translateX(3px); }
}

.puente-variables {
    display: grid;
    gap: 0.4rem;
}

.puente-variable {
    display: grid;
    grid-template-columns: 5.5rem auto minmax(0, 1fr) 1rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    opacity: 0.25;
    transition: opacity 0.35s ease;
}

.puente-variable.is-on {
    opacity: 1;
}

.puente-variable code {
    padding: 0;
    background: none;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.puente-a {
    color: rgba(255, 255, 255, 0.35);
}

.puente-destino {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.4rem;
    font-size: 0.76rem;
    color: white;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.puente-destino em {
    padding: 0.05rem 0.45rem;
    border-radius: 50px;
    background: rgba(18, 181, 255, 0.16);
    font-size: 0.58rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: #6fd2ff;
}

.puente-ok {
    font-size: 0.75rem;
    color: var(--ud-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.puente-variable.is-codificada .puente-destino,
.puente-variable.is-codificada .puente-ok {
    opacity: 1;
    transform: none;
}

.puente-validacion {
    margin-top: 1rem;
}

/* A Medida: el tipo de proyecto, el total de pacientes y cada centro participante */
.medida-tipos {
    display: inline-flex;
    margin-bottom: 0.9rem;
    padding: 0.2rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
}

.medida-tipo {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.55);
    transition: background 0.3s ease, color 0.3s ease;
}

.medida-tipos.is-on .medida-tipo:first-child {
    background: white;
    color: var(--ud-navy-2);
}

.medida-total {
    margin-bottom: 0.9rem;
}

.medida-cifra {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}

.medida-cifra b {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
}

.medida-cifra span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.medida-centros {
    display: grid;
    gap: 0.4rem;
}

.medida-centro {
    display: grid;
    grid-template-columns: 1.7rem minmax(0, 1fr) 3.5rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    opacity: 0.3;
    transition: opacity 0.35s ease;
}

.medida-centro.is-on {
    opacity: 1;
}

.medida-centro i {
    padding: 0.15rem 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 800;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
}

.medida-centro div > span {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.74rem;
    color: white;
}

.medida-centro b {
    font-size: 0.72rem;
    text-align: right;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
}

/* ========== MÓVIL ========== */
@media (max-width: 991px) {
    /* El texto arriba y su ventana debajo, en todas las franjas, nunca más anchos que la pantalla */
    .producto-fila {
        padding: 3.5rem 0;
    }
    .producto-fila-cuerpo {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.25rem;
    }
    .producto-fila--invertida .producto-fila-texto {
        order: 0;
    }
    .producto-nombre {
        font-size: 2.1rem;
    }
}

@media (max-width: 575px) {
    /* Menos margen dentro de las ventanas, para que quepa su contenido */
    .demo-cuerpo {
        min-height: 0;
        padding: 0.75rem;
    }
    .tablero-cifra {
        padding: 0.55rem;
    }
    .tablero-cifra b {
        font-size: 1.15rem;
    }
    .tablero-barras {
        gap: 0.25rem;
    }
    .comunidad-linea {
        flex-wrap: wrap;
    }
    .puente-variable {
        grid-template-columns: 4.6rem auto minmax(0, 1fr) 0.9rem;
        gap: 0.35rem;
        padding: 0.45rem 0.5rem;
    }
    .medida-tipo {
        padding: 0.3rem 0.55rem;
        font-size: 0.62rem;
    }
}

/* Quien pide menos movimiento ve el último fotograma, sin transiciones */
@media (prefers-reduced-motion: reduce) {
    .demo *,
    .demo *::before,
    .demo *::after {
        transition: none !important;
        animation: none !important;
    }
}
