/* ZIVO mobile topbar overrides. Loaded only for screens <= 768px. */
@media (max-width: 768px) {
  app-top-bar .top-bar {
    height: 58px;
    min-height: 58px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 max(8px, env(safe-area-inset-right)) 0 62px;
    overflow: visible;
    background:
      linear-gradient(135deg, rgba(34, 211, 238, 0.07), transparent 38%),
      rgba(7, 16, 29, 0.96);
    border-bottom: 1px solid rgba(34, 211, 238, 0.18);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  app-top-bar .btn-directory,
  app-top-bar #zivo-pwa-install-button,
  app-top-bar .btn-lms,
  app-top-bar .btn-support,
  app-top-bar .notificaciones-container,
  app-top-bar .usuario-info {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 40px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.74);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  app-top-bar .btn-directory:hover,
  app-top-bar #zivo-pwa-install-button:hover,
  app-top-bar .btn-lms:hover,
  app-top-bar .notificaciones-container:hover,
  app-top-bar .usuario-info:hover,
  app-top-bar .usuario-info.abierto {
    transform: none;
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.1);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.05);
  }

  app-top-bar .btn-support {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(22, 101, 52, 0.12);
  }

  app-top-bar .btn-support:hover {
    transform: none;
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.14);
    box-shadow: none;
  }

  app-top-bar .btn-lms span,
  app-top-bar .btn-support span,
  app-top-bar .usuario-info > span {
    display: none !important;
  }

  app-top-bar .btn-directory mat-icon,
  app-top-bar #zivo-pwa-install-button mat-icon,
  app-top-bar .btn-lms mat-icon,
  app-top-bar .notificaciones-container mat-icon {
    width: 21px;
    height: 21px;
    font-size: 21px;
    line-height: 21px;
  }

  app-top-bar .support-icon {
    width: 21px;
    height: 21px;
  }

  app-top-bar .usuario-info {
    position: relative;
  }

  app-top-bar .foto-perfil {
    width: 31px;
    height: 31px;
    border-width: 1.5px;
  }

  app-top-bar .badge {
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #07101d;
    border-radius: 999px;
    font-size: 0.62rem;
    line-height: 1;
    box-shadow: none;
  }

  app-top-bar .notificaciones-wrapper {
    position: static;
  }

  app-top-bar .bandeja {
    position: fixed;
    top: 64px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    height: min(72dvh, 560px);
    border-radius: 18px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.52);
  }

  app-top-bar .bandeja-inner {
    max-height: none;
  }

  app-top-bar .titulo {
    padding: 14px 16px 12px;
    font-size: 0.95rem;
  }

  app-top-bar .filtros {
    gap: 7px;
    padding: 9px 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  app-top-bar .filtros::-webkit-scrollbar {
    display: none;
  }

  app-top-bar .filtro {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    border-radius: 999px;
  }

  app-top-bar .lista-scroll {
    max-height: calc(min(72dvh, 560px) - 142px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  app-top-bar .notificacion {
    min-height: 58px;
    padding: 11px 14px;
  }

  app-top-bar .notificacion p {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  app-top-bar .footer {
    padding: 9px 10px;
  }

  app-top-bar .ver-todas-btn {
    min-height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
  }

  app-top-bar .submenu {
    position: fixed;
    top: 64px;
    right: 8px;
    width: min(290px, calc(100vw - 16px));
    border-radius: 16px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.52);
    overflow: hidden;
  }

  app-top-bar .submenu a,
  app-top-bar .submenu button {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 0.86rem;
  }

  app-top-bar .ui-toast-container {
    top: 66px;
    right: 8px;
    left: 8px;
    width: auto;
  }

  app-top-bar .ui-toast {
    width: 100%;
    max-width: none;
    padding: 12px 14px;
    border-radius: 15px;
  }

  app-top-bar .directory-modal {
    top: 58px;
    right: 0;
    left: 0;
    width: 100vw;
    min-width: 0;
    max-width: none;
    height: calc(100dvh - 58px);
    border-left: 0;
    border-top: 2px solid rgba(34, 211, 238, 0.7);
    box-shadow: none;
  }

  app-top-bar .directory-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px;
  }

  app-top-bar .directory-header input {
    min-height: 44px;
    font-size: 16px;
  }

  app-top-bar .directory-body {
    padding: 10px;
    overscroll-behavior: contain;
  }

  app-top-bar .directory-user {
    padding: 12px;
    border-radius: 14px;
  }

  app-top-bar .directory-footer {
    position: sticky;
    bottom: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  app-top-bar .top-bar {
    gap: 4px;
    padding-left: 60px;
    padding-right: max(6px, env(safe-area-inset-right));
  }

  app-top-bar .btn-directory,
  app-top-bar #zivo-pwa-install-button,
  app-top-bar .btn-lms,
  app-top-bar .btn-support,
  app-top-bar .notificaciones-container,
  app-top-bar .usuario-info {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    flex-basis: 36px;
    border-radius: 11px;
  }

  app-top-bar .foto-perfil {
    width: 28px;
    height: 28px;
  }

  app-top-bar .btn-directory mat-icon,
  app-top-bar #zivo-pwa-install-button mat-icon,
  app-top-bar .btn-lms mat-icon,
  app-top-bar .notificaciones-container mat-icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 20px;
  }

  app-top-bar .support-icon {
    width: 20px;
    height: 20px;
  }

  app-top-bar .bandeja,
  app-top-bar .submenu {
    top: 62px;
  }
}
