.actor-map-marker {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  transform: scale(var(--zoom-scale, 1));
  transition: transform 160ms ease, scale 160ms ease;
  cursor: pointer;
}

.actor-map-marker:hover {
  scale: 1.2;
}

.actor-map-marker__pulse,
.actor-map-marker__dot {
  position: absolute;
  display: block;
  border-radius: 50%;
}

.actor-map-marker__pulse {
  inset: 3px;
  border: 2px solid var(--marker-color);
  animation: actor-marker-pulse 1.8s ease-out infinite;
}

.actor-map-marker__dot {
  width: 12px;
  height: 12px;
  background: var(--marker-color);
  border: 2px solid #fff;
  box-shadow: 0 0 10px var(--marker-color);
}

@keyframes actor-marker-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }

  80%,
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .actor-map-marker__pulse {
    animation: none;
  }

  .actor-map-marker {
    transition: none;
  }
}

.map-controls.map-overlay {
  position: absolute;
  z-index: 20;
  top: 20px;
  right: 20px;
  width: fit-content;
  min-width: 0;
  max-width: calc(100vw - 32px);
  max-height: calc(100% - 40px);
  box-sizing: border-box;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  background: rgba(10, 16, 28, 0.92);
  color: #e2e8f0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
}

.map-search {
  width: min(300px, calc(100vw - 80px));
  margin-top: 14px;
  pointer-events: auto;
}

.map-header-search-slot .map-search {
  position: relative;
  width: 100%;
  margin: 0;
}

.map-header-search-slot .map-actor-search-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  box-sizing: border-box;
}

.map-search .map-actor-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.78);
  color: #94a3b8;
}

.map-search .map-actor-search input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f8fafc;
  font: 12px system-ui, sans-serif;
}

.map-search .map-actor-search input::placeholder {
  color: #94a3b8;
}

.map-actor-search-results {
  display: grid;
  gap: 3px;
  max-height: 180px;
  overflow: auto;
  margin: 4px 0 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(10, 16, 28, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.map-actor-search-results button {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e2e8f0;
  font: 12px system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}

.map-actor-search-results button:hover,
.map-actor-search-results button:focus-visible {
  background: rgba(148, 163, 184, 0.16);
}

.map-actor-search-results p {
  margin: 0;
  padding: 8px 10px;
  color: #94a3b8;
  font: 12px system-ui, sans-serif;
}

.map-controls .map-controls-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: max-content;
  margin: 0;
  padding: 3px 2px;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: transparent;
  color: #f8fafc;
  font: 700 11px system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.map-controls .map-controls-toggle small {
  margin-left: 5px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
}

.map-layer-list {
  display: grid;
  gap: 0;
  width: max-content;
  max-width: 100%;
  max-height: min(calc(100dvh - 130px), 620px);
  overflow: auto;
  margin: 2px 0 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.map-layer-list::-webkit-scrollbar {
  width: 5px;
}

.map-layer-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 5px;
}

.map-layer-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  transition: background 120ms ease, color 120ms ease;
}

.map-layer-row.is-visible {
  color: #e2e8f0;
}

.map-layer-row:hover {
  background: rgba(148, 163, 184, 0.1);
}

.map-layer-color {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.map-layer-name {
  flex: 0 1 auto;
  max-width: min(220px, calc(100vw - 100px));
  overflow: hidden;
  font: 11px/1.15 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-layer-visibility {
  display: grid;
  width: 20px;
  height: 22px;
  flex: 0 0 20px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.map-layer-row.is-visible .map-layer-visibility {
  color: #a3e635;
}

.map-layer-visibility:hover,
.map-layer-visibility:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
}

.map-controls.is-collapsed {
  width: fit-content;
}

.map-controls.is-collapsed .map-controls-toggle {
  border-top: 0;
}

.map-actor-popup {
  width: min(300px, calc(100vw - 64px));
  box-sizing: border-box;
  padding: 12px;
  color: #e2e8f0;
  font: 12px/1.45 system-ui, sans-serif;
}

.map-actor-popup__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.map-actor-popup__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.map-actor-popup__category {
  padding: 2px 6px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  font-size: 10px;
}

.map-actor-popup__close {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  margin: -5px -5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #94a3b8;
  font: 18px/1 system-ui, sans-serif;
  cursor: pointer;
}

.map-actor-popup__close:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #fff;
}

.map-actor-popup__title {
  margin: 5px 0 4px;
  color: #f8fafc;
  font: 700 15px/1.25 system-ui, sans-serif;
}

.map-actor-popup__address {
  margin: 0 0 8px;
  color: #cbd5e1;
}

.map-actor-popup__links {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.map-actor-popup a {
  color: #93c5fd;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.map-actor-popup a:hover {
  color: #dbeafe;
  text-decoration: underline;
}

.map-actor-popup a.map-actor-popup__whatsapp {
  color: #4ade80;
}

.map-actor-popup a.map-actor-popup__directory {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  color: #a3e635;
}

.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: #0f172a;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.gm-style .gm-style-iw-d {
  overflow: auto !important;
  max-height: none !important;
}

.gm-style .gm-style-iw-t::after {
  background: #0f172a;
}

@media (max-width: 760px) {
  .map-controls.map-overlay {
    top: 10px;
    right: 10px;
    max-width: calc(100vw - 20px);
    max-height: calc(100% - 20px);
  }

  .map-search {
    width: min(300px, calc(100vw - 80px));
  }

  .map-layer-list {
    max-height: min(calc(100dvh - 120px), 420px);
  }
}
