/* -------------------------------------------------------- */
/* 🔹 Navbar                                                */
/* -------------------------------------------------------- */
/* Top navigation bar with logo, page links and lang switch */

.navbar {
  flex-shrink: 0;
  z-index: 100;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-outline);
}

.navbar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
}

/* Right side — language switch + hamburger */
.navbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xl);
}


/* -------------------------------------------------------- */
/* 🔹 Links                                                 */
/* -------------------------------------------------------- */

.navbar__links {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: var(--space-xxxl);
  list-style: none;
}

.navbar__link {
  font-size: var(--text-body-large);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.navbar__link:hover {
  opacity: 0.7;
  text-decoration: none;
}

.navbar__link--active {
  font-weight: var(--text-title-weight);
}


/* -------------------------------------------------------- */
/* 🔹 Language Switcher                                     */
/* -------------------------------------------------------- */
/* Globe icon + language code + chevron — opens dropdown     */

.navbar__lang {
  position: relative;
}

.navbar__lang-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-small);
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-body-medium);
  font-weight: 500;
  color: var(--color-on-surface-variant);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.navbar__lang-trigger:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.navbar__lang-trigger svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.navbar__lang-trigger svg:last-child {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Dropdown menu */
.navbar__lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  min-width: 160px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-small);
  padding: var(--space-xxs) 0;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.navbar__lang-dropdown--open {
  display: block;
}

.navbar__lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-s) var(--space-m);
  font-size: var(--text-body-medium);
  color: var(--color-on-surface);
  text-decoration: none;
  transition: background-color 0.1s ease;
}

.navbar__lang-option:hover {
  background-color: var(--color-scaffold-bg);
  text-decoration: none;
}

.navbar__lang-option--active {
  font-weight: 500;
}

.navbar__lang-option svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}


/* -------------------------------------------------------- */
/* 🔹 Hamburger (mobile only)                               */
/* -------------------------------------------------------- */

.navbar__hamburger {
  display: none;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-s);
  margin: 0;
  line-height: 0;
  color: var(--color-on-surface);
}

.navbar__hamburger svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* Show menu icon by default, close icon when open */
.navbar__hamburger svg:last-child {
  display: none;
}

.navbar__hamburger[aria-expanded="true"] svg:first-child {
  display: none;
}

.navbar__hamburger[aria-expanded="true"] svg:last-child {
  display: block;
}


/* -------------------------------------------------------- */
/* 🔹 Mobile Menu                                           */
/* -------------------------------------------------------- */

.navbar__mobile-menu {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background-color: var(--color-surface);
  padding: var(--space-xl) 0;
  z-index: 99;
  list-style: none;
}

.navbar__mobile-menu .navbar__link {
  font-size: var(--text-title-medium);
  display: block;
  padding: var(--space-s) var(--space-xl);
  text-align: left;
}

.navbar__mobile-menu--open {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}


/* -------------------------------------------------------- */
/* 🔹 Responsive                                            */
/* -------------------------------------------------------- */

@media (max-width: 639px) {
  .navbar__inner {
    grid-template-columns: 1fr auto;
  }

  .navbar__links {
    display: none;
  }

  .navbar__hamburger {
    display: grid;
    place-items: center;
    margin-right: calc(-1 * var(--space-s));
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  .navbar__links {
    gap: var(--space-m);
  }
}


/* -------------------------------------------------------- */
/* 🔹 Download CTA                                          */
/* -------------------------------------------------------- */
/* Pill button that reveals an App Store badge + QR popover  */
/* on hover/click (desktop only — mobile links directly)     */

.navbar__download {
  position: relative;
}

.navbar__cta {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-l);
  background-color: var(--color-primary);
  color: var(--color-surface);
  font-size: var(--text-body-medium);
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  transition: filter 0.15s ease;
}

.navbar__cta:hover {
  filter: brightness(1.1);
  text-decoration: none;
}


/* -------------------------------------------------------- */
/* 🔹 Download Popover                                      */
/* -------------------------------------------------------- */
/* App Store badge + QR code — scan to install on iPhone     */

.navbar__download-popover {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-s));
  right: 0;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  width: 264px;
  padding: var(--space-l);
  background-color: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 200;
}

/* Transparent bridge over the gap so hover survives the move  */
/* from the button down onto the popover                       */
.navbar__download-popover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: var(--space-s);
}

.navbar__download-popover--open {
  display: flex;
}

.navbar__download-badge img {
  display: block;
  height: 46px;
  width: auto;
}

/* White backing keeps the QR scannable in dark mode too */
.navbar__download-qr {
  padding: var(--space-s);
  background-color: #ffffff;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-small);
}

.navbar__download-qr img {
  display: block;
  width: 184px;
  height: 184px;
}

.navbar__download-hint {
  font-size: var(--text-body-medium);
  color: var(--color-on-surface-variant);
  text-align: center;
}


/* Hidden on small screens — hamburger menu links directly */
@media (max-width: 639px) {
  .navbar__download {
    display: none;
  }
}
