/* ============================================================
   HOME DE BUSAE — piezas que no son utilidades de Tailwind.
   Ver partials/home/render.php.

   Los resets van con :where() para que su especificidad sea la de una
   etiqueta: anulan lo global de main.css (section con max-width y padding,
   márgenes de h1-h6, color de p/li/a) pero cualquier clase tw-* gana.
   ============================================================ */

/* ---------- Reset local de main.css ---------- */
:where(.bx) section { max-width: none; margin: 0; padding: 0; }
:where(.bx) :is(h1, h2, h3, h4, p, ul, ol, li, dl, dd, figure, blockquote) { margin: 0; }
:where(.bx) :is(h1, h2, h3, h4) { font-weight: 600; color: inherit; letter-spacing: -0.02em; }
:where(.bx) :is(p, li) { color: inherit; font-size: inherit; line-height: inherit; }
:where(.bx) a { color: inherit; text-decoration: none; }
:where(.bx) a:hover { text-decoration: none; }
:where(.bx) img { max-width: 100%; height: auto; }

/* Lo que entra desde los costados no debe crear scroll horizontal. */
.bx { overflow-x: clip; background: #fff; }
@supports not (overflow: clip) { .bx { overflow-x: hidden; } }

.bx-sec { scroll-margin-top: 16px; }
@media (min-width: 1280px) { .bx-sec, .bx-row { scroll-margin-top: 96px; } }

.bx-skip {
    position: absolute; left: 12px; top: -60px; z-index: 300;
    padding: 10px 16px; border-radius: 10px;
    background: #125781; color: #fff; font-weight: 600;
}
.bx-skip:focus { top: 12px; color: #fff; }

/* ---------- Hero ---------- */
.bx-hero { background: linear-gradient(180deg, #eef5fb 0%, #f7fbfe 45%, #fff 100%); }
.bx-hero-glow {
    position: absolute; inset: -20% -10% auto; height: 760px; z-index: -1; pointer-events: none;
    background:
        radial-gradient(42% 46% at 22% 30%, rgba(26, 111, 158, .20), transparent 70%),
        radial-gradient(34% 38% at 80% 22%, rgba(240, 136, 74, .13), transparent 70%),
        radial-gradient(40% 40% at 55% 75%, rgba(18, 87, 129, .10), transparent 70%);
    filter: blur(10px);
}
.bx-grad {
    background: linear-gradient(90deg, #0f4d72 0%, #1a6f9e 55%, #2f8fc4 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    padding-bottom: .08em;   /* que no se corte el trazo de la g y la p */
}
/* Barrido del título: una máscara con el borde difuminado avanza de
   izquierda a derecha (GSAP anima --bx-wipe de -25 % a 100 %). Solo mientras
   está la clase .bx-js: si el JS no arranca, el título se ve completo. */
.bx-js .bx-wipe {
    --bx-wipe: -25%;
    -webkit-mask-image: linear-gradient(90deg, #000 var(--bx-wipe), transparent calc(var(--bx-wipe) + 25%));
            mask-image: linear-gradient(90deg, #000 var(--bx-wipe), transparent calc(var(--bx-wipe) + 25%));
}
.bx-wipe.is-wiping {
    -webkit-mask-image: linear-gradient(90deg, #000 var(--bx-wipe), transparent calc(var(--bx-wipe) + 25%));
            mask-image: linear-gradient(90deg, #000 var(--bx-wipe), transparent calc(var(--bx-wipe) + 25%));
}
.bx-hero-video .yt_facade {
    border-radius: 24px;
    box-shadow: 0 40px 80px -24px rgba(10, 44, 66, .45), 0 0 0 1px rgba(10, 44, 66, .06);
}

/* ---------- Piezas comunes ---------- */
.bx-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: #125781;
}
.bx-hero .bx-eyebrow {
    padding: 7px 16px; border-radius: 999px; background: #fff;
    box-shadow: 0 1px 2px rgba(10, 44, 66, .06), 0 0 0 1px #e1edf6;
    letter-spacing: .04em; text-transform: none; font-size: 14px;
}
/* En móvil la etiqueta del hero («Plataforma ITS SaaS para transporte
   público») no se muestra, pero se oculta solo visualmente: el texto sigue
   en el HTML para Google (índice móvil) y para los lectores de pantalla. */
@media (max-width: 767px) {
    .bx-hero .bx-eyebrow {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .bx-hero h1 { margin-top: 0; }
}
.bx-eyebrow--dark { color: #F0884A; }   /* mismo naranja que el resto de la web */
.bx-dot { width: 8px; height: 8px; border-radius: 50%; background: #F0884A; box-shadow: 0 0 0 4px rgba(240, 136, 74, .16); }

.bx-chip {
    display: inline-flex; align-items: center;
    padding: 6px 14px; border-radius: 999px;
    background: #fff; color: #125781; font-size: 14px; font-weight: 500;
    box-shadow: 0 0 0 1px #e1edf6;
}
.bx-chip--link { transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
/* Chip con punto naranja (hero). */
.bx-chip--dot::before {
    content: "";
    flex: none;
    width: 6px; height: 6px; margin-right: 7px; border-radius: 50%;
    background: #F0884A;
    box-shadow: 0 0 0 3px rgba(240, 136, 74, .16);
}
/* Móvil: dos filas de tres bloques del mismo ancho, en el espacio de una
   sola línea de chips. .bx .bx-chips gana a la utilidad tw-flex. */
@media (max-width: 639px) {
    .bx .bx-chips {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        max-width: 360px;
    }
    .bx .bx-chips .bx-chip {
        justify-content: center;
        padding: 7px 6px;
        font-size: 13px;
        white-space: nowrap;
    }
}
.bx-chip--link:hover { background: #125781; color: #fff; box-shadow: 0 0 0 1px #125781; }

.bx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 28px; border-radius: 999px;
    font-size: 16px; font-weight: 600; line-height: 1;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
}
.bx-btn:hover { transform: translateY(-1px); }
.bx-btn:focus-visible, .bx-link:focus-visible, .bx-chip--link:focus-visible { outline: 3px solid #F0884A; outline-offset: 3px; }
.bx-btn--primary { background: #F0884A; color: #fff; box-shadow: 0 12px 28px -10px rgba(240, 136, 74, .65); }
.bx-btn--primary:hover { background: #de7438; color: #fff; }
.bx-btn--ghost { background: #fff; color: #125781; box-shadow: 0 0 0 1px #c3d9ea; }
.bx-btn--ghost:hover { color: #0f4d72; box-shadow: 0 0 0 1px #1a6f9e; }
.bx-btn--light { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.bx-btn--light:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.bx-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 16px; font-weight: 600; color: #125781;
}
.bx-link svg { transition: transform .2s ease; }
.bx-link:hover { color: #0f4d72; }
.bx-link:hover svg { transform: translateX(3px); }
.bx-link--light, .bx-link--light:hover { color: #fff; }

/* Capturas y fotos: marco redondeado y sombra profunda. */
.bx-shot {
    overflow: hidden;
    box-shadow: 0 30px 60px -28px rgba(10, 44, 66, .45), 0 0 0 1px rgba(10, 44, 66, .06);
}
.bx-dark .bx-shot { box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08); }
/* Las imágenes de la home van sin visor: <picture> en bloque para que no
   quede la línea de base bajo la foto dentro de los marcos redondeados. */
.bx picture { display: block; }
.bx picture img { display: block; width: 100%; height: auto; }

.bx-avatar {
    overflow: hidden;
    box-shadow: 0 0 0 4px #fff, 0 12px 26px -12px rgba(10, 44, 66, .45);
    transition: box-shadow .35s ease, transform .35s cubic-bezier(.22, 1, .36, 1);
}
/* Equipo: al pasar el cursor por una persona, el borde del círculo se
   ilumina en el naranja de la web (con un halo suave) y la foto sube un poco.
   Solo con ratón: en pantallas táctiles el :hover se quedaría pegado. */
@media (hover: hover) and (pointer: fine) {
    .bx-persona { cursor: default; }
    .bx-persona:hover .bx-avatar {
        transform: translateY(-4px);
        box-shadow: 0 0 0 4px #F0884A, 0 0 0 9px rgba(240, 136, 74, .22), 0 16px 32px -12px rgba(240, 136, 74, .55);
    }
}
.bx-avatar picture, .bx-avatar picture img { width: 100%; height: 100%; object-fit: cover; }

.bx-card { transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease; }
.bx-card:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -24px rgba(10, 44, 66, .35); }

/* ---------- Slide de fotos (bloque de videovigilancia) ----------
   En todos los tamaños: una foto a todo el ancho, con imán; cambia sola
   (ver home-its.js, «Slide»). Formato 16:10, el mismo hueco que ocupaba la
   imagen anterior; las fotos de 4:3 se ajustan con object-fit. */
.bx .bx-fotos {
    position: relative;
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    aspect-ratio: 16 / 10;
    background: #f1f1f0;
    -webkit-overflow-scrolling: touch;
}
.bx .bx-fotos::-webkit-scrollbar { display: none; }
.bx .bx-fotos > .bx-foto {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}
.bx .bx-fotos picture,
.bx .bx-fotos picture img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Slide en móvil (tarjetas del ecosistema) ----------
   Por debajo de 768 px la rejilla pasa a ser una fila con desplazamiento
   horizontal e imán (scroll-snap): cada tarjeta ocupa el 86 % y asoma la
   siguiente, para que se entienda que se puede deslizar. .bx .bx-slider
   para ganar a la utilidad tw-grid de Tailwind. */
@media (max-width: 767px) {
    .bx .bx-slider {
        position: relative;
        display: flex;
        gap: 14px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 20px;
        margin-inline: -20px;
        padding: 6px 20px 14px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .bx .bx-slider::-webkit-scrollbar { display: none; }
    .bx .bx-slider > * {
        flex: 0 0 86%;
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }
    .bx .bx-slider .bx-card:hover { transform: none; box-shadow: none; }
}

/* ---------- Puntos de los slides ----------
   Comunes a los dos slides. El de las tarjetas solo se ve en móvil
   (md:tw-hidden en el marcado); el de las fotos, siempre. */
.bx-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}
.bx-dot-btn {
    position: relative;
    width: 28px;
    height: 28px;            /* área táctil cómoda; el punto se dibuja dentro */
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width .35s cubic-bezier(.22, 1, .36, 1);
}
.bx-dot-btn span {
    position: relative;
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #c3d9ea;
    overflow: hidden;
    transition: width .35s cubic-bezier(.22, 1, .36, 1), background .3s ease;
}
.bx-dot-btn:hover span { background: #a9c7dc; }
.bx-dot-btn.is-on { width: 44px; }
.bx-dot-btn.is-on span { width: 36px; background: #c3d9ea; }
/* Relleno del punto activo: se llena durante lo que dura cada paso del slide
   (--bx-paso, lo fija el JS: 3 s las tarjetas, 2 s las fotos) mientras avanza
   solo; quieto y lleno cuando el usuario manda. */
.bx-dot-btn.is-on span::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: #125781;
    transform-origin: left center;
}
.bx-dots.is-playing .bx-dot-btn.is-on span::after { animation: bx-dot-fill var(--bx-paso, 3s) linear forwards; }
.bx-dot-btn:focus-visible { outline: 3px solid #F0884A; outline-offset: 2px; border-radius: 999px; }
@keyframes bx-dot-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Sección oscura (nube) ---------- */
.bx-dark {
    background:
        radial-gradient(60% 60% at 15% 20%, rgba(26, 111, 158, .45), transparent 70%),
        radial-gradient(50% 50% at 90% 90%, rgba(240, 136, 74, .12), transparent 70%),
        #0a2c42;
}

/* ---------- Logos de clientes en bucle ---------- */
.bx-marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.bx-marquee-track { display: flex; width: max-content; animation: bx-marquee 55s linear infinite; }
.bx-marquee:hover .bx-marquee-track { animation-play-state: paused; }
.bx-marquee-list { display: flex; align-items: center; gap: 56px; margin: 0; padding: 0 28px; list-style: none; }
.bx-marquee-list li { flex: none; }
.bx-marquee-list img {
    display: block; width: auto; height: 46px; max-width: 150px; object-fit: contain;
    filter: grayscale(1); opacity: .7; mix-blend-mode: multiply;
    transition: filter .3s ease, opacity .3s ease;
}
.bx-marquee-list img:hover { filter: none; opacity: 1; }
@keyframes bx-marquee { to { transform: translateX(-50%); } }

/* ---------- Preguntas ---------- */
.bx-faq summary { list-style: none; }
.bx-faq summary::-webkit-details-marker { display: none; }
.bx-faq-ico svg { transition: transform .3s ease; }
.bx-faq[open] .bx-faq-ico svg { transform: rotate(180deg); }
.bx-faq summary:focus-visible { outline: 3px solid #F0884A; outline-offset: 4px; border-radius: 8px; }

/* ---------- Paso a paso: bullets desplegables ----------
   Una línea fina une los iconos de arriba abajo (progresión sin números).
   La línea va en cada paso menos el último, del icono al siguiente. */
.bx-paso { position: relative; }
.bx-paso:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;               /* centro del icono de 28 px */
    top: 42px;
    bottom: -8px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(240, 136, 74, .55), rgba(240, 136, 74, .15));
}
.bx-paso summary { list-style: none; -webkit-tap-highlight-color: transparent; }
.bx-paso summary::-webkit-details-marker { display: none; }
.bx-paso-ico { box-shadow: 0 0 0 5px rgba(240, 136, 74, .14); }
.bx-paso-flecha { transition: background .2s ease; }
.bx-paso-flecha svg { transition: transform .3s ease; }
.bx-paso summary:hover .bx-paso-flecha { background: #e1edf6; }
.bx-paso[open] .bx-paso-flecha svg { transform: rotate(180deg); }
.bx-paso summary:focus-visible { outline: 3px solid #F0884A; outline-offset: 4px; border-radius: 10px; }
.bx-paso[open] > p { animation: bx-paso-abre .35s ease; }
@keyframes bx-paso-abre { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bx-paso[open] > p { animation: none; } }

/* ---------- Llamada final ---------- */
.bx-cta {
    background:
        radial-gradient(60% 80% at 10% 0%, rgba(47, 143, 196, .55), transparent 70%),
        radial-gradient(50% 70% at 100% 100%, rgba(240, 136, 74, .28), transparent 70%),
        linear-gradient(135deg, #125781, #0a2c42);
}

/* ---------- Estado inicial de las animaciones (lo pone el <head>) ---------- */
.bx-js [data-hero],
.bx-js [data-hero-video],
.bx-js [data-anim],
.bx-js [data-seq-item],
.bx-js [data-cascada-item] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .bx-marquee-track { animation: none; }
    .bx-marquee { overflow-x: auto; }
    .bx-btn:hover, .bx-card:hover { transform: none; }
}
