.mapa-america {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 340px;
    overflow: hidden;
}

.mapa-america__base,
.mapa-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mapa-america__base {
    z-index: 1;
}

.mapa-america__conexiones {
    pointer-events: none;
}

.mapa-america .jvm-region {
    cursor: default;
}

.mapa-america .jvm-zoom-btn {
    position: absolute;
    z-index: 5;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid rgba(21, 101, 192, 0.22);
    border-radius: 0.75rem;
    background: #ffffff;
    color: #0d47a1;
    font-size: 1.15rem;
    line-height: 1;
    box-shadow: 0 0.35rem 1rem rgba(13, 71, 161, 0.14);
    cursor: pointer;
}

.mapa-america .jvm-zoomin {
    top: 1rem;
    left: 1rem;
}

.mapa-america .jvm-zoomout {
    top: 4rem;
    left: 1rem;
}

.mapa-america .jvm-zoom-btn:focus-visible {
    outline: 3px solid rgba(21, 101, 192, 0.38);
    outline-offset: 3px;
}

.mapa-conexion {
    fill: none;
    stroke: #1565c0;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 5 7;
    opacity: 0.9;
    vector-effect: non-scaling-stroke;
    animation: flujo-conexion 3s linear infinite;
}

.mapa-nodo {
    fill: #2ECC71;
    stroke: #FFFFFF;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.mapa-nodo--origen {
    fill: #0051B5;
}

.mapa-pulso {
    fill: none;
    stroke: #9FC5F8;
    stroke-width: 2;
    transform-box: fill-box;
    transform-origin: center;
    vector-effect: non-scaling-stroke;
    animation: pulso-mapa 2s ease-out infinite;
}

.mapa-fallback {
    z-index: 4;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: #f4f7fa;
    color: #29435f;
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
}

.mapa-fallback[hidden] {
    display: none;
}

.mapa-america ~ .jvm-tooltip,
.jvm-tooltip {
    z-index: 1000;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0.6rem;
    background: #0d47a1;
    color: #ffffff;
    font-family: 'Hanken Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.4;
    pointer-events: none;
    white-space: pre-line;
    box-shadow: 0 0.5rem 1.25rem rgba(13, 71, 161, 0.22);
}

@keyframes flujo-conexion {
    to {
        stroke-dashoffset: -24;
    }
}

@keyframes pulso-mapa {
    from {
        opacity: 0.78;
        transform: scale(0.7);
    }

    to {
        opacity: 0;
        transform: scale(2.3);
    }
}

@media (max-width: 600px) {
    .mapa-america {
        min-height: 340px;
    }

    .mapa-conexion {
        stroke-width: 1.35;
        opacity: 0.58;
    }

    .mapa-america .jvm-zoom-btn {
        width: 2.75rem;
        height: 2.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mapa-conexion,
    .mapa-pulso {
        animation: none;
    }
}
