/********** Hero interactivo de servicios (service.html) **********/

.svx-hero { padding-bottom: 48px; }

.svx-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    margin-bottom: 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
}

.svx-badge-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #25D366;
    animation: svx-pulse 1.6s infinite;
}

@keyframes svx-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .6); }
    100% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
}


/*** Detalle del servicio activo ***/
.svx-detail {
    position: relative;
    padding: 20px 22px 18px;
    border-radius: 20px;
    text-align: left;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.svx-detail-head span { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .7); }
.svx-detail-head strong { display: block; font-family: 'Ubuntu', sans-serif; font-size: 20px; margin-bottom: 10px; color: #fff; }

.svx-detail ul { list-style: none; margin: 0 0 12px; padding: 0; }

.svx-detail li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 7px;
    font-size: 15px;
    color: rgba(255, 255, 255, .92);
}

.svx-detail li::before {
    content: "\f00c";
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 10px;
    color: #fff;
    background: var(--svx-c, #15ACE1);
    transition: background .3s ease;
}

.svx-detail-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.svx-detail-result i { color: #ffc400; margin-top: 3px; }

/* Entrada suave cuando cambia el servicio */
.svx-detail.is-swap li,
.svx-detail.is-swap .svx-detail-result,
.svx-detail.is-swap .svx-detail-head strong { animation: svx-in .45s ease both; }
.svx-detail.is-swap li:nth-child(2) { animation-delay: .08s; }
.svx-detail.is-swap li:nth-child(3) { animation-delay: .16s; }
.svx-detail.is-swap .svx-detail-result { animation-delay: .24s; }

@keyframes svx-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.svx-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); }
.svx-progress i { display: block; height: 100%; width: 0; background: var(--svx-c, #15ACE1); }
.svx-progress i.is-run { animation: svx-progress var(--svx-t, 5s) linear forwards; }
@keyframes svx-progress { to { width: 100%; } }


/*** Constelación ***/
.svx-orbit {
    --size: 540px;
    position: relative;
    width: var(--size);
    height: var(--size);
    max-width: 100%;
    margin: 0 auto;
}

.svx-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.svx-ring--outer { inset: 32px; border: 2px dashed rgba(255, 255, 255, .18); animation: svx-spin 60s linear infinite; }
.svx-ring--inner { inset: 120px; border: 1px solid rgba(21, 172, 225, .3); box-shadow: 0 0 60px rgba(21, 172, 225, .18) inset; animation: svx-spin 40s linear infinite reverse; }
@keyframes svx-spin { to { transform: rotate(360deg); } }

.svx-beam { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.svx-beam line { stroke: var(--svx-c, #15ACE1); stroke-width: 3; stroke-dasharray: 6 6; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: svx-flow .8s linear infinite; transition: stroke .3s ease; }
@keyframes svx-flow { to { stroke-dashoffset: -12; } }

.svx-nodes { position: absolute; inset: 0; }

.svx-node {
    --c: #15ACE1;
    position: absolute;
    width: 62px;
    height: 62px;
    margin: -31px 0 0 -31px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #fff;
    background: rgba(20, 24, 62, .78);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), 0 10px 22px rgba(0, 0, 0, .35);
    cursor: pointer;
    transition: transform .3s ease, background .3s ease, box-shadow .3s ease;
    animation: svx-float 5s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes svx-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

.svx-node:hover,
.svx-node:focus-visible {
    background: var(--c);
    box-shadow: 0 0 0 3px #fff, 0 0 26px var(--c);
    transform: scale(1.12);
    outline: none;
}

.svx-node.is-active {
    background: var(--c);
    transform: scale(1.22);
    box-shadow: 0 0 0 4px #fff, 0 0 0 10px rgba(255, 255, 255, .15), 0 0 34px var(--c);
    z-index: 2;
}

/* Nombre del servicio junto al nodo */
.svx-node-label {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font: 600 12px 'Open Sans', sans-serif;
    color: #fff;
    background: rgba(20, 24, 62, .92);
    border: 1px solid rgba(255, 255, 255, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.svx-node:hover .svx-node-label,
.svx-node:focus-visible .svx-node-label,
.svx-node.is-active .svx-node-label { opacity: 1; transform: translateX(-50%); }

.svx-node.is-active .svx-node-label { background: var(--c); border-color: transparent; }


/*** Tarjeta central ***/
.svx-core {
    --c: #15ACE1;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 268px;
    padding: 22px 20px 20px;
    border-radius: 24px;
    text-align: center;
    color: var(--dark);
    background: #fff;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .12), 0 24px 50px rgba(0, 0, 0, .4);
    transform: translate(-50%, -50%);
    z-index: 3;
}

.svx-core-icon {
    width: 64px;
    height: 64px;
    margin: -54px auto 10px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 28px;
    color: #fff;
    background: var(--c);
    box-shadow: 0 0 0 5px #fff, 0 12px 26px rgba(0, 0, 0, .25);
    transition: background .3s ease;
}

.svx-core-tag {
    display: inline-block;
    padding: 2px 10px;
    margin-bottom: 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    color: #3a4470;
    background: var(--light);
}

.svx-core-name { font-size: 20px; margin-bottom: 8px; color: var(--dark); }
.svx-core-line { font-size: 14px; color: #56607e; margin-bottom: 14px; }

.svx-core-actions { display: flex; gap: 8px; justify-content: center; }

.svx-core-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.svx-core-btn:hover { color: #fff; transform: translateY(-2px); background: #0f52a6; }
.svx-core-btn--alt { color: var(--primary); background: transparent; box-shadow: inset 0 0 0 2px var(--primary); }
.svx-core-btn--alt:hover { color: #fff; background: var(--primary); }

.svx-core.is-swap .svx-core-icon { animation: svx-pop .45s ease both; }
.svx-core.is-swap .svx-core-name,
.svx-core.is-swap .svx-core-line,
.svx-core.is-swap .svx-core-tag { animation: svx-in .4s ease both; }

@keyframes svx-pop {
    0% { transform: scale(.6) rotate(-12deg); }
    70% { transform: scale(1.08); }
    100% { transform: none; }
}


/*** Fila de servicios para celular ***/
.svx-chips { display: none; }

.svx-chip {
    --c: #15ACE1;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    scroll-snap-align: start;
    transition: background .2s ease, border-color .2s ease;
}

.svx-chip i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--c); }
.svx-chip.is-active { background: var(--c); border-color: #fff; }
.svx-chip.is-active i { background: rgba(255, 255, 255, .25); }


/*** Responsive ***/
@media (max-width: 1199.98px) {
    .svx-orbit { --size: 470px; }
    .svx-ring--inner { inset: 100px; }
    .svx-core { width: 240px; padding: 18px 16px; }
    .svx-node { width: 54px; height: 54px; margin: -27px 0 0 -27px; font-size: 19px; }
}

@media (max-width: 991.98px) {
    .svx-hero { padding-bottom: 32px; }
    .svx-chips {
        display: flex;
        gap: 8px;
        margin: 0 -12px 18px;
        padding: 4px 12px 10px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .svx-chips::-webkit-scrollbar { display: none; }
    .svx-orbit { width: auto; height: auto; }
    .svx-ring, .svx-beam, .svx-nodes { display: none; }
    .svx-core { position: relative; top: auto; left: auto; width: auto; max-width: 440px; margin: 40px auto 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .svx-ring, .svx-node, .svx-badge-dot, .svx-beam line { animation: none; }
    .svx-detail.is-swap *, .svx-core.is-swap * { animation: none !important; }
    .svx-progress { display: none; }
}

/* Botones de la tarjeta central en una línea */
.svx-core-btn { white-space: nowrap; }
@media (max-width: 1199.98px) {
    .svx-core-btn { padding: 7px 12px; font-size: 13px; }
}

/* En celular y tablet: título → servicios → detalle → botones */
@media (max-width: 991.98px) {
    .svx-hero { justify-content: center; }
    .svx-hero > div { display: contents; }
    .svx-hero > div > * {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: calc(var(--bs-gutter-x) * .5);
        padding-right: calc(var(--bs-gutter-x) * .5);
    }
    .svx-hero .svx-badge { flex: 0 0 auto; order: 1; }
    .svx-title { order: 2; }
    .svx-lead { order: 3; }
    .svx-chips { order: 4; }
    .svx-orbit { order: 5; margin-bottom: 22px; }
    .svx-detail { order: 6; flex-basis: calc(100% - var(--bs-gutter-x)); max-width: calc(100% - var(--bs-gutter-x)); padding: 20px 22px 18px; }
    .svx-ctas { order: 7; }
    .svx-crumb { order: 8; }
    .svx-core { margin-top: 34px; }
}

@media (max-width: 991.98px) {
    .svx-hero { --bs-gutter-x: 24px; }
    .svx-hero .svx-chips { margin: 0 0 18px; }
}
