/* ============================================================
   Locations page — interactive branch finder
   ============================================================ */

.locations-page {
  --loc-surface: #f5f7fb;
  --loc-card: #ffffff;
  --loc-ink: #0a1628;
  --loc-muted: #5c6b7a;
}

.locations-hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 1.5rem 3.5rem;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(ellipse 70% 80% at 80% 10%, rgba(212, 175, 55, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 70% at 10% 90%, rgba(37, 81, 160, 0.28), transparent 50%),
    linear-gradient(165deg, #081225 0%, #102447 48%, #0a1628 100%);
}

.locations-hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.45), transparent);
}

.locations-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.locations-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold, #d4af37);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.locations-eyebrow svg {
  width: 14px;
  height: 14px;
}

.locations-hero h1 {
  margin: 0 0 0.85rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  color: #fff;
}

.locations-hero h1 em {
  color: var(--gold, #d4af37);
  font-style: italic;
}

.locations-hero-lead {
  margin: 0 auto 1.5rem;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0;
  text-transform: none;
}

.locations-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.geo-btn,
.loc-chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.geo-btn {
  background: var(--gold, #d4af37);
  color: var(--navy-900, #0a1628);
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.25);
}

.geo-btn:hover {
  background: var(--gold-light, #f0d060);
  transform: translateY(-2px);
}

.geo-btn svg,
.loc-chip-btn svg,
.region-filter svg,
.btn-map-toggle svg,
.nearest-badge svg,
.loc-stat-icon svg,
.meta-icon svg,
.region-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.loc-chip-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.loc-chip-btn:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.locations-stats {
  background: #0b1628;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.25rem 1.25rem;
}

.locations-stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.loc-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.loc-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #d4af37);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.loc-stat-num {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.loc-stat-lbl {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* Anchor holds layout space when the toolbar becomes fixed. */
.locations-toolbar-anchor {
  height: 0;
  pointer-events: none;
}

.locations-toolbar {
  position: relative;
  z-index: 40;
  background: rgba(245, 247, 251, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(13, 31, 60, 0.08);
  padding: 0.9rem 1.25rem;
}

/* JS pins this under the navbar — sticky fails with body overflow-x:hidden. */
.locations-toolbar.is-fixed {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 50;
  box-shadow: 0 10px 28px rgba(10, 22, 40, 0.1);
}

body.has-live-admin-bar .locations-toolbar.is-fixed {
  top: 112px;
}

.locations-toolbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.location-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 360px;
}

.location-search i,
.location-search svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #7a8898;
  pointer-events: none;
}

.location-search input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: 999px;
  border: 1px solid #d7deea;
  background: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  color: var(--loc-ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.location-search input:focus {
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.region-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #d7deea;
  background: #fff;
  color: #3d4c5c;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: 0.2s ease;
}

.region-filter:hover {
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--loc-ink);
}

.region-filter.is-active {
  background: var(--navy-900, #0a1628);
  border-color: var(--navy-900, #0a1628);
  color: #fff;
}

.geo-bar {
  background: linear-gradient(90deg, #102447, #0d1f3c);
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  padding: 0.85rem 1.25rem;
}

.geo-bar[hidden] {
  display: none !important;
}

.geo-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
}

.geo-bar-inner svg {
  width: 18px;
  height: 18px;
  color: var(--gold, #d4af37);
  flex-shrink: 0;
}

.geo-status strong {
  color: var(--gold, #d4af37);
}

.locations-body {
  background:
    radial-gradient(ellipse at top, rgba(212, 175, 55, 0.05), transparent 40%),
    var(--loc-surface);
  padding: 2.75rem 1.25rem 4.5rem;
}

.locations-body .container {
  max-width: 1100px;
}

.region-section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 160px;
}

.region-section.is-filtered-out {
  display: none;
}

.region-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(13, 31, 60, 0.08);
}

.region-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #d4af37);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.28);
  flex-shrink: 0;
}

.region-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  font-weight: 700;
  color: var(--loc-ink);
  line-height: 1.2;
}

.region-count {
  margin-top: 0.25rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--loc-muted);
}

.districts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.district-card {
  background: var(--loc-card);
  border-radius: 18px;
  border: 1px solid rgba(13, 31, 60, 0.08);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(8, 20, 40, 0.05);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.district-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(8, 20, 40, 0.1);
  border-color: rgba(212, 175, 55, 0.35);
}

.district-card.nearest {
  border-color: rgba(46, 204, 113, 0.45);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12), 0 18px 40px rgba(8, 20, 40, 0.1);
}

.district-card.is-search-hit {
  border-color: rgba(212, 175, 55, 0.45);
}

.district-card-head {
  padding: 1.2rem 1.3rem 1rem;
  border-bottom: 1px solid rgba(13, 31, 60, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.06), transparent);
}

.district-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--loc-ink);
  margin-bottom: 0.35rem;
}

.district-hq-badge,
.nearest-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.district-hq-badge {
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: #8a6d16;
}

.nearest-badge {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.28);
  color: #1e8f53;
  margin-top: 0.35rem;
}

.district-card-body {
  padding: 1.15rem 1.3rem 1.2rem;
}

.district-meta {
  margin-bottom: 1rem;
}

.district-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.meta-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #d4af37);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.meta-label {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--loc-muted);
}

.meta-value {
  font-size: 0.92rem;
  color: var(--loc-ink);
  line-height: 1.45;
}

.meta-value a {
  color: var(--navy-700, #102447);
  font-weight: 700;
  text-decoration: none;
}

.meta-value a:hover {
  color: var(--gold, #d4af37);
}

.sub-branches-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--loc-muted);
}

.sub-branches-label svg {
  width: 14px;
  height: 14px;
}

.sub-branches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sub-branch-tag {
  font-size: 0.75rem;
  color: var(--navy-700, #102447);
  background: #f3f6fb;
  border: 1px solid #dde3ef;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  transition: 0.2s ease;
}

.district-card:hover .sub-branch-tag {
  border-color: rgba(212, 175, 55, 0.35);
}

.district-map {
  overflow: hidden;
  border-top: 1px solid rgba(13, 31, 60, 0.06);
  max-height: 0;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.3s ease;
}

.district-map.open {
  max-height: 240px;
  opacity: 1;
}

.district-map iframe {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}

.district-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.95rem 1.15rem 1.1rem;
  border-top: 1px solid rgba(13, 31, 60, 0.06);
  flex-wrap: wrap;
  background: #fbfcfe;
}

.btn-card-primary,
.btn-card-secondary,
.btn-map-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.2rem;
  border-radius: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
  flex: 1;
}

.btn-card-primary {
  background: var(--gold, #d4af37);
  color: var(--navy-900, #0a1628);
  border: 2px solid var(--gold, #d4af37);
}

.btn-card-primary:hover {
  background: #e0c354;
  border-color: #e0c354;
  transform: translateY(-2px);
}

.btn-card-secondary {
  background: transparent;
  color: var(--navy-700, #102447);
  border: 2px solid var(--navy-500, #1a3a6b);
}

.btn-card-secondary:hover {
  background: var(--navy-700, #102447);
  color: #fff;
  border-color: var(--navy-700, #102447);
  transform: translateY(-2px);
}

.btn-map-toggle {
  background: #fff;
  color: var(--loc-muted);
  border: 2px solid #d7deea;
  flex: 0 1 auto;
  text-transform: none;
  letter-spacing: 0.02em;
}

.btn-map-toggle:hover,
.btn-map-toggle.is-open {
  border-color: var(--navy-600, #152c55);
  color: var(--navy-700, #102447);
}

.locations-empty {
  text-align: center;
  padding: 3rem 1.25rem;
  border-radius: 18px;
  border: 1px dashed #cfd7e4;
  background: #fff;
  color: var(--loc-muted);
}

.locations-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 0.75rem;
  color: #98a6b5;
}

.locations-empty p {
  margin: 0;
  line-height: 1.6;
}

.locations-empty[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .locations-stats-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .locations-hero {
    padding: 4.5rem 1rem 2.75rem;
  }

  .locations-toolbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .location-search {
    max-width: none;
  }

  .region-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
  }

  .region-filter {
    flex: 0 0 auto;
  }

  .districts-grid {
    grid-template-columns: 1fr;
  }

  .district-card-actions {
    flex-direction: column;
  }

  .btn-card-primary,
  .btn-card-secondary,
  .btn-map-toggle {
    width: 100%;
    flex: none;
  }
}

@media (max-width: 480px) {
  .locations-stats-inner {
    grid-template-columns: 1fr;
  }

  .loc-stat {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .district-card,
  .district-map,
  .geo-btn,
  .region-filter {
    transition: none;
  }

  .district-card:hover {
    transform: none;
  }
}
