/* Viewport-specific menu adjustments and motion preferences. */

@supports (height: 100dvh) {
  .top-menu-dropdown { max-height: min(720px, calc(100dvh - 108px)); }
}

@media (max-height: 760px) and (min-width: 1181px) {
  .top-menu-dropdown {
    max-height: calc(100vh - 94px);
    padding-top: 12px;
    padding-bottom: 12px;
  }

  @supports (height: 100dvh) {
    .top-menu-dropdown { max-height: calc(100dvh - 94px); }
  }

  .top-menu-dropdown-link { padding-block: 9px; }
  .top-menu-dropdown-head { padding-block: 7px 10px; }
}

@media (max-height: 640px) and (min-width: 1181px) {
  .top-menu-dropdown { max-height: calc(100vh - 82px); }

  @supports (height: 100dvh) {
    .top-menu-dropdown { max-height: calc(100dvh - 82px); }
  }
}

@supports not (height: 100dvh) {
  .top-menu-mobile { max-height: calc(100vh - var(--mobile-menu-top-space) - var(--mobile-safe-bottom)); }
}

@media (max-width: 1180px) {
  .top-menu-nav,
  .top-menu-actions { display: none; }
  .top-menu-bar { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .top-menu-burger { display: flex; grid-column: 3; }
  .top-menu-brand { grid-column: 1; }
}

@media (max-width: 620px) {
  .top-menu { --mobile-menu-top-space: 78px; padding: 10px 10px 0; }
  .top-menu-bar { min-height: 66px; padding: 9px 12px; border-radius: 16px; }
  .top-menu-brand { width: 52px; }
  .top-menu-logo { height: 38px; max-width: 48px; }
  .top-menu-burger { width: 42px; height: 40px; flex-basis: 42px; border-radius: 12px; }
  .top-menu-mobile { left: 10px; right: 10px; top: calc(100% + 8px); border-radius: 16px; }
  .top-menu-mobile-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .top-menu * { transition: none !important; }
}
