/* Header "Open the app" + "Create an account" (markup: scripts/header-open-app.mjs) */
.nav .nav-links-right {
  gap: 12px;
}
.nav .hdr-signup,
.nav .hdr-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font: 600 14px/1 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.nav .nav-links-right .hdr-signup {
  background: #fff;
  color: #1f2937;
  opacity: 1;
}
.nav .nav-links-right .hdr-signup:hover {
  background: rgba(255, 255, 255, 0.85);
}
.nav .hdr-open-btn {
  background: rgba(17, 24, 39, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.nav .hdr-open-btn:hover,
.hdr-open.is-open .hdr-open-btn {
  background: rgba(255, 255, 255, 0.12);
}
.nav .hdr-open-btn svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}
.hdr-open.is-open .hdr-open-btn svg {
  transform: rotate(180deg);
}
.nav .hdr-signup:focus-visible,
.nav .hdr-open-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.hdr-open {
  position: relative;
}
.hdr-open-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0; /* the button sits at the right in RTL too (nav is row-reverse) */
  z-index: 200;
  min-width: 250px;
  padding: 8px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22),
    0 2px 8px rgba(15, 23, 42, 0.08);
  text-align: start;
}
.hdr-open-menu[hidden],
.hdr-open-head,
.hdr-open-backdrop {
  display: none;
}
.nav .hdr-open-menu a {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #1f2937;
  font-size: 15px;
  font-weight: 600;
  opacity: 1;
  text-decoration: none;
}
.nav .hdr-open-menu a:hover,
.nav .hdr-open-menu a:focus-visible {
  background: #f1f3f6;
  outline: none;
}
.hdr-open-menu a small {
  order: 2;
  flex-basis: 100%;
  margin-top: 2px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 400;
}
.nav .hdr-open-menu a.is-reco {
  background: #eef2ff;
}
.hdr-reco {
  order: 1;
  margin-inline-start: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* below this the centered logo can collide with long labels (ru): let it flow */
@media (max-width: 1100px) {
  .nav .nav-logo {
    position: relative;
    left: auto;
    transform: none;
  }
}
@media (max-width: 768px) {
  .nav .nav-inner {
    justify-content: space-between;
  }
  .nav .nav-links-right {
    display: flex;
    gap: 8px;
  }
  .nav .nav-logo img {
    width: 44px;
    height: 44px;
  }
  .nav .hdr-signup,
  .nav .hdr-open-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }
  .hdr-open-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .hdr-open.is-open .hdr-open-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .hdr-open-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 301;
    min-width: 0;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    animation: hdr-sheet-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .hdr-open-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px 8px;
    color: #1f2937;
    font-size: 17px;
    font-weight: 700;
  }
  .hdr-open-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f3f6;
    color: #1f2937;
    cursor: pointer;
  }
  .hdr-open-close svg {
    width: 14px;
    height: 14px;
  }
  .nav .hdr-open-menu a {
    min-height: 56px;
    padding: 12px 14px;
    font-size: 16px;
  }
}
@media (max-width: 400px) {
  .nav.nav {
    padding-left: 16px;
    padding-right: 16px;
  }
  .nav .nav-logo img {
    width: 36px;
    height: 36px;
  }
  .nav .hdr-signup,
  .nav .hdr-open-btn {
    padding: 0 10px;
    font-size: 12px;
  }
  .nav .hdr-open-btn svg {
    display: none;
  }
}
/* 320px phones can't fit the logo next to both buttons in every language */
@media (max-width: 359px) {
  .nav .nav-logo {
    display: none;
  }
  .nav .nav-inner {
    justify-content: center;
  }
}
@keyframes hdr-sheet-in {
  from {
    transform: translateY(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hdr-open-menu {
    animation: none;
  }
}
