/* css/atlas.css — Atlas Bíblico Digital e Histórico */

/* =====================================================
   SUBMÓDULOS DE CRONOLOGÍA, POPOVERS, MODALES Y GENEALOGÍA
   ===================================================== */
@import url('./atlas/timeline.css');
@import url('./atlas/popovers.css');
@import url('./atlas/modals.css');
@import url('./atlas/genealogy.css');

/* ==========================================================================
   css/atlas.css — Visor de Mapas y Recursos Bíblicos
   Integrado armoniosamente en panelConcordancia junto a Diccionario.
   100% SVG, soporte temas claro/oscuro/sepia, pan & zoom interactivo.
   ========================================================================== */

:root {
  --bg-card: var(--bg-container, #ffffff);
  --text: var(--text-main, #0f172a);
}

[data-theme="dark"] {
  --bg-card: var(--bg-container, #1e293b);
  --text: var(--text-main, #f1f5f9);
}

/* ── CONTENEDOR PRINCIPAL DEL ATLAS ── */
#concordanceAtlasView {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg-container, #ffffff);
  color: var(--text, #1e293b);
  position: relative;
  overflow: hidden;
}

body.atlas-active #panelConcordancia,
#panelConcordancia.has-atlas {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── BARRA SUPERIOR / HERO CON BUSCADOR Y FILTROS ── */
.atlas-hero-bar {
  padding: 12px 16px 8px;
  background: var(--studio-panel-muted, rgba(120, 120, 120, 0.04));
  border-bottom: 1px solid var(--border, rgba(150, 150, 150, 0.15));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atlas-search-wrapper {
  position: relative;
  width: 100%;
}

.atlas-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #888);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atlas-search-input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 40px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
  background: var(--bg, #ffffff);
  color: var(--text, #111);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.atlas-search-input:focus {
  border-color: var(--accent, #d97706);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #d97706) 20%, transparent);
}

.atlas-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atlas-search-clear:hover {
  color: var(--text, #111);
  background: var(--bg-hover, rgba(120, 120, 120, 0.1));
}

/* Categorías tipo chip */
.atlas-categories-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.atlas-categories-bar::-webkit-scrollbar {
  display: none;
}

.atlas-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
  background: var(--bg, #ffffff);
  color: var(--text-muted, #666);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
}

.atlas-cat-chip:hover {
  background: var(--bg-hover, rgba(120, 120, 120, 0.08));
  color: var(--text, #111);
  border-color: var(--accent, #d97706);
}

.atlas-cat-chip.active {
  background: var(--accent, #d97706);
  color: #ffffff;
  border-color: var(--accent, #d97706);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent, #d97706) 30%, transparent);
}

/* ── GALERÍA DE TARJETAS ── */
.atlas-gallery-container {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.atlas-card {
  background: var(--bg-card, var(--bg, #ffffff));
  border: 1px solid var(--border, rgba(150, 150, 150, 0.2));
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.atlas-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #d97706);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.atlas-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.atlas-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #d97706) 15%, transparent);
  color: var(--accent, #d97706);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.atlas-card-period {
  font-size: 0.74rem;
  color: var(--text-muted, #777);
  font-weight: 500;
}

.atlas-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text, #111);
  line-height: 1.3;
}

.atlas-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted, #666);
  line-height: 1.4;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.atlas-card-preview {
  height: 110px;
  border-radius: 8px;
  background: var(--studio-panel-muted, rgba(120, 120, 120, 0.05));
  border: 1px solid var(--border, rgba(150, 150, 150, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #d97706);
  overflow: hidden;
  margin-top: auto;
}

.atlas-card-preview svg {
  width: 48px;
  height: 48px;
  opacity: 0.75;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.atlas-card:hover .atlas-card-preview svg {
  transform: scale(1.1);
  opacity: 1;
}

/* ── VISTA DE DETALLE / VISOR DE MAPA ── */
.atlas-viewer-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Barra de herramientas del visor */
.atlas-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--studio-panel-muted, rgba(120, 120, 120, 0.06));
  border-bottom: 1px solid var(--border, rgba(150, 150, 150, 0.18));
  flex-shrink: 0;
  z-index: 10;
  gap: 10px;
}

.atlas-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.atlas-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
  background: var(--bg, #ffffff);
  color: var(--text, #111);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.atlas-btn-back:hover {
  background: var(--bg-hover, rgba(120, 120, 120, 0.1));
  border-color: var(--accent, #d97706);
}

.atlas-viewer-title-box {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.atlas-viewer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atlas-viewer-period {
  font-size: 0.74rem;
  color: var(--text-muted, #777);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atlas-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.atlas-tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
  background: var(--bg, #ffffff);
  color: var(--text, #111);
  cursor: pointer;
  transition: all 0.2s ease;
}

.atlas-tool-btn:hover {
  background: var(--bg-hover, rgba(120, 120, 120, 0.1));
  color: var(--accent, #d97706);
  border-color: var(--accent, #d97706);
}

/* Lienzo de visualización con Pan & Zoom */
.atlas-canvas-viewport {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg-container, #ffffff);
  cursor: grab;
  user-select: none;
  display: block;
}

.atlas-canvas-viewport:active {
  cursor: grabbing;
}

.atlas-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.atlas-svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  pointer-events: auto;
}

/* ── VISOR 3D WEBGL Y HOTSPOTS ── */
.atlas-3d-viewport {
  cursor: default !important;
  background: var(--bg-container, #0f172a);
}

model-viewer#atlasModelViewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

.atlas-3d-hotspot {
  background: rgba(17, 24, 39, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.atlas-3d-hotspot:hover,
.atlas-3d-hotspot.active {
  background: var(--accent, #d97706);
  border-color: #ffffff;
  transform: scale(1.1);
  z-index: 50;
}

.atlas-hotspot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
}

.atlas-hotspot-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

/* Pines interactivos en el SVG */
.atlas-pin {
  cursor: pointer;
  outline: none;
}

/* Badges minimalistas de la Cronología */
.atlas-timeline-badge {
  transition: transform 0.15s ease, filter 0.15s ease;
  transform-origin: center center;
}
.atlas-timeline-badge:hover,
.atlas-timeline-badge.active {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
}
.atlas-timeline-badge:hover .badge-bg,
.atlas-timeline-badge.active .badge-bg {
  stroke-width: 2.5px;
}
[data-theme="dark"] .atlas-timeline-badge .badge-bg {
  fill: #1e293b !important;
}
[data-theme="dark"] .atlas-timeline-badge .badge-name {
  fill: #f8fafc !important;
}
[data-theme="dark"] .atlas-timeline-badge .badge-year {
  fill: #94a3b8 !important;
}

.atlas-pin circle.pin-marker {
  transition: fill 0.15s ease, stroke-width 0.15s ease;
}

.atlas-pin:hover circle.pin-marker {
  fill: var(--accent, #d97706) !important;
  stroke: #ffffff !important;
}

.atlas-pin.active circle.pin-marker {
  fill: #dc2626 !important;
  stroke: #ffffff !important;
}

.atlas-pin:hover circle.pin-halo,
.atlas-pin.active circle.pin-halo {
  fill-opacity: 0.3 !important;
}

/* Tooltip dinámico al pasar el cursor sobre los pines */
.atlas-pin-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.9);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  z-index: 50;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.atlas-pin-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="dark"] .atlas-pin-tooltip {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
}


/* Tarjeta informativa lateral / inferior desplegable */
.atlas-info-drawer {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 320px;
  max-width: calc(100% - 32px);
  max-height: 280px;
  background: var(--bg-card, var(--bg, #ffffff));
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 14px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
  backdrop-filter: blur(8px);
  animation: atlasSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes atlasSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.atlas-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.atlas-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #111);
  margin: 0;
}

.atlas-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atlas-drawer-close:hover {
  color: var(--text, #111);
}

.atlas-drawer-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #555);
  line-height: 1.45;
  margin: 0 0 10px;
}

.atlas-drawer-verses-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.atlas-drawer-verses-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.atlas-verse-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, #d97706) 12%, transparent);
  color: var(--accent, #d97706);
  border: 1px solid color-mix(in srgb, var(--accent, #d97706) 30%, transparent);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.atlas-verse-chip:hover {
  background: var(--accent, #d97706);
  color: #ffffff;
}

.atlas-drawer-dict-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent, #d97706);
  text-decoration: none;
  cursor: pointer;
  margin-top: 4px;
  align-self: flex-start;
}

.atlas-drawer-dict-link:hover {
  text-decoration: underline;
}

/* ── LEYENDA FLOTANTE EN EL VISOR ── */
.atlas-map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: var(--bg-card, var(--bg, #ffffff));
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-width: 260px;
  pointer-events: auto;
}

.atlas-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text, #111);
  font-weight: 500;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.atlas-legend-item:hover {
  background: var(--bg-hover, rgba(120, 120, 120, 0.1));
}

.atlas-legend-item.dimmed {
  opacity: 0.35;
}

.atlas-legend-item.active {
  font-weight: 700;
  background: color-mix(in srgb, var(--accent, #d97706) 15%, transparent);
}

.atlas-legend-color {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── MODO OSCURO ── */
[data-theme="dark"] #concordanceAtlasView,
[data-theme="dark"] .atlas-canvas-viewport {
  background: var(--bg-container, #111827);
  color: var(--text, #f3f4f6);
}

[data-theme="dark"] .atlas-card,
[data-theme="dark"] .atlas-info-drawer,
[data-theme="dark"] .atlas-map-legend,
[data-theme="dark"] .timeline-card {
  background: var(--bg-card, #1f2937);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
}

[data-theme="dark"] .timeline-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .atlas-search-input,
[data-theme="dark"] .atlas-cat-chip,
[data-theme="dark"] .atlas-btn-back,
[data-theme="dark"] .atlas-tool-btn {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.15);
  color: #f3f4f6;
}

[data-theme="dark"] .atlas-card-title,
[data-theme="dark"] .atlas-viewer-title,
[data-theme="dark"] .atlas-drawer-title,
[data-theme="dark"] .timeline-card-name,
[data-theme="dark"] .timeline-section-title {
  color: #f9fafb;
}

[data-theme="dark"] .atlas-card-desc,
[data-theme="dark"] .atlas-drawer-desc,
[data-theme="dark"] .timeline-card-desc,
[data-theme="dark"] .atlas-timeline-intro {
  color: #9ca3af;
}

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 640px) {
  .atlas-hero-bar {
    padding: 6px 10px 4px;
    gap: 6px;
  }

  .atlas-search-input {
    height: 34px;
    padding: 0 30px 0 32px;
    font-size: 0.82rem;
  }

  .atlas-search-icon {
    left: 10px;
    width: 14px;
    height: 14px;
  }

  .atlas-categories-bar {
    gap: 4px;
    padding-bottom: 3px;
  }

  .atlas-cat-chip {
    height: 26px;
    padding: 2px 8px;
    font-size: 0.70rem;
    border-radius: 999px;
    gap: 4px;
  }

  .atlas-grid {
    grid-template-columns: 1fr;
  }
  .atlas-viewer-toolbar {
    padding: 6px 10px;
  }
  .atlas-info-drawer {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: 220px;
  }
  .atlas-map-legend {
    display: none; /* En pantallas pequeñas se oculta para no tapar el mapa */
  }
}



/* ── MEJORAS DE RESPONSIVIDAD Y USABILIDAD MÓVIL ── */
.atlas-btn-action {
  width: auto !important;
  height: 32px;
  padding: 0 12px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem !important;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  border: 1px solid var(--border, rgba(150, 150, 150, 0.25));
}

.btn-text-short {
  display: none;
}
.btn-text-full {
  display: inline;
}

.atlas-toolbar-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


@media (max-width: 640px) {
  .atlas-viewer-toolbar {
    padding: 6px 10px !important;
    gap: 6px !important;
  }
  .atlas-btn-back {
    padding: 6px 8px !important;
    min-width: 34px !important;
    height: 32px !important;
    justify-content: center !important;
  }
  .atlas-btn-back-text {
    display: none !important;
  }
  .atlas-viewer-title-box {
    max-width: calc(100vw - 165px) !important;
  }
  .atlas-viewer-title {
    font-size: 0.86rem !important;
  }
  .atlas-viewer-period {
    font-size: 0.68rem !important;
  }
  .btn-text-full {
    display: none !important;
  }
  .btn-text-short {
    display: inline !important;
  }
  .atlas-btn-action {
    height: 30px !important;
    padding: 0 8px !important;
    font-size: 0.74rem !important;
    gap: 4px !important;
  }
  .atlas-toolbar-zoom-group {
    display: none !important;
  }
}

/* ── MODO GALERÍA / PANTALLA COMPLETA ULTRAFLUIDO ── */
.atlas-viewer-container.fullscreen-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999998 !important;
  background: var(--bg-container, #ffffff) !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.atlas-viewer-container.fullscreen-mode .atlas-viewer-toolbar {
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

.atlas-viewer-container.fullscreen-mode .atlas-viewer-title,
.atlas-viewer-container.fullscreen-mode .atlas-viewer-period {
  color: #ffffff !important;
}

.atlas-viewer-container.fullscreen-mode .atlas-btn-back,
.atlas-viewer-container.fullscreen-mode .atlas-tool-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.atlas-viewer-container.fullscreen-mode .atlas-canvas-viewport {
  touch-action: none !important;
  overscroll-behavior: none !important;
  height: calc(100vh - 50px) !important;
}


/* ── BOTÓN FLOTANTE SALIR PANTALLA COMPLETA ── */
.atlas-fullscreen-floating-close {
  display: none;
}

.atlas-viewer-container.fullscreen-mode .atlas-fullscreen-floating-close {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 999999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease;
}

.atlas-viewer-container.fullscreen-mode .atlas-fullscreen-floating-close:hover {
  background: #dc2626;
  border-color: #ef4444;
}

.atlas-viewer-container.fullscreen-mode .atlas-fullscreen-floating-close:active {
  transform: scale(0.92);
}


/* ── MODO PANTALLA COMPLETA INMERSIVO EN TELÉFONO (MAPAS E INFOGRAFÍAS) ── */
.atlas-phone-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: max(16px, env(safe-area-inset-right, 16px));
  z-index: 1000002;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 30, 35, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease;
}

.atlas-phone-close-btn:active {
  transform: scale(0.92);
  background: #dc2626;
  border-color: #ef4444;
}

.atlas-mobile-corner-actions {
  display: none;
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  right: max(16px, env(safe-area-inset-right, 16px));
  flex-direction: column;
  gap: 10px;
  z-index: 1000001;
  align-items: flex-end;
}

.atlas-mobile-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  min-height: 42px;
  border-radius: 22px;
  background: rgba(24, 24, 28, 0.9);
  border: 1.5px solid rgba(245, 158, 11, 0.75);
  color: #fef08a;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease;
}

.atlas-mobile-fab:active {
  transform: scale(0.94);
  background: rgba(45, 45, 52, 0.98);
  border-color: #fbbf24;
}

@media (max-width: 768px) {
  .atlas-viewer-container.atlas-mobile-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    background: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
  }

  .atlas-viewer-container.atlas-mobile-fullscreen .atlas-viewer-toolbar {
    display: none !important;
  }

  .atlas-viewer-container.atlas-mobile-fullscreen .atlas-canvas-viewport {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    background: #000000 !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
    overflow: hidden !important;
  }

  .atlas-viewer-container.atlas-mobile-fullscreen .atlas-toolbar-zoom-group {
    display: none !important;
  }

  .atlas-phone-close-btn {
    display: flex !important;
  }

  .atlas-mobile-corner-actions {
    display: flex !important;
  }

  .atlas-viewer-container.atlas-mobile-fullscreen .atlas-map-legend {
    display: none !important;
  }

}
