/* Friends App · Cabecera móvil · controlador visual único 2026-10-17.
 * La cabecera PHP es común. Esta capa gobierna exclusivamente <= 899 px,
 * se aplica a Inicio, Momentos, Conecta, Planes, Grupos, Cuenta, Explora,
 * chats y demás páginas que utilizan banana_web_shell_render().
 * NO se cambian las reglas de escritorio ni la navegación inferior.
 */
body.bf-web-page > .bf-web-header-spacer { display: none; }

@media screen and (max-width: 899px) {
  /* Mismo blanco en el área superior de iOS y en la cabecera.
     El fondo sólido elimina el segundo tono que creaban transparencias
     sobre el degradado de cada página. Escritorio permanece igual. */
  :root {
    --bf-mobile-head-height: 68px;
    --bf-mobile-head-inner: 68px;
    --bf-mobile-top-surface: #ffffff;
    background-color: var(--bf-mobile-top-surface);
  }
  html { background-color: var(--bf-mobile-top-surface) !important; }

  /* Espacio reservado en el flujo del documento: no desplaza tarjetas ni
     provoca saltos si cambia el scroll de <body> a un contenedor interno. */
  html body.bf-web-page.bf-web-page > .bf-web-header-spacer {
    display: block !important;
    position: relative !important;
    flex: 0 0 var(--bf-mobile-head-measured, var(--bf-mobile-head-height)) !important;
    width: 100% !important;
    height: var(--bf-mobile-head-measured, var(--bf-mobile-head-height)) !important;
    min-height: var(--bf-mobile-head-measured, var(--bf-mobile-head-height)) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    pointer-events: none !important;
  }

  /* Fixed evita las divergencias de sticky entre Safari, Momentos (body
     scrolleable) y contenedores internos. El spacer ocupa exactamente
     la altura retirada del flujo. Fondo y botones iguales en todos. */
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    z-index: 1900 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: var(--bf-mobile-head-measured, var(--bf-mobile-head-height)) !important;
    min-height: var(--bf-mobile-head-measured, var(--bf-mobile-head-height)) !important;
    margin: 0 !important;
    padding: env(safe-area-inset-top, 0px) 0 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(30, 32, 38, .075) !important;
    background: var(--bf-mobile-top-surface) !important;
    color: #17171a !important;
    box-shadow: 0 1px 0 rgba(22, 22, 27, .03) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    transform: none !important;
    translate: none !important;
    overflow: visible !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] > .bf-web-header-inner {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: calc(100% - 32px) !important;
    min-width: 0 !important;
    max-width: none !important;
    height: var(--bf-mobile-head-inner) !important;
    min-height: var(--bf-mobile-head-inner) !important;
    max-height: var(--bf-mobile-head-inner) !important;
    padding: 0 !important;
    margin: 0 auto !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    transform: none !important;
    translate: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-location-wrap,
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-location,
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-nav,
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-menu-button {
    display: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-brand {
    display: inline-flex !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 0 1 auto !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    text-decoration: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-brand-mark {
    display: grid !important;
    width: 39px !important;
    height: 39px !important;
    min-width: 39px !important;
    flex: 0 0 39px !important;
    place-items: center !important;
    overflow: hidden !important;
    border-radius: 13px !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-brand-name {
    display: inline-block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 20px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    gap: 6px !important;
  }
  /* Explora: siempre junto a comunicaciones. Se conserva el aspecto aprobado
     del menú, independientemente de qué bundle CSS cargue la página. */
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-explore-link {
    display: grid !important;
    position: relative !important;
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    place-items: center !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication {
    display: inline-flex !important;
    position: relative !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
    height: 44px !important;
    padding: 0 !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication > .bf-web-icon-link {
    position: relative !important;
    display: grid !important;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    place-items: center !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication::after {
    top: 2px !important;
    left: 2px !important;
    width: 41px !important;
    height: 38px !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication[data-bf-comm-target="notifications"]::after {
    transform: translate3d(41px, 0, 0) scale(1) !important;
  }
  /* Miembros: el avatar está en el dock. Invitados: acceso arriba. */
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-account--desktop-only-on-mobile {
    display: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-account.is-guest {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] :is(a, button):focus-visible {
    outline: 2px solid #59616b !important;
    outline-offset: 2px !important;
  }
  html { scroll-padding-top: calc(var(--bf-mobile-head-height) + 10px); }
  html body.bf-web-page.bf-web-page :target { scroll-margin-top: calc(var(--bf-mobile-head-height) + 10px); }
}

@media screen and (max-width: 680px) {
  :root { --bf-mobile-head-height: calc(68px + env(safe-area-inset-top, 0px)); }
}
@media screen and (min-width: 681px) and (max-width: 899px) {
  :root { --bf-mobile-head-height: calc(70px + env(safe-area-inset-top, 0px)); --bf-mobile-head-inner: 70px; }
}
@media screen and (max-width: 360px) {
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] > .bf-web-header-inner { gap: 4px !important; width: calc(100% - 24px) !important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-actions { gap: 4px !important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-brand { gap: 5px !important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-brand-name { font-size: 17px !important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-explore-link { width: 36px !important; height: 36px !important; flex-basis: 36px !important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication { width:auto!important;min-width:0!important;flex-basis:auto!important;height:40px!important;gap:6px!important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication > .bf-web-icon-link { width:40px!important;height:40px!important;flex-basis:40px!important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication::after { width: 38px !important; height: 36px !important; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication[data-bf-comm-target="notifications"]::after { transform: translate3d(38px, 0, 0) scale(1) !important; }
}
/* Chat grupal inmersivo: el shell es una columna flex y el teclado modifica
   el viewport. Su cabecera ocupa el propio flujo, sin spacer adicional. */
@media screen and (max-width: 899px) {
  html body.bf-web-page.bf-page-group-chat.gc-chat-immersive > .bf-web-header[data-bf-header] {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    flex: 0 0 var(--bf-mobile-head-measured, var(--bf-mobile-head-height)) !important;
  }
  html body.bf-web-page.bf-page-group-chat.gc-chat-immersive > .bf-web-header-spacer {
    display: none !important;
  }
}


/* Friends · Identidad móvil fija, con símbolo animado sin desplazar el texto. */
.bf-web-mobile-brand { display: none; }
@media screen and (max-width: 899px) {
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-brand {
    display: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-mobile-brand {
    display:flex!important;position:relative!important;inset:auto!important;transform:none!important;
    order:-2!important;flex:0 0 auto!important;width:auto!important;min-width:0!important;max-width:none!important;
    height:46px;align-items:center!important;justify-content:flex-start!important;gap:7px!important;
    margin:0 auto 0 0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;text-decoration:none;
    -webkit-tap-highlight-color:transparent;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-actions {
    position: static !important;
    order: 1 !important; margin:0!important;
    z-index: 2;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-explore-link {
    position: relative !important;
    inset: auto !important;
    order: 0 !important;
    z-index: 2;
    transform: none !important;
  }
}

/* Friends App · Compartir Momento · solo móvil.
   El símbolo «+» tiene una zona táctil accesible, pero ninguna silueta,
   fondo, borde, sombra ni cápsula visual. Escritorio sigue intacto. */
.bf-web-header .bf-web-create-link { display: none !important; }
@media screen and (max-width: 899px) {
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link {
    display: grid !important;
    position: relative !important;
    inset: auto !important;
    order: 0 !important;
    z-index: 2 !important;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #eee5fa !important;
    background-image: none !important;
    box-shadow: none !important;
    outline-offset: 0;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    color: #4b14a5 !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transform: none !important;
    transition: opacity 150ms ease !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link::before,
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link::after {
    display: none !important;
    content: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link svg {
    display: block;
    width: 22px !important;
    height: 22px !important;
    flex: none;
    stroke: currentColor;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link:is(:active,:hover) {
    background: #4b14a5 !important;
    color:#fff!important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link:active { opacity: .55; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link:focus-visible {
    outline: 2px solid #73777e !important;
    outline-offset: -2px;
    border-radius: 8px !important;
  }
}
@media screen and (max-width: 360px) {
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-create-link {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bf-web-header .bf-web-create-link { transition: none !important; }
}

/* Oculta únicamente el cristal antiguo de Momentos en la vista móvil.
   Se instala en la capa común para invalidar caché sin editar momentos.php. */
@media screen and (max-width: 899px) {
  html body.bf-web-page.bf-page-feeds > .feed > header.feed-list-heading.plans-list-heading.pg-head {
    display: none !important;
  }
}

/* Friends · Cabecera móvil · notificaciones y chats con identidad morada.
   Los SVG clásicos de escritorio siguen intactos. La disposición móvil usa
   order: -1 en Notificaciones; no modifica el DOM ni los accesos en PC. */
.bf-web-header .bf-web-communication > .bf-web-icon-link > svg.bf-header-icon-mobile {
  display: none !important;
}
@media screen and (max-width: 899px) {
  /* Quitar la cápsula y el indicador rosa heredados; solo iconos. */
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication::before,
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication::after {
    display: none !important;
    content: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication > .bf-web-notification-link {
    order: -1 !important; /* Primero el corazón */
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication > .bf-web-message-link {
    order: 1 !important; /* Después el avión de papel */
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication
    > :is(.bf-web-message-link, .bf-web-notification-link) {
    border: 0 !important;
    border-radius: 50% !important;
    background: #eee5fa !important;
    box-shadow: none !important;
    color: #4b14a5 !important;
    transform: none !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication
    > :is(.bf-web-message-link, .bf-web-notification-link):is(:hover,:active,.is-active) {
    border: 0 !important;
    background: #4b14a5 !important;
    box-shadow: none !important;
    color: #fff !important;
    transform: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication
    > :is(.bf-web-message-link, .bf-web-notification-link):active { opacity: .55; }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication
    > :is(.bf-web-message-link, .bf-web-notification-link):focus-visible {
    outline: 2px solid #4b14a5 !important;
    outline-offset: -2px !important;
    border-radius: 50% !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication
    > :is(.bf-web-message-link, .bf-web-notification-link) > svg:not(.bf-header-icon-mobile) {
    display: none !important;
  }
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication
    > :is(.bf-web-message-link, .bf-web-notification-link) > svg.bf-header-icon-mobile {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    flex: none !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    color: inherit !important;
    opacity: 1 !important;
  }
  /* Conserva los avisos de pendientes, con una paleta neutra. */
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication .bf-web-badge,
  html body.bf-web-page.bf-web-page > .bf-web-header[data-bf-header] .bf-web-communication .bf-web-dot {
    background: #4b14a5 !important;
    color:#fff!important;
    border-color: #fff !important;
  }
}

/* Marca compartida: dimensiones y tipografía de friendsapp.es. */
.bf-web-header .bf-brand-symbol {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  line-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.bf-web-header .bf-brand-symbol > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: none;
}
.bf-web-header .bf-brand-word {
  display: block;
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  font: 750 24px/1 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -.065em;
  color: #4b14a5;
  -webkit-text-fill-color: #4b14a5;
  background: transparent;
  border: 0;
  box-shadow: none;
  text-transform: none;
}
@media (max-width: 760px) {
  .bf-web-header .bf-brand-symbol { flex-basis: 29px; width: 29px; height: 29px; }
  .bf-web-header .bf-brand-word { font-size: 22px; }
}
@media (max-width: 360px) {
  .bf-web-header .bf-brand-symbol { flex-basis: 25px; width: 25px; height: 25px; }
  .bf-web-header .bf-brand-word { font-size: 20px; }
}
.bf-web-header .bf-brand-symbol .brand-motion-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  visibility: hidden;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.bf-web-header .bf-brand-symbol.is-playing img { opacity: 0 !important; }
.bf-web-header .bf-brand-symbol.is-playing .brand-motion-video { visibility: visible; }
@media (prefers-reduced-motion: reduce) {
  .bf-web-header .bf-brand-symbol.is-playing img { opacity: 1 !important; }
  .bf-web-header .bf-brand-symbol.is-playing .brand-motion-video { visibility: hidden; }
}
