/* ==========================================================================
   SafarGet — Elevated Frosted-Glass Topbar & Floating Pill Navigation
   Applies to Homepage (/) and Best Mac Download Manager (/best-mac-download-manager)
   ========================================================================== */

header.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  height: 76px;
  padding-inline: max(20px, 50vw - 660px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(244, 249, 247, 0.82);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(19, 169, 140, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, height 0.25s ease;
}

header.topbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(19, 169, 140, 0.55) 32%, rgba(56, 189, 248, 0.5) 55%, rgba(245, 196, 81, 0.45) 75%, transparent 95%);
  opacity: 0.85;
  pointer-events: none;
}

header.topbar.is-scrolled {
  background: rgba(248, 252, 250, 0.94);
  border-bottom-color: rgba(19, 169, 140, 0.24);
  box-shadow:
    0 12px 34px rgba(13, 45, 44, 0.1),
    0 2px 8px rgba(13, 45, 44, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

header.topbar .brand-and-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.8vw, 24px);
  min-width: 0;
  flex: 1 1 auto;
}

header.topbar .brand {
  flex: none;
  gap: 10px;
  transition: transform 0.2s ease;
}

header.topbar .brand:hover {
  transform: translateY(-1px);
}

header.topbar .brand img {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(19, 169, 140, 0.28), 0 0 0 1px rgba(19, 169, 140, 0.16);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

header.topbar .brand:hover img {
  transform: scale(1.04);
  box-shadow: 0 8px 22px rgba(19, 169, 140, 0.38), 0 0 0 1px rgba(19, 169, 140, 0.3);
}

header.topbar .brand-name {
  color: #102a30;
  font-size: 18.5px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

header.topbar .brand-sub {
  color: #12917a;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1.55px;
}

/* Sculpted Floating Glass Pill Container for Desktop Nav */
header.topbar .site-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(176, 213, 202, 0.65);
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 4px 16px rgba(16, 48, 50, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  min-width: 0;
}

header.topbar .site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #32514b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.16s ease;
}

header.topbar .site-nav a:hover {
  background: rgba(19, 169, 140, 0.12);
  color: #097c66;
}

header.topbar .site-nav a.is-active {
  background: linear-gradient(135deg, #13a98c, #0c826c);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(19, 169, 140, 0.3);
}

header.topbar .site-nav a.sg-nav-highlight {
  color: #0b7d67;
  background: rgba(19, 169, 140, 0.08);
}

header.topbar .site-nav a.sg-nav-highlight:hover {
  background: rgba(19, 169, 140, 0.18);
  color: #086755;
}

header.topbar .site-nav a.sg-nav-highlight::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #13a98c;
  box-shadow: 0 0 0 3px rgba(19, 169, 140, 0.2);
  flex: none;
}

/* Slightly tighter pills for longer European/Russian labels */
html[lang="de"] header.topbar .site-nav a,
html[lang="es"] header.topbar .site-nav a,
html[lang="pt-BR"] header.topbar .site-nav a,
html[lang="ru"] header.topbar .site-nav a {
  padding: 7px 8.5px;
  font-size: 10.5px;
}

/* Unified Action Bar (.top-meta) */
header.topbar .top-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

/* Hide redundant "Made for macOS" pill inside topbar on standard laptops so all 8 nav links breathe cleanly */
@media (max-width: 1520px) {
  header.topbar .mac-tag {
    display: none;
  }
}

header.topbar .sg-lang-dd-btn {
  height: 36px;
  padding: 0 11px;
  border-color: rgba(176, 213, 202, 0.78);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(16, 48, 50, 0.04);
}

header.topbar .sg-auth-btn {
  height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

header.topbar .sg-auth-login {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(176, 213, 202, 0.78);
  color: #16383d;
}

header.topbar .sg-auth-login:hover {
  background: #ffffff;
  border-color: #13a98c;
  color: #0b7d67;
}

header.topbar .sg-auth-signup {
  background: #14363c;
  border-color: #14363c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(20, 54, 60, 0.18);
}

header.topbar .sg-auth-signup:hover {
  background: #0d6e5c;
  border-color: #0d6e5c;
}

header.topbar .download-nav {
  min-height: 36px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(19, 169, 140, 0.5);
  background: linear-gradient(135deg, #13a98c 0%, #0b826c 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(19, 169, 140, 0.28), inset 0 1px rgba(255, 255, 255, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

header.topbar .download-nav:hover {
  background: linear-gradient(135deg, #15b898 0%, #0d9179 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 10px 24px rgba(19, 169, 140, 0.38), inset 0 1px rgba(255, 255, 255, 0.3);
}

header.topbar .mobile-nav-toggle {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(176, 213, 202, 0.78);
  background: rgba(255, 255, 255, 0.88);
  color: #16383d;
  box-shadow: 0 2px 8px rgba(16, 48, 50, 0.05);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

header.topbar .mobile-nav-toggle:hover {
  border-color: #13a98c;
  color: #0b7d67;
  background: #ffffff;
}

/* Polished Mobile Drawer */
header.topbar .mobile-nav {
  background: rgba(252, 254, 253, 0.97);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(164, 208, 196, 0.7);
  border-radius: 18px;
  padding: 10px;
  gap: 3px;
  box-shadow: 0 24px 60px rgba(12, 42, 42, 0.2), 0 4px 14px rgba(12, 42, 42, 0.08);
}

header.topbar .mobile-nav a {
  border-radius: 11px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #1f423d;
  transition: background 0.16s ease, color 0.16s ease;
}

header.topbar .mobile-nav a:hover {
  background: rgba(19, 169, 140, 0.12);
  color: #097c66;
}

header.topbar .mobile-nav a.sg-mnav-highlight {
  color: #097c66;
  background: rgba(19, 169, 140, 0.08);
}

/* Clean Tablet / Narrow-Laptop Collapse Breakpoint so 8 links never overflow */
@media (max-width: 1140px) {
  header.topbar {
    padding-inline: 18px;
  }

  header.topbar .site-nav {
    display: none !important;
  }

  header.topbar .mobile-nav-toggle {
    display: grid !important;
  }

  header.topbar .mobile-nav {
    display: grid;
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    right: 18px;
    z-index: 80;
  }

  header.topbar .mobile-nav[hidden] {
    display: none !important;
  }
}

@media (max-width: 700px) {
  header.topbar {
    height: 68px;
    padding-inline: 14px;
  }

  header.topbar .brand img {
    width: 35px;
    height: 35px;
    border-radius: 10px;
  }

  header.topbar .brand-name {
    font-size: 16.5px;
  }

  header.topbar .top-meta {
    gap: 5px;
  }

  header.topbar .sg-lang-dd-btn,
  header.topbar .sg-auth-btn,
  header.topbar .download-nav,
  header.topbar .mobile-nav-toggle {
    height: 33px;
    min-height: 33px;
  }

  header.topbar .download-nav {
    padding: 0 11px;
    font-size: 10px;
  }
}
