/* Barra superior v4.
   Idea: la marca al centro y la navegación partida en dos lados con jerarquía propia.
   A la izquierda, lo que Liberty ofrece (Productos, Soluciones, Clientes). A la derecha, quiénes somos y cómo hablar
   (Empresa, el agente, la demo). Los grupos abren paneles con contenido, no listas sueltas de links. */

.site-header { position: sticky; top: 0; z-index: 60; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); border: 0; background: none; transition: none; }
.site-header.scrolled { background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }

.hd {
  position: relative; max-width: 1240px; margin: 0 auto; height: 68px; padding: 0 10px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  border-radius: 20px; border: 1px solid transparent;
  transition: height .45s cubic-bezier(.16,1,.3,1), background-color .35s, border-color .35s, box-shadow .35s;
}
.site-header.scrolled .hd, .site-header.menu-open .hd {
  height: 58px; background: var(--glass-bg); border-color: var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 22px 44px -30px rgb(15 30 61 / .45);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
}

/* Marca */
.hd-brand { display: block; padding: 6px 12px; border-radius: 14px; text-decoration: none; }
.lt-brand { display: block; height: 50px; width: auto; overflow: visible; transition: height .45s cubic-bezier(.16,1,.3,1); }
.scrolled .lt-brand { height: 40px; }
.lt-brand .b-word { fill: var(--ink); }
.lt-brand .b-gulls { fill: var(--accent); transition: transform .6s cubic-bezier(.16,1,.3,1); transform-box: fill-box; transform-origin: 30% 80%; }
.hd-brand:hover .b-gulls, .foot-brand:hover .b-gulls { transform: translate(5%, -14%) rotate(-3deg); }

/* Lados */
.hd-left { justify-self: start; display: flex; align-items: center; gap: 2px; }
.hd-right { justify-self: end; display: flex; align-items: center; gap: 6px; }
.hd-item { position: static; }
.hd-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px;
  font: 600 1rem/1 var(--body); color: var(--ink-2); background: none; border: 0; cursor: pointer; text-decoration: none;
  transition: color .25s, background-color .25s;
}
.hd-link:hover, .hd-item.open > .hd-link { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.hd-link.is-current, .hd-link[aria-current="page"] { color: var(--ink); }
.hd-link.is-current::after, .hd-link[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); }
.chev { width: 7px; height: 7px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .35s cubic-bezier(.16,1,.3,1); }
.hd-item.open .chev { transform: translateY(1px) rotate(-135deg); }

/* Acciones: un solo grupo. La demo es la acción principal; el agente, la alternativa inmediata. */
.hd-actions {
  display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 15px;
  background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid var(--glass-line);
}
.hd-agent {
  position: relative; display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; border-radius: 11px; text-decoration: none;
  font: 600 .98rem/1 var(--body); color: var(--ink-2); transition: color .25s, background-color .25s;
}
.hd-agent:hover, .hd-agent[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgb(15 30 61 / .08); }
.live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #1FB76A; flex: none; }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #1FB76A; opacity: 0; animation: live 2.2s ease-out infinite; }
@keyframes live { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.hd-cta { height: 40px; padding: 0 18px; font-size: .96rem; border-radius: 11px; box-shadow: 0 8px 18px -12px var(--accent); }
.hd-left .hd-link { font-weight: 600; }

/* Paneles */
.hd-panel {
  position: absolute; top: calc(100% + 10px); left: 50%; width: min(560px, calc(100vw - 32px));
  transform: translate(-50%, 10px); opacity: 0; visibility: hidden; pointer-events: none;
  padding: 14px; border-radius: 20px; border: 1px solid var(--glass-line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 34px 70px -34px rgb(15 30 61 / .5);
  transition: opacity .3s ease, transform .45s cubic-bezier(.16,1,.3,1), visibility 0s .3s;
}
.hd-panel.wide { width: min(900px, calc(100vw - 32px)); padding: 16px; }
.hd-item.open .hd-panel { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition-delay: 0s; }
.hd-panel > * > * { opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .5s cubic-bezier(.16,1,.3,1); }
.hd-item.open .hd-panel > * > * { opacity: 1; transform: none; }
.hd-item.open .hd-panel > * > :nth-child(2) { transition-delay: .04s; }
.hd-item.open .hd-panel > * > :nth-child(3) { transition-delay: .08s; }
.hd-item.open .hd-panel > * > :nth-child(4) { transition-delay: .12s; }
.hd-item.open .hd-panel > * > :nth-child(5) { transition-delay: .16s; }

.pn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pn-prod { display: grid; gap: 12px; padding: 12px 12px 16px; border-radius: 14px; text-decoration: none; color: var(--ink-2); font-size: .95rem; transition: background-color .25s, transform .4s cubic-bezier(.16,1,.3,1); }
.pn-prod:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); transform: translateY(-2px); }
.pn-logo { display: grid; place-items: center; height: 84px; border-radius: 12px; background: #fff; border: 1px solid rgb(15 30 61 / .06); transition: box-shadow .3s; }
.pn-prod:hover .pn-logo { box-shadow: 0 16px 30px -20px rgb(15 30 61 / .45); }
.pn-logo img { height: 40px; width: auto; max-width: 78%; object-fit: contain; }
.pn-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 12px 12px 4px; border-top: 1px solid var(--line); }
.pn-label { font-size: .9rem; line-height: 40px; color: var(--ink-2); margin-right: 6px; }
.pn-chip { display: inline-grid; place-items: center; width: 112px; height: 40px; padding: 0 10px; border-radius: 10px; background: #fff; border: 1px solid rgb(15 30 61 / .06); }
/* los logos tienen la gaviota arriba y la palabra abajo: se suben un poco para que la palabra quede al centro del botón */
.pn-chip img { height: 22px; width: auto; transform: translateY(-3.5px); }
.pn-foot .link { margin-left: auto; padding: 9px 14px; font-size: .92rem; }
.pn-list { display: grid; gap: 2px; }
.pn-row { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; text-decoration: none; transition: background-color .25s, padding-left .35s cubic-bezier(.16,1,.3,1); }
.pn-row b { font: 700 1.02rem var(--head); color: var(--ink); }
.pn-row span { font-size: .92rem; color: var(--ink-2); }
.pn-row:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); padding-left: 20px; }

/* Botón de menú (móvil) */
.menu-btn { display: none; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--glass-line); background: var(--glass-bg); color: var(--ink); cursor: pointer; position: relative; }
.menu-btn b { font: 700 .98rem var(--head); }
.menu-btn span { position: absolute; left: 14px; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .35s cubic-bezier(.16,1,.3,1); }
.menu-btn span:first-child { transform: translateY(-4px); }
.menu-btn span:nth-child(2) { transform: translateY(4px); }
.menu-btn b { margin-left: 24px; }
.menu-open .menu-btn span:first-child { transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { transform: rotate(-45deg); }

.hd-sheet { display: none; }

/* Pie: misma marca */
.foot-brand { display: inline-block; text-decoration: none; }
.foot-brand .lt-brand { height: 40px; }

/* WhatsApp de acceso rápido */
.wa-float {
  position: fixed; z-index: 70; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 0; height: 56px; padding: 0 16px; border-radius: 28px; text-decoration: none;
  background: #1FA855; color: #fff; box-shadow: 0 16px 34px -14px rgb(31 168 85 / .7), 0 2px 6px rgb(0 0 0 / .15);
  transition: gap .4s cubic-bezier(.16,1,.3,1), transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s;
}
.wa-float svg { width: 24px; height: 24px; flex: none; }
.wa-float span { max-width: 0; overflow: hidden; white-space: nowrap; font: 700 .98rem var(--head); transition: max-width .45s cubic-bezier(.16,1,.3,1); }
.wa-float:hover, .wa-float:focus-visible { gap: 10px; transform: translateY(-2px); }
.wa-float:hover span, .wa-float:focus-visible span { max-width: 120px; }
.js .wa-float { opacity: 0; transform: translateY(16px) scale(.9); }
body.ready .wa-float { opacity: 1; transform: none; transition: opacity .5s .9s, transform .6s .9s cubic-bezier(.16,1,.3,1), gap .4s cubic-bezier(.16,1,.3,1), box-shadow .35s; }
body.ready .wa-float:hover { transform: translateY(-2px); transition: gap .4s cubic-bezier(.16,1,.3,1), transform .35s cubic-bezier(.16,1,.3,1); }

@media (max-width: 1080px) {
  .hd { grid-template-columns: auto minmax(0, 1fr); padding: 0 8px 0 4px; }
  .hd-left, .hd-right .hd-cta { display: none; }
  .hd-actions { background: none; border: 0; padding: 0; }
  .hd-agent { color: var(--ink); border: 1.5px solid var(--glass-line); background: var(--glass-bg); }
  .hd-brand { grid-column: 1; grid-row: 1; padding-left: 8px; }
  .hd-right { grid-column: 2; grid-row: 1; }
  .menu-btn { display: inline-flex; }
  .hd-agent { padding: 0 13px; height: 44px; font-weight: 700; }
  .hd-sheet {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: calc(100dvh - 100px); overflow: auto;
    padding: 18px 18px 22px; border-radius: 20px; border: 1px solid var(--glass-line);
    background: color-mix(in srgb, var(--surface) 97%, transparent); box-shadow: 0 34px 70px -34px rgb(15 30 61 / .5);
    opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .4s cubic-bezier(.16,1,.3,1);
  }
  .hd-sheet.open { display: block; }
  .menu-open .hd-sheet.open { opacity: 1; transform: none; }
  .sh-label { font: 600 .85rem var(--body); color: var(--ink-2); margin: 14px 4px 8px; }
  .sh-label:first-child { margin-top: 2px; }
  .sh-prods { display: grid; gap: 8px; }
  .sh-prods a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid rgb(15 30 61 / .06); text-decoration: none; }
  .sh-prods img { height: 24px; width: auto; }
  .sh-prods small { color: #4A5067; font-size: .88rem; text-align: right; }
  .sh-links { display: grid; }
  .sh-links a { padding: 13px 6px; border-bottom: 1px solid var(--line); text-decoration: none; font: 700 1.08rem var(--head); color: var(--ink); }
  .sh-actions { display: grid; gap: 10px; margin-top: 18px; }
  .sh-actions .btn { justify-content: center; }
  .site-header.menu-open .hd { border-radius: 20px; }
}
@media (max-width: 560px) {
  .lt-brand { height: 34px; }
  .scrolled .lt-brand { height: 30px; }
  .hd-agent { font-size: .95rem; }
  .menu-btn b { display: none; }
  .menu-btn { width: 44px; padding: 0; justify-content: center; }
  .menu-btn span { left: 13px; }
  .wa-float { height: 52px; padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .live::after { animation: none; }
  .hd-panel, .hd-panel > * > *, .wa-float { transition: none; }
}

body.menu-open .wa-float { opacity: 0 !important; pointer-events: none; }

/* ===== v6: paneles anclados a su botón, con puente invisible para llegar con el cursor ===== */
.hd-item { position: relative; }
.hd-panel { left: -8px; top: calc(100% + 14px); transform: translateY(8px); width: min(560px, calc(100vw - 32px)); }
.hd-panel.wide { width: min(880px, calc(100vw - 48px)); }
.hd-item.open .hd-panel { transform: none; }
/* el puente cubre el espacio entre el botón y el panel: el cursor nunca "sale" al bajar */
.hd-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px; }
.hd-panel { background: #FFFFFF; border-color: #DCDFE7; box-shadow: 0 1px 2px rgb(15 30 61 / .06), 0 34px 70px -30px rgb(15 30 61 / .38); }

/* Legibilidad sobre blanco */
.hd-link { color: #2B2F42; font-weight: 600; }
.hd-link:hover, .hd-item.open > .hd-link { color: #0F1E3D; background: #F0F1F5; }
.hd-agent { color: #2B2F42; }
.hd-actions { background: #F3F4F7; border-color: #E2E4EB; }
.pn-prod { color: #3F4459; }
.pn-row span { color: #4A5067; }
.pn-label { color: #4A5067; }
.site-header.scrolled .hd { background: rgb(255 255 255 / .9); border-color: #E2E4EB; }
.pn-chip { transition: border-color .25s, transform .3s; } .pn-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
@media (min-width: 1081px) and (max-width: 1220px) { .hd-left .hd-link { padding-inline: 9px; font-size: .95rem; } .hd-left .hd-link .chev { margin-left: 4px; } }   /* con Soluciones en el menú: más aire antes del logo */
