/* Clínica Premium · Mapa 3D Ubicaciones */
.cp-map3d {
  --cp-primary: #1e1b58;
  --cp-accent: #3e66ff;
  --cp-text: #1d2733;
  --cp-muted: #5f6b7a;
  --cp-radius: 14px;
  --cp-map-h: 600px;
  --cp-shadow: 0 10px 30px rgba(30, 27, 88, .18);

  position: relative;
  width: 100%;
  height: var(--cp-map-h);
  border-radius: var(--cp-radius);
  overflow: hidden;
  box-shadow: var(--cp-shadow);
  background: #dfe8ef;
  font-family: inherit;
  color: var(--cp-text);
}
.cp-map3d.cp-map3d--no-shadow { box-shadow: none; }
.cp-map3d *, .cp-map3d *::before, .cp-map3d *::after { box-sizing: border-box; }
.cp-map3d__map { position: absolute; inset: 0; }

/* Location list panel */
.cp-map3d__panel {
  position: absolute; z-index: 2;
  top: 16px; left: 16px;
  width: min(320px, calc(100% - 32px));
  display: flex; flex-direction: column; gap: 10px;
}

/* Explicit resets: Hello Elementor styles every <button> globally */
.cp-map3d .cp-card,
.cp-map3d .cp-card:hover,
.cp-map3d .cp-card:focus {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; margin: 0; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 2px solid transparent; border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
  font: inherit; color: inherit; text-transform: none; letter-spacing: normal; white-space: normal;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.cp-map3d .cp-card { opacity: 0; transform: translateX(-20px); animation: cp-slide-in .6s ease forwards; }
.cp-map3d .cp-card:nth-child(2) { animation-delay: .15s; }
.cp-map3d .cp-card:nth-child(3) { animation-delay: .3s; }
.cp-map3d .cp-card:hover { transform: translateX(4px); }
.cp-map3d .cp-card.is-active { border-color: var(--cp-accent); box-shadow: 0 6px 20px rgba(62, 102, 255, .35); }
.cp-map3d .cp-card:focus-visible { outline: 3px solid var(--cp-accent); outline-offset: 2px; }

.cp-map3d .cp-num {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cp-primary); color: #fff; font-weight: 700; font-size: 14px; line-height: 1;
}
.cp-map3d .cp-card.is-active .cp-num { background: var(--cp-accent); }
.cp-map3d .cp-card__title {
  display: block; margin: 0 0 3px; font-size: 13.5px; font-weight: 700; line-height: 1.25;
  color: var(--cp-primary); text-transform: uppercase; letter-spacing: .02em;
}
.cp-map3d .cp-card__text { display: block; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--cp-muted); }
.cp-map3d .cp-card__nica { display: block; margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--cp-muted); opacity: .8; }

@keyframes cp-slide-in { to { opacity: 1; transform: translateX(0); } }

/* Pulsing marker. No "position" on .cp-marker: MapLibre needs .maplibregl-marker to stay absolute */
.cp-map3d .cp-marker { width: 44px; height: 56px; cursor: pointer; }
.cp-map3d .cp-pin {
  position: absolute; left: 50%; bottom: 10px; width: 36px; height: 36px;
  margin-left: -18px; border-radius: 50% 50% 50% 0;
  background: var(--cp-primary); transform: rotate(-45deg);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .3);
  transition: background .3s ease;
  animation: cp-drop .9s cubic-bezier(.3, 1.6, .5, 1) both;
}
.cp-map3d .cp-pin span {
  position: absolute; inset: 0; display: grid; place-items: center;
  transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 14px; line-height: 1;
}
.cp-map3d .cp-pulse {
  position: absolute; left: 50%; bottom: 0; width: 20px; height: 8px; margin-left: -10px;
  border-radius: 50%; background: rgba(62, 102, 255, .5);
}
.cp-map3d .cp-pulse::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 60px; height: 24px; margin: -12px 0 0 -30px; border-radius: 50%;
  border: 2px solid var(--cp-accent); opacity: 0;
  animation: cp-ring 2s ease-out infinite;
}
.cp-map3d .cp-marker.is-active .cp-pin { background: var(--cp-accent); }
.cp-map3d .cp-marker.is-active { z-index: 5; }

@keyframes cp-drop { from { transform: translateY(-80px) rotate(-45deg); opacity: 0; } to { transform: rotate(-45deg); opacity: 1; } }
@keyframes cp-ring { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* Popup */
.cp-map3d .maplibregl-popup-content {
  border-radius: 10px; padding: 12px 14px; box-shadow: var(--cp-shadow);
  font-family: inherit; font-size: 13px; line-height: 1.45; color: var(--cp-text);
}
.cp-map3d .cp-popup__title { display: block; margin-bottom: 4px; font-weight: 700; color: var(--cp-primary); }
.cp-map3d .cp-popup__nica { font-size: 11px; color: var(--cp-muted); }
/* "Get directions" pill; explicit states because the Elementor kit styles every link */
.cp-map3d .cp-popup a.cp-popup__cta,
.cp-map3d .cp-popup a.cp-popup__cta:visited {
  display: flex; width: fit-content; align-items: center; gap: 4px;
  margin-top: 8px; padding: 5px 12px;
  border-radius: 999px; border: 0;
  background: var(--cp-accent); color: #fff;
  font-size: 11.5px; font-weight: 600; line-height: 1.3; letter-spacing: .01em;
  text-decoration: none; box-shadow: 0 2px 6px rgba(62, 102, 255, .3);
  transition: background .2s ease, transform .2s ease;
}
.cp-map3d .cp-popup a.cp-popup__cta:hover,
.cp-map3d .cp-popup a.cp-popup__cta:focus {
  background: var(--cp-primary); color: #fff; text-decoration: none; transform: translateY(-1px);
}
.cp-map3d .cp-popup a.cp-popup__cta:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 2px; }

/* Compact layout (set from JS by container width, not viewport): panel below the map */
.cp-map3d.is-compact { height: auto; display: flex; flex-direction: column; }
.cp-map3d.is-compact .cp-map3d__map { position: relative; height: min(var(--cp-map-h), 60vh); min-height: 340px; }
.cp-map3d.is-compact .cp-map3d__panel { position: static; width: 100%; padding: 12px; background: #fff; }
.cp-map3d.is-compact .cp-card { box-shadow: none; border-color: #e3e9ef; }

@media (prefers-reduced-motion: reduce) {
  .cp-map3d .cp-card { animation: none; opacity: 1; transform: none; }
  .cp-map3d .cp-pin { animation: none; }
  .cp-map3d .cp-pulse::after { animation: none; }
}
