/* ========================================
   FRANDE ONE ECF · IDENTIDAD DEL ECOSISTEMA
   Franja «Ecosistema Frande One», cabecera y pie de las páginas públicas
   (landing, términos, protección de datos). Réplica visual de la landing
   frandeone.com: tokens.css, header.css y el bloque «PIE DEL ECOSISTEMA» de base.css.
   Carga después de common.css y landing.css. Prefijo fo- para no chocar con
   .navbar / .footer heredados de landing.css.
   ======================================== */

:root {
  --fo-brand-blue: #25a1fb;
  --fo-brand-navy: #0f0d3f;

  --fo-font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --fo-font-body: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fo-font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --fo-radius-md: 10px;
  --fo-radius-lg: 16px;
  --fo-duration: 180ms;
  --fo-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fo-content-max: 1180px;
  --fo-header-h: 4.5rem;

  --fo-background: #f4f8fb;
  --fo-surface: #ffffff;
  --fo-foreground: #0f0d3f;
  --fo-foreground-secondary: #4b4969;
  --fo-border: #d6dfe6;
  --fo-primary: #0476c8;          /* blanco sobre #0476c8: 4,74:1 */
  --fo-primary-hover: #0364aa;
  --fo-primary-active: #035896;
  --fo-primary-soft: #e2f2fd;
  --fo-link: #0364aa;
  --fo-focus: #0364aa;
  --fo-header-bg: rgba(255, 255, 255, 0.94);
  --fo-header-glass: rgba(255, 255, 255, 0.7);
  --fo-shadow-lg: 0 24px 60px -20px rgba(15, 13, 63, 0.28);

  /* La paleta de la página se alinea con la del ecosistema (solo páginas públicas) */
  --ecf-font: var(--fo-font-body);
  --ecf-font-mono: var(--fo-font-mono);
  --ecf-primary: #0476c8;
  --ecf-primary-dark: #0364aa;
}

[data-theme="dark"] {
  --fo-surface: #161625;
  --fo-foreground: #e8e8f3;
  --fo-foreground-secondary: #b9b8cc;
  --fo-border: #333248;
  --fo-primary-soft: #193143;
  --fo-link: #6cc0fc;
  --fo-focus: #6cc0fc;
  --fo-header-bg: rgba(14, 13, 25, 0.96);
  --fo-header-glass: rgba(14, 13, 25, 0.72);
  --fo-shadow-lg: 0 28px 70px -24px rgba(0, 0, 0, 0.75);

  --ecf-primary: #6cc0fc;
  --ecf-primary-dark: #9fd3fd;
}

@media (prefers-reduced-motion: reduce) {
  :root { --fo-duration: 0ms; }
}

/* overflow-x:hidden (landing.css) crea un contenedor de scroll y anula el sticky; clip no */
html,
body {
  overflow-x: clip;
}

/* Los anclajes (#pricing, #faq…) no quedan debajo de la cabecera fija */
html {
  scroll-padding-top: calc(var(--fo-header-h) + 1rem);
}

h1, h2, h3,
.section-title {
  font-family: var(--fo-font-display);
  letter-spacing: -0.01em;
}

/* La cabecera ya no es fixed: el hero no necesita reservar su altura */
.hero {
  padding-top: 72px;
}

.fo-container {
  width: 100%;
  max-width: var(--fo-content-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 700px) {
  .fo-container { padding: 0 24px; }
}

.fo-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Saltar al contenido ---------- */
.fo-skip-link {
  position: absolute;
  top: 0;
  left: 0.5rem;
  transform: translateY(-120%);
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--fo-primary);
  color: #ffffff;
  font-family: var(--fo-font-body);
  font-weight: 600;
  border-radius: 0 0 var(--fo-radius-md) var(--fo-radius-md);
  text-decoration: none;
}

.fo-skip-link:focus,
.fo-skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid #ffffff;
  outline-offset: -5px;
  color: #ffffff;
}

/* =========================================================
   FRANJA «ECOSISTEMA FRANDE ONE» (arriba de todo, se va con el scroll)
   ========================================================= */
.eco-bar {
  position: relative;
  z-index: 1002;
  background: var(--fo-brand-navy);
  color: #e8e8f3;
  font-family: var(--fo-font-body);
  font-size: 0.8125rem;
}

.eco-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.eco-back,
.eco-products-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.6rem;
  margin: 0 -0.6rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e8e8f3;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.eco-back:hover,
.eco-products-toggle:hover,
.eco-products-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.eco-back svg,
.eco-products-toggle svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.eco-back-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--fo-brand-blue);
}

.eco-products-toggle svg {
  transition: transform var(--fo-duration) var(--fo-ease);
}

.eco-products-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.eco-back:focus-visible,
.eco-products-toggle:focus-visible {
  outline: 3px solid #6cc0fc;
  outline-offset: 2px;
}

.eco-products {
  position: relative;
}

.eco-products-panel {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: min(22rem, calc(100vw - 2rem));
  background: var(--fo-surface);
  border: 1px solid var(--fo-border);
  border-radius: var(--fo-radius-lg);
  box-shadow: var(--fo-shadow-lg);
  display: none;
}

.eco-products-toggle[aria-expanded="true"] + .eco-products-panel {
  display: grid;
  gap: 0.25rem;
}

.eco-products-panel a {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: var(--fo-radius-md);
  color: var(--fo-foreground);
  text-decoration: none;
}

.eco-products-panel a:hover,
.eco-products-panel a[aria-current] {
  background: var(--fo-primary-soft);
  color: var(--fo-foreground);
}

.eco-products-panel a:focus-visible {
  outline: 3px solid var(--fo-focus);
  outline-offset: -3px;
}

.eco-products-panel strong {
  font-weight: 600;
  font-size: 0.95rem;
}

.eco-products-panel .eco-desc {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--fo-foreground-secondary);
}

.eco-here {
  font-family: var(--fo-font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--fo-primary);
  color: #ffffff;
}

[data-theme="dark"] .eco-here {
  background: #6cc0fc;
  color: #0f0d3f;
}

/* =========================================================
   CABECERA (cristal al hacer scroll; altura constante)
   El fondo y el desenfoque viven en ::before, NO en .fo-header: un backdrop-filter
   en la cabecera la convierte en bloque contenedor del panel móvil (position:fixed)
   y el menú queda recortado.
   ========================================================= */
.fo-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  isolation: isolate;
  border-bottom: 1px solid var(--fo-border);
  font-family: var(--fo-font-body);
  transition: box-shadow 240ms ease, border-color 240ms ease;
}

.fo-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fo-header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color 240ms ease;
  pointer-events: none;
}

.fo-header.scrolled {
  box-shadow: 0 10px 30px -18px rgba(15, 13, 63, 0.45);
  border-bottom-color: transparent;
}

.fo-header.scrolled::before {
  background: var(--fo-header-glass);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

.fo-navbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--fo-header-h);
}

.fo-brand {
  display: flex;
  align-items: center;
  margin-right: auto;
  position: relative;
  z-index: 2;
}

.fo-brand a {
  display: inline-flex;
  align-items: center;
  border-radius: var(--fo-radius-md);
}

.fo-brand img {
  display: block;
  height: 40px;
  width: auto;
}

.fo-brand .fo-logo-dark,
[data-theme="dark"] .fo-brand .fo-logo-light {
  display: none;
}

[data-theme="dark"] .fo-brand .fo-logo-dark {
  display: block;
}

.fo-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.fo-menu > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--fo-radius-md);
  color: var(--fo-foreground);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.fo-menu > li > a:hover {
  color: var(--fo-link);
  background: var(--fo-primary-soft);
}

.fo-menu > li > a.fo-cta {
  color: #ffffff;
  background: var(--fo-primary);
  font-weight: 600;
  margin-left: 0.25rem;
}

.fo-menu > li > a.fo-cta:hover {
  color: #ffffff;
  background: var(--fo-primary-hover);
}

.fo-header a:focus-visible,
.fo-header button:focus-visible {
  outline: 3px solid var(--fo-focus);
  outline-offset: 2px;
}

.fo-header .theme-toggle {
  position: relative;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--fo-border);
  background: var(--fo-surface);
  color: var(--fo-foreground);
}

.fo-header .theme-toggle:hover {
  color: var(--fo-link);
  border-color: var(--fo-link);
}

.fo-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fo-border);
  border-radius: 999px;
  background: var(--fo-surface);
  color: var(--fo-foreground);
  cursor: pointer;
}

.fo-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

.fo-toggle .fo-icon-close,
.fo-toggle[aria-expanded="true"] .fo-icon-open {
  display: none;
}

.fo-toggle[aria-expanded="true"] .fo-icon-close {
  display: block;
}

.fo-menu-footer {
  display: none;
}

/* ---------- Escritorio: cápsula del menú ---------- */
@media (min-width: 1181px) {
  .fo-brand img { height: 44px; }

  .fo-menu {
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background-color 240ms ease, box-shadow 240ms ease, padding 240ms ease, margin 240ms ease;
  }

  /* La cápsula no cambia la altura de la cabecera (el margen negativo compensa el relleno):
     un cambio de altura al hacer scroll mueve la página y hace parpadear el cristal. */
  .fo-header.scrolled .fo-menu {
    padding: 0.3rem 0.35rem;
    margin: -0.3rem -0.35rem;
    background: color-mix(in srgb, var(--fo-surface) 60%, transparent);
    border-color: var(--fo-border);
    box-shadow: 0 6px 20px -12px rgba(15, 13, 63, 0.35);
  }

  .fo-header.scrolled .fo-menu > li > a {
    min-height: 2.4rem;
    border-radius: 999px;
  }
}

/* ---------- Móvil y tableta: panel a pantalla completa ---------- */
@media (max-width: 1180px) {
  .fo-toggle {
    display: inline-flex;
  }

  .fo-header .theme-toggle {
    order: 2;
  }

  .fo-toggle {
    order: 3;
  }

  /* El panel ocupa toda la pantalla; el logo, el tema y el botón de cerrar quedan encima
     (z-index 2), así el botón de cerrar nunca pisa el logo. --fo-menu-top lo fija layout-public.js
     con el borde inferior real de la cabecera. */
  .fo-menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: calc(var(--fo-menu-top, var(--fo-header-h)) + 1rem) 16px 1.5rem;
    background: var(--fo-surface);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .fo-menu.open {
    display: flex;
  }

  .fo-menu > li {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
  }

  .fo-menu > li > a {
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 0.85rem;
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--fo-border);
    border-radius: 0;
  }

  .fo-menu > li > a.fo-cta {
    justify-content: center;
    margin: 1rem 0 0;
    border-bottom: 0;
    border-radius: var(--fo-radius-md);
  }

  .fo-menu-footer {
    display: block;
    margin-top: auto !important;
    padding-top: 1.5rem;
  }

  .fo-menu-footer-title {
    font-family: var(--fo-font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fo-foreground-secondary);
    margin-bottom: 0.5rem;
  }

  .fo-menu-footer-contact {
    display: flex;
    flex-direction: column;
  }

  .fo-menu-footer-contact a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--fo-foreground-secondary);
    text-decoration: none;
  }

  .fo-menu-footer-contact a:hover {
    color: var(--fo-link);
  }

  .fo-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .fo-social a {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fo-radius-md);
    background: var(--fo-primary-soft);
    color: var(--fo-foreground);
  }

  .fo-social a:hover {
    background: var(--fo-primary);
    color: #ffffff;
  }

  body.fo-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 400px) {
  .fo-brand img { height: 34px; }
  .fo-navbar { gap: 0.5rem; }
}

/* =========================================================
   PIE DEL ECOSISTEMA: azul marino de marca, franja superior,
   columnas alineadas a la izquierda, sin cajas.
   ========================================================= */
footer.fo-footer {
  position: relative;
  background: var(--fo-brand-navy);
  color: #d9d8ea;
  padding: 3.5rem 0 0;
  font-family: var(--fo-font-body);
  text-align: left;
}

footer.fo-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: repeating-linear-gradient(-45deg, #25a1fb 0 12px, transparent 12px 24px, #ffffff 24px 36px, transparent 36px 48px);
}

.fo-footer-content {
  display: grid;
  /* Contacto a su ancho natural: los correos no se parten a media palabra */
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 0.9fr)) auto;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.fo-footer-section h2 {
  font-family: var(--fo-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fd3fd;
  margin: 0 0 1rem;
}

.fo-footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.fo-footer a {
  color: #d9d8ea;
  text-decoration: none;
}

.fo-footer-section ul a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  font-size: 0.925rem;
  overflow-wrap: anywhere;
}

.fo-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fo-footer a:focus-visible {
  outline: 3px solid #6cc0fc;
  outline-offset: 2px;
}

.fo-footer-logo {
  display: block;
  height: 40px;
  width: auto;
  margin: 0 0 1rem;
}

.fo-footer-tagline {
  font-family: var(--fo-font-display);
  font-size: 1.15rem;
  line-height: 1.35;
  color: #ffffff;
  margin: 0 0 0.5rem;
  max-width: 26ch;
}

.fo-footer-company {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #b9b8cc;
  margin: 0 0 1rem;
  max-width: 36ch;
}

.fo-footer .fo-social {
  display: flex;
  gap: 0.5rem;
}

.fo-footer .fo-social a {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--fo-radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.fo-footer .fo-social a:hover {
  background: #0476c8;
  text-decoration: none;
}

.fo-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem 0 1.5rem;
}

.fo-footer-bottom .fo-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.fo-footer-bottom p {
  margin: 0;
  font-size: 0.8rem;
  color: #b9b8cc;
}

.fo-footer-bottom p a {
  color: #d9d8ea;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1100px) {
  .fo-footer-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fo-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .fo-footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Deja libre la esquina del botón flotante de ventas (ecf-sales-widget) */
  .fo-footer-bottom {
    padding-bottom: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fo-header,
  .fo-header::before,
  .fo-menu,
  .eco-products-toggle svg {
    transition: none;
  }
}
