/* ==========================================================================
   AW FLOTANTES | Componente unico de los botones flotantes del sitio publico:
   Ajustes (.aw-floating-stack > .aw-pill-btn) + SOS (#awSosFab).
   Capa 3 (componentes compartidos). Sustituye a aw-flotantes-glass.css y a las
   reglas repetidas de .aw-floating-stack que vivian en webapp/css/style.css
   (5 bloques) y webapp/css/responsive.css (4 bloques).
   Posicion/tamano salen de los tokens (aw-tokens.css): --aw-fl-*.
   ========================================================================== */
:root {
  --aw-fl-right: clamp(16px, 2.2vw, 30px);
  --aw-fl-bottom: calc(20px + var(--aw-safe-bottom, env(safe-area-inset-bottom, 0px)));
}

/* Columna: Ajustes abajo, SOS encima (misma alineacion y mismo margen) */
.aw-floating-stack {
  position: fixed;
  right: var(--aw-fl-right);
  bottom: var(--aw-fl-bottom);
  left: auto;
  z-index: var(--aw-z-floating, 2550);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--aw-fl-gap, 8px);
  pointer-events: none;
}

.aw-floating-stack .aw-pill-btn,
#awSosFab {
  width: var(--aw-fl-size, 44px);
  height: var(--aw-fl-size, 44px);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .55);
  background: var(--aw-glass-soft, rgba(255, 255, 255, .28));
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: var(--aw-shadow-sm, 0 8px 22px rgba(5, 48, 72, .08));
  color: var(--aw-primary-800, #0b4f8a);
  opacity: .8;
  transition: opacity .2s, background-color .2s, transform .2s;
}
.aw-floating-stack .aw-pill-btn { pointer-events: auto; }
.aw-floating-stack .aw-pill-btn span { display: none; }
.aw-floating-stack .aw-pill-btn i,
#awSosFab i { width: auto; margin: 0; font-size: 18px; }

/* SOS: encima de Ajustes, misma columna */
#awSosFab {
  position: fixed;
  left: auto;
  right: var(--aw-fl-right);
  bottom: calc(var(--aw-fl-bottom) + var(--aw-fl-size, 44px) + var(--aw-fl-gap, 8px));
  z-index: var(--aw-z-floating, 2550);
  background: rgba(211, 47, 47, .42);
  color: #fff;
}

.aw-floating-stack .aw-pill-btn:hover,
.aw-floating-stack .aw-pill-btn:focus-visible { opacity: 1; background: rgba(255, 255, 255, .8); transform: translateY(-2px); }
#awSosFab:hover,
#awSosFab:focus-visible { opacity: 1; background: rgba(211, 47, 47, .92); transform: translateY(-2px); }

/* Variante del agente (si se vuelve a habilitar el boton de chat) */
.aw-floating-stack .aw-pill-btn--agent { background: rgba(6, 27, 43, .88); color: #fff; border-color: rgba(255, 255, 255, .18); }

/* Tablet / movil: sube para no tapar la barra inferior */
@media (max-width: 991.98px) {
  :root { --aw-fl-right: 12px; --aw-fl-bottom: calc(88px + var(--aw-safe-bottom, env(safe-area-inset-bottom, 0px))); }
}
@media (max-width: 560px) {
  :root { --aw-fl-right: 10px; --aw-fl-bottom: calc(86px + var(--aw-safe-bottom, env(safe-area-inset-bottom, 0px))); }
}

/* Horizontal bajo: fila, SOS a la izquierda de Ajustes */
@media (max-width: 991.98px) and (max-height: 560px) and (orientation: landscape) {
  :root { --aw-fl-bottom: calc(72px + var(--aw-safe-bottom, env(safe-area-inset-bottom, 0px))); }
  .aw-floating-stack { flex-direction: row; }
  #awSosFab { right: calc(var(--aw-fl-right) + var(--aw-fl-size, 44px) + var(--aw-fl-gap, 8px)); bottom: var(--aw-fl-bottom); }
}
