/* Mapa full-bleed + sidebar liquid glass sobreposta à direita */

html body.pm-liquid-v2.map-source-active .main,
html body.pm-liquid-v2.pm-app-shell-mounted.map-source-active .main,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .main {
  position: relative !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  padding: 0 !important;
  gap: 0 !important;
}

html body.pm-liquid-v2.pm-apple-shell.map-source-active .main,
html body.pm-liquid-v2.pm-apple-shell .censo-integrated[data-active-source="mapa"] .main {
  padding: 0 !important;
}

html body.pm-liquid-v2.map-source-active .content,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .content {
  position: absolute !important;
  inset: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

html body.pm-liquid-v2.map-source-active .censo-integrated,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

html body.pm-liquid-v2.map-source-active #panel-mapa,
html body.pm-liquid-v2.map-source-active #panel-mapa.active,
html body.pm-liquid-v2.map-source-active #sec-mapa,
html body.pm-liquid-v2.map-source-active #sec-mapa.active,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] #panel-mapa,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] #sec-mapa {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

html body.pm-liquid-v2.map-source-active .pm-glass-workspace,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-workspace {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

/* Shell do mapa: camada base */
html body.pm-liquid-v2.map-source-active .pm-glass-map-layout.pm-map-layout,
html body.pm-liquid-v2.pm-apple-shell.map-source-active .pm-glass-map-layout.pm-map-layout,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-map-layout.pm-map-layout {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  gap: 0 !important;
  padding: 0 !important;
  grid-template-columns: none !important;
  overflow: hidden !important;
}

/* Mapa = background (atrás de tudo) */
html body.pm-liquid-v2.map-source-active .pm-glass-map-card,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-map-card {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
  border-radius: 0 !important;
  pointer-events: auto !important;
}

html body.pm-liquid-v2.map-source-active .pm-glass-map-area.pm-map-area,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-map-area.pm-map-area {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #f4f2ec !important;
  overflow: hidden !important;
}

html body.pm-liquid-v2.map-source-active .pm-glass-map-area .pm-map-iframe,
html body.pm-liquid-v2.map-source-active .pm-glass-map-area #mapFrame,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-map-area .pm-map-iframe,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-map-area #mapFrame {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Topbar flutuante */
html body.pm-liquid-v2.map-source-active .pm-float-topbar,
html body.pm-liquid-v2.map-source-active .pm-apple-topbar,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-float-topbar,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-apple-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 60 !important;
  pointer-events: none;
}

html body.pm-liquid-v2.map-source-active .pm-float-topbar > *,
html body.pm-liquid-v2.map-source-active .pm-apple-topbar > *,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-float-topbar > *,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-apple-topbar > * {
  pointer-events: auto;
}

/* Sidebar = overlay à direita (vence position:relative do liquid-glass-v2) */
html body.pm-liquid-v2.map-source-active .pm-glass-rail.pm-map-sidebar,
html body.pm-liquid-v2.map-source-active .pm-map-sidebar.pm-vision-sidebar,
html body.pm-liquid-v2.pm-apple-shell.map-source-active .pm-glass-rail.pm-map-sidebar,
html body.pm-liquid-v2.pm-apple-shell.map-source-active .pm-map-sidebar.pm-vision-sidebar,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-glass-rail.pm-map-sidebar,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-sidebar.pm-vision-sidebar {
  position: absolute !important;
  top: 76px !important;
  right: 16px !important;
  bottom: 28px !important;
  left: auto !important;
  max-height: calc(100dvh - 104px) !important;
  width: var(--pm-map-rail-width, 380px) !important;
  min-width: 0 !important;
  max-width: min(420px, calc(100vw - 24px)) !important;
  height: auto !important;
  flex: none !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 50 !important;
  margin: 0 !important;
  isolation: isolate !important;
  overflow: hidden !important;
  transform: translateX(0);
  pointer-events: auto !important;
  transition:
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s ease,
    visibility 0.28s ease;
}

html body.pm-liquid-v2.map-source-active .pm-map-sidebar > *,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-sidebar > * {
  position: relative;
  z-index: 2;
}

html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-glass-rail.pm-map-sidebar,
html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-sidebar,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-sidebar {
  transform: translateX(calc(100% + 20px)) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* HUD do mapa */
html body.pm-liquid-v2.map-source-active .pm-map-area .pm-map-corner-right,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area .pm-map-corner-right {
  z-index: 40 !important;
  top: auto !important;
  bottom: 88px !important;
  right: calc(var(--pm-map-rail-width, 380px) + 28px) !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-area #pmPopReportMapCorner.is-visible,
html body.pm-liquid-v2.map-source-active .pm-map-area .pm-pop-report-map-corner.is-visible,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area #pmPopReportMapCorner.is-visible,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area .pm-pop-report-map-corner.is-visible {
  z-index: 70 !important;
  top: 88px !important;
  right: calc(var(--pm-map-rail-width, 380px) + 28px) !important;
  left: auto !important;
  max-width: min(300px, calc(100vw - var(--pm-map-rail-width, 380px) - 56px)) !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-area #pmPopReportMapCorner.is-visible,
html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-area .pm-pop-report-map-corner.is-visible,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-area #pmPopReportMapCorner.is-visible,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-area .pm-pop-report-map-corner.is-visible {
  right: 16px !important;
  max-width: min(300px, calc(100vw - 32px)) !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-area .pm-map-corner-right,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-area .pm-map-corner-right {
  right: 16px !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-area .pm-weather-card,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area .pm-weather-card {
  z-index: 40 !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-bottom-hud.pm-map-corner-bottom,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-bottom-hud.pm-map-corner-bottom {
  z-index: 40 !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: min(560px, calc(100% - var(--pm-map-rail-width, 380px) - 56px)) !important;
  max-width: calc(100% - 32px) !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-bottom-hud.pm-map-corner-bottom,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-bottom-hud.pm-map-corner-bottom {
  width: min(560px, calc(100% - 32px)) !important;
}

html body.pm-liquid-v2.map-source-active .pm-map-loading-overlay,
html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-loading-overlay {
  z-index: 5 !important;
}

@media (max-width: 980px) {
  html body.pm-liquid-v2.map-source-active .pm-glass-rail.pm-map-sidebar,
  html body.pm-liquid-v2.map-source-active .pm-map-sidebar.pm-vision-sidebar,
  html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-sidebar {
    top: auto !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: min(62vh, 520px) !important;
  }

  html body.pm-liquid-v2.map-source-active .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-sidebar,
  html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-layout.pm-map-sidebar-rail-collapsed .pm-map-sidebar {
    transform: translateY(calc(100% + 16px)) !important;
  }

  html body.pm-liquid-v2.map-source-active .pm-map-area .pm-map-corner-right,
  html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area .pm-map-corner-right {
    right: 12px !important;
    bottom: calc(min(62vh, 520px) + 16px) !important;
  }

  html body.pm-liquid-v2.map-source-active .pm-map-area #pmPopReportMapCorner.is-visible.pm-pop-map-corner--fill,
  html body.pm-liquid-v2.map-source-active .pm-map-area .pm-pop-report-map-corner.is-visible.pm-pop-map-corner--fill,
  html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area #pmPopReportMapCorner.is-visible.pm-pop-map-corner--fill,
  html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-area .pm-pop-report-map-corner.is-visible.pm-pop-map-corner--fill {
    top: 72px !important;
    bottom: calc(min(62vh, 520px) + 16px) !important;
    right: 12px !important;
    height: auto !important;
    align-items: stretch !important;
    max-width: min(280px, calc(100vw - 24px)) !important;
  }

  html body.pm-liquid-v2.map-source-active .pm-map-bottom-hud.pm-map-corner-bottom,
  html body.pm-liquid-v2 .censo-integrated[data-active-source="mapa"] .pm-map-bottom-hud.pm-map-corner-bottom {
    width: min(520px, calc(100% - 24px)) !important;
    bottom: calc(min(62vh, 520px) + 20px) !important;
  }
}

/* ═══ Modo imersivo (Biomas / Geoparque) — oculta toda a UI do Panorama ═══ */
html body.pm-map-embed-mode {
  overflow: hidden !important;
}

html body.pm-map-embed-mode .pm-bridge-bg {
  display: none !important;
}

html body.pm-map-embed-mode .topbar.pm-apple-topbar,
html body.pm-map-embed-mode .pm-glass-topbar,
html body.pm-map-embed-mode .pm-float-topbar,
html body.pm-map-embed-mode.map-source-active .topbar.pm-apple-topbar,
html body.pm-map-embed-mode.map-source-active .pm-glass-topbar,
html body.pm-map-embed-mode.map-source-active .pm-float-topbar,
html body.pm-map-embed-mode .censo-integrated[data-active-source="mapa"] .topbar.pm-apple-topbar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

html body.pm-map-embed-mode #sidebar,
html body.pm-map-embed-mode #sb-backdrop,
html body.pm-map-embed-mode #drawer,
html body.pm-map-embed-mode #drawerBackdrop {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html body.pm-map-embed-mode .main,
html body.pm-map-embed-mode.map-source-active .main,
html body.pm-map-embed-mode .censo-integrated[data-active-source="mapa"] .main {
  height: 100dvh !important;
  max-height: 100dvh !important;
  padding: 0 !important;
  margin: 0 !important;
}

html body.pm-map-embed-mode .content,
html body.pm-map-embed-mode.map-source-active .content,
html body.pm-map-embed-mode .censo-integrated[data-active-source="mapa"] .content {
  inset: 0 !important;
  top: 0 !important;
  height: 100% !important;
}

html body.pm-map-embed-mode .pm-glass-workspace,
html body.pm-map-embed-mode .pm-glass-map-layout.pm-map-layout,
html body.pm-map-embed-mode .pm-glass-map-card,
html body.pm-map-embed-mode .pm-glass-map-area.pm-map-area,
html body.pm-map-embed-mode.map-source-active .pm-glass-workspace,
html body.pm-map-embed-mode.map-source-active .pm-glass-map-layout.pm-map-layout,
html body.pm-map-embed-mode.map-source-active .pm-glass-map-card,
html body.pm-map-embed-mode.map-source-active .pm-glass-map-area.pm-map-area {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  gap: 0 !important;
}

html body.pm-map-embed-mode.map-source-active .pm-glass-rail.pm-map-sidebar,
html body.pm-map-embed-mode.map-source-active .pm-map-sidebar.pm-vision-sidebar,
html body.pm-map-biomas-mode .pm-map-layout[data-sidebar-mode="biomas"] .pm-glass-rail.pm-map-sidebar,
html body.pm-map-biomas-mode .pm-map-layout[data-sidebar-mode="biomas"] .pm-map-sidebar,
html body.pm-map-biomas-mode .pm-map-layout[data-sidebar-mode="biomas"] .pm-map-sidebar.pm-vision-sidebar,
html body.pm-map-geoparque-mode .pm-map-layout[data-sidebar-mode="geoparque"] .pm-glass-rail.pm-map-sidebar,
html body.pm-map-geoparque-mode .pm-map-layout[data-sidebar-mode="geoparque"] .pm-map-sidebar,
html body.pm-map-geoparque-mode .pm-map-layout[data-sidebar-mode="geoparque"] .pm-map-sidebar.pm-vision-sidebar,
html body.pm-map-embed-mode .censo-integrated[data-active-source="mapa"] .pm-glass-rail.pm-map-sidebar,
html body.pm-map-embed-mode .censo-integrated[data-active-source="mapa"] .pm-map-sidebar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  transform: none !important;
}

html body.pm-map-embed-mode .pm-map-corner-right,
html body.pm-map-embed-mode .pm-map-corner-bottom,
html body.pm-map-embed-mode .pm-map-tools-wrap,
html body.pm-map-embed-mode .pm-map-tools-popover,
html body.pm-map-embed-mode .pm-map-loading-overlay,
html body.pm-map-embed-mode .pm-streetview-panel,
html body.pm-map-embed-mode .pm-weather-popover,
html body.pm-map-embed-mode .pm-calendar-popover,
html body.pm-map-embed-mode #userMenu,
html body.pm-map-embed-mode #userMenuBackdrop {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html body.pm-map-embed-mode .pm-biomas-map-mask-exit,
html body.pm-map-embed-mode .pm-biomas-map-mask-bottom {
  display: none !important;
}

html body.pm-map-embed-mode .pm-biomas-map-host.is-active,
html body.pm-map-geoparque-mode .pm-geoparque-map-host.is-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 120 !important;
}

html body.pm-map-embed-mode .pm-biomas-exit-wrap:not([hidden]) {
  position: fixed !important;
  top: 12px !important;
  left: auto !important;
  right: 12px !important;
  z-index: 200 !important;
  margin: 0 !important;
  pointer-events: auto !important;
}

@media (max-width: 980px) {
  html body.pm-map-embed-mode.map-source-active .pm-glass-rail.pm-map-sidebar,
  html body.pm-map-embed-mode.map-source-active .pm-map-sidebar.pm-vision-sidebar,
  html body.pm-map-embed-mode .censo-integrated[data-active-source="mapa"] .pm-map-sidebar {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    transform: none !important;
  }
}
