/* =============================================
   CustomsBroker.com — Component Styles
   Airbnb Design System
   ============================================= */

/* === HEADER === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background var(--transition-base), border-color var(--transition-base),
              box-shadow var(--transition-base);
}

[data-theme="dark"] .site-header {
  background: var(--bg-primary);
  border-bottom-color: var(--border-color);
}

.site-header:has(.search-dropdown.active) {
  box-shadow: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-4);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  min-height: 44px;
}

.logo-link svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: #222222;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .logo-text {
  color: var(--text-primary);
}

/* Header Search */
.header-search-wrap {
  position: relative;
  flex: 1;
  max-width: 400px;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.header-search-wrap.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-4) 0 var(--space-10);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

[data-theme="dark"] .search-input {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus {
  outline: none;
  border-color: var(--gray-222);
  box-shadow: var(--shadow-card);
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 480px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
}

.search-dropdown.active { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 44px;
}

.search-result-item:hover,
.search-result-item.highlighted {
  background: var(--bg-secondary);
}

.search-result-name {
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.search-result-loc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.search-result-badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(255, 56, 92, 0.08);
  color: var(--rausch);
  flex-shrink: 0;
}

[data-theme="dark"] .search-result-badge {
  background: rgba(255, 56, 92, 0.15);
  color: var(--rausch);
}

/* Nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #222222;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
  min-height: 44px;
  white-space: nowrap;
}

[data-theme="dark"] .nav-link {
  color: var(--text-primary);
}

.nav-link:hover {
  color: #222222;
  background: var(--bg-secondary);
}

[data-theme="dark"] .nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--rausch);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: color var(--transition-fast), background var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--text-secondary);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4) var(--space-6);
  z-index: 999;
  box-shadow: var(--shadow-lg);
}

.mobile-nav.active { display: block; }

.mobile-nav .nav-link {
  display: flex;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .header-search-wrap { max-width: 200px; }
  .logo-text { display: none; }
}

@media (max-width: 480px) {
  .header-search-wrap { display: none; }
}

/* === FLOATING SEARCH BAR === */
.floating-search {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-6);
  z-index: 998;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
  pointer-events: none;
}

[data-theme="dark"] .floating-search {
  background: var(--bg-primary);
}

.floating-search.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.floating-search .search-input-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.floating-search .search-input {
  height: 44px;
  font-size: var(--text-base);
}

.floating-search .search-dropdown {
  max-width: 600px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

/* === MAIN CONTENT === */
.main-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height) - 200px);
}

/* === HERO === */
.hero {
  background: linear-gradient(160deg, #f7f7f7 0%, #f2f2f2 100%);
  background-size: cover;
  background-position: center;
  padding: var(--space-20) var(--space-6) var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .hero {
  background: linear-gradient(160deg, #1a1a1a 0%, #242424 100%);
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 56, 92, 0.04) 0%, transparent 60%),
              radial-gradient(circle at 80% 30%, rgba(255, 56, 92, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  z-index: 3;
}

.hero h1 {
  font-size: var(--text-5xl);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .hero h1 {
  color: var(--text-primary);
}

.hero .subtitle {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: #222222;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), transform var(--transition-fast),
              box-shadow var(--transition-fast);
  min-height: 48px;
}

.hero-cta:hover {
  background: var(--rausch);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

@media (max-width: 768px) {
  .hero { padding: var(--space-12) var(--space-4) var(--space-10); }
  .hero h1 { font-size: var(--text-3xl); }
  .hero .subtitle { font-size: var(--text-base); }
}

/* === DISPLAY BANNER ADS === */
.pu-wrap {
  margin: var(--space-5) auto 0;
  max-width: var(--max-width);
  position: relative;
}

.pu-wrap--sidebar {
  margin: var(--space-6) 0 0;
}

/* Google-style ad unit */
.pu {
  display: block;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.pu:hover {
  border-color: #bdc1c6;
}

.pu--lb {
  background: #ffffff;
}

.pu__content {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 12px 16px;
}

.pu__text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.pu__urlrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.pu__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #1a73e8;
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.pu__url {
  font-size: 13px;
  color: #202124;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pu__headline {
  font-size: 18px;
  font-weight: 400;
  color: #1a0dab;
  line-height: 1.3;
  font-family: Arial, sans-serif;
}

.pu:hover .pu__headline {
  text-decoration: underline;
}

.pu__sub {
  font-size: 13px;
  color: #4d5156;
  line-height: 1.4;
  margin-top: 3px;
  font-family: Arial, sans-serif;
}

/* Sidebar ad unit */
.pu--rect {
  background: #ffffff;
}

.pu__rect-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  gap: 4px;
}

.pu__headline--rect {
  font-size: 15px;
  font-weight: 400;
  color: #1a0dab;
  text-align: left;
  line-height: 1.3;
  font-family: Arial, sans-serif;
}

.pu:hover .pu__headline--rect {
  text-decoration: underline;
}

.pu__sub--rect {
  font-size: 12px;
  color: #4d5156;
  text-align: left;
  line-height: 1.4;
  font-family: Arial, sans-serif;
}

[data-theme="dark"] .pu {
  background: #303134;
  border-color: #5f6368;
}
[data-theme="dark"] .pu__headline,
[data-theme="dark"] .pu__headline--rect {
  color: #8ab4f8;
}
[data-theme="dark"] .pu__url {
  color: #bdc1c6;
}
[data-theme="dark"] .pu__sub,
[data-theme="dark"] .pu__sub--rect {
  color: #9aa0a6;
}
[data-theme="dark"] .pu__badge {
  background: #8ab4f8;
  color: #202124;
}

@media (max-width: 640px) {
  .pu__content {
    padding: 10px 14px;
  }
  .pu__headline { font-size: 16px; }
  .pu__sub { font-size: 12px; }
}

/* === SECTION HEADERS === */
.section-header {
  margin-bottom: var(--space-8);
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* === COMPANY CARDS GRID === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.company-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  min-height: 72px;
}

.company-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.company-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gray-f2);
}

.company-logo-mark svg {
  width: 48px;
  height: 48px;
}

.company-card-info {
  flex: 1;
  min-width: 0;
}

.company-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.company-card-loc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === DIRECTORY TABLE === */
.directory-section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.directory-controls {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.directory-search {
  flex: 1;
  min-width: 200px;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.directory-search:focus {
  outline: none;
  border-color: var(--gray-222);
  box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.08);
}

[data-theme="dark"] .directory-search:focus {
  border-color: var(--text-secondary);
  box-shadow: 0 0 0 2px rgba(255, 56, 92, 0.15);
}

.state-filter {
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  min-width: 150px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a6a6a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.sort-btn:hover {
  border-color: #222222;
  color: var(--text-primary);
}

.broker-table {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.broker-table thead th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.broker-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.broker-table tbody tr:last-child { border-bottom: none; }
.broker-table tbody tr:hover { background: var(--bg-secondary); }

.broker-table td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.broker-table td:first-child {
  font-weight: 500;
  color: var(--rausch);
}

.broker-table .featured-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rausch);
  margin-left: var(--space-2);
  vertical-align: middle;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
  border-color: #222222;
  color: #222222;
}

.page-btn.active {
  background: #222222;
  color: white;
  border-color: #222222;
}

[data-theme="dark"] .page-btn.active {
  background: var(--rausch);
  border-color: var(--rausch);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: 0 var(--space-2);
}

/* === COMPANY PROFILE === */
.profile-hero {
  background: #f7f7f7;
  padding: var(--space-10) var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .profile-hero {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-color);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover { color: #222222; }

[data-theme="dark"] .breadcrumbs a:hover { color: var(--text-primary); }

.breadcrumbs .sep { color: var(--gray-c1); }

.breadcrumbs .current { color: #222222; }

[data-theme="dark"] .breadcrumbs .current { color: var(--text-primary); }

.profile-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
}

.profile-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--gray-f2);
  box-shadow: var(--shadow-sm);
}

.profile-logo svg { width: 72px; height: 72px; }

.profile-hero-info { flex: 1; }

.profile-hero-info h1 {
  font-size: var(--text-3xl);
  color: #222222;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .profile-hero-info h1 {
  color: var(--text-primary);
}

.profile-hero-loc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.profile-links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: #222222;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #ffffff;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 36px;
}

.profile-link:hover {
  background: var(--rausch);
  box-shadow: var(--shadow-hover);
}

.profile-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-8);
  padding: var(--space-8) 0;
}

@media (max-width: 960px) {
  .profile-body { grid-template-columns: 1fr; }
}

.profile-main { min-width: 0; }

.profile-section {
  margin-bottom: var(--space-8);
}

.profile-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: -0.02em;
}

.profile-description {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Quick Facts Sidebar */
.sidebar-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.sidebar-card h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: -0.01em;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--text-sm);
}

.fact-row:last-child { border-bottom: none; }

.fact-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.fact-value {
  color: var(--text-primary);
  text-align: right;
  max-width: 60%;
}

/* Contact info */
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.contact-item svg {
  width: 16px;
  height: 16px;
  color: var(--rausch);
  flex-shrink: 0;
}

.contact-item a {
  color: var(--rausch);
  transition: color var(--transition-fast);
}

.contact-item a:hover { color: var(--rausch-dark); }


/* === BRANCH CARDS === */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.branch-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
}

.branch-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.branch-card-city {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}

.branch-card-addr {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.branch-card-phone {
  font-size: var(--text-sm);
  color: var(--rausch);
}

/* === MAP === */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.map-container.small-map {
  height: 280px;
}

/* === BRANCH DETAIL === */
.branch-detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-8);
  padding: var(--space-8) 0;
}

@media (max-width: 960px) {
  .branch-detail-grid { grid-template-columns: 1fr; }
}

/* === STATE PAGES === */
.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}

.state-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  cursor: pointer;
  min-height: 52px;
}

.state-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.state-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.state-card-count {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* === ABOUT / FAQ === */
.about-section {
  padding: var(--space-12) 0;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  margin-top: var(--space-10);
  letter-spacing: -0.02em;
}

.about-content h2:first-child { margin-top: 0; }

.about-content p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.faq-list { margin-top: var(--space-6); }

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-align: left;
  transition: background var(--transition-fast);
  min-height: 56px;
}

.faq-question:hover { background: var(--bg-secondary); }

.faq-question svg {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-item.open .faq-question {
  color: var(--rausch);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 var(--space-5) var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* === GENERIC BROKER DETAIL === */
.broker-detail-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-8);
  max-width: 700px;
  margin: var(--space-8) auto;
}

.broker-detail-card h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

.email-reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--rausch);
  transition: background var(--transition-fast), border-color var(--transition-fast);
  min-height: 36px;
  cursor: pointer;
}

.email-reveal-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--rausch);
}

/* === FOOTER === */
.site-footer {
  background: #f7f7f7;
  border-top: 1px solid var(--border-color);
  padding: var(--space-10) var(--space-6) var(--space-6);
  margin-top: var(--space-16);
}

[data-theme="dark"] .site-footer {
  background: var(--bg-secondary);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--space-6); }
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-3);
  max-width: 360px;
}

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #222222;
  margin-bottom: var(--space-3);
}

[data-theme="dark"] .footer-col h4 {
  color: var(--text-primary);
}

.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
}

.footer-col a:hover { color: var(--rausch); }

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.footer-bottom a {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.footer-bottom a:hover { color: var(--rausch); }

/* === LOADING STATE === */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--rausch);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === 404 === */
.not-found {
  text-align: center;
  padding: var(--space-20) var(--space-6);
}

.not-found h1 {
  font-size: var(--text-5xl);
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.not-found p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.not-found-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: #222222;
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.not-found-link:hover {
  background: var(--rausch);
  box-shadow: var(--shadow-hover);
}

/* === NOSCRIPT === */
noscript .noscript-content {
  max-width: var(--max-width);
  margin: var(--space-8) auto;
  padding: var(--space-6);
}

noscript h2 { margin-top: var(--space-8); }
noscript ul { margin-left: var(--space-6); list-style: disc; }
noscript li { margin-bottom: var(--space-2); }

/* Branch filter */
.branch-filter {
  margin-bottom: var(--space-4);
}

.branch-filter-input {
  width: 100%;
  max-width: 400px;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.branch-filter-input:focus {
  outline: none;
  border-color: #222222;
  box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.08);
}

[data-theme="dark"] .branch-filter-input:focus {
  border-color: var(--rausch);
  box-shadow: 0 0 0 2px rgba(255, 56, 92, 0.15);
}

/* Page header for inner pages */
.page-header {
  background: #f7f7f7;
  padding: var(--space-8) var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .page-header {
  background: var(--bg-secondary);
}

.page-header h1 {
  font-size: var(--text-3xl);
  color: #222222;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .page-header h1 {
  color: var(--text-primary);
}

.page-header p {
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* Parent company card on branch detail */
.parent-company-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  margin-bottom: var(--space-6);
}

.parent-company-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* Sibling branches */
.sibling-branches h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.sibling-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sibling-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
  min-height: 40px;
}

.sibling-item:hover { background: var(--bg-secondary); }
.sibling-item.current { background: var(--bg-secondary); font-weight: 600; }

/* State detail page */
.state-page-content {
  padding: var(--space-8) 0;
}

/* Featured section */
.featured-section {
  padding-top: var(--space-5);
  padding-bottom: var(--space-12);
}

/* Result count badge */
.result-count {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-left: var(--space-3);
}

/* Responsive profile hero */
@media (max-width: 640px) {
  .profile-hero-inner { flex-direction: column; }
  .profile-hero-info h1 { font-size: var(--text-2xl); }
  .profile-logo { width: 56px; height: 56px; }
  .profile-logo svg { width: 56px; height: 56px; }
}

/* Leaflet dark mode overrides */
[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.7) contrast(1.1) saturate(0.8);
}

[data-theme="dark"] .leaflet-control-attribution {
  background: rgba(0,0,0,0.6) !important;
  color: var(--text-tertiary) !important;
}

[data-theme="dark"] .leaflet-control-attribution a {
  color: var(--text-tertiary) !important;
}

/* Fix leaflet default z-index conflicts */
.leaflet-pane { z-index: 1; }
.leaflet-control { z-index: 2; }


/* Logo image in company cards */
.company-logo-mark img {
  display: block;
}
.profile-logo img {
  display: block;
}

/* Controversy section */
.controversy-section {
  border-left: 4px solid #c13515;
  padding-left: var(--space-4);
  background: rgba(193, 53, 21, 0.04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-4) var(--space-6);
}
.controversy-section h2 {
  color: #c13515;
}
.controversy-sources {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.controversy-sources a {
  color: var(--rausch);
  text-decoration: underline;
}
[data-theme="dark"] .controversy-section {
  background: rgba(193, 53, 21, 0.08);
}

/* ── Leadership Grid ── */
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-3);
}
.leader-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .leader-card {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}
.leader-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #222222;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-base);
  flex-shrink: 0;
}
[data-theme="dark"] .leader-avatar {
  background: var(--rausch);
}
.leader-info {
  min-width: 0;
}
.leader-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
}
.leader-title {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}
@media (max-width: 640px) {
  .leadership-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Editorial content section (homepage SEO) ── */
.editorial-section {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border-color);
}
.editorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}
.editorial-block {
  padding: var(--space-6);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-card);
}
.editorial-block h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}
.editorial-block p {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}
.editorial-block p:last-child {
  margin-bottom: 0;
}
.editorial-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.editorial-list li {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  padding-left: var(--space-4);
  position: relative;
}
.editorial-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rausch);
}
.editorial-list li strong {
  color: var(--text-primary);
}
.editorial-block--cta {
  grid-column: 1 / -1;
  text-align: center;
  background: #222222;
  border-color: transparent;
  box-shadow: none;
}
[data-theme="dark"] .editorial-block--cta {
  background: #2d2d2d;
}
.editorial-block--cta h2 {
  color: #ffffff;
}
.editorial-block--cta p {
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.editorial-cta {
  display: inline-block;
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-6);
  background: var(--rausch);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.editorial-cta:hover {
  background: var(--rausch-dark);
  box-shadow: var(--shadow-hover);
}
@media (max-width: 768px) {
  .editorial-grid {
    grid-template-columns: 1fr;
  }
}

/* ── State intro paragraph ── */
.state-intro {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 800px;
  margin-bottom: var(--space-6);
}

/* ── Related brokers (internal linking) ── */
.related-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}
.related-section h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
}
.related-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.related-link:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.related-link-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-link-loc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.nearby-states {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.nearby-state-link {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.nearby-state-link:hover {
  border-color: var(--rausch);
  color: var(--rausch);
  background: rgba(255, 56, 92, 0.04);
}

/* === CITY TOP 5 PAGES === */
.city-hero {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.city-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}

.city-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.18) 60%, rgba(0,0,0,0.05) 100%);
}

.city-hero-content {
  position: relative;
  z-index: 1;
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
}

.city-hero-content h1 {
  color: #ffffff;
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.city-hero-content p {
  color: rgba(255,255,255,0.82);
  font-size: var(--text-sm);
}

.breadcrumbs--light a,
.breadcrumbs--light .sep {
  color: rgba(255,255,255,0.7);
}

.breadcrumbs--light a:hover {
  color: #ffffff;
}

.breadcrumbs--light .current {
  color: rgba(255,255,255,0.95);
}

.city-content {
  padding-top: var(--space-6);
  padding-bottom: var(--space-12);
}

.city-ranking {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: none;
}

.city-rank-item {
  border-bottom: 1px solid var(--border);
}

.city-rank-item:last-child {
  border-bottom: none;
}

.city-rank-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  transition: background 0.15s ease;
}

.city-rank-link:hover {
  background: var(--bg-secondary);
}

.city-rank-num {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-tertiary);
  min-width: 36px;
  text-align: center;
  letter-spacing: -0.02em;
}

.city-rank-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.city-rank-logo img,
.city-rank-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.city-rank-info {
  flex: 1;
  min-width: 0;
}

.city-rank-name {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.city-rank-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--rausch);
  background: rgba(255, 56, 92, 0.08);
  padding: 2px 8px;
  border-radius: 100px;
  margin-top: 2px;
}

[data-theme="dark"] .city-rank-badge {
  background: rgba(255, 56, 92, 0.15);
}

.city-rank-arrow {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.city-viewall {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.city-viewall-link {
  color: var(--rausch);
  font-weight: 600;
  text-decoration: none;
  font-size: var(--text-sm);
}

.city-viewall-link:hover {
  text-decoration: underline;
}

.city-nearby {
  margin-top: var(--space-8);
}

.city-nearby h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.city-nearby-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.city-nearby-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.city-nearby-link:hover {
  border-color: var(--rausch);
  color: var(--rausch);
  background: rgba(255, 56, 92, 0.04);
}

.city-nearby-count {
  color: var(--text-tertiary);
  font-size: 12px;
}

@media (max-width: 640px) {
  .city-hero {
    min-height: 220px;
  }
  .city-hero-content h1 {
    font-size: var(--text-xl);
  }
  .city-rank-link {
    gap: var(--space-3);
    padding: var(--space-3) var(--space-1);
  }
  .city-rank-num {
    font-size: var(--text-xl);
    min-width: 28px;
  }
  .city-rank-logo {
    width: 40px;
    height: 40px;
  }
}
