/* Phone and tablet menu (under 820px). page.js adds the Menu button to the top bar; the existing
   .topbar__nav becomes a full-screen panel under the bar. Without JavaScript the bar stays as before. */
.menu-btn { display: none; }

@media (max-width: 819px) {
  .js .menu-btn {
    display: inline-flex; align-items: center; gap: 10px; flex: none;
    min-height: 44px; padding: 0 14px; margin-inline-start: auto;
    border: 2px solid var(--ink); border-radius: 0; background: var(--white); color: var(--ink);
    font: 600 .9375rem/1 var(--f-body); cursor: pointer;
  }
  .js .menu-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
  .menu-btn__icon { position: relative; width: 18px; height: 12px; }
  .menu-btn__icon::before, .menu-btn__icon::after, .menu-btn__icon i {
    content: ""; position: absolute; inset-inline: 0; height: 2px; background: currentColor;
    transition: transform .2s var(--ease), opacity .2s var(--ease);
  }
  .menu-btn__icon::before { top: 0; }
  .menu-btn__icon i { top: 5px; }
  .menu-btn__icon::after { top: 10px; }
  .topbar.is-open .menu-btn { background: var(--ink); color: var(--white); }
  .topbar.is-open .menu-btn__icon::before { transform: translateY(5px) rotate(45deg); }
  .topbar.is-open .menu-btn__icon::after { transform: translateY(-5px) rotate(-45deg); }
  .topbar.is-open .menu-btn__icon i { opacity: 0; }

  /* the panel */
  .js .topbar__nav {
    position: fixed; inset-inline: 0; top: var(--topbar-h, 64px); bottom: 0; z-index: 60;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 32px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--white); border-top: 1px solid var(--ink);
  }
  .js .topbar.is-open .topbar__nav { display: flex; animation: menu-in .18s var(--ease) both; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

  .js .topbar__nav .topbar__links { display: block; margin: 0; padding: 0; }
  .js .topbar__nav .topbar__links li { border-bottom: 1px solid #d9d9d2; }
  .js .topbar__nav .topbar__links a {
    display: flex; align-items: center; min-height: 56px; padding: 0;
    border: 0; font: 600 1.25rem/1.2 var(--f-body); color: var(--ink);
  }
  .js .topbar__nav .topbar__links a[aria-current] { box-shadow: inset 4px 0 0 var(--sun); padding-inline-start: 14px; }

  .js .topbar__nav .lang { order: 2; gap: 8px; margin: 24px 0 0; }
  .js .topbar__nav .lang a {
    display: flex; align-items: center; justify-content: center; min-width: 56px; min-height: 44px; padding: 0 12px;
    border: 1px solid #c7c7c2; font-size: .9375rem;
  }
  .js .topbar__nav .lang a[aria-current] { border: 2px solid var(--ink); background: var(--sun); }

  .js .topbar__nav .topbar__cta {
    order: 3; display: flex; justify-content: center; margin-top: 24px; min-height: 52px; font-size: 1.25rem;
  }
  html.menu-open, html.menu-open body { overflow: hidden; }
}

@media (max-width: 819px) and (prefers-reduced-motion: reduce) {
  .js .topbar.is-open .topbar__nav { animation: none; }
  .menu-btn__icon::before, .menu-btn__icon::after, .menu-btn__icon i { transition: none; }
}

/* while the menu is open, the sticky free-check bar and the contact buttons step aside */
html.menu-open .stickybar, html.menu-open .chatfab { display: none !important; }
