/* ── Branches: list + map + navigation ── */
.br-block {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid var(--bd-sky-border);
  border-radius: 20px;
  background: var(--bg-0a1628-a8);
}

.br-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-bottom: 1.25rem;
}

.br-title {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--tx-sky-white);
}

.br-hint {
  max-width: 420px;
  color: var(--tx-94a3b8);
  font-size: 0.85rem;
}

.br-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.br-list {
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.br-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--bd-94a3b8-a12);
  border-radius: 14px;
  background: var(--bg-ffffff-a04);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.br-item:hover {
  border-color: var(--bd-3b82f6-a4);
}

.br-item:focus-visible {
  outline: 2px solid var(--tx-22d3ee);
  outline-offset: 2px;
}

.br-item.active {
  border-color: var(--bd-3b82f6-a4);
  background: var(--bg-3b82f6-a1);
}

.br-item-pin {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--bg-06b6d4-a15);
  color: var(--tx-22d3ee);
}

.br-item.active .br-item-pin {
  background: linear-gradient(135deg, var(--bg-1a56db), var(--bg-06b6d4));
  color: var(--on-ffffff, #fff);
}

.br-item-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.br-item-text strong {
  color: var(--tx-e2e8f0);
  font-size: 0.9rem;
}

.br-item-text small {
  overflow: hidden;
  color: var(--tx-94a3b8);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.br-item-city {
  padding: 2px 8px;
  border: 1px solid var(--bd-94a3b8-a12);
  border-radius: 999px;
  color: var(--tx-94a3b8);
  font-size: 0.68rem;
  font-weight: 600;
}

.br-map-wrap {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--bd-94a3b8-a12);
  border-radius: 16px;
}

.br-map {
  min-height: 340px;
  background: var(--bg-0a1628);
}

.br-map.br-map-empty {
  display: none;
}

.br-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--bd-94a3b8-a12);
  background: var(--bg-0a1628);
}

.br-panel[hidden] {
  display: none;
}

.br-panel-text strong {
  color: var(--tx-e2e8f0);
}

.br-panel-text p {
  max-width: 520px;
  margin-top: 2px;
  color: var(--tx-94a3b8);
  font-size: 0.8rem;
  line-height: 1.5;
}

.br-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.br-panel-actions a {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* map pins (MapLibre markers; the library positions them, so no position here) */
.br-pin {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.br-pin:focus-visible {
  outline: 2px solid var(--tx-22d3ee);
  outline-offset: 4px;
  border-radius: 50%;
}

.br-pin-dot {
  position: absolute;
  inset: 3px;
  border: 2px solid var(--on-ffffff, #fff);
  border-radius: 50%;
  background: var(--bg-06b6d4);
  box-shadow: 0 0 0 6px var(--sh-06b6d4-a4), 0 6px 14px var(--sh-000000-a35);
  transition: transform 0.2s;
}

.br-pin.active .br-pin-dot {
  background: var(--bg-1a56db);
  transform: scale(1.35);
}

.br-pin-label {
  position: absolute;
  left: 50%;
  bottom: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg-0f172a-a78);
  color: var(--tx-e2e8f0);
  font: 600 0.72rem var(--font-body);
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.br-pin.active .br-pin-label,
.br-pin:hover .br-pin-label {
  opacity: 1;
}

.br-map .maplibregl-ctrl-attrib {
  font-size: 10px;
}

@media (max-width: 860px) {
  .br-layout {
    grid-template-columns: 1fr;
  }

  /* branches become a swipeable row above the map */
  .br-list {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .br-item {
    flex: 0 0 min(78%, 280px);
    scroll-snap-align: start;
  }

  .br-map-wrap {
    min-height: 0;
  }

  .br-map {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .br-block {
    padding: 1rem;
  }

  .br-panel-actions,
  .br-panel-actions a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}
