:root {
  --purple-900: #2e1670;
  --purple-700: #5b2cbf;
  --purple-600: #6f3dff;
  --purple-500: #8b62ff;
  --purple-300: #c3b1ff;
  --purple-soft: rgba(111, 61, 255, 0.12);
  --mint: #2dd4a7;
  --rose: #f43f63;
  --amber: #f5a524;
  --ink: #14132b;
  --ink-soft: #2c2b48;
  --muted: #5e6377;
  --muted-2: #8c92a8;
  --line: rgba(23, 15, 73, 0.08);
  --line-strong: rgba(23, 15, 73, 0.14);
  --surface: #ffffff;
  --shell: linear-gradient(180deg, #f5f4ff 0%, #ecebfb 50%, #f7f7ff 100%);
  --shadow-xs: 0 4px 12px rgba(34, 20, 90, 0.06);
  --shadow-sm: 0 8px 22px rgba(34, 20, 90, 0.09);
  --shadow-md: 0 18px 48px rgba(34, 20, 90, 0.13);
  --shadow-lg: 0 28px 64px rgba(34, 20, 90, 0.18);
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

body.bh-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--shell);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font-family: inherit;
}

.bh-visually-hidden {
  position: absolute;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
}

.bh-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 24px);
  padding-bottom: calc(140px + env(safe-area-inset-bottom));
}

/* === Header === */

.bh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.bh-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.bh-logo-ring {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(155deg, #8b62ff 0%, #5530ff 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 14px 32px rgba(84, 45, 255, 0.38);
  flex-shrink: 0;
}

.bh-brand-text strong,
.bh-brand strong {
  display: block;
  font-weight: 800;
  font-size: clamp(1.4rem, 3.5vw, 1.65rem);
  letter-spacing: -0.02em;
}

.bh-brand-tag {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.005em;
}

.bh-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bh-wallet {
  display: grid;
  align-items: center;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.bh-wallet-lab {
  font-size: 0.66rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bh-wallet-lab i {
  color: var(--purple-600);
}

.bh-wallet-val {
  font-weight: 800;
  color: var(--purple-900);
  font-size: 0.95rem;
}

.bh-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  font-size: 1rem;
  transition: transform 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.bh-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--purple-700);
}

.bh-icon-btn:focus-visible {
  outline: 3px solid rgba(111, 61, 255, 0.35);
  outline-offset: 2px;
}

.bh-icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--rose);
  color: #fff;
  border-radius: 9px;
  font-size: 0.6rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.bh-avatar-stack {
  position: relative;
  width: 44px;
  height: 44px;
  display: block;
  text-decoration: none;
}

.bh-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.bh-status-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid #fff;
}

/* === Tabs (filtros) === */

.bh-scroll-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 6px 2px 14px;
  margin: 0 -2px;
  scroll-snap-type: x proximity;
}

.bh-scroll-row::-webkit-scrollbar {
  display: none;
}

.bh-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  backdrop-filter: blur(8px);
  font-size: 0.86rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.bh-tab i {
  font-size: 0.85em;
  opacity: 0.85;
}

.bh-tab:hover {
  border-color: rgba(111, 61, 255, 0.22);
  color: var(--purple-700);
}

.bh-tab.is-active {
  background: linear-gradient(135deg, rgba(111, 61, 255, 0.16), rgba(139, 98, 255, 0.18));
  color: var(--purple-900);
  border-color: rgba(111, 61, 255, 0.28);
}

.bh-tab-badge {
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(111, 61, 255, 0.18);
  color: var(--purple-700);
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* === Busca + chip GPS === */

.bh-search-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

@media (max-width: 719px) {
  .bh-search-strip {
    grid-template-columns: 1fr auto;
  }

  .bh-search-strip .bh-field {
    grid-column: 1 / -1;
  }
}

.bh-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 42px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.bh-field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
}

.bh-field-input {
  border: 0;
  outline: 0;
  font: inherit;
  flex: 1;
  background: transparent;
  min-width: 0;
  color: var(--ink);
}

.bh-field-input::placeholder {
  color: var(--muted-2);
}

.bh-chip {
  border-radius: 16px;
  border: 1px solid rgba(45, 212, 167, 0.4);
  background: linear-gradient(135deg, rgba(45, 212, 167, 0.14), rgba(45, 212, 167, 0.05));
  padding: 10px 14px;
  display: grid;
  gap: 2px;
  min-width: 0;
  align-content: center;
}

.bh-chip-dot {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}

.bh-chip-dot i {
  color: #1aab85;
  animation: bh-pulse 2s ease-in-out infinite;
}

@keyframes bh-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.86); }
}

.bh-chip-muted {
  font-size: 0.72rem;
  color: var(--muted);
}

/* === Banner de prioridade === */

.bh-priority-banner {
  margin: 18px 0 4px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bh-priority-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(244, 63, 99, 0.12);
  color: var(--rose);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bh-priority-text {
  flex: 1 1 200px;
  display: grid;
  min-width: 0;
}

.bh-priority-text strong {
  color: var(--rose);
  font-size: 0.95rem;
  font-weight: 800;
}

.bh-priority-text span {
  color: var(--muted);
  font-size: 0.78rem;
}

.bh-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.bh-sort-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.bh-sort-btn i {
  color: var(--purple-600);
  font-size: 0.7rem;
}

/* === Feed === */

.bh-feed {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .bh-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1280px) {
  .bh-feed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.bh-post {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  padding: 14px clamp(13px, 2vw, 18px);
  display: grid;
  grid-template-columns: 64px 108px minmax(0, 1fr) 124px;
  gap: clamp(10px, 1.8vw, 14px);
  align-items: center;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.bh-post:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 720px) {
  .bh-post {
    grid-template-columns: 64px 92px minmax(0, 1fr);
    grid-template-areas:
      "owner photo meta"
      "map map map";
    align-items: start;
  }

  .bh-owner-col { grid-area: owner; }
  .bh-pet-photo { grid-area: photo; }
  .bh-pet-meta { grid-area: meta; }
  .bh-mini-map-slot { grid-area: map; }
}

.bh-owner-col {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.bh-mini-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: var(--shadow-xs);
}

.bh-owner-lines {
  display: grid;
  gap: 2px;
  font-size: 0.74rem;
  justify-items: center;
}

.bh-stack-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.1;
}

.bh-stack-name i.bh-verified {
  color: var(--purple-600);
  font-size: 0.78rem;
}

.bh-chip-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(111, 61, 255, 0.1);
  color: var(--purple-700);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bh-chip-role i {
  font-size: 0.55rem;
}

.bh-pet-photo {
  width: 108px;
  height: 108px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f3f3fb;
}

@media (max-width: 720px) {
  .bh-pet-photo {
    width: 92px;
    height: 92px;
  }
}

.bh-pet-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bh-headline-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.bh-heading {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.005em;
  color: var(--ink);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.bh-heading i {
  color: var(--purple-600);
  font-size: 0.85rem;
}

.bh-save {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.bh-save:hover { color: var(--purple-700); }

.bh-save.is-saved {
  color: var(--purple-700);
  background: rgba(111, 61, 255, 0.1);
  border-color: rgba(111, 61, 255, 0.28);
}

.bh-meta-line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.bh-line-icon {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.bh-line-icon i {
  width: 14px;
  text-align: center;
  color: var(--muted-2);
  font-size: 0.8rem;
}

.bh-reward-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 165, 36, 0.16), rgba(245, 165, 36, 0.06));
  color: #8a5300;
  font-size: 0.72rem;
  font-weight: 800;
  width: max-content;
}

.bh-reward-chip i {
  color: var(--amber);
}

/* === Mini-mapa Leaflet === */

.bh-mini-map-slot {
  display: grid;
  gap: 6px;
  align-items: center;
  justify-items: center;
}

@media (max-width: 720px) {
  .bh-mini-map-slot {
    grid-template-columns: 120px minmax(0, 1fr);
    justify-items: stretch;
    gap: 12px;
    margin-top: 4px;
  }
}

.bh-mini-map {
  width: 120px;
  height: 96px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(111, 61, 255, 0.18);
  background: #eef0f8;
}

@media (max-width: 720px) {
  .bh-mini-map {
    width: 100%;
    height: 110px;
  }
}

.bh-mini-map.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, #eef0f8 0%, #f7f7ff 50%, #eef0f8 100%);
  background-size: 200% 100%;
  animation: bh-shimmer 1.4s linear infinite;
}

@keyframes bh-shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: -200% 0%; }
}

.bh-dist-labels {
  display: grid;
  gap: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 720px) {
  .bh-dist-labels {
    text-align: left;
  }
}

.bh-bold-km {
  font-weight: 800;
  color: var(--ink);
}

/* Marcador divIcon do Leaflet com FA */
.bh-marker {
  background: transparent;
  border: 0;
}

.bh-marker-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: var(--rose);
  transform: rotate(-45deg);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(244, 63, 99, 0.45);
  border: 2px solid #fff;
}

.bh-marker-pin i {
  color: #fff;
  transform: rotate(45deg);
  font-size: 0.78rem;
}

.bh-marker-overview .bh-marker-pin {
  background: var(--purple-600);
  box-shadow: 0 4px 14px rgba(111, 61, 255, 0.45);
}

.leaflet-container {
  font-family: var(--font);
  background: #eef0f8;
}

.bh-mini-map .leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0 4px;
}

.bh-mini-map .leaflet-control-attribution a {
  color: var(--purple-700);
}

/* === Botão publicar === */

.bh-publish {
  margin-top: clamp(18px, 4vw, 28px);
  width: 100%;
}

.bh-publish-btn {
  width: 100%;
  border: none;
  border-radius: 22px;
  padding: 16px 18px;
  cursor: pointer;
  background: linear-gradient(125deg, #b69cff 0%, #764af1 55%, #5b38e5 100%);
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  box-shadow:
    0 18px 40px rgba(91, 56, 229, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: transform 160ms ease, box-shadow 160ms ease;
  text-align: left;
}

.bh-publish-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(91, 56, 229, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.bh-publish-btn:active {
  transform: translateY(0);
}

.bh-publish-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.bh-paw-wrap {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.bh-publish-copy {
  display: grid;
  gap: 2px;
}

.bh-publish-title {
  font-weight: 900;
  font-size: clamp(1.02rem, 2vw, 1.12rem);
}

.bh-publish-sub {
  opacity: 0.86;
  font-size: 0.78rem;
  font-weight: 600;
}

.bh-publish-chev {
  opacity: 0.85;
}

/* === Bottom nav fixo === */

.bh-bottom-nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 14px clamp(14px, 4vw, 22px)
    calc(12px + env(safe-area-inset-bottom))
    clamp(14px, 4vw, 22px);
  z-index: 40;
}

.bh-bottom-nav {
  pointer-events: auto;
  width: min(540px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr 88px 1fr 1fr;
  align-items: end;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  border: 1px solid rgba(23, 15, 73, 0.08);
  box-shadow:
    0 20px 50px rgba(28, 20, 80, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  padding: 10px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bh-nav-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 0 8px;
  border-radius: 16px;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease;
}

.bh-nav-item i {
  font-size: 1.1rem;
}

.bh-nav-item:hover {
  color: var(--purple-700);
}

.bh-nav-item.is-current {
  color: var(--purple-700);
  background: rgba(111, 61, 255, 0.1);
}

.bh-plus-wrap {
  position: relative;
  display: grid;
  justify-self: center;
  margin-top: -36px;
}

.bh-plus {
  border: none;
  background: radial-gradient(circle at 30% 20%, #9c7dff, var(--purple-700));
  border-radius: 50%;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-size: 1.3rem;
  box-shadow:
    0 18px 40px rgba(91, 44, 191, 0.4),
    inset 0 -3px 8px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.35);
  border: 4px solid #fff;
  transition: transform 160ms ease;
}

.bh-plus:hover {
  transform: scale(1.06);
}

.bh-plus:focus-visible {
  outline: 3px solid rgba(111, 61, 255, 0.4);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
