/* Map Container */
#map {
  position: absolute;
  /* mapa centrado ocupando ~90% de la pantalla */
  width: 90%;
  height: 90vh;
  top: 5vh;
  left: 5%;
  z-index: 0; /* enviar al fondo, otros elementos tienen z-index mayor */
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 0;
  padding: 12px;
  font-size: 14px;
}

/* Top Bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.topbar-logo {
  height: 44px;
  max-height: 44px;
  width: auto;
  object-fit: contain;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  margin: 0 8px;
  overflow-x: auto;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-chips {
  display: flex;
  gap: 6px;
  padding: 2px;
}

/* Side Actions */
.side-actions {
  position: fixed;
  right: 12px;
  top: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.action-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.action-btn.ring-btn.has-unread::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: red;
  border-radius: 50%;
  border: 2px solid white;
}

/* Bottom Sheet */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
  z-index: 900;
  max-height: 70vh;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 12px auto;
  cursor: grab;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.sheet-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.sheet-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  min-height: 0;
}

/* Post overlay layout */
.post-overlay {
  position: fixed;
  inset: 0;
  background: #000000; /* opaco, sin transparencia para que siempre se vea claro */
  z-index: 950;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.post-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.post-overlay-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #ddd;
}

.post-overlay-title {
  font-size: 16px;
  font-weight: 600;
}

.post-overlay-actions {
  display: flex;
  gap: 8px;
}

.post-overlay-icon-btn {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
}

.post-overlay-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  max-height: calc(var(--vh, 100vh) - 52px);
}