/* ═══════════════════════════════════════
   BRANCHES
═══════════════════════════════════════ */
.branches {
  /* A deliberately distinct variant of --dark-gradient (shallower angle,
     an extra steel-blue stop echoing the map header decoration below),
     same family as Principals/Distribution Reach so all three still read
     as their own section on scroll without breaking the shared "dark =
     proof" language across them. */
  background: linear-gradient(115deg, #24476B 0%, #2C5078 35%, #276B5E 70%, #238450 100%);
  position: relative;
}

.map-wrap {
  position: relative;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  overflow: hidden;
  height: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  margin-bottom: 32px;
}

#branchMap { width: 100%; height: 100%; }

/* Loading skeleton, shown until map tiles finish loading */
.map-skeleton {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: linear-gradient(100deg, var(--navy2) 30%, #1a3358 50%, var(--navy2) 70%);
  background-size: 220% 100%;
  animation: map-skeleton-shimmer 1.4s ease-in-out infinite;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.map-skeleton.hidden { opacity: 0; }

@keyframes map-skeleton-shimmer {
  0%   { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

/* Ctrl/Cmd + scroll to zoom hint */
.map-scroll-hint {
  position: absolute;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,31,58,0.55);
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.map-scroll-hint.show { opacity: 1; }

/* "View all branches" reset control */
.map-reset-btn {
  background: rgba(11,31,58,0.9);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition);
  white-space: nowrap;
}

.map-reset-btn:hover {
  background: var(--teal);
  border-color: var(--teal2);
}

.branches-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
  background: var(--navy2);
  color: white;
  border: 1px solid rgba(46,204,113,0.3);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.leaflet-popup-tip { background: var(--navy2); }

.leaflet-popup-content {
  font-family: var(--font);
  font-size: 15px;
  margin: 12px 16px;
}

.popup-city { color: var(--teal2); font-weight: 600; font-size: 15px; }
.popup-city--coverage { color: #FFB74D; }
.popup-region { color: rgba(255,255,255,0.45); font-size: 12.5px; }
.popup-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #FFB74D;
}

/* Custom map dots */
.map-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #00BFA5;
  border: 2px solid #00897B;
  box-shadow: 0 0 6px rgba(0,191,165,0.5);
}

/* Extended coverage: solid amber with a white ring, so it stays clearly
   visible over the map's light-blue ocean while reading as a second tier. */
.map-dot--coverage {
  background: #F59E0B;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(180,110,0,0.6), 0 1px 5px rgba(0,0,0,0.45);
}

/* Legend */
.map-legend {
  background: rgba(11,31,58,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 10px;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.map-legend-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #00BFA5;
  border: 2px solid #00897B;
  flex-shrink: 0;
}
.map-legend-dot--coverage {
  background: #F59E0B;
  border: 2px solid #ffffff;
}

/* Cluster badge */
.map-cluster {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,191,165,0.15);
  border: 2px solid rgba(0,191,165,0.5);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.map-cluster span {
  color: #00BFA5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.branch-region h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--teal2);
  margin-bottom: 12px;
}

.branch-region ul { display: flex; flex-direction: column; gap: 7px; }

.branch-region li {
  font-size: 17px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 8px;
}

.branch-region li::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

/* Extended coverage group: spans the full width below the branch regions,
   with a centered title and several centered columns, so it reads as a
   highlighted "reach beyond branches" row. Amber matches its map markers. */
.branch-region--coverage {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.branch-region--coverage h4 {
  color: #FFB74D;
  text-align: center;
}
.branch-region--coverage ul {
  display: grid;
  grid-template-columns: repeat(5, max-content);
  justify-content: center;
  column-gap: 48px;
  row-gap: 8px;
}
.branch-region--coverage li::before { background: #FFB74D; }

.branch-link {
  cursor: pointer;
  transition: color 0.2s ease;
}

.branch-link:hover {
  color: var(--teal2);
}

@media (max-width: 900px) {
  .branches-list { grid-template-columns: repeat(2, 1fr); }
  .branch-region--coverage ul { grid-template-columns: repeat(3, max-content); column-gap: 40px; }
}

@media (max-width: 560px) {
  .branch-region--coverage ul { grid-template-columns: repeat(2, max-content); column-gap: 32px; }
}
