/* ==========================================================================
   EMA Eco-Movement Map
   Frontend styles for [eco_movement_map]
   ========================================================================== */

.ema-emm {
  --ema-text: #111827;
  --ema-muted: #6b7280;
  --ema-border: rgba(17, 24, 39, 0.12);
  --ema-border-strong: rgba(17, 24, 39, 0.22);
  --ema-bg: #ffffff;
  --ema-bg-soft: #f8fafc;
  --ema-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --ema-shadow-hover: 0 12px 30px rgba(15, 23, 42, 0.12);
  --ema-radius: 14px;
  --ema-radius-map: 16px;
  position: relative;
  width: 100%;
  color: var(--ema-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  box-sizing: border-box;
}

.ema-emm *,
.ema-emm *::before,
.ema-emm *::after {
  box-sizing: border-box;
}

/* ==========================================================================
   Filters - premium UI
   ========================================================================== */

.ema-emm__filters {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0 0 16px;
  padding: 18px 18px 14px;
  overflow: visible;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
}

.ema-emm__field {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.ema-emm__field label {
  margin: 0;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.ema-emm__field--active label {
  color: #111827;
}

/* El select nativo se conserva como fuente de datos, pero la UI visible es custom. */
.ema-emm__native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ema-emm__field input[data-ema-filter] {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #dde2e8;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #111827;
  font: 600 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ema-emm__field input[data-ema-filter]::placeholder {
  color: #9ca3af;
  font-weight: 500;
}

.ema-emm__field input[data-ema-filter]:hover {
  border-color: #c7cdd5;
}

.ema-emm__field input[data-ema-filter]:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.ema-emm__field--active input[data-ema-filter] {
  border-color: #9ca3af;
  background: #fbfbfc;
}

/* Custom dropdown */
.ema-emm-select {
  position: relative;
  width: 100%;
}

.ema-emm-select__button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 0 42px 0 14px;
  border: 1px solid #dde2e8;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #4b5563;
  font: 600 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ema-emm-select__button:hover {
  border-color: #c7cdd5;
  background: #fcfcfd;
}

.ema-emm-select__button:focus-visible,
.ema-emm-select.is-open .ema-emm-select__button {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.ema-emm-select__button.has-value {
  border-color: #b7bec8;
  background: #fbfbfc;
  color: #111827;
}

.ema-emm-select__value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ema-emm-select__chevron {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 1.7px solid #6b7280;
  border-bottom: 1.7px solid #6b7280;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 0.16s ease, margin-top 0.16s ease;
}

.ema-emm-select.is-open .ema-emm-select__chevron {
  margin-top: -2px;
  transform: rotate(225deg);
}

.ema-emm-select__menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 8px);
  left: 0;
  width: max(100%, 240px);
  max-width: min(330px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.05);
  transform-origin: top center;
}

.ema-emm-select__menu[hidden] {
  display: none !important;
}

.ema-emm-select__search-wrap {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 10px;
  border-bottom: 1px solid #eef0f3;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
}

.ema-emm-select__search {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 11px;
  border: 1px solid #e1e5ea;
  border-radius: 9px;
  outline: none;
  background: #f9fafb;
  color: #111827;
  font: 500 13px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ema-emm-select__search:focus {
  border-color: #b3bac4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05);
}

.ema-emm-select__list {
  max-height: 286px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.ema-emm-select__option {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: transparent;
  color: #374151;
  font: 500 13px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.ema-emm-select__option:hover,
.ema-emm-select__option:focus-visible {
  background: #f5f6f8;
  color: #111827;
}

.ema-emm-select__option[aria-selected="true"] {
  background: #f0f2f5;
  color: #111827;
  font-weight: 700;
}

.ema-emm-select__option[aria-selected="true"] .ema-emm-select__option-label::before {
  display: inline-block;
  margin-right: 7px;
  color: #111827;
  content: "\2713";
}

.ema-emm-select__option-count {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.ema-emm-select__option[aria-selected="true"] .ema-emm-select__option-count {
  background: #e5e7eb;
  color: #374151;
}

.ema-emm__field--reset {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  margin-top: -2px;
}

.ema-emm__reset {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font: 650 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.ema-emm__reset:hover {
  background: #f3f4f6;
  color: #111827;
}

.ema-emm__reset:focus-visible {
  outline: 2px solid rgba(17, 24, 39, 0.18);
  outline-offset: 2px;
}

/* ==========================================================================
   Summary
   ========================================================================== */

.ema-emm__summary {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.ema-emm__summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ema-emm__summary-item strong {
  color: #111827;
  font-weight: 750;
}

.ema-emm__summary-item--available {
  padding: 5px 9px;
  border: 1px solid #d9efe1;
  border-radius: 999px;
  background: #f3fbf6;
  color: #39704d;
}

.ema-emm__summary-item--available strong {
  color: #21623a;
}

.ema-emm__summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22a559;
  box-shadow: 0 0 0 3px rgba(34, 165, 89, 0.11);
}

/* ==========================================================================
   Map
   ========================================================================== */

.ema-emm__map-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--ema-radius-map);
  background: #f3f4f6;
  box-shadow: var(--ema-shadow);
}

.ema-emm__map {
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  border-radius: inherit;
  background: #eef2f7;
}

.ema-emm__map img {
  max-width: none;
}

/* Evita que estilos globales de themes/Elementor rompan controles de Google. */
.ema-emm__map button,
.ema-emm__map input,
.ema-emm__map select {
  font-family: Arial, sans-serif;
}

.ema-emm__map .gm-style img {
  max-width: none !important;
}

.ema-emm__map .gm-style-iw,
.ema-emm__map .gm-style-iw-d {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ==========================================================================
   Loading and messages
   ========================================================================== */

.ema-emm__loading,
.ema-emm__message {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  max-width: calc(100% - 40px);
  transform: translate(-50%, -50%);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(4px);
}

.ema-emm__loading[hidden],
.ema-emm__message[hidden] {
  display: none !important;
}

.ema-emm--loading .ema-emm__map {
  opacity: 0.72;
}

.ema-emm__message[data-ema-message-type="empty"] {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ema-text);
  border-color: var(--ema-border);
}

.ema-emm__message[data-ema-message-type="error"] {
  background: rgba(127, 29, 29, 0.96);
  color: #fff;
}

.ema-emm__noscript,
.ema-emm-config-error {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--ema-border);
  border-radius: 10px;
  background: var(--ema-bg-soft);
  color: var(--ema-text);
  font-size: 14px;
  line-height: 1.45;
}

/* ==========================================================================
   Google Maps InfoWindow
   ========================================================================== */

.ema-emm-iw {
  width: min(300px, 72vw);
  padding: 2px 2px 4px;
  color: var(--ema-text);
  font: 14px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ema-emm-iw__title {
  margin: 0 0 7px;
  padding: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.ema-emm-iw__address {
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
}

.ema-emm-iw__meta {
  margin: 6px 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.4;
}

.ema-emm-iw__meta strong {
  color: #111827;
  font-weight: 700;
}

.ema-emm-iw__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.ema-emm-iw__status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.ema-emm-iw__status--available {
  background: #ecfdf5;
  color: #047857;
}

.ema-emm-iw__status--charging {
  background: #eff6ff;
  color: #1d4ed8;
}

.ema-emm-iw__status--reserved {
  background: #fff7ed;
  color: #c2410c;
}

.ema-emm-iw__status--blocked,
.ema-emm-iw__status--inoperative,
.ema-emm-iw__status--outoforder {
  background: #fef2f2;
  color: #b91c1c;
}

.ema-emm-iw__status--planned {
  background: #f5f3ff;
  color: #6d28d9;
}

.ema-emm-iw__status--removed,
.ema-emm-iw__status--unknown {
  background: #f3f4f6;
  color: #6b7280;
}

.ema-emm-iw__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ema-emm-iw__directions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #111827;
  color: #fff !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none !important;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.ema-emm-iw__directions:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ==========================================================================
   Google UI normalization
   ========================================================================== */

.ema-emm .gm-style .gm-style-iw-c {
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.ema-emm .gm-style .gm-style-iw-d {
  overflow: auto !important;
}

.ema-emm .gm-style button {
  box-shadow: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
  .ema-emm__filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: 15px;
  }

  .ema-emm__field--reset {
    grid-column: 1 / -1;
  }

  .ema-emm__summary {
    font-size: 12px;
  }

  .ema-emm-select__menu {
    width: max(100%, 220px);
  }

  .ema-emm__map-wrap,
  .ema-emm__map {
    border-radius: 12px;
  }

  .ema-emm-iw {
    width: min(280px, 70vw);
  }
}

@media (max-width: 479px) {
  .ema-emm__filters {
    grid-template-columns: 1fr;
  }

  .ema-emm__field,
  .ema-emm__field--reset {
    width: 100%;
    min-width: 0;
  }

  .ema-emm__field--reset {
    justify-content: flex-start;
  }

  .ema-emm-select__button,
  .ema-emm__field input[data-ema-filter] {
    min-height: 46px;
  }

  .ema-emm-select__menu {
    width: 100%;
    max-width: none;
  }

  .ema-emm__loading,
  .ema-emm__message {
    width: calc(100% - 32px);
    max-width: none;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .ema-emm *,
  .ema-emm *::before,
  .ema-emm *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==========================================================================
   InfoWindow compact polish
   ========================================================================== */

.ema-emm .gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 14px !important;
  overflow: visible !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.ema-emm .gm-style .gm-style-iw-chr {
  position: absolute !important;
  z-index: 10 !important;
  top: 7px !important;
  right: 7px !important;
  height: 32px !important;
}

.ema-emm .gm-style .gm-ui-hover-effect {
  top: 0 !important;
  right: 0 !important;
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
}

.ema-emm .gm-style .gm-style-iw-d {
  overflow: auto !important;
  padding: 0 !important;
}

.ema-emm-iw {
  width: min(300px, 72vw);
  padding: 18px 42px 18px 18px !important;
}

.ema-emm-iw__title {
  margin: 0 0 8px !important;
}
/* =========================================================
   Evitar doble flecha en dropdowns personalizados
   ========================================================= */

.ema-emm-select__button {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}

/* Evita flechas/iconos agregados por Elementor o el theme */
.ema-emm-select__button::before,
.ema-emm-select__button::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* También neutralizamos cualquier estilo del select nativo oculto */
.ema-emm__native-select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}
/* =========================================================
   Tooltip de ubicaciones agrupadas
   ========================================================= */

.ema-emm-iw--cluster {
  width: min(320px, 72vw) !important;
  max-height: 360px;
  overflow-y: auto;
  padding: 18px 42px 16px 18px !important;
}

/* Un poco de aire debajo del título */
.ema-emm-iw--cluster > div:first-child {
  margin-bottom: 6px !important;
}

/* El último elemento no necesita línea inferior */
.ema-emm-iw--cluster > div:last-child {
  border-bottom: 0 !important;
}

/* =========================================================
   FIX DEFINITIVO - doble flecha de dropdowns
   ========================================================= */

html body .ema-emm .ema-emm-select > button.ema-emm-select__button {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}

/* Elimina cualquier flecha agregada por theme / Elementor */
html body .ema-emm .ema-emm-select > button.ema-emm-select__button::before,
html body .ema-emm .ema-emm-select > button.ema-emm-select__button::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  background-image: none !important;
  -webkit-mask: none !important;
  mask: none !important;
  transform: none !important;
}

/* Por si el theme intenta añadir el icono al texto interior */
html body .ema-emm .ema-emm-select__value::before,
html body .ema-emm .ema-emm-select__value::after {
  content: none !important;
  display: none !important;
}

/* Conservamos exclusivamente nuestra flecha */
html body .ema-emm .ema-emm-select__chevron {
  display: block !important;
  position: absolute !important;
  top: 50% !important;
  right: 15px !important;
  width: 8px !important;
  height: 8px !important;
  margin-top: -6px !important;
  border: 0 !important;
  border-right: 1.7px solid #6b7280 !important;
  border-bottom: 1.7px solid #6b7280 !important;
  background: transparent !important;
  transform: rotate(45deg) !important;
  pointer-events: none !important;
}

html body .ema-emm .ema-emm-select.is-open .ema-emm-select__chevron {
  margin-top: -2px !important;
  transform: rotate(225deg) !important;
}

.select_container:after{
    margin-right:10px;
}

html body .ema-emm .ema-emm-select__chevron{
    display:none!important;
}

.ema-emm-select__search{
    padding:10px;
}