.installers-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: calc(100vh - 12rem);
  border-top: 1px solid #333;
}

.installers-map-panel {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

.installers-map-panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3rem;
  background: linear-gradient(90deg, rgba(10, 10, 10, 0) 0%, rgba(10, 10, 10, 0.18) 70%, rgba(10, 10, 10, 0.45) 100%);
  pointer-events: none;
  z-index: 4;
}

/* Leaflet defaults to z-index 400+; keep map layers below fixed nav on this page */
#installer-map.leaflet-container {
  z-index: 0 !important;
}

#installer-map .leaflet-map-pane,
#installer-map .leaflet-tile-pane,
#installer-map .leaflet-overlay-pane,
#installer-map .leaflet-shadow-pane {
  z-index: 1 !important;
}

#installer-map .leaflet-marker-pane {
  z-index: 2 !important;
}

#installer-map .leaflet-popup-pane {
  z-index: 3 !important;
}

/* Nav/cart load only on this page; sit above Leaflet after map init */
nav.fixed,
#mobileNav,
#cartDrawer {
  z-index: 1000 !important;
}

#mobileOverlay {
  z-index: 999 !important;
}

.installers-list-panel {
  width: 22rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: none;
  background: #0a0a0a;
  max-height: calc(100vh - 12rem);
}

.installers-list-title {
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

#installer-map {
  height: calc(100vh - 12rem);
  min-height: 420px;
  width: 100%;
  border-radius: 0;
  border: none;
  background: #111;
}

.installers-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.installers-table {
  border-collapse: collapse;
}

.installers-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1b1b1b;
  color: #d1d5db;
  border-bottom: 1px solid #444;
}

.installers-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.installers-table th:first-child {
  width: 5.5rem;
}

.installers-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #222;
}

.installers-table td {
  padding: 0.875rem 1rem;
  vertical-align: top;
}

.installers-table tbody tr:hover,
.installers-table tbody tr.installer-row-active {
  background-color: rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .installers-split {
    flex-direction: column;
    min-height: 0;
  }

  .installers-map-panel::after {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2rem;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(10, 10, 10, 0.18) 70%, rgba(10, 10, 10, 0.45) 100%);
  }

  .installers-list-panel {
    width: 100%;
    max-height: none;
    border-top: none;
  }

  #installer-map {
    height: 50vh;
    min-height: 280px;
  }

  #installer-map.leaflet-container,
  #installer-map .leaflet-pane,
  #installer-map .leaflet-control-container {
    pointer-events: none;
  }

  #installer-map .leaflet-marker-pane,
  #installer-map .leaflet-popup-pane {
    pointer-events: auto;
  }

  .installers-map-panel {
    touch-action: pan-y;
  }
}

.leaflet-popup-content-wrapper {
  background: #fff;
  color: #111;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.leaflet-popup-tip {
  background: #fff;
}

.leaflet-popup-content {
  margin: 12px 14px;
  line-height: 1.45;
  font-size: 14px;
}

.installer-popup-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  color: #000;
  line-height: 1.35;
}

.installer-list-name {
  line-height: 1.35;
}

.installer-list-phone {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
  -webkit-touch-callout: none;
}

.installer-popup-person {
  color: #000;
  margin-top: 4px;
}

.installer-popup-contact {
  margin-top: 6px;
}

.installer-popup-muted {
  color: #b0b0b0;
  margin-top: 4px;
}

.installer-popup-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #25d366;
  text-decoration: none;
}

.installer-popup-phone:hover {
  color: #1da851;
}

.installer-popup-wa-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.leaflet-popup-content .installer-popup-phone {
  color: #25d366;
}

.leaflet-popup-content .installer-popup-phone:hover {
  color: #1da851;
}

.leaflet-container a {
  color: #93c5fd;
}

#installer-map .leaflet-control-attribution {
  display: none;
}

.installer-leaflet-pin {
  background: transparent;
  border: none;
}

.installer-leaflet-pin img,
.installer-leaflet-pin svg {
  display: block;
  filter:
    drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5))
    drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}
