/**
 * World map pins — shared by homepage, About, and Contact.
 * Requires inline left/top % on .es-global-map__pin-anchor and labels (global-map-pins.php).
 */

.es-branch-network__map {
  position: relative;
  aspect-ratio: 1000 / 760;
  max-width: min(720px, 100%);
  margin: 0 auto;
}

.es-global-map {
  position: relative;
  width: 100%;
  max-width: min(720px, 100%);
  margin: 0 auto;
  aspect-ratio: 1000 / 760;
  min-height: 280px;
}

.es-global-map__world,
.es-branch-network__map-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
  mix-blend-mode: normal;
  filter: drop-shadow(0 0 28px rgba(80, 180, 255, 0.22));
  pointer-events: none;
}

.es-global-map--callout {
  overflow: visible;
}

.es-global-map__leaders {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.es-global-map__leaders line {
  stroke: rgba(140, 220, 255, 0.62);
  stroke-width: 0.32;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.es-global-map__marker {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.es-global-map__marker:not(.es-global-map__marker--static) {
  cursor: pointer;
}

.es-global-map__marker--static {
  pointer-events: none;
}

.es-global-map__pin-anchor,
.es-global-map__pin-label--callout,
.es-global-map__pin-card {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.es-global-map__pin-anchor {
  z-index: 4;
  width: 0;
  height: 0;
}

.es-global-map__pin-label--callout {
  z-index: 5;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(8, 22, 38, 0.88);
  border: 1px solid rgba(120, 210, 255, 0.42);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.es-global-map__marker.is-active .es-global-map__pin-label--callout,
.es-global-map__marker:hover .es-global-map__pin-label--callout,
.es-global-map__marker:focus-visible .es-global-map__pin-label--callout {
  border-color: rgba(160, 230, 255, 0.85);
  background: rgba(10, 111, 174, 0.55);
}

/* Legacy pin stack (fallback) */
.es-global-map__pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 4;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: center;
}

.es-global-map__pin--static {
  pointer-events: none;
  cursor: default;
}

.es-global-map__pin-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  border: 1px solid rgba(120, 210, 255, 0.55);
  animation: es-map-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.es-global-map__pin-anchor .es-global-map__pin-dot,
.es-global-map__pin-dot,
.es-branch-network__pin-marker {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a8e8ff 0%, #4eb8e8 45%, #0a6fae 100%);
  border: 2px solid #fff;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.45),
    0 0 16px rgba(78, 184, 232, 0.45);
}

.es-global-map__pin-dot::after,
.es-branch-network__pin-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
}

.es-global-map__pin-label,
.es-global-map__pin-label--callout,
.es-branch-network__pin-label {
  font-size: clamp(11px, 1.3vw, 13px);
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 12px rgba(0, 0, 0, 0.55);
}

.es-global-map__pin--label-left .es-global-map__pin-label {
  transform: translate(-50%, -50%) translateX(-10px);
}

.es-global-map__pin--label-right .es-global-map__pin-label {
  transform: translate(-50%, -50%) translateX(10px);
}

.es-global-map__pin-card {
  z-index: 8;
  min-width: min(280px, 72vw);
  max-width: 320px;
  margin-top: -8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(8, 22, 38, 0.92);
  border: 1px solid rgba(120, 200, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
  transform: translate(-50%, calc(-100% - 20px));
}

.es-global-map__marker.is-active .es-global-map__pin-card,
.es-global-map__marker:hover .es-global-map__pin-card,
.es-global-map__marker:focus-visible .es-global-map__pin-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 28px));
}

.es-global-map__pin-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #fff;
}

.es-global-map__pin-addr,
.es-global-map__pin-addr-en {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.es-global-map__pin-addr-en {
  margin-top: 4px;
  color: rgba(180, 210, 235, 0.9);
}

.es-global-map__pin-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
}

.es-global-map__pin:hover .es-global-map__pin-card,
.es-global-map__pin:focus-visible .es-global-map__pin-card,
.es-global-map__pin.is-active .es-global-map__pin-card {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.es-global-map__marker.is-active .es-global-map__pin-dot,
.es-global-map__marker:hover .es-global-map__pin-dot,
.es-global-map__marker:focus-visible .es-global-map__pin-dot {
  box-shadow:
    0 2px 16px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(120, 220, 255, 0.75);
}

.es-global-map__aside {
  display: grid;
  gap: clamp(20px, 3vw, 28px);
  align-content: start;
}

.es-global-map__aside-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
}

.es-global-map__office-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(14px, 1.8vw, 18px);
}

.es-global-map__office-item {
  position: relative;
  padding: 12px 14px 12px 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  cursor: default;
  transition:
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.36s ease,
    border-color 0.36s ease,
    background-color 0.36s ease;
}

.es-global-map__office-num {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #0a1f33;
  background: linear-gradient(145deg, #a8e8ff 0%, #4eb8e8 100%);
  box-shadow: 0 0 12px rgba(78, 184, 232, 0.45);
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s ease;
}

.es-global-map__office-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: #fff;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}

.es-global-map__office-item p {
  margin: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}

.es-global-map__office-en {
  margin-top: 4px !important;
  font-size: 12px;
  color: rgba(180, 210, 235, 0.88) !important;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}

.es-global-map__office-item:hover,
.es-global-map__office-item:focus-within {
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  border-color: rgba(120, 210, 255, 0.55);
  background: rgba(10, 111, 174, 0.28);
}

.es-global-map__office-item:hover strong,
.es-global-map__office-item:focus-within strong {
  transform: translateX(4px) scale(1.04);
}

.es-global-map__office-item:hover p,
.es-global-map__office-item:focus-within p,
.es-global-map__office-item:hover .es-global-map__office-en,
.es-global-map__office-item:focus-within .es-global-map__office-en {
  transform: translateX(3px);
}

.es-global-map__office-item:hover .es-global-map__office-num,
.es-global-map__office-item:focus-within .es-global-map__office-num {
  transform: scale(1.12);
  box-shadow: 0 0 18px rgba(78, 184, 232, 0.65);
}

.es-global-map__office-item.is-highlight {
  border-color: rgba(120, 210, 255, 0.55);
  background: rgba(10, 111, 174, 0.22);
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.es-global-map__office-item.is-highlight strong {
  transform: translateX(4px) scale(1.04);
}

.es-global-map__office-item.is-highlight p,
.es-global-map__office-item.is-highlight .es-global-map__office-en {
  transform: translateX(3px);
}

.es-global-map__office-item.is-highlight .es-global-map__office-num {
  transform: scale(1.12);
  box-shadow: 0 0 18px rgba(78, 184, 232, 0.65);
}

@keyframes es-map-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.85;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .es-global-map__pin-ring {
    animation: none;
  }

  .es-global-map__office-item:hover,
  .es-global-map__office-item:focus-within,
  .es-global-map__office-item.is-highlight {
    transform: none;
  }

  .es-global-map__office-item:hover strong,
  .es-global-map__office-item:hover p,
  .es-global-map__office-item:hover .es-global-map__office-en,
  .es-global-map__office-item:hover .es-global-map__office-num,
  .es-global-map__office-item.is-highlight strong,
  .es-global-map__office-item.is-highlight p,
  .es-global-map__office-item.is-highlight .es-global-map__office-en,
  .es-global-map__office-item.is-highlight .es-global-map__office-num {
    transform: none;
  }
}

@media (max-width: 900px) {
  .es-global-map__pin-label--callout {
    font-size: 11px;
    padding: 4px 8px;
  }

  .es-global-map__leaders line {
    stroke-width: 0.4;
  }
}
