/* Sigma Operaciones · mejoras de diseño (se carga después del estilo propio de cada página) */

html { scroll-padding-top: 88px; }

/* Tono más sobrio: menos resplandor */
.aura-lemon-lime { filter: drop-shadow(0 0 10px rgba(204, 255, 0, 0.28)); }
.animate-pulse-slow { animation-duration: 10s; }

/* Foco visible para teclado */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #0B3B6D;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(204, 255, 0, 0.55);
}

/* Navegación: se compacta al hacer scroll */
nav.glass-nav > .container { transition: padding 0.3s ease; }
nav.glass-nav.nav-scrolled { box-shadow: 0 14px 30px -14px rgba(0, 26, 51, 0.65); }
nav.glass-nav.nav-scrolled > .container { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.nav-link-active { color: #CCFF00 !important; }
.nav-link-active::after { width: 100% !important; }

/* Entrada del hero */
@keyframes sg-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.hero-in > * { animation: sg-rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-in > *:nth-child(2) { animation-delay: 0.1s; }
.hero-in > *:nth-child(3) { animation-delay: 0.2s; }
.hero-in > *:nth-child(4) { animation-delay: 0.3s; }

/* Aparición al hacer scroll */
html.js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--d, 0s);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* Barra de lectura y botón volver arriba para páginas que no los traen */
.sg-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 100;
    background: linear-gradient(to right, #8BA870, #CCFF00);
    transition: width 0.1s ease-out;
}
.sg-top {
    position: fixed; bottom: 1.5rem; right: 1.5rem; width: 3rem; height: 3rem; z-index: 40;
    border-radius: 9999px; background: #002D56; color: #fff; border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 10px 25px -8px rgba(0, 26, 51, 0.5);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease, background 0.3s ease;
}
.sg-top.is-on { opacity: 1; pointer-events: auto; }
.sg-top:hover { background: #0B3B6D; }

/* Soe: presencia discreta en Nosotros */
.soe-stage { display: flex; justify-content: center; }
.soe { position: relative; width: 150px; }
.soe-img { width: 100%; height: auto; display: block; transform-origin: 50% 100%; animation: sg-float 5s ease-in-out infinite; }
.soe.is-visible .soe-img { animation: sg-wave 1.4s ease-in-out 0.5s 1, sg-float 5s ease-in-out 2s infinite; }
.soe-bubble {
    position: absolute; left: 100%; top: 6px; margin-left: 10px;
    background: #ffffff; color: #002D56; border: 1px solid #cbd5e1;
    border-radius: 14px 14px 14px 4px; padding: 0.55rem 0.85rem;
    font-size: 0.85rem; font-weight: 700; white-space: nowrap;
    box-shadow: 0 10px 22px -12px rgba(0, 45, 86, 0.4);
    opacity: 0; transform: scale(0.85) translateY(6px); transform-origin: 0 100%;
    transition: opacity 0.4s ease 0.9s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.9s;
}
.soe.is-visible .soe-bubble { opacity: 1; transform: none; }
@keyframes sg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sg-wave {
    0% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 40% { transform: rotate(5deg); }
    60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } 100% { transform: rotate(0); }
}
@media (max-width: 520px) {
    .soe-bubble {
        left: 50%; top: auto; bottom: 100%; margin: 0 0 6px -80px; width: 160px;
        white-space: normal; text-align: center; border-radius: 14px 14px 4px 14px; transform-origin: 50% 100%;
    }
    .soe { margin-top: 3.5rem; }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    html.js .reveal { opacity: 1; transform: none; transition: none; }
    .hero-in > *, .soe-img, .animate-pulse-slow { animation: none !important; }
    .soe-bubble { opacity: 1; transform: none; transition: none; }
}

/* Sello ISO del inicio: ticket en líneas blancas con brillo verde */
.iso-badge { display: flex; align-items: center; gap: 1rem; margin-top: 2.25rem; }
.iso-badge svg {
    width: 96px; height: 96px; overflow: visible; flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(204, 255, 0, 1)) drop-shadow(0 0 24px rgba(204, 255, 0, 0.6));
    animation: iso-glow 3.2s ease-in-out infinite;
}
.iso-ring { transform-origin: 60px 60px; animation: iso-spin 28s linear infinite; }
.iso-circle { stroke-dasharray: 100; stroke-dashoffset: 100; animation: iso-draw 1.2s ease-out 0.3s forwards; }
.iso-check { stroke-dasharray: 100; stroke-dashoffset: 100; animation: iso-draw 0.9s ease-out 1.2s forwards; }
.iso-spark { stroke: #CCFF00; opacity: 0; animation: iso-spark 3.2s ease-in-out 2s infinite; }
.iso-spark.s2 { animation-delay: 3.4s; }
@keyframes iso-draw { to { stroke-dashoffset: 0; } }
@keyframes iso-spin { to { transform: rotate(360deg); } }
@keyframes iso-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(204, 255, 0, 1)) drop-shadow(0 0 24px rgba(204, 255, 0, 0.6)); }
    50% { filter: drop-shadow(0 0 12px rgba(204, 255, 0, 1)) drop-shadow(0 0 36px rgba(204, 255, 0, 0.8)); }
}
@keyframes iso-spark { 0%, 100% { opacity: 0; transform: scale(0.6); } 40% { opacity: 1; transform: scale(1); } }

/* Tarjetas de respaldo: barra lima y movimiento sutil */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, #8BA870, #CCFF00);
    transform: scaleX(0); transform-origin: left; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-card:hover::before, .stat-card.is-active::before { transform: scaleX(1); }
.stat-ic { transition: transform 0.35s ease, box-shadow 0.35s ease; }
.stat-card:hover .stat-ic { transform: translateY(-3px) rotate(-6deg); box-shadow: 0 12px 24px -8px rgba(204, 255, 0, 0.55); }

@media (prefers-reduced-motion: reduce) {
    .iso-badge svg, .iso-ring, .iso-spark { animation: none !important; }
    .iso-circle, .iso-check { animation: none !important; stroke-dashoffset: 0; }
    .iso-spark { opacity: 1; }
    .stat-card::before { transform: scaleX(1); }
}

/* Ticket ISO del inicio: un solo ticket verde que se arma con líneas */
.iso-ticket { margin-top: 2rem; width: min(430px, 100%); }
.iso-ticket svg { width: 100%; height: auto; overflow: visible; }
.iso-ticket svg * { stroke-linecap: round; stroke-linejoin: round; }
.tk-float { transform-box: fill-box; transform-origin: center; animation: tk-float 6s ease-in-out 3.4s infinite; filter: drop-shadow(0 0 7px rgba(204, 255, 0, 0.55)); }
.tk-outline { stroke: #CCFF00; stroke-width: 5.5; stroke-dasharray: 100; stroke-dashoffset: 100; animation: tk-draw 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards; }
.tk-run { stroke: #F4FFB0; stroke-width: 5.5; stroke-dasharray: 4 96; stroke-dashoffset: 100; opacity: 0; animation: tk-run 4.2s linear 3.6s infinite; }
.tk-perf { stroke: #CCFF00; stroke-width: 4.5; stroke-dasharray: 9 10; transform-box: fill-box; transform-origin: top; transform: scaleY(0); animation: tk-perf 0.7s ease-out 1.3s forwards; }
.tk-title { fill: #CCFF00; }
.tk-sub { fill: #CCFF00; opacity: 0.85; }
.tk-clip { transform-box: fill-box; transform-origin: left; transform: scaleX(0); animation: tk-wipe 1s cubic-bezier(0.3, 0, 0.2, 1) 1.5s forwards; }
.tk-bar { fill: #CCFF00; opacity: 0.7; transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: tk-bar 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) calc(2.3s + var(--i) * 0.05s) forwards; }
.tk-ring { stroke: #CCFF00; stroke-width: 5.5; stroke-dasharray: 100; stroke-dashoffset: 100; transform-box: fill-box; transform-origin: center; animation: tk-draw 0.7s ease-out 1.9s forwards, tk-pulse 0.6s ease-out 3.1s 1; }
.tk-check { stroke: #CCFF00; stroke-width: 6; stroke-dasharray: 100; stroke-dashoffset: 100; animation: tk-draw 0.5s ease-out 2.6s forwards; }
.tk-ripple { stroke: #CCFF00; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: tk-ripple 1.1s ease-out 3.1s 1; }
.tk-spark { stroke: #CCFF00; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; animation: tk-twinkle 3s ease-in-out infinite; }
.tk-spark.sp1 { animation-delay: 3.4s; }
.tk-spark.sp2 { animation-delay: 4.3s; }
.tk-spark.sp3 { animation-delay: 5.2s; }
@keyframes tk-draw { to { stroke-dashoffset: 0; } }
@keyframes tk-perf { to { transform: scaleY(1); } }
@keyframes tk-wipe { to { transform: scaleX(1); } }
@keyframes tk-bar { to { transform: scaleY(1); } }
@keyframes tk-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes tk-ripple { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes tk-twinkle { 0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes tk-run { from { stroke-dashoffset: 100; opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes tk-float { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-5px) rotate(0.6deg); } }
@media (prefers-reduced-motion: reduce) {
    .tk-float, .tk-run, .tk-spark, .tk-ripple { animation: none !important; }
    .tk-run, .tk-ripple, .tk-spark { display: none; }
    .tk-outline, .tk-ring, .tk-check { animation: none !important; stroke-dashoffset: 0; }
    .tk-perf, .tk-clip, .tk-bar { animation: none !important; transform: none; }
}

/* Carrusel continuo de marcas en una sola fila (tarjetas cuadradas) */
.brands-marquee {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 0.25rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
.brands-track {
    display: flex;
    width: max-content;
    animation: brands-scroll 42s linear infinite;
    will-change: transform;
}
.brands-marquee:hover .brands-track,
.brands-marquee:focus-within .brands-track {
    animation-play-state: paused;
}
.brands-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 1.15rem;
    padding-right: 1.15rem;
}
.brand-tile {
    width: 110px;
    height: 110px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px -3px rgba(0, 45, 86, 0.06);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.brand-tile:hover {
    transform: translateY(-2px);
    border-color: #8BA870;
    box-shadow: 0 10px 22px -8px rgba(0, 45, 86, 0.14);
}
.brand-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
@media (min-width: 640px) {
    .brand-tile {
        width: 124px;
        height: 124px;
    }
}
@keyframes brands-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .brands-marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .brands-track {
        animation: none;
    }
    .brands-group[aria-hidden="true"] {
        display: none;
    }
}
