:root {
  --font-primary: 'Montserrat', sans-serif;
  --goat-gold: #ffd700;
  --goat-gold-dark: #b89000;
  --goat-text: #f7f7f7;
  --goat-muted: #a8a8a8;
  --goat-bg: #080808;
  --goat-border: rgba(255, 215, 0, 0.22);
  --goat-ease: 220ms ease;
  --nav-height: 76px;
}

.mobile-home-header,
.mobile-desktop-header {
  display: none;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 215, 0, 0.11), transparent 34%),
    linear-gradient(90deg, rgba(13, 13, 8, 0.92), rgba(8, 8, 8, 0.84));
  border-bottom: 1px solid rgba(255, 215, 0, 0.12);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
}

.navbar.scrolled {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 215, 0, 0.08), transparent 34%),
    linear-gradient(90deg, rgba(12, 12, 8, 0.72), rgba(8, 8, 8, 0.66));
}

.nav-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 48px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}

.nav-logo img {
  max-height: 38px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.logo-accent {
  color: var(--goat-gold);
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.36);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-category-links {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.045);
}

.nav-link,
.nav-category-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--goat-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  transition: color var(--goat-ease), background var(--goat-ease);
}

.nav-link:hover,
.nav-link.active,
.nav-category-link:hover,
.nav-category-link.active {
  color: var(--goat-gold);
  background: rgba(255, 215, 0, 0.09);
}

.nav-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: min(360px, 28vw);
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--goat-ease), border-color var(--goat-ease), box-shadow var(--goat-ease);
}

.search-pill:focus-within {
  background: rgba(8, 8, 8, 0.95);
  border-color: var(--goat-border);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.18);
}

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

.search-pill:focus-within .search-pill-icon {
  color: var(--goat-gold);
}

.search-pill-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--goat-text);
  font: 600 13px/1.2 var(--font-primary);
}

.search-pill-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.search-pill-clear {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--goat-muted);
  cursor: pointer;
}

.search-pill-clear:hover {
  color: var(--goat-text);
  background: rgba(255, 255, 255, 0.1);
}

.hidden {
  display: none !important;
}

.nav-avatar {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--goat-gold-dark), var(--goat-gold));
  color: #000;
  font: 800 14px/1 var(--font-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--goat-gold-dark);
  transition: transform var(--goat-ease), box-shadow var(--goat-ease);
}

.nav-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--goat-gold), 0 0 26px rgba(255, 215, 0, 0.28);
}

.nav-avatar img,
.user-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.nav-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--goat-muted);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 1100;
  width: 292px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 215, 0, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 215, 0, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(20, 20, 20, 0.98), rgba(7, 7, 7, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.76), 0 0 34px rgba(255, 215, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.985);
  transition: opacity var(--goat-ease), transform var(--goat-ease), visibility var(--goat-ease);
}

.user-menu-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(255, 215, 0, 0.34);
  border-top: 1px solid rgba(255, 215, 0, 0.34);
  background: #11100c;
  transform: rotate(45deg);
}

.user-menu-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 8px 8px 14px;
}

.user-menu-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--goat-gold-dark), var(--goat-gold));
  color: #000;
  font: 800 18px/1 var(--font-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 215, 0, 0.86);
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.08), 0 0 24px rgba(255, 215, 0, 0.2);
  flex-shrink: 0;
  overflow: hidden;
}

.user-menu-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.user-menu-name {
  color: var(--goat-text);
  font: 800 16px/1.2 var(--font-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  margin-top: 3px;
  color: var(--goat-muted);
  font: 700 12px/1.2 var(--font-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-divider {
  height: 1px;
  margin: 8px 6px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.22), transparent);
}

.user-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-menu-item,
.user-menu-logout {
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--goat-muted);
  font: 800 14px/1.2 var(--font-primary);
  cursor: pointer;
  transition: color var(--goat-ease), background var(--goat-ease), border-color var(--goat-ease), transform var(--goat-ease);
}

.user-menu-item:hover {
  color: var(--goat-text);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.1), rgba(255, 255, 255, 0.045));
  border-color: rgba(255, 215, 0, 0.2);
  transform: translateX(2px);
}

.menu-icon {
  width: 19px;
  height: 19px;
  color: var(--goat-muted);
  flex-shrink: 0;
}

.user-menu-item:hover .menu-icon {
  color: var(--goat-gold);
}

.user-menu-logout {
  color: #ff6b6b;
}

.user-menu-logout:hover {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.24);
  transform: translateX(2px);
}

.logout-icon {
  color: #ff6b6b !important;
}

body.has-shared-header {
  padding-top: var(--nav-height);
}

body.has-shared-header.home-shell {
  padding-top: 0;
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  body.has-shared-header {
    padding-top: 0;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .mobile-home-header {
    display: none !important;
  }

  .mobile-desktop-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: calc(100% - 20px);
    min-height: 42px;
    margin: calc(8px + env(safe-area-inset-top)) 10px 0;
    pointer-events: auto;
  }

  .mobile-top-category-links {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    max-width: 100%;
    min-height: 40px;
    padding: 3px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
    list-style: none;
    border: 1px solid rgba(255, 215, 0, 0.16);
    border-radius: 999px;
    background: rgba(18, 18, 18, 0.78);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 32px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .mobile-top-category-links::-webkit-scrollbar {
    display: none;
  }

  .mobile-top-category-links .nav-category-link {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
    line-height: 1;
  }

  .navbar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: fit-content;
    min-width: 168px;
    max-width: calc(100% - 28px);
    height: 50px;
    min-height: 0;
    padding: 0;
    margin: 0 auto;
    transform: none;
    border: 0;
    border-radius: 999px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  body.has-page-bottom-nav .navbar {
    display: none;
  }

  .navbar.scrolled {
    background: transparent;
    box-shadow: none;
  }

  .nav-container {
    justify-content: center;
    gap: 0;
    padding: 0;
    min-height: 0;
  }

  .nav-logo,
  .nav-category-links,
  .nav-links li {
    display: none !important;
  }

  .nav-links li:first-child,
  .nav-links li.nav-mobile-goat-item {
    display: list-item !important;
  }

  .nav-links {
    display: flex;
    flex: 0 0 auto;
    gap: 18px;
    align-items: center;
    min-height: 50px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-link {
    width: 50px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 15px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    box-shadow: none;
  }

  .nav-link::before {
    font-family: "Font Awesome 7 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 15px;
    line-height: 1;
  }

  #nav-home::before {
    content: "\f015";
  }

  #nav-my-goat {
    width: 74px;
  }

  #nav-my-goat::before {
    content: "\f521";
  }

  .nav-link.active,
  .nav-link:hover,
  .nav-search-container:focus-within .search-pill,
  .nav-avatar:hover {
    color: var(--goat-gold);
    background: rgba(255, 215, 0, 0.08);
    transform: none;
  }

  .nav-actions {
    position: static !important;
    top: auto;
    right: auto;
    z-index: 1120;
    display: flex;
    align-items: center;
    gap: 7px;
    width: auto;
    flex: 0 0 auto;
    margin: 0 0 0 auto !important;
  }

  .nav-search-container {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    flex: 0 0 38px;
    display: flex;
  }

  .search-pill {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
    color: var(--goat-gold);
    background: linear-gradient(180deg, rgba(18, 14, 4, 0.94), rgba(7, 7, 7, 0.94));
    border-color: rgba(255, 215, 0, 0.28);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.44);
  }

  .search-pill-input,
  .search-pill-clear {
    display: none;
  }

  .search-pill:focus-within {
    width: 38px;
  }

  .nav-avatar {
    width: 34px;
    height: 34px;
  }

  .user-menu-dropdown {
    position: fixed;
    top: 78px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 320px;
    margin-left: auto;
    z-index: 4000;
  }

  .user-menu-dropdown::before {
    right: 18px;
  }
}

@media (max-width: 420px) {
  .mobile-desktop-header {
    width: calc(100% - 20px);
  }

  .mobile-top-category-links .nav-category-link {
    padding-inline: 8px;
    font-size: 10px;
  }

  .nav-links {
    gap: 14px;
    padding-inline: 0;
  }
}

/* OBS: a notificação flutuante de mensagens/pedidos de amizade e o estilo do
   badge de não lidas foram unificados em friend-notifications.js e friends.css
   respectivamente (funcionam em todas as páginas, com estilo próprio injetado). */

