/* ==========================================================================
   MARCA 2026 (08-11-2026): piezas comunes del rediseño de la home, para otras páginas
   (de momento /api-empresas). Copiadas de home-hero.css; la home sigue usando la suya.
   Botones .hx-b, haces del hero, barra fija en móvil, pie, productos del pie,
   cabecera fija en escritorio, conectores entre secciones, foco con teclado y chat.
   ========================================================================== */

.hx-beams { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
    -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 25%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 65% at 50% 30%, #000 25%, transparent 75%); }
.hx-beams i { position: absolute; display: block; }
.hx-beams .h { height: 1px; width: 220px; left: -240px; background: linear-gradient(90deg, transparent, rgba(147, 197, 253, .9), transparent); animation: hxBeamX 9s linear infinite; }
.hx-beams .v { width: 1px; height: 200px; top: -220px; background: linear-gradient(180deg, transparent, rgba(110, 231, 183, .8), transparent); animation: hxBeamY 11s linear infinite; }
.hx-beams .h1 { top: 167px; animation-delay: 0s; }
.hx-beams .h2 { top: 335px; animation-delay: 4.5s; animation-duration: 12s; }
.hx-beams .v1 { left: calc(50% - 392px); animation-delay: 2s; }
.hx-beams .v2 { left: calc(50% + 336px); animation-delay: 7s; animation-duration: 13s; }
@keyframes hxBeamX { to { transform: translateX(calc(100vw + 480px)); } }
@keyframes hxBeamY { to { transform: translateY(900px); } }
@media (prefers-reduced-motion: reduce) { .hx-beams { display: none; } }

.hx-b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s, color .15s;
}
.hx-b--pri {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 0 0 1px rgba(96, 165, 250, .4), 0 12px 32px -10px rgba(59, 130, 246, .95);
}
.hx-b--pri:hover { background: #3b82f6; color: #fff; transform: translateY(-1px); }
.hx-b--pri:disabled { opacity: .7; cursor: progress; transform: none; }
.hx-b--glass {
    background: rgba(255, 255, 255, .05);
    color: #e6edfa;
    border-color: rgba(147, 197, 253, .25);
    backdrop-filter: blur(6px);
}
.hx-b--glass:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(147, 197, 253, .45); }
.hx-b:focus-visible { outline: 3px solid rgba(147, 197, 253, .6); outline-offset: 2px; }

/* Ámbar = registrarse (08-11-2026). Mismo degradado que «Crear cuenta gratis» de la cabecera
   (styles.css .btn_header--primary). Solo sobre fondos oscuros; el texto va en azul marino. */
.hx-b--amber {
    background: linear-gradient(135deg, #facc15 0%, #f97316 100%);
    color: #0b1020;
    font-weight: 700;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 12px 28px -10px rgba(249, 115, 22, .65);
}
.hx-b--amber:hover { background: linear-gradient(135deg, #eab308 0%, #ea580c 100%); color: #0b1020; transform: translateY(-1px); }
.hx-b--amber:focus-visible { outline: 3px solid rgba(250, 204, 21, .6); outline-offset: 2px; }

/* ==========================================================================
   BARRA FIJA EN MÓVIL (#mSticky) — 08-11-2026
   Solo por debajo de 720 px. Clase .on la pone el script del final de home.php.
   ========================================================================== */
.msticky { display: none; }
@media (max-width: 720px) {
    .msticky {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 900;
        padding: 10px 10px 10px 16px; border-radius: 16px;
        background: rgba(20, 51, 125, .94);
        border: 1px solid rgba(147, 197, 253, .3);
        box-shadow: 0 18px 40px -14px rgba(11, 26, 71, .7);
        -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
        transform: translateY(140%); opacity: 0;
        transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .3s;
    }
    .msticky.on { transform: none; opacity: 1; }
    .msticky-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
    .msticky-txt b { color: #fff; font-size: 14px; font-weight: 700; }
    .msticky-txt span { color: #a3b3d1; font-size: 11.5px; font-family: 'JetBrains Mono', Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .msticky .hx-b { flex: 0 0 auto; height: 44px; padding: 0 16px; font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .msticky { transition: none; } }


/* ==========================================================================
   PIE (partials/footer) — 08-11-2026, SOLO EN LA HOME.
   El partial lo usa toda la web: aquí solo se le cambia el aspecto con
   selectores "html body footer …" (ganan a su <style> inline y a styles.css).
   No se quita ni se mueve ningún enlace del HTML; solo se reordena visualmente
   (marca arriba) con flex "order".
   ========================================================================== */
html body footer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 72px 0 32px !important;
    background:
        radial-gradient(800px 320px at 50% 0%, rgba(59, 130, 246, .22), transparent 70%),
        radial-gradient(520px 320px at 100% 100%, rgba(16, 185, 129, .1), transparent 70%),
        linear-gradient(180deg, #102a6b 0%, #0b1f56 100%) !important;
    border-top: 0 !important;
}
html body footer::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(147, 197, 253, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(147, 197, 253, .06) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 15%, transparent 75%);
}
html body footer::after {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, #93c5fd, #6ee7b7, transparent);
}
html body footer > .container { display: flex; flex-direction: column; }

/* Marca arriba, como una franja de presentación */
html body footer .pf-brandbar {
    order: -1;
    margin: 0 0 44px; padding: 0 0 32px;
    border-top: 0; border-bottom: 1px solid rgba(147, 197, 253, .14);
}
html body footer .pf-brandbar .brand-name { font-size: 1.15rem; }
html body footer .pf-brandbar .brand-tag { color: #93a6cc; }
html body footer .pf-brandbar .foot-desc { color: #a3b3d1; font-size: .88rem; border-left-color: rgba(147, 197, 253, .18); }
html body footer .pf-status {
    gap: 9px; padding: 8px 14px; border-radius: 999px;
    color: #e6edfa; font-size: .85rem; font-weight: 600;
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(147, 197, 253, .25);
    transition: background .15s, border-color .15s;
}
html body footer .pf-status:hover { background: rgba(255, 255, 255, .1); border-color: rgba(147, 197, 253, .45); color: #fff; }
html body footer .pf-dot { animation: hxPulse 2.4s ease-in-out infinite; }

/* Columnas principales */
html body footer .pf-main { margin-bottom: 36px; row-gap: 32px; }
html body footer .pf-main .foot-title,
html body footer .pf-seo-grid h5 {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 14px;
    font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11.5px; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; color: #6ee7b7; opacity: 1;
}
html body footer .pf-main .foot-links a {
    position: relative; font-size: .9rem; padding: 6px 0; color: #c7d4ee;
    transition: color .15s;
}
html body footer .pf-main .foot-links a:hover { color: #fff; transform: none; }
html body footer .pf-main .foot-links a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 3px; height: 1px;
    background: linear-gradient(90deg, #93c5fd, #6ee7b7); transform: scaleX(0); transform-origin: left; transition: transform .2s;
}
html body footer .pf-main .foot-links a:hover::after { transform: scaleX(1); }

/* Informes por zona y sector: franja secundaria en un panel de cristal */
html body footer .pf-seo {
    padding: 26px 28px 18px; border-top: 0;
    border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(147, 197, 253, .12);
}
html body footer .pf-seo-grid h5 { color: #93a6cc; }
html body footer .pf-seo .foot-links a { font-size: .84rem; color: #a3b3d1; padding: 4px 0; }
html body footer .pf-seo .foot-links a:hover { color: #fff; transform: none; }

/* Línea final */
html body footer .pf-bottom { margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(147, 197, 253, .12); }
html body footer .pf-legal { color: #8798ba; }
html body footer .pf-legal a { color: #b4c2dd; }
html body footer .pf-legal a:hover { color: #fff; }
html body footer .pf-badge { color: #d6e2fa; background: rgba(16, 185, 129, .08); border-color: rgba(110, 231, 183, .25); }
html body footer .pf-badge svg { color: #6ee7b7; }
html body footer .pf-trust img { opacity: .75; filter: grayscale(1) brightness(1.6); }

@media (max-width: 640px) {
    html body footer { padding: 52px 0 28px !important; }
    html body footer .pf-brandbar { margin-bottom: 32px; padding-bottom: 24px; }
    html body footer .pf-seo { padding: 20px 18px 12px; }
}
@media (prefers-reduced-motion: reduce) { html body footer .pf-dot { animation: none; } }

/* ---- Pie: productos destacados con icono cuadrado (08-11-2026, solo home: $pieProductos) ---- */
html body footer .pf-prod { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 6px 0 34px; }
html body footer .pf-prod-card { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 16px; text-decoration: none; color: #e2e8f0; background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.1); transition: translate .2s, border-color .2s, background .2s, box-shadow .2s; }
html body footer .pf-prod-card::after { display: none !important; }
html body footer .pf-prod-card:hover { translate: 0 -3px; border-color: rgba(125,211,252,.4); background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.04)); box-shadow: 0 16px 34px -20px rgba(0,0,0,.7); }
html body footer .pf-prod-ic { flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 18px -10px rgba(0,0,0,.6); }
html body footer .pf-prod--riesgo .pf-prod-ic { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
html body footer .pf-prod--gemelos .pf-prod-ic { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
html body footer .pf-prod--vertice .pf-prod-ic { background: linear-gradient(135deg, #fb923c, #ea580c); }
html body footer .pf-prod--vendor .pf-prod-ic { background: linear-gradient(135deg, #34d399, #047857); }
html body footer .pf-prod-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
html body footer .pf-prod-txt b { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .97rem; font-weight: 800; color: #fff; letter-spacing: -.01em; }
html body footer .pf-prod-txt b i { font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: rgba(110,231,183,.16); color: #6ee7b7; border: 1px solid rgba(110,231,183,.3); }
html body footer .pf-prod-txt b em { font-style: normal; color: #93c5fd; font-weight: 700; }
html body footer .pf-prod-txt small { font-size: .82rem; line-height: 1.45; color: #a9b8d6; }
@media (max-width: 1100px) { html body footer .pf-prod { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { html body footer .pf-prod { grid-template-columns: 1fr; gap: 10px; } html body footer .pf-prod-card { padding: 14px; } }


/* ---- Mejoras 1–4 (08-11-2026) ---- */
/* 1) Pie en desplegables en móvil (el script de home.php mete un botón dentro de cada título) */
footer .pf-acc { all: unset; display: flex; align-items: center; justify-content: space-between; width: 100%; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
footer .pf-acc svg { flex-shrink: 0; transition: transform .2s; opacity: .8; }
footer .pf-acc:focus-visible { outline: 2px solid #6ee7b7; outline-offset: 4px; border-radius: 4px; }
@media (max-width: 760px) {
  html body footer .pf-main, html body footer .pf-seo-grid { row-gap: 0 !important; }
  html body footer .pf-col { border-bottom: 1px solid rgba(255, 255, 255, .08); }
  html body footer .pf-col > .foot-title, html body footer .pf-col > h5 { margin: 0 !important; }
  html body footer .pf-col .pf-acc { padding: 16px 2px; }
  html body footer .pf-col.is-closed > ul { display: none !important; }
  html body footer .pf-col:not(.is-closed) > ul { padding-bottom: 14px; }
  html body footer .pf-col:not(.is-closed) .pf-acc svg { transform: rotate(180deg); }
  html body footer .pf-seo { padding-top: 8px !important; }
}

/* ---- Cabecera fija y compacta en escritorio (08-11-2026, script al final de home.php) ---- */
.hdr-hueco { display: none; }
@media (min-width: 1025px) {
  html { scroll-padding-top: 76px; }
  html.hx-hdr-fija .hdr-hueco { display: block; height: var(--hdr-alto, 107px); }
  html.hx-hdr-fija header.main-site-header {
    position: fixed !important; top: 0; left: 0; right: 0;
    background: linear-gradient(180deg, rgba(19, 58, 130, .9), rgba(11, 34, 84, .92)) !important;
    -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 0 12px 32px -14px rgba(2, 8, 30, .6);
    animation: hdrEntra .3s cubic-bezier(.2, .8, .2, 1);
  }
  html.hx-hdr-fija header.main-site-header .ae-subbar { display: none !important; }
  html.hx-hdr-fija header.main-site-header .container.nav { padding-top: 9px; padding-bottom: 9px; }
}
@keyframes hdrEntra { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { html.hx-hdr-fija header.main-site-header { animation: none; } }

/* ---- Conectores entre secciones (08-11-2026, prueba: $transiciones en home.php) ---- */
/* Va justo en el corte (alto 0): línea de luz, resplandor solo hacia el lado oscuro, trazo vertical y nodo con icono. */
.tx { position: relative; z-index: 6; height: 0; pointer-events: none; }
.tx > span { position: absolute; left: 50%; display: block; }
.tx-line { left: 0 !important; right: 0; top: -.5px; height: 1px;
  background: linear-gradient(90deg, transparent 4%, rgba(96,165,250,.35) 22%, rgba(110,231,183,.9) 50%, rgba(96,165,250,.35) 78%, transparent 96%); }
.tx-glow { width: min(900px, 90vw); height: 140px; transform: translateX(-50%);
  background: radial-gradient(50% 100% at 50% var(--g, 100%), rgba(59,130,246,.38), rgba(16,185,129,.08) 55%, transparent 75%); }
.tx--baja .tx-glow { bottom: 0; --g: 100%; }
.tx--sube .tx-glow { top: 0; --g: 0%; }
.tx-stem { width: 1px; height: 120px; top: -60px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(110,231,183,.7) 40%, rgba(96,165,250,.7) 60%, transparent); }
.tx--baja .tx-stem { background: linear-gradient(180deg, transparent, rgba(110,231,183,.8) 45%, rgba(37,99,235,.35) 55%, transparent); }
.tx--sube .tx-stem { background: linear-gradient(180deg, transparent, rgba(37,99,235,.35) 45%, rgba(110,231,183,.8) 55%, transparent); }
.tx-node { top: 0; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 13px;
  display: grid !important; place-items: center; color: #2563eb; background: #fff;
  border: 1px solid #dbe4f3;
  box-shadow: 0 0 0 6px rgba(255,255,255,.06), 0 0 28px rgba(96,165,250,.45), 0 12px 24px -12px rgba(11,31,77,.45); }
.tx-node::after { content: ""; position: absolute; inset: -7px; border-radius: 17px; border: 1px solid rgba(147,197,253,.35); }
@media (max-width: 760px) {
  .tx-glow { height: 90px; }
  .tx-stem { height: 80px; top: -40px; }
  .tx-node { width: 38px; height: 38px; border-radius: 11px; }
  .tx-node svg { width: 16px; height: 16px; }
}
html body:has(.tx) footer::after { display: none; } /* la línea de luz del pie la pone ya la transición */
/* Final del hero en curva suave (08-11-2026): 36 px de flecha en escritorio, 16 px en móvil */
.tx--curva { height: 36px; margin-top: -36px; }
.tx--curva > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.tx--curva .tx-c-brillo { filter: blur(6px); opacity: .85; }
.tx--curva .tx-node { top: 100%; }
@media (max-width: 760px) {
  .tx--curva { height: 16px; margin-top: -16px; }
  .tx--curva .tx-c-brillo { filter: blur(4px); }

/* Foco visible con teclado */
main :is(a, button, summary, [tabindex]):focus-visible, footer :is(a, button, summary):focus-visible, header.main-site-header :is(a, button):focus-visible { outline: 2px solid #2563eb !important; outline-offset: 3px; border-radius: 8px; }
footer :is(a, button, summary):focus-visible, header.main-site-header :is(a, button):focus-visible, .m26-dark :is(a, button, summary, [tabindex]):focus-visible { outline-color: #6ee7b7 !important; }
/* Chat: abajo a la derecha; en móvil sube cuando aparece la barra fija */
#ai-chat-container #chat-toggle { margin-left: auto; background: linear-gradient(135deg, #2563eb, #1e40af); box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 12px 26px -8px rgba(2, 8, 30, .65); }
@media (max-width: 760px) {
  #ai-chat-container { right: 16px; bottom: 20px; transition: bottom .25s ease; }
  body:has(#mSticky.on) #ai-chat-container { bottom: 96px; }
}
main :is(h1, h2, h3), footer :is(h4, h5) { text-wrap: balance; }
main p { text-wrap: pretty; }

@keyframes hxPulse { 50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, .05); } }
#json-modal { z-index: 10050 !important; } /* por encima de la cabecera (z 10001), que tapaba la parte de arriba de la ventana del JSON */
