/* ===== ECOALTALLER: mapa de cobertura con banderas + modal de comuna ===== */
.ea-cob-map { position: relative; width: 100%; aspect-ratio: 4 / 3; max-width: 760px; margin: 0 auto 22px;
  border-radius: 22px; overflow: hidden; border: 0.5px solid rgba(255,255,255,0.12); background: #141416;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35); z-index: 0; scroll-margin-top: 90px; }
.ea-cob-map #ea-cob-map { width: 100%; height: 100%; }
.ea-cob-hint { text-align: center; font-size: 0.8rem; color: var(--ea-text, #E5E7EB); opacity: 0.7; margin: -10px 0 22px; }
.leaflet-container { font-family: inherit; background: #1b1d21; }
/* Mapa OSM en modo oscuro */
.ea-cob-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.6); }
.ea-cob-map .leaflet-control-attribution { background: rgba(20,20,22,0.75); color: #bbb; }
.ea-cob-map .leaflet-control-attribution a { color: #ddd; }

/* Banderas */
.ea-flag-icon { background: transparent !important; border: none !important; pointer-events: none !important; }
.ea-fl { position: relative; width: 120px; height: 56px; }
.ea-fl svg, .ea-fl b { pointer-events: auto; cursor: pointer; }
.ea-fl svg { position: absolute; left: 56px; top: 0; width: 26px; height: 34px; overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)); transform-origin: 4px 32px; transition: transform .2s cubic-bezier(.25,.8,.25,1); }
.ea-fl b { position: absolute; left: 50%; top: 36px; transform: translateX(-50%);
  font: 700 11px/1 -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; color: #fff; white-space: nowrap;
  background: rgba(20,20,22,0.88); padding: 4px 8px; border-radius: 999px; }
.ea-fl:hover svg { transform: scale(1.15); }
.ea-fl.base b { background: #E60000; }
.ea-fl.sel svg { transform: scale(1.4); animation: ea-wave 1.2s ease-in-out infinite; }
.ea-fl.sel b { background: #fff; color: #111; }
.ea-fl.sel::before { content: ''; position: absolute; left: 50px; top: 24px; width: 20px; height: 14px; border-radius: 50%;
  background: rgba(230,0,0,0.45); animation: ea-ring 1.4s ease-out infinite; }
@keyframes ea-wave { 0%,100% { transform: scale(1.4) rotate(0); } 50% { transform: scale(1.4) rotate(-6deg); } }
@keyframes ea-ring { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.ea-z-lo .ea-fl:not(.base):not(.sel) b { display: none; }
/* Zoom muy alejado: banderas más chicas para que no se amontonen */
.ea-z-xlo .ea-fl:not(.sel) svg { transform: scale(0.62); }
.ea-z-xlo .ea-fl.base b { font-size: 10px; padding: 3px 6px; }
@media (prefers-reduced-motion: reduce) { .ea-fl.sel svg, .ea-fl.sel::before { animation: none; } }

/* Chips / items de comunas clicables */
a.cob-link, a.cobertura-item { cursor: pointer; }
a.cob-link.is-sel, a.cobertura-item.is-sel { border-color: #E60000 !important; background: rgba(230,0,0,0.18) !important; color: #fff !important; }

/* Modal */
.ea-cmodal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ea-cmodal[hidden] { display: none; }
.ea-cmodal-card { position: relative; width: 100%; max-width: 400px; text-align: center; color: #fff;
  background: rgba(30,30,32,0.97); border: 0.5px solid rgba(255,255,255,0.12); border-radius: 26px;
  padding: 30px 22px 22px; box-shadow: 0 24px 70px rgba(0,0,0,0.55); animation: ea-cm-in .22s cubic-bezier(.25,.8,.25,1); }
@keyframes ea-cm-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.ea-cmodal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.1); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.ea-cmodal-flag { display: block; margin: 0 auto 8px; width: 34px; height: 44px; }
.ea-cmodal h3 { font-size: 1.35rem; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.02em; }
.ea-cmodal-sub { font-size: 0.86rem; color: #E5E7EB; opacity: 0.8; margin: 0 0 16px; }
.ea-cmodal-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 20px; }
.ea-cmodal-meta span { font-size: 0.74rem; font-weight: 600; color: #E5E7EB; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,0.07); border: 0.5px solid rgba(255,255,255,0.1); }
.ea-cmodal-actions { display: flex; flex-direction: column; gap: 10px; }
.ea-cmodal-actions a { display: block; padding: 14px; border-radius: 14px; font-weight: 700; font-size: 0.98rem; color: #fff;
  text-decoration: none; transition: transform .15s, filter .2s; }
.ea-cmodal-actions a[hidden] { display: none; }
.ea-cmodal-actions a:active { transform: scale(0.97); }
.ea-cmodal-go { background: linear-gradient(180deg, #F2392F, #D41E16); box-shadow: 0 6px 18px rgba(230,0,0,0.3); }
.ea-cmodal-wa { background: linear-gradient(180deg, #34E07A, #22C35E); }
body.ea-cm-open { overflow: hidden; }
@media (max-width: 600px) {
  .ea-cmodal { align-items: flex-end; padding: 0; }
  .ea-cmodal-card { max-width: none; border-radius: 26px 26px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation-name: ea-cm-up; }
  @keyframes ea-cm-up { from { transform: translateY(100%); } to { transform: none; } }
}
