/* === GRAN ATLAS INTERACTIVO DE ELCHE · ESTILO EDITORIAL PRO === */
.esm-atlas-wrap {
  padding: 1.4rem 0 2.8rem;
  background: linear-gradient(180deg, #eef6f4 0%, #f6f8fb 260px);
}

.esm-atlas-hero {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-left: 5px solid #0d9488;
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px -8px rgba(9, 17, 31, 0.08);
}

.esm-atlas-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b6e66;
  background: #e6f7f5;
  border: 1px solid #99f6e4;
  padding: 0.2rem 0.62rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.esm-atlas-hero h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  color: #09111f !important;
  line-height: 1.15;
}

.esm-atlas-hero p {
  margin: 0;
  font-size: 0.92rem;
  color: #334155 !important;
  max-width: 68ch;
}

.esm-atlas-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.esm-radar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.68rem 1.18rem;
  border-radius: 12px;
  border: 1px solid #0b6e66;
  background: linear-gradient(180deg, #0d9488 0%, #0b6e66 100%);
  color: #ffffff !important;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px -4px rgba(11, 110, 102, 0.42);
  transition: transform 0.16s ease, filter 0.16s ease;
}
.esm-radar-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.esm-radar-btn.is-active {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28), 0 8px 20px -4px rgba(4, 120, 87, 0.45);
}
.esm-radar-btn svg { color: #ffffff !important; flex-shrink: 0; }

.esm-atlas-sec-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.64rem 0.98rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #09111f !important;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}
.esm-atlas-sec-btn:hover,
.esm-atlas-sec-btn.is-pick-mode {
  background: #f0fdfa;
  border-color: #0d9488;
  color: #0b6e66 !important;
}
.esm-atlas-sec-btn svg { color: #0d9488; flex-shrink: 0; }

/* Barra de estado Radar Cerca de Mi */
.esm-radar-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 14px;
  padding: 0.68rem 1rem;
  margin-bottom: 0.9rem;
  color: #065f46;
  font-size: 0.86rem;
}
.esm-radar-bar.is-visible {
  display: flex;
}
.esm-radar-radii {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.esm-rad-pill {
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  border: 1px solid #6ee7b7;
  background: #ffffff;
  color: #065f46 !important;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}
.esm-rad-pill.is-active {
  background: #059669;
  border-color: #047857;
  color: #ffffff !important;
}

/* Barra horizontal de capas con iconos SVG */
.esm-atlas-layers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 0.75rem;
  margin-bottom: 0.35rem;
  scrollbar-width: thin;
}
.esm-layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.88rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b !important;
  font-size: 0.83rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(9, 17, 31, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.esm-layer-chip:hover {
  transform: translateY(-1px);
  border-color: #0d9488;
}
.esm-layer-chip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.esm-layer-chip .esm-lc-count {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.08rem 0.44rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}
.esm-layer-chip.is-active {
  background: #09111f;
  border-color: #09111f;
  color: #ffffff !important;
  box-shadow: 0 6px 16px -4px rgba(9, 17, 31, 0.28);
}
.esm-layer-chip.is-active svg {
  color: #5eead4 !important;
}
.esm-layer-chip.is-active .esm-lc-count {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Conmutador movil Mapa / Lista */
.esm-atlas-mob-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.esm-mob-vtab {
  padding: 0.58rem 0.8rem;
  border-radius: 11px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #09111f !important;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.esm-mob-vtab.is-active {
  background: #0d9488;
  border-color: #0b6e66;
  color: #ffffff !important;
}

/* Rejilla principal: Mapa + Panel Explorador */
.esm-atlas-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.esm-atlas-map-shell {
  position: sticky;
  top: 82px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 32px -10px rgba(9, 17, 31, 0.12);
}

#esm-atlas-map {
  width: 100%;
  height: clamp(460px, 70vh, 690px);
  background: #e2e8f0;
  z-index: 1;
}

.esm-atlas-map-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.58rem 0.95rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.78rem;
  color: #475569;
  flex-wrap: wrap;
}

/* Columna derecha: Buscador + Lista de tarjetas */
.esm-atlas-sidebar {
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  padding: 0.95rem;
  box-shadow: 0 8px 24px -8px rgba(9, 17, 31, 0.07);
}

.esm-atlas-search-box {
  position: relative;
  margin-bottom: 0.75rem;
}
.esm-atlas-search-box input {
  width: 100%;
  padding: 0.65rem 2.2rem 0.65rem 2.35rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc !important;
  color: #09111f !important;
  font-size: 0.9rem;
  font-weight: 600;
}
.esm-atlas-search-box input:focus {
  outline: none;
  border-color: #0d9488 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}
.esm-atlas-search-ic {
  position: absolute;
  left: 0.78rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}
.esm-atlas-clear-btn {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  display: none;
}

.esm-atlas-list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.79rem;
  font-weight: 750;
  color: #475569;
  padding: 0 0.2rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.65rem;
}

.esm-atlas-cards {
  max-height: 590px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  padding-right: 0.2rem;
}

.esm-place-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.72rem;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.esm-place-item:hover,
.esm-place-item.is-selected {
  border-color: #0d9488;
  background: #f0fdfa;
  transform: translateX(2px);
}
.esm-place-thumb {
  width: 66px;
  height: 66px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
}
.esm-place-ic-box {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.esm-place-body {
  min-width: 0;
  flex: 1;
}
.esm-place-top {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
  margin-bottom: 0.18rem;
}
.esm-place-dist {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}
.esm-place-multi {
  font-size: 0.69rem;
  font-weight: 800;
  padding: 0.08rem 0.44rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
}
.esm-place-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #09111f !important;
  line-height: 1.25;
}
.esm-place-sub {
  font-size: 0.76rem;
  color: #52637a !important;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.esm-place-links {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.42rem;
}
.esm-place-links a {
  font-size: 0.76rem;
  font-weight: 750;
  color: #0b6e66 !important;
  text-decoration: none !important;
}
.esm-place-links a:hover {
  text-decoration: underline !important;
}

/* Marcadores SVG y Clusters sobre Leaflet */
.esm-svg-marker {
  background: transparent !important;
  border: 0 !important;
}
.esm-pin-bubble {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #ffffff;
  box-shadow: 0 6px 14px rgba(9, 17, 31, 0.32);
  position: relative;
}
.esm-pin-bubble svg {
  transform: rotate(45deg);
  width: 15px;
  height: 15px;
  color: #ffffff !important;
  stroke: #ffffff !important;
}
.esm-pin-cnt {
  position: absolute;
  top: -6px;
  right: -8px;
  transform: rotate(45deg);
  background: #09111f;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  line-height: 1.1;
}

.esm-cluster-icon {
  background: transparent !important;
  border: 0 !important;
}
.esm-cluster-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(11, 110, 102, 0.92);
  border: 3px solid #ffffff;
  color: #ffffff !important;
  font-weight: 850;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(9, 17, 31, 0.3);
}

.esm-user-gps-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.28), 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Popup Pro dentro de Leaflet */
.leaflet-popup-content-wrapper {
  border-radius: 15px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 18px 38px -8px rgba(9, 17, 31, 0.25) !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  width: 285px !important;
}
.esm-pop-card {
  padding: 0.9rem;
  background: #ffffff;
  color: #1e293b;
  font-family: system-ui, -apple-system, sans-serif;
}
.esm-pop-img {
  width: 100%;
  height: 126px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.6rem;
  background: #f1f5f9;
}
.esm-pop-title {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.98rem;
  font-weight: 850;
  color: #09111f !important;
  line-height: 1.25;
}
.esm-pop-desc {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: #475569 !important;
  line-height: 1.45;
}
.esm-pop-btns {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
}
.esm-pop-btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 0.7rem;
  border-radius: 9px;
  background: #0d9488;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none !important;
}
.esm-pop-btn-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.46rem 0.58rem;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #09111f !important;
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: none !important;
  cursor: pointer;
}
.esm-pop-sublist {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #cbd5e1;
  max-height: 115px;
  overflow-y: auto;
}
.esm-pop-sublist a {
  display: block;
  font-size: 0.75rem;
  color: #0b6e66 !important;
  padding: 0.2rem 0;
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.esm-pop-sublist a:hover { text-decoration: underline !important; }

@media (max-width: 980px) {
  .esm-atlas-mob-tabs {
    display: grid;
  }
  .esm-atlas-grid {
    grid-template-columns: 1fr;
  }
  .esm-atlas-map-shell {
    position: static;
  }
  #esm-atlas-map {
    height: 62vh;
    min-height: 370px;
  }
  .esm-atlas-grid.mob-view-list .esm-atlas-map-shell {
    display: none;
  }
  .esm-atlas-grid.mob-view-map .esm-atlas-sidebar {
    display: none;
  }
}

/* === LEAFLET_TILE_PROTECTION === */
#esm-atlas-map {
  width: 100% !important;
  height: 620px !important;
  min-height: 440px !important;
  position: relative !important;
  display: block !important;
  background: #dde6ee !important;
}
@media (max-width: 980px) {
  #esm-atlas-map {
    height: 62vh !important;
    min-height: 380px !important;
  }
}
html body #esm-atlas-map.leaflet-container img,
html body #esm-atlas-map .leaflet-pane img,
html body #esm-atlas-map img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
html body #esm-atlas-map img.leaflet-tile {
  width: 256px !important;
  height: 256px !important;
}
html body #esm-atlas-map .esm-pin-bubble svg {
  width: 15px !important;
  height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
}
