/* Customer installation map, scoped to the redesigned public page. */
.installations-hero {
  color: #fff;
  background:
    radial-gradient(circle at 82% 24%, rgba(32, 165, 255, .25), transparent 27%),
    linear-gradient(115deg, #02162f 0%, #063562 100%);
  border-bottom: 1px solid var(--blue);
}

.installations-hero-inner {
  min-height: 330px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.installations-hero h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.installations-hero-inner > div:first-child > p:last-child {
  max-width: 680px;
  margin: 0;
  color: #dce9f6;
  font-size: 16px;
  line-height: 1.65;
}

.installations-summary {
  min-width: 158px;
  padding: 25px 22px;
  text-align: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 9px;
  backdrop-filter: blur(7px);
}

.installations-summary strong {
  display: block;
  color: var(--blue2);
  font-size: 42px;
  line-height: 1;
}

.installations-summary span {
  display: block;
  margin-top: 7px;
  color: #dce9f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.installations-section {
  padding: 72px 0 82px;
  background: #f4f8fc;
}

.installations-heading {
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: 1fr minmax(320px, .75fr);
  gap: 48px;
  align-items: end;
}

.installations-heading h2 {
  margin: 5px 0 0;
  font-size: 34px;
  letter-spacing: -.025em;
}

.installations-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.customer-map-card {
  position: relative;
  padding: clamp(6px, 1.1vw, 14px);
  overflow: visible;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(4, 31, 61, .12);
}

.map-toolbar {
  min-height: 48px;
  padding: 0 4px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-toolbar button {
  height: 36px;
  color: var(--navy);
  background: #fff;
  border: 1px solid #cbd8e8;
  border-radius: 5px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.map-toolbar button:hover,
.map-toolbar button:focus-visible {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.map-zoom-buttons {
  display: flex;
  align-items: center;
}

.map-zoom-buttons button {
  width: 38px;
  padding: 0;
  font-size: 21px;
}

.map-zoom-buttons output {
  min-width: 58px;
  text-align: center;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.map-reset { padding: 0 14px; }

.map-toolbar p {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.map-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  touch-action: none;
  cursor: grab;
}

.map-viewport.is-dragging { cursor: grabbing; }

.map-stage {
  position: relative;
  width: 100%;
  line-height: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.map-stage > img { display: block; width: 100%; height: auto; border-radius: 6px; user-select: none; pointer-events: none; -webkit-user-drag: none; }
.overlay-layer { position: absolute; inset: 0; pointer-events: none; }
.pin-layer { z-index: 5; }
.calibration-layer { display: none; }

.map-pin { position: absolute; width: 0; height: 0; pointer-events: auto; z-index: 1; transform: scale(var(--map-inverse-scale, 1)); transform-origin: 0 0; }
.map-pin:hover, .map-pin:focus-within, .map-pin.is-open { z-index: 20; }
.pin-button { position: absolute; top: 0; left: 0; width: clamp(22px, 2.1vw, 34px); aspect-ratio: 36/46; padding: 0; border: 0; background: transparent; transform: translate(-50%, -100%); filter: drop-shadow(0 3px 3px rgba(0,0,0,.28)); cursor: pointer; }
.pin-button svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pin-button path { fill: var(--navy); stroke: #fff; stroke-width: 2.25; }
.pin-button circle { fill: #ff3947; stroke: #fff; stroke-width: 1.7; }
.pin-button:hover path, .pin-button:focus-visible path { fill: var(--blue); }
.pin-button:focus-visible { outline: 3px solid rgba(8,119,249,.28); outline-offset: 3px; border-radius: 50%; }

.pin-count { position: absolute; top: 20%; left: 50%; transform: translate(-50%,-50%); color: #fff; font-size: clamp(8px,.68vw,11px); font-weight: 900; line-height: 1; }
.pin-count:empty { display: none; }

.map-popup { position: absolute; left: 50%; bottom: 13px; width: min(320px,75vw); max-height: 360px; overflow: auto; padding: 16px; color: var(--ink); background: rgba(255,255,255,.98); border: 1px solid #cbd8e8; border-radius: 8px; box-shadow: 0 18px 42px rgba(3,26,53,.25); line-height: 1.35; opacity: 0; visibility: hidden; transform: translate(-50%,-12px) scale(.98); transition: opacity .15s,transform .15s,visibility .15s; pointer-events: none; }
.map-pin:hover .map-popup, .map-pin:focus-within .map-popup, .map-pin.is-open .map-popup { opacity: 1; visibility: visible; transform: translate(-50%,-20px) scale(1); pointer-events: auto; }
.map-pin.align-left .map-popup { left: auto; right: -12px; transform-origin: right bottom; }
.map-pin.align-right .map-popup { left: -12px; transform-origin: left bottom; }
.map-pin.below .map-popup { top: 15px; bottom: auto; }
.map-pin.below:hover .map-popup, .map-pin.below:focus-within .map-popup, .map-pin.below.is-open .map-popup { transform: translate(-50%,20px) scale(1); }
.map-pin.below.align-left .map-popup, .map-pin.below.align-right .map-popup { transform: translate(0,20px) scale(1); }

/* The public viewer uses an unscaled popup portal outside the map viewport. */
.map-viewport .map-popup {
  display: none;
}

.map-floating-popup {
  position: fixed;
  z-index: 1000;
  width: min(320px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  overflow: auto;
  padding: 16px;
  color: var(--ink);
  background: rgba(255,255,255,.99);
  border: 1px solid #cbd8e8;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(3,26,53,.25);
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity .14s, transform .14s, visibility .14s;
}

.map-floating-popup.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.popup-heading { margin: 0; color: var(--navy); font-size: 17px; }
.popup-coordinates { margin: 3px 0 12px; color: var(--muted); font-size: 11px; }
.customer-entry { padding-top: 12px; display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 11px; border-top: 1px solid #e5ebf3; }
.customer-entry + .customer-entry { margin-top: 12px; }
.customer-logo { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; color: var(--navy); background: #edf6ff; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; font-weight: 800; text-align: center; }
.customer-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.customer-name { margin: 0 0 6px; font-size: 14px; font-weight: 800; }
.detail-list { margin: 0; display: grid; gap: 3px; font-size: 11px; }
.detail-row { display: grid; grid-template-columns: minmax(88px,.8fr) 1.2fr; gap: 8px; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; overflow-wrap: anywhere; }
.detail-row a { color: var(--blue); }
.status-message { min-height: 18px; margin: 10px 7px 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-message.error { color: #a12828; }

.installations-cta {
  margin-top: 38px;
  padding: 34px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: #fff;
  background: linear-gradient(105deg, var(--navy), var(--navy2));
  border-radius: 8px;
}

.installations-cta h2 { margin: 5px 0 0; font-size: 25px; }
.installations-cta .button { flex: 0 0 auto; }

@media (max-width: 800px) {
  .installations-hero-inner { min-height: 300px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 24px; }
  .installations-summary { padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
  .installations-summary strong { font-size: 32px; }
  .installations-summary span { margin: 0; }
  .installations-heading { grid-template-columns: 1fr; gap: 15px; }
  .installations-cta { align-items: flex-start; flex-direction: column; padding: 28px 24px; }
}

@media (max-width: 520px) {
  .installations-section { padding: 50px 0 60px; }
  .installations-heading h2 { font-size: 29px; }
  .customer-map-card { padding: 3px; }
  .map-popup { width: min(290px,88vw); }
  .map-floating-popup { width: min(290px, calc(100vw - 20px)); }
  .map-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .map-toolbar p { width: 100%; margin-left: 0; }
}
