/* ============================================================================
   Мобильная оболочка сайта (до 800px), 02.11.2026.
   Компактная шапка 56px (прячется при прокрутке вниз), нижняя панель
   из пяти вкладок с кнопкой звонка, шторка-меню снизу с плитками и контактами.
   Разметка: template/header.php (.header__brand, .header__mvk) и
   template/mobile_nav.php. Поведение: js/mobile_nav.js.
   Подключается последним, после css страниц.
   Анимации только transform/opacity; backdrop-filter - на шапке, панели и
   подложке шторки (одиночные элементы), не на карточках.
   ========================================================================== */

:root {
  --mn-navy: #10263f;
  --mn-navy-2: #17375a;
  --mn-orange: #f90;
  --mn-orange-2: #fbb03d;
  --mn-ink: #1b2b3d;
  --mn-muted: #6b7a8c;
  --mn-line: #e6ebf1;
  --mn-bar-h: 64px;
  --mn-safe: env(safe-area-inset-bottom, 0px);
  --mn-ease: cubic-bezier(.32, .72, 0, 1);
}

.mn-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.mn-ic {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

/* На десктопе мобильной оболочки нет */
.header__brand,
.header__mvk,
.mn-bar,
.mn-sheet,
.mn-scrim {
  display: none;
}

@media (max-width: 800px) {

  /* ---------- 1. Шапка ---------- */
  .header__top {
    background: rgba(16, 38, 63, .9);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px rgba(4, 16, 30, .18);
    transition: transform .35s var(--mn-ease);
    will-change: transform;
  }

  html.mn-hide-head .header__top {
    transform: translateY(-100%);
  }

  .header__top .container {
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 12px 0 10px;
  }

  .header__logo {
    align-self: center;
  }

  .header__logo a img {
    max-width: 40px;
    max-height: 40px;
    display: block;
  }

  /* Старое: телефон, почта, оранжевая кнопка, бургер и выпадающий список -
     теперь их роль у нижней панели и шторки */
  .header__contacts,
  .header__btn-menu,
  .menu ul,
  #go-top {
    display: none !important;
  }

  .header__brand {
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1 1 auto;
    color: #fff;
    text-decoration: none;
    line-height: 1.1;
  }

  .header__brand b {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 19px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .header__brand span {
    margin-top: 2px;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header__mvk {
    order: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    transition: transform .15s ease, background-color .2s ease;
  }

  .header__mvk .mn-ic {
    width: 21px;
    height: 21px;
  }

  .header__mvk:active {
    transform: scale(.92);
    background: rgba(255, 255, 255, .16);
  }

  /* Баннер главной начинался под шапкой 70px */
  .banner {
    padding-top: 56px;
  }

  /* Якоря главной: шапка 56px */
  .anchor {
    top: -64px;
  }

  /* ---------- 2. Нижняя панель ---------- */
  body {
    padding-bottom: calc(var(--mn-bar-h) + var(--mn-safe));
  }

  .mn-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: calc(var(--mn-bar-h) + var(--mn-safe));
    padding: 0 6px var(--mn-safe);
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid rgba(16, 38, 63, .08);
    box-shadow: 0 -8px 24px rgba(16, 38, 63, .08);
  }

  .mn-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: var(--mn-bar-h);
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: 500 11px/1.1 'Roboto', sans-serif;
    letter-spacing: .01em;
    color: var(--mn-muted);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s ease;
  }

  .mn-tab .mn-ic {
    width: 24px;
    height: 24px;
    transition: transform .25s var(--mn-ease);
  }

  .mn-tab:active .mn-ic {
    transform: scale(.86);
  }

  /* Активная вкладка: цвет и тонкая черта сверху */
  .mn-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 3px;
    margin-left: -14px;
    border-radius: 0 0 3px 3px;
    background: var(--mn-orange);
    transform: scaleX(0);
    transition: transform .3s var(--mn-ease);
  }

  .mn-tab.is-on {
    color: var(--mn-navy);
  }

  .mn-tab.is-on .mn-ic {
    stroke-width: 2.2;
  }

  .mn-tab.is-on::before {
    transform: scaleX(1);
  }

  /* Центральная кнопка звонка */
  .mn-tab--call {
    color: var(--mn-navy);
    font-weight: 600;
  }

  .mn-tab--call::before {
    display: none;
  }

  .mn-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -22px;
    margin-bottom: 1px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, var(--mn-orange-2), var(--mn-orange));
    box-shadow: 0 10px 22px rgba(255, 153, 0, .42), 0 2px 4px rgba(16, 38, 63, .12);
    transition: transform .2s var(--mn-ease), box-shadow .2s ease;
  }

  .mn-fab .mn-ic {
    width: 24px;
    height: 24px;
    stroke-width: 2.1;
  }

  .mn-tab--call:active .mn-fab {
    transform: scale(.92);
  }

  .mn-tab--call:active .mn-fab .mn-ic {
    transform: none;
  }

  /* Лёгкое «звонит» раз в несколько секунд: только transform, пауза
     при скрытой вкладке - js снимает класс */
  html.mn-anim .mn-fab .mn-ic {
    animation: mn-ring 6s ease-in-out 2s infinite;
  }

  @keyframes mn-ring {
    0%, 86%, 100% { transform: rotate(0); }
    88% { transform: rotate(-14deg); }
    90% { transform: rotate(12deg); }
    92% { transform: rotate(-10deg); }
    94% { transform: rotate(8deg); }
    96% { transform: rotate(0); }
  }

  .mn-badge {
    position: absolute;
    top: 7px;
    left: 50%;
    margin-left: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px !important; /* исключение из прямых углов ui.css, как .menu-badge */
    box-sizing: border-box;
    background: #e8452c;
    color: #fff;
    font: 700 10px/17px 'Roboto', sans-serif;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
  }

  /* ---------- 3. Шторка ---------- */
  .mn-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(8, 20, 34, .5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .35s ease;
  }

  .mn-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1210;
    max-height: 88vh;
    max-height: 88dvh;
    padding-bottom: var(--mn-safe);
    background: #f5f7fa;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(4, 16, 30, .3);
    transform: translateY(105%);
    transition: transform .42s var(--mn-ease);
    will-change: transform;
  }

  .mn-scrim[hidden],
  .mn-sheet[hidden] {
    display: none;
  }

  html.mn-open .mn-scrim {
    opacity: 1;
  }

  html.mn-open .mn-sheet {
    transform: translateY(0);
  }

  html.mn-open,
  html.mn-open body {
    overflow: hidden;
  }

  .mn-sheet.is-drag {
    transition: none;
  }

  .mn-sheet__grip {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    padding: 9px 0 4px;
    touch-action: none;
  }

  .mn-sheet__grip span {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #cdd5df;
  }

  .mn-sheet__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 16px 12px 20px;
    touch-action: none;
  }

  .mn-sheet__title {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mn-navy);
    line-height: 1.1;
  }

  .mn-sheet__title small {
    display: block;
    margin-top: 2px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--mn-muted);
  }

  .mn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #e7ecf2;
    color: var(--mn-ink);
    cursor: pointer;
    transition: transform .15s ease;
  }

  .mn-close:active {
    transform: scale(.9);
  }

  .mn-sheet__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 14px 18px;
  }

  .mn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  .mn-grid li {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mn-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 88px;
    padding: 6px 4px;
    box-sizing: border-box;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--mn-line);
    color: var(--mn-ink);
    text-decoration: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, border-color .2s ease;
  }

  .mn-tile:active {
    transform: scale(.95);
  }

  .mn-tile.is-on {
    border-color: var(--mn-orange-2);
    box-shadow: inset 0 0 0 1px var(--mn-orange-2);
  }

  .mn-tile__ic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(23, 55, 90, .07);
    color: var(--mn-navy-2);
  }

  .mn-tile.is-on .mn-tile__ic {
    background: rgba(255, 153, 0, .14);
    color: #d97f00;
  }

  .mn-tile__ic .mn-badge {
    top: -5px;
    left: auto;
    right: -8px;
    margin: 0;
  }

  .mn-tile__t {
    font: 500 12.5px/1.15 'Roboto', sans-serif;
  }

  /* Плитки въезжают лесенкой при открытии */
  html.mn-anim .mn-grid li {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .3s ease, transform .4s var(--mn-ease);
    transition-delay: calc(var(--i) * 22ms + 60ms);
  }

  html.mn-anim.mn-open .mn-grid li {
    opacity: 1;
    transform: none;
  }

  /* Карточка контактов */
  .mn-card {
    margin-top: 12px;
    padding: 6px 14px 14px;
    border-radius: 18px;
    background: var(--mn-navy);
    color: #fff;
  }

  .mn-card .mn-ic {
    color: var(--mn-orange-2);
  }

  .mn-card__phone,
  .mn-card__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.25;
  }

  .mn-card__phone {
    font-family: 'Oswald', sans-serif;
    font-size: 21px;
    letter-spacing: .02em;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }

  .mn-card__row + .mn-card__row {
    border-top: 1px solid rgba(255, 255, 255, .08);
  }

  .mn-card small {
    display: block;
    margin-top: 2px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    letter-spacing: 0;
    color: rgba(255, 255, 255, .6);
  }

  .mn-card__btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
  }

  .mn-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font: 500 14px/1 'Roboto', sans-serif;
    text-decoration: none;
    transition: transform .15s ease;
  }

  .mn-btn .mn-ic {
    width: 19px;
    height: 19px;
    color: #fff;
  }

  .mn-btn--vk {
    background: #0077ff;
  }

  .mn-btn--vk .mn-ic {
    fill: currentColor;
    stroke: none;
  }

  .mn-btn:active {
    transform: scale(.96);
  }

  /* ---------- 4. Текст: на узкой колонке без растяжки по ширине ---------- */
  .articles-info,
  .articles-text,
  .panda__articles-desc,
  .panda__articles-excerpt,
  .about__text,
  .about__text-dark,
  .about__item-info,
  .adaptive_column_conteiner_text,
  .faq-answer,
  .review-text,
  .section-subtitle,
  .panda__articles-empty,
  .about__text p,
  .about__text li,
  .about__text-dark p,
  .about__text-dark li {
    text-align: left !important;
    text-justify: auto;
  }

  /* Заголовки секций: вместо длинной черты слева, съедавшей треть строки, -
     короткая оранжевая черта над заголовком */
  .title__box h2,
  .title__box-dark h2 {
    padding: 34px 0 14px !important;
    margin-top: 0;
    font-size: 25px !important;
    line-height: 1.15;
    letter-spacing: .01em;
    text-align: left !important;
  }

  .title__box h2::before,
  .title__box-dark h2::before {
    top: 20px !important;
    left: 0;
    width: 34px !important;
    height: 3px;
    border-radius: 2px;
    background-color: var(--mn-orange) !important;
  }

  /* Появление блоков при прокрутке - один раз, только opacity/transform */
  html.mn-anim .mn-rv {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .55s ease, transform .6s var(--mn-ease);
  }

  html.mn-anim .mn-rv.mn-in {
    opacity: 1;
    transform: none;
  }

  /* ---------- 5. Чужие фиксированные элементы над панелью ---------- */
  .clubs-switch {
    bottom: calc(var(--mn-bar-h) + var(--mn-safe) + 34px) !important;
  }
}

@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
  .header__top,
  .mn-sheet,
  .mn-scrim,
  .mn-tab .mn-ic {
    transition: none;
  }
}
