/*********************************\
      SHORTCODE [hero-grafico]
\*********************************/
/* Red amarilla del hero: se dibuja al cargar la página y descubre los cinco servicios por orden.
   Escritorio: horizontal, con el círculo a la derecha. Móvil (hasta 767px): vertical, con el círculo abajo. */
.hero-grafico {
    --hero-grafico-color: #ECE316;
    --hero-grafico-ease: cubic-bezier(0.16, 1, 0.3, 1); /* expo.out */
    --hero-grafico-delay: 0.25s;

    color: var(--hero-grafico-color);
    line-height: 0;

    .hero-grafico__svg {
        display: block;
        width: 100%;
        height: auto;
    }

    .hero-grafico__svg--movil { display: none; }

    .hg-line,
    .hg-box,
    .hg-arc { transform-box: fill-box; }

    /* Dirección en la que se traza cada línea */
    .hg-x   { transform-origin: 0 50%; }     /* de izquierda a derecha */
    .hg-x-r { transform-origin: 100% 50%; }  /* de derecha a izquierda */
    .hg-y   { transform-origin: 50% 0; }     /* de arriba abajo */

    /* Ritmo: primero la línea principal y después las dos ramas */
    .hg-line--main { --hg-dur: 1.4s; --hg-del: 0s; }
    .hg-line--b1   { --hg-dur: 1s;   --hg-del: 0.15s; }
    .hg-line--b2   { --hg-dur: 1s;   --hg-del: 0.35s; }
}

@media only screen and (max-width: 767px) {
    .hero-grafico {
        .hero-grafico__svg--desktop { display: none; }
        .hero-grafico__svg--movil   { display: block; }
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero-grafico {
        .hg-line {
            animation-duration: var(--hg-dur);
            animation-delay: calc(var(--hero-grafico-delay) + var(--hg-del));
            animation-timing-function: var(--hero-grafico-ease);
            animation-fill-mode: both;
        }

        .hg-x, .hg-x-r { animation-name: hero-grafico-x; }
        .hg-y          { animation-name: hero-grafico-y; }

        .hg-box { animation: hero-grafico-box 0.7s var(--hero-grafico-ease) calc(var(--hero-grafico-delay) + 0.1s + var(--i, 0) * 0.12s) both; }

        .hg-arc    { animation: hero-grafico-arc 1.1s var(--hero-grafico-ease) calc(var(--hero-grafico-delay) + 0.45s) both; }
        .hg-arc--b { animation-name: hero-grafico-arc-b; }
    }
}

@keyframes hero-grafico-x {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@keyframes hero-grafico-y {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

/* Las cajas se destapan de izquierda a derecha */
@keyframes hero-grafico-box {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

/* El arco aparece desde la derecha (escritorio) */
@keyframes hero-grafico-arc {
    from { opacity: 0; clip-path: inset(0 0 0 100%); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* El arco aparece desde abajo (móvil) */
@keyframes hero-grafico-arc-b {
    from { opacity: 0; clip-path: inset(100% 0 0 0); }
    to   { opacity: 1; clip-path: inset(0 0 0 0); }
}
