/* Air theme · 90-responsive-shell.css
   Адаптив КАРКАСА (мобильный drawer / топбар / меню) — извлечено ДОСЛОВНО из шаблона
   css/90-responsive.css (только shell-секции двух медиа-блоков; per-screen медиа
   уезжают в screens/<screen>.css на этапе соответствующего экрана).
   Правка AIR-NAV: селектор .nav button расширен на .nav a (навигация в Yii = ссылки). */

@media (min-width: 721px) and (max-width: 1180px) {
  body.menu-open {
    overflow: hidden;
  }

  .topbar-inner {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: 13px clamp(24px, 4vw, 42px);
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 49, 95, 0.06);
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .brand img {
    height: 46px;
    max-width: 238px;
  }

  .top-actions {
    gap: 10px;
  }

  .topbar .ghost {
    padding: 10px 18px;
  }

  .topbar .primary {
    padding: 11px 18px;
  }

  .account-balance {
    min-height: 42px;
    padding: 6px 12px 6px 6px;
  }

  .account-balance b {
    font-size: 15px;
  }

  .balance-topup-icon {
    width: 30px;
    height: 30px;
  }

  .icon-action {
    width: 42px;
    height: 42px;
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    width: min(360px, 86vw);
    height: 100vh;
    margin: 0;
    padding: 28px 22px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--border-soft);
    box-shadow: 24px 0 48px rgba(15, 49, 95, 0.14);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav a, /* AIR-NAV */
  .nav button {
    justify-content: flex-start;
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
  }

  .nav > .menu-close {
    position: relative;
    display: inline-flex;
    align-self: flex-end;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
  }

  .menu-close span {
    position: absolute;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
  }

  .menu-close span:first-child {
    transform: rotate(45deg);
  }

  .menu-close span:last-child {
    transform: rotate(-45deg);
  }

  .docs-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .documents-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
  }

  /* Реальные подписи документов длинные (в шаблоне были короткие заглушки), а в drawer
     меню вертикальное на всю ширину — разрешаем перенос строк, иначе nowrap из .nav клипает. */
  .documents-menu a,
  .documents-menu button {
    white-space: normal;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(22, 34, 58, 0.22);
    border: 0;
  }

  body.menu-open .menu-backdrop {
    display: block;
  }
}

@media (max-width: 720px) {
  body.menu-open {
    overflow: hidden;
  }

  .topbar {
    position: sticky;
  }

  .topbar-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 10px 14px;
  }

  .brand {
    display: none;
  }

  .top-actions {
    justify-self: end;
    gap: 8px;
    width: auto;
    margin-left: 0;
    overflow: visible;
    padding-bottom: 0;
  }

  .topbar .ghost {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 11px;
  }

  .topbar .primary {
    min-height: 40px;
    padding: 10px 13px;
    font-size: 14px;
    border-radius: 11px;
    white-space: nowrap;
  }

  .topbar .top-actions .primary {
    display: none;
  }

  .topbar .primary svg {
    display: none;
  }

  .account-balance {
    min-height: 38px;
    gap: 6px;
    padding: 5px 8px 5px 5px;
    border-radius: 10px;
  }

  .balance-topup-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .account-balance b {
    font-size: 12px;
  }

  .icon-action {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .icon-action svg {
    width: 17px;
    height: 17px;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 49, 95, 0.06);
  }

  .menu-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    width: min(320px, 88vw);
    height: 100vh;
    margin: 0;
    padding: 22px 18px 28px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    border-right: 1px solid var(--border-soft);
    box-shadow: 24px 0 48px rgba(15, 49, 95, 0.14);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
  }

  .nav.is-open {
    transform: translateX(0);
  }

  .nav a, /* AIR-NAV */
  .nav button {
    justify-content: flex-start;
    width: 100%;
    padding: 13px 12px;
    font-size: 16px;
  }

  .nav > .menu-close {
    position: relative;
    display: inline-flex;
    align-self: flex-end;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
  }

  .menu-close span {
    position: absolute;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
  }

  .menu-close span:first-child {
    transform: rotate(45deg);
  }

  .menu-close span:last-child {
    transform: rotate(-45deg);
  }

  .nav .drawer-brand {
    display: flex;
    width: 100%;
    margin: 0 0 14px;
    padding: 0 4px 16px;
    border-bottom: 1px solid var(--border-soft);
  }

  .nav .drawer-brand img {
    display: block;
    height: 48px;
    max-width: 230px;
  }

  .docs-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .documents-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
  }

  /* Реальные подписи документов длинные (в шаблоне были короткие заглушки), а в drawer
     меню вертикальное на всю ширину — разрешаем перенос строк, иначе nowrap из .nav клипает. */
  .documents-menu a,
  .documents-menu button {
    white-space: normal;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(22, 34, 58, 0.22);
    border: 0;
  }

  body.menu-open .menu-backdrop {
    display: block;
  }
}
