/* =========================================================
   АвтоДок — мобильная навигация приложения
   Новая реализация: нижнее меню + полноэкранный экран меню.
========================================================= */

@media (min-width: 992px){
  .av-mobile-appnav{display:none !important;}
}

@media (max-width: 991.98px){
  body{
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.av-mobile-menu-open{
    overflow: hidden;
    touch-action: none;
  }


  .av-mobile-bottom{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2300;
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    background: rgba(255,255,255,.96);
    border-top: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 -14px 34px rgba(15,23,42,.10);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .av-mobile-bottom__item{
    appearance: none;
    border: 0;
    background: transparent;
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px 3px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 16px;
    color: #98a2b3;
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 680;
    line-height: 1.05;
    letter-spacing: -.01em;
    transition: color .16s ease, background .16s ease, transform .16s ease;
  }

  .av-mobile-bottom__item i{
    font-size: 23px;
    line-height: 1;
  }

  .av-mobile-bottom__item span{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .av-mobile-bottom__item:hover,
  .av-mobile-bottom__item:focus{
    color: #0f172a;
    text-decoration: none;
  }

  .av-mobile-bottom__item.is-active{
    color: #0f172a;
    background: rgba(49,101,255,.08);
  }

  .av-mobile-bottom__item--primary i{
    font-size: 24px;
  }

  .av-mobile-bottom__item--primary.is-active,
  .av-mobile-bottom__item--primary:hover{
    color: #3165ff;
  }

  .av-mobile-menu{
    position: fixed;
    inset: 0;
    z-index: 2400;
    background: #fff;
    color: #0f172a;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s ease, opacity .22s ease, visibility .28s ease;
  }

  .av-mobile-menu.is-open{
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .av-mobile-menu__scroll{
    min-height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: calc(18px + env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom));
  }

  .av-mobile-menu__head{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
  }

  .av-mobile-menu__profile{
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0f172a;
    text-decoration: none;
  }

  .av-mobile-menu__profile:hover{
    color: #0f172a;
    text-decoration: none;
  }


  .av-mobile-menu__profile--auth{
    padding: 4px 0;
  }

  .av-mobile-menu__profile--guest{
    pointer-events: none;
    cursor: default;
  }

  .av-mobile-menu__avatar,
  .av-mobile-menu__avatarImage{
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 50%;
  }

  .av-mobile-menu__avatar{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef4ff 0%, #e4edff 100%);
    color: #2956d9;
    font-size: 23px;
    font-weight: 800;
    border: 1px solid rgba(49,101,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
  }

  .av-mobile-menu__avatar--guest{
    width: 52px;
    height: 52px;
    flex-basis: 52px;
    position: relative;
    background: radial-gradient(circle at 30% 30%, #f4f8ff 0%, #e7eefc 72%, #dde7fb 100%);
    border: 1px solid rgba(49,101,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 10px 22px rgba(49,101,255,.10);
    overflow: hidden;
  }

  .av-mobile-menu__avatarCore{
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3165ff 0%, #5f87ff 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.02em;
    box-shadow: 0 8px 16px rgba(49,101,255,.24);
  }

  .av-mobile-menu__avatarDot{
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #12b76a;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(18,183,106,.28);
  }

  .av-mobile-menu__avatarImage{
    object-fit: cover;
    border: 1px solid rgba(15,23,42,.08);
  }

  .av-mobile-menu__profileText{
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .av-mobile-menu__profileText strong{
    font-size: 18px;
    line-height: 1.05;
    font-weight: 750;
    letter-spacing: -.025em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .av-mobile-menu__profile--auth .av-mobile-menu__profileText strong{
    font-size: 16px;
    font-weight: 720;
  }

  .av-mobile-menu__profile--guest .av-mobile-menu__profileText strong{
    font-size: 19px;
    line-height: 1.08;
    font-weight: 600;
    letter-spacing: -.015em;
  }

  .av-mobile-menu__profileText small{
    font-size: 12.5px;
    line-height: 1.25;
    color: #7b8797;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .av-mobile-menu__profile--guest .av-mobile-menu__profileText small{
    font-size: 13px;
    color: #8a95a6;
  }

  .av-mobile-menu__headIcon,
  .av-mobile-menu__close{
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #0f172a;
    font-size: 19px;
    text-decoration: none;
    background: rgba(247,249,252,.74);
    border: 1px solid rgba(15,23,42,.055);
  }

  .av-mobile-menu__headIcon:hover,
  .av-mobile-menu__close:hover{
    color: #0f172a;
    background: #f1f5f9;
    text-decoration: none;
  }

  .av-mobile-menu__authActions{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
  }

  .av-mobile-menu__authBtn{
    min-height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    color: #27364a;
    background: #ffffff;
    border: 1px solid rgba(148,163,184,.28);
    text-decoration: none;
    font-weight: 650;
    font-size: 14px;
    letter-spacing: -.006em;
    box-shadow: 0 6px 16px rgba(15,23,42,.045);
  }

  .av-mobile-menu__authBtn i{
    width: 22px;
    height: 22px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(49,101,255,.09);
    color: #3165ff;
    font-size: 14px;
    line-height: 1;
  }

  .av-mobile-menu__authBtn:hover{
    color: #172033;
    text-decoration: none;
    background: #f8fbff;
    border-color: rgba(49,101,255,.22);
  }

  .av-mobile-menu__authBtn--primary{
    color: #195bd7;
    background: linear-gradient(180deg, #f7fbff 0%, #eff6ff 100%);
    border-color: rgba(49,101,255,.18);
    box-shadow: 0 7px 18px rgba(49,101,255,.075);
  }

  .av-mobile-menu__authBtn--primary:hover{
    color: #1450c6;
    background: linear-gradient(180deg, #f4f9ff 0%, #eaf3ff 100%);
  }

  .av-mobile-menu__authBtn--secondary{
    color: #32445b;
    background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  }

  .av-mobile-menu__authBtn--secondary:hover{
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  }

  .av-mobile-menu__section{
    margin-top: 18px;
  }

  .av-mobile-menu__sectionTitle{
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 760;
    letter-spacing: -.018em;
  }

  .av-mobile-menu__grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .av-mobile-menu-card{
    min-height: 108px;
    border-radius: 20px;
    padding: 13px 13px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    color: #111827;
    background: #f7f8fb;
    border: 1px solid rgba(15,23,42,.05);
    text-decoration: none;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  }

  .av-mobile-menu-card:hover{
    color: #111827;
    text-decoration: none;
    transform: translateY(-1px);
  }

  .av-mobile-menu-card.is-disabled{
    color: #6b7280;
    opacity: .72;
  }

  .av-mobile-menu-card__icon{
    width: 36px;
    height: 36px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #3165ff;
    font-size: 19px;
    box-shadow: 0 8px 18px rgba(15,23,42,.045);
  }

  .av-mobile-menu-card__title{
    width: 100%;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.15;
    font-weight: 560;
    letter-spacing: -.006em;
  }

  .av-mobile-menu-card__text{
    width: 100%;
    color: #7b8797;
    font-size: 12px;
    line-height: 1.22;
    font-weight: 400;
  }

  .av-mobile-menu__list{
    margin-top: 20px;
    border-radius: 22px;
    background: #f7f8fb;
    overflow: hidden;
  }

  .av-mobile-menu__list a{
    min-height: 50px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #364152;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -.004em;
    border-bottom: 1px solid rgba(15,23,42,.055);
  }

  .av-mobile-menu__list a:last-child{
    border-bottom: 0;
  }

  .av-mobile-menu__list a i{
    width: 24px;
    color: #75849a;
    font-size: 17px;
    text-align: center;
  }

  .av-mobile-menu__list a span{
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
  }

  .av-mobile-menu__list a em{
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
  }


  .av-mobile-menu__group{
    border-bottom: 1px solid rgba(15,23,42,.06);
  }

  .av-mobile-menu__group:last-child{
    border-bottom: 0;
  }

  .av-mobile-menu__group > summary{
    min-height: 50px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #364152;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -.004em;
    cursor: pointer;
    user-select: none;
    list-style: none;
  }

  .av-mobile-menu__group > summary::-webkit-details-marker{
    display: none;
  }

  .av-mobile-menu__group > summary i:first-child{
    width: 24px;
    color: #75849a;
    font-size: 17px;
    text-align: center;
  }

  .av-mobile-menu__group > summary span{
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 500;
  }

  .av-mobile-menu__groupChevron{
    margin-left: auto;
    color: #94a3b8 !important;
    font-size: 14px !important;
    transition: transform .18s ease;
  }

  .av-mobile-menu__group[open] .av-mobile-menu__groupChevron{
    transform: rotate(180deg);
  }

  .av-mobile-menu__sublist{
    padding: 0 10px 10px 50px;
    animation: avMobileSubmenu .16s ease both;
  }

  .av-mobile-menu__sublist a{
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.64);
    color: #475569;
    font-size: 13.5px;
    font-weight: 520;
  }

  .av-mobile-menu__sublist a + a{
    margin-top: 6px;
  }

  .av-mobile-menu__sublist a i{
    width: 20px;
    color: #7c8ba0;
    font-size: 16px;
  }

  .av-mobile-menu__sublist a:hover{
    background: #fff;
    color: #1f2937;
  }

  @keyframes avMobileSubmenu{
    from{opacity:0; transform: translateY(-4px);}
    to{opacity:1; transform: translateY(0);}
  }

  .av-mobile-menu__logoutForm{
    margin: 16px 0 0;
  }

  .av-mobile-menu__logout{
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff1f1;
    color: #b91c1c;
    font-size: 15px;
    font-weight: 760;
  }
}

@media (max-width: 374.98px){
  .av-mobile-bottom__item{
    font-size: 9.5px;
  }
  .av-mobile-bottom__item i{
    font-size: 22px;
  }
  .av-mobile-menu__scroll{
    padding-left: 14px;
    padding-right: 14px;
  }
  .av-mobile-menu__grid{
    gap: 8px;
  }
  .av-mobile-menu-card{
    min-height: 110px;
    padding: 12px 10px;
  }
  .av-mobile-menu-card__title{
    font-size: 13.5px;
  }
  .av-mobile-menu__authBtn{
    min-height: 44px;
    font-size: 13.5px;
  }
}
