:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Colors */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-elevated: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Our Agency Hero/Banner Theme */
  --agency-navy-dark: #091322;
  --agency-navy: #0f233e;
  --agency-navy-light: #1e3a5f;
  --agency-gold: #d97706;
  --agency-gold-hover: #b45309;
  --agency-gold-subtle: #fef3c7;
  --agency-gold-text: #92400e;
  
  --emerald-accent: #059669;
  --emerald-subtle: #ecfdf5;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px -2px rgb(15 23 42 / 0.08), 0 2px 6px -2px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 12px 28px -4px rgb(15 23 42 / 0.12), 0 4px 12px -2px rgb(15 23 42 / 0.06);
  --shadow-gold: 0 10px 25px -3px rgba(217, 119, 6, 0.35);
  --shadow-glow: 0 0 20px rgba(217, 119, 6, 0.2);

  --max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Base Utility Classes */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Subtle Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-pill);
}

.badge-gold {
  background-color: var(--agency-gold-subtle);
  color: var(--agency-gold-text);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-emerald {
  background-color: var(--emerald-subtle);
  color: var(--emerald-accent);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-neutral {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Leaflet Map overrides */
.leaflet-container {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans) !important;
  z-index: 1;
  border-radius: var(--radius-md);
}

.custom-map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--agency-navy-dark);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes pulse-soft {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.animate-pulse-soft {
  animation: pulse-soft 2.5s infinite ease-in-out;
}

@keyframes ping-slow {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  80%, 100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.ping-indicator {
  position: relative;
  display: inline-flex;
}

.ping-indicator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: currentColor;
  animation: ping-slow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* =========================================
   SCROLL REVEAL ANIMATION SYSTEM
   Use data-reveal on any element.
   The composable useScrollReveal() adds
   .is-visible when element enters viewport.
   ========================================= */

/* Initial hidden state */
.reveal-init {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Direction variants — set by data-reveal value */
[data-reveal],
[data-reveal="fade-up"] {
  transform: translateY(28px);
}

[data-reveal="fade-left"] {
  transform: translateX(-28px);
}

[data-reveal="fade-right"] {
  transform: translateX(28px);
}

[data-reveal="zoom-in"] {
  transform: scale(0.94);
}

[data-reveal="fade"] {
  transform: none;
}

/* Visible state — added by IntersectionObserver */
.reveal-init.is-visible {
  opacity: 1;
  transform: none !important;
}

/* Smooth scroll for the entire page */
html {
  scroll-behavior: smooth;
}

/* =========================================
   BROWSER SURFACES — text selection, caret,
   focus ring, scrollbar
   ========================================= */

::selection {
  background-color: var(--agency-gold-subtle);
  color: var(--agency-gold-text);
}

input,
textarea {
  caret-color: var(--agency-gold);
}

:focus-visible {
  outline: 2px solid var(--agency-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =========================================
   HEADER
   ========================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--agency-navy-dark), var(--agency-navy-light));
  color: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 35, 62, 0.2);
  flex-shrink: 0;
}

.brand-icon--sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--agency-navy-dark);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 639px) {
  .brand-subtitle { display: none; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--agency-navy-dark);
}

/* =========================================
   FOOTER — dark navy 3-col
   ========================================= */
.site-footer {
  background: #0d1b2a;
  margin-top: 0;
  padding: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 64px 20px 52px;
}

@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .footer-grid {
    grid-template-columns: 1.15fr 1.3fr 1fr;
    gap: 56px;
  }
}

.footer-col { display: flex; flex-direction: column; }

/* Col 1 — brand */
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 16px;
}

.footer-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--agency-navy-light), #1d4ed8);
  color: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,.52);
  line-height: 1.65;
  margin-bottom: 22px;
  max-width: 300px;
}

/* Badge chips — col 1 */
.footer-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 6px;
}

.footer-badge--outline {
  color: rgba(255,255,255,.8);
  border: 1.5px solid rgba(255,255,255,.25);
  background: transparent;
}

.footer-badge--teal {
  color: #2dd4bf;
  border: 1.5px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.06);
}

/* Col heading — shared */
.footer-col-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

/* Col 2 — districts */
.footer-districts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px 20px;
}

.footer-dist-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color 0.15s ease;
  line-height: 1.4;
}

.footer-dist-link:hover { color: #ffffff; }

/* Col 3 — info card */
.footer-info-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-info-card-title {
  font-size: 0.975rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.footer-info-text {
  font-size: 0.84rem;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
}

.footer-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.15);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.footer-cta-btn:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.25);
}

.footer-info-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2dd4bf;
}

.footer-info-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2dd4bf;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(45, 212, 191, 0.6);
}

/* Bottom bar */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 20px 0;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255,255,255,.3);
}

.footer-disclaimer {
  font-size: 0.775rem;
  color: rgba(255,255,255,.25);
  max-width: 520px;
  text-align: right;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .footer-disclaimer { text-align: left; }
}

/* =========================================
   APP LAYOUT
   ========================================= */
.main-content {
  flex: 1;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================
   HOMEPAGE — HERO
   ========================================= */
.hero-section {
  background: linear-gradient(180deg, #fdfcfb 0%, #f3f1ee 100%);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-container {
  text-align: center;
  max-width: 860px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--agency-navy-dark);
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .hero-title { font-size: 2.85rem; }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── SEARCH ── */
.search-wrap {
  margin-top: 28px;
}

.search-form {
  width: 100%;
}

.search-inner {
  display: flex;
  gap: 10px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.search-field-wrap {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: transparent;
  font-family: var(--font-sans);
}

.search-input::placeholder { color: var(--text-muted); }

.search-select-wrap {
  border-left: 1px solid var(--border-subtle);
  padding-left: 10px;
}

.search-select {
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: transparent;
  font-family: var(--font-sans);
  padding: 8px 4px;
  cursor: pointer;
  min-width: 160px;
}

.search-btn {
  background: var(--agency-navy-dark);
  color: #fef3c7;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s ease;
}

.search-btn:hover { background: var(--agency-navy-light); }

/* =========================================
   DISTRICT CHIPS (below search bar)
   ========================================= */
.chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chips-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.chips-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--agency-navy-dark);
  color: var(--agency-navy-dark);
  background: var(--bg-subtle);
}

.chip--active {
  background: var(--agency-navy-dark);
  border-color: var(--agency-navy-dark);
  color: #fff;
}

.chip--active:hover {
  background: var(--agency-navy-light);
  border-color: var(--agency-navy-light);
  color: #fff;
}

/* Select icon layout fix */
.search-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle);
}

.select-icon {
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

/* =========================================
   AGENCY TABLE (redesigned)
   ========================================= */
.directory-section { padding: 32px 0 24px; }

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dir-section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--agency-navy-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dir-count-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.dir-section-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.dir-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.dir-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dir-table thead th {
  background: var(--agency-navy-dark);
  color: rgba(255,255,255,.7);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
}

.dir-table thead th:last-child { text-align: right; }

.dir-table .dir-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}

.dir-table .dir-row:last-child { border-bottom: none; }
.dir-table .dir-row:hover { background: #fafcfe; }

.dir-table td {
  padding: 12px 16px;
  vertical-align: middle;
  line-height: 1.4;
}

/* Agency cell (avatar + name + address) */
.td-agency { min-width: 240px; max-width: 360px; }

.agency-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dir-agency-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--agency-navy-dark), var(--agency-navy-light));
  color: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15, 35, 62, 0.25);
}

.agency-cell-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.agency-name-link {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--agency-navy-dark);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-name-link:hover { color: var(--agency-gold); }

.agency-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* City / Concelho column */
.td-city-col { min-width: 130px; }

.city-primary {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.city-secondary {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* District pill */
.td-dist-col { min-width: 120px; }

.district-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--agency-navy-light);
  background: rgba(30, 58, 95, 0.07);
  border: 1px solid rgba(30, 58, 95, 0.15);
  border-radius: var(--radius-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.district-pill:hover {
  background: var(--agency-navy-dark);
  color: #fff;
  border-color: var(--agency-navy-dark);
}

/* "Ver Dados" button */
.td-action-col { min-width: 110px; text-align: right; }

.ver-dados-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--agency-gold-hover);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.ver-dados-btn:hover { color: var(--agency-navy-dark); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

/* Keep legacy classes for other pages */
.agency-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.td-city, .td-muni { color: var(--text-secondary); }

.district-link {
  color: var(--agency-navy-light);
  font-weight: 600;
  text-decoration: none;
}

.district-link:hover { text-decoration: underline; }

.phone-link {
  color: var(--agency-navy-dark);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.phone-link:hover { color: var(--agency-gold); }

.text-muted { color: var(--text-muted); }

.btn-view {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--agency-gold-hover);
  text-decoration: none;
  white-space: nowrap;
}

.btn-view:hover { color: var(--agency-gold); }

/* =========================================
   DISTRICTS GRID
   ========================================= */
.districts-grid-section {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border-subtle);
}

.section-title-wrap { margin-bottom: 28px; }

.section-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--agency-navy-dark);
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.districts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .districts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .districts-grid { grid-template-columns: repeat(4, 1fr); }
}

.district-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
}

.district-card:hover {
  border-color: var(--agency-gold);
  box-shadow: var(--shadow-md);
  background-color: #fffdf9;
}

.district-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.district-name {
  font-weight: 700;
  color: var(--agency-navy-dark);
  font-size: 1.05rem;
}

.district-badge {
  font-size: 0.75rem;
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.district-card-sub {
  font-size: 0.8rem;
  color: var(--agency-gold-hover);
  font-weight: 600;
}

.district-card:hover .district-card-sub {
  color: var(--agency-gold);
}

/* =========================================
   AGENCY DETAIL PAGE
   ========================================= */
.agency-detail-page { padding-bottom: 48px; }

.breadcrumbs-bar { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); padding: 12px 0; margin-bottom: 24px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.84rem; color: var(--text-muted); }
.crumb-link { color: var(--text-secondary); transition: color 0.15s ease; text-decoration: none; }
.crumb-link:hover { color: var(--agency-navy-dark); }
.crumb-sep { color: var(--border-strong); }
.crumb-current { color: var(--text-primary); font-weight: 600; }

.page-body { max-width: 1040px; }

.agency-header-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.agency-header-main { display: flex; align-items: flex-start; gap: 18px; }
.agency-avatar { width: 56px; height: 56px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--agency-navy-dark), var(--agency-navy-light)); color: #fef3c7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.agency-avatar-initials { font-family: 'Playfair Display', Georgia, serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; display: flex; align-items: baseline; gap: 1px; }
.avatar-char1 { color: var(--agency-gold); }
.avatar-char2 { color: #fef3c7; }
.agency-h1 { font-family: var(--font-serif); font-size: 1.55rem; font-weight: 700; color: var(--agency-navy-dark); line-height: 1.2; margin-bottom: 6px; }
.agency-address-line { display: flex; align-items: center; gap: 5px; font-size: 0.875rem; color: var(--text-secondary); margin-top: 6px; }
.addr-pin-icon { color: var(--agency-gold-hover); flex-shrink: 0; }
.agency-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.agency-website-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--bg-subtle); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-md); text-decoration: none; transition: all 0.15s ease; white-space: nowrap; align-self: flex-start; }
.agency-website-btn:hover { border-color: var(--agency-navy-dark); color: var(--agency-navy-dark); }

.agency-content-grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
@media (min-width: 768px) { .agency-content-grid { grid-template-columns: 1fr 1.2fr; } }

.content-block { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.block-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); }
.section-icon { color: var(--agency-navy-dark); }
.block-title { font-family: var(--font-sans); font-size: 1rem; font-weight: 800; color: var(--agency-navy-dark); text-transform: uppercase; letter-spacing: 0.05em; }

.info-card-body { display: flex; flex-direction: column; gap: 16px; }
.info-item { display: flex; align-items: flex-start; gap: 14px; }
.info-icon-box { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-subtle); color: var(--agency-gold-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.info-text { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.info-val { font-size: 0.95rem; color: var(--text-primary); line-height: 1.4; }

.phone-link-lg { font-size: 1.25rem; font-weight: 800; color: var(--agency-navy-dark); text-decoration: none; transition: color 0.15s ease; }
.phone-link-lg:hover { color: var(--agency-gold); }
.email-link { font-size: 0.92rem; color: var(--agency-navy-light); word-break: break-all; text-decoration: none; }
.email-link:hover { text-decoration: underline; }

.map-card-body { flex: 1; min-height: 280px; display: flex; }
.google-map-embed { width: 100%; min-height: 280px; border: 0; border-radius: var(--radius-md); flex: 1; }

.hours-display { width: 100%; }
.hours-tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-top: 4px; }
.hours-tbl td { padding: 5px 0; vertical-align: middle; }
.hours-tbl .hours-day { color: var(--text-secondary); white-space: nowrap; padding-right: 16px; }
.hours-tbl .hours-val { color: var(--text-primary); font-weight: 500; }
.hours-tbl .hours-row-today .hours-day { color: var(--agency-gold-hover); font-weight: 700; }
.hours-tbl .hours-row-today .hours-val { color: var(--agency-navy-dark); font-weight: 700; }
.map-placeholder { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-muted); min-height: 200px; }
.map-placeholder p { font-size: 0.9rem; }

.description-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); margin-bottom: 32px; }
.description-text { display: flex; flex-direction: column; gap: 0; margin-bottom: 24px; }
.description-text p { font-size: 1rem; line-height: 1.75; color: var(--text-secondary); margin-bottom: 16px; }
.description-text p:empty { display: none; }
.description-text p:has(> br:only-child) { display: none; }
.description-text b, .description-text strong { color: var(--text-primary); font-weight: 700; }

.services-wrapper { border-top: 1px solid var(--border-subtle); padding-top: 20px; }
.services-title { font-size: 0.95rem; font-weight: 700; color: var(--agency-navy-dark); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.services-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.service-pill { display: inline-flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid var(--border-subtle); padding: 6px 14px; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.pill-check { color: var(--emerald-accent); }

.related-agencies-section { border-top: 1px solid var(--border-subtle); padding-top: 32px; margin-top: 24px; }
.related-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.related-title { font-family: var(--font-serif); font-size: 1.3rem; color: var(--agency-navy-dark); font-weight: 700; }
.related-all-link { font-size: 0.85rem; font-weight: 600; color: var(--agency-gold-hover); text-decoration: none; }
.related-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }
.related-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: all 0.2s ease; text-decoration: none; }
.related-card:hover { border-color: var(--agency-gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.rel-name { font-size: 0.95rem; font-weight: 700; color: var(--agency-navy-dark); }
.rel-location { font-size: 0.8rem; color: var(--text-muted); }
.rel-view-btn { font-size: 0.78rem; font-weight: 600; color: var(--agency-gold-hover); margin-top: 6px; }

/* =========================================
   SPONSOR BANNER
   ========================================= */
.sponsor-wrap { margin-bottom: 24px; }

.sponsor-label { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 8px; }
.sponsor-label-icon { color: var(--text-light); }
.sponsor-dot { color: var(--border-strong); }
.sponsor-brand-name { color: var(--text-secondary); }

.sponsor-card {
  background: #4d6b5c;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  gap: 28px;
  align-items: stretch;
}

.sponsor-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.sponsor-top-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.sponsor-live-pill { display: inline-flex; align-items: center; gap: 7px; background: rgba(0,0,0,0.25); color: #e8f5e0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; padding: 5px 12px; border-radius: var(--radius-pill); }
.sponsor-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #7ec87e; box-shadow: 0 0 0 2px rgba(126,200,126,0.3); flex-shrink: 0; }

.sponsor-coverage { font-size: 0.85rem; color: rgba(255,255,255,0.65); }

.sponsor-title { font-family: var(--font-serif); font-size: 1.65rem; font-weight: 700; color: #ffffff; line-height: 1.15; }

.sponsor-subtitle { font-size: 0.95rem; font-weight: 400; font-style: italic; color: rgba(255,255,255,0.88); line-height: 1.5; }

.sponsor-body { font-size: 0.875rem; color: rgba(255,255,255,0.7); line-height: 1.65; }

.sponsor-checks { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.sponsor-checks li { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: rgba(255,255,255,0.85); }
.sponsor-checks li svg { color: #7ec87e; flex-shrink: 0; }

/* CTA card */
.sponsor-cta-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  min-width: 220px;
  flex-shrink: 0;
}

.sponsor-cta-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: -4px; }
.sponsor-phone { font-family: var(--font-sans); font-size: 1.9rem; font-weight: 900; color: var(--agency-navy-dark); letter-spacing: -0.02em; line-height: 1.1; }
.sponsor-cta-sub { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; margin-top: -2px; }

.sponsor-btn-call {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 16px;
  background: var(--agency-navy-dark); color: #ffffff;
  font-size: 0.875rem; font-weight: 700;
  border-radius: var(--radius-md); text-decoration: none;
  transition: background 0.15s ease;
  margin-top: 4px;
}
.sponsor-btn-call:hover { background: var(--agency-navy-light); }

.sponsor-btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 16px;
  background: var(--bg-subtle); color: var(--text-secondary);
  font-size: 0.875rem; font-weight: 600;
  border-radius: var(--radius-md); text-decoration: none;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}
.sponsor-btn-whatsapp:hover { border-color: #25d366; color: #128c3e; }

@media (max-width: 640px) {
  .sponsor-card { flex-direction: column; padding: 22px 20px; }
  .sponsor-cta-card { min-width: unset; width: 100%; }
}

/* =========================================
   DISTRICT PAGE
   ========================================= */
.district-table-count { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; }
.th-phone { min-width: 130px; }
.district-city-name { display: block; font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.district-muni { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.district-hero { background: linear-gradient(135deg, var(--agency-navy-dark) 0%, var(--agency-navy-light) 100%); padding: 40px 0; margin-bottom: 32px; }
.district-hero .breadcrumbs { margin-bottom: 16px; }
.district-hero .crumb-link { color: rgba(255,255,255,.6); }
.district-hero .crumb-link:hover { color: #fff; }
.district-hero .crumb-sep { color: rgba(255,255,255,.3); }
.district-hero .crumb-current { color: rgba(255,255,255,.9); font-weight: 600; }
.district-hero-title { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 10px; }
.district-hero-subtitle { font-size: 1rem; color: rgba(255,255,255,.7); max-width: 600px; line-height: 1.6; }
.district-hero-subtitle strong { color: rgba(255,255,255,.9); }

.page-content { padding-bottom: 60px; }

/* =========================================
   TABLE — MOBILE ADAPTATION (< 640px)
   ========================================= */
@media (max-width: 639px) {
  /* Remove horizontal scroll — reflow instead */
  .dir-table-wrap { overflow-x: visible; }

  /* Hide header row */
  .dir-table thead { display: none; }

  /* Each row becomes a flex row: [avatar+name] [button] */
  .dir-table tbody { display: block; }
  .dir-table .dir-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
  }

  /* All cells block by default, then override per column */
  .dir-table td { display: block; padding: 11px 14px; }

  /* Agency cell: takes all available space, no min-width */
  .dir-table .td-agency {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    padding: 12px 14px;
    border-right: none;
  }

  /* Agency name: allow wrap on narrow screens */
  .agency-name-link {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.35;
  }

  /* Address: allow wrap too */
  .agency-address {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  /* Hide secondary columns — city is already in the address */
  .dir-table .td-city-col,
  .dir-table .td-dist-col { display: none; }

  /* Action button: compact, flush right */
  .dir-table .td-action-col {
    flex-shrink: 0;
    min-width: unset;
    padding: 12px 14px 12px 4px;
    text-align: right;
    align-self: center;
  }

  /* Make button icon-only hint: tighten text */
  .ver-dados-btn { font-size: 0.8rem; gap: 3px; }
}
