/* ══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV + DRAWER
   Показывается только на экранах ≤1200px (как burger-режим в styles.css)
   ══════════════════════════════════════════════════════════════ */

/* ── Отступ снизу, чтобы контент не прятался под навигацией ─── */
@media (max-width: 1200px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    padding-top: 0 !important;
    transition: padding-bottom 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }

  /* Когда нижнее меню спрятано при скролле — отступ только под safe-area */
  body.mob-nav-scroll-hidden {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Полностью скрываем шапку на мобилках */
  .site-header {
    display: none !important;
  }
}

/* ══ BOTTOM NAV ══════════════════════════════════════════════════ */
.mob-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8000;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-top: 1px solid rgba(6, 86, 185, 0.07);
  box-shadow:
    0 -1px 0 rgba(255,255,255,0.6),
    0 -8px 40px rgba(10, 22, 40, 0.10);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 1200px) {
  .mob-nav {
    display: flex;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
  }

  .mob-nav.is-scroll-hidden {
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
    pointer-events: none;
  }
}

@media (max-width: 1200px) and (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }

  .mob-nav,
  .mob-nav.is-scroll-hidden {
    transition: none;
  }
}

.mob-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px 4px;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  color: #8fa4bc;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.mob-nav-ico {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.mob-nav-item.is-active {
  color: var(--blue, #0656b9);
}

.mob-nav-item.is-active .mob-nav-ico {
  background: rgba(6, 86, 185, 0.10);
}

.mob-nav-item:active .mob-nav-ico {
  transform: scale(0.88);
}

/* badge на иконке кабинета/корзины */
.mob-nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #e53935;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

/* ══ DRAWER ══════════════════════════════════════════════════════ */
.mob-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s 0.42s;
}

.mob-drawer.is-open {
  pointer-events: all;
  visibility: visible;
  transition: visibility 0s;
}

.mob-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 34, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mob-drawer.is-open .mob-drawer-backdrop {
  opacity: 1;
}

.mob-drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 28px 28px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -32px 80px rgba(10, 22, 40, 0.18);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.mob-drawer.is-open .mob-drawer-sheet {
  transform: translateY(0);
}

/* Закрытый drawer не перехватывает тапы по нижнему меню */
.mob-drawer:not(.is-open) .mob-drawer-sheet,
.mob-drawer:not(.is-open) .mob-drawer-backdrop {
  pointer-events: none;
}

/* Пока открыт drawer — нижняя панель не кликается под ним */
body.mob-drawer-open .mob-nav {
  pointer-events: none;
}

/* Ручка-индикатор для свайпа */
.mob-drawer-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: #dde6f0;
  margin: 14px auto 0;
  flex-shrink: 0;
}

/* Шапка drawer */
.mob-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #f0f4fa;
}

.mob-drawer-logo {
  height: 30px;
  width: auto;
  display: block;
}

.mob-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #e4ecf7;
  background: #f7fafd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #5a7a99;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mob-drawer-close:active {
  background: #e8f0fb;
  color: var(--blue, #0656b9);
}

/* Контакты в drawer */
.mob-drawer-contacts {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f4fa;
}

.mob-drawer-contact {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f4f8fd;
  border-radius: 14px;
  text-decoration: none;
  color: #1e3550;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.mob-drawer-contact:active {
  background: #e4eefc;
}

.mob-drawer-contact svg {
  flex-shrink: 0;
  color: var(--blue, #0656b9);
}

/* Секции меню */
.mob-drawer-sections {
  padding: 8px 12px;
}

.mob-drawer-section {
  margin-bottom: 4px;
}

.mob-drawer-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  border-radius: 14px;
  transition: background 0.18s;
}

.mob-drawer-section-root {
  min-width: 0;
  padding: 13px 4px 13px 12px;
  color: #0a1628;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.mob-drawer-section-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #0a1628;
  text-align: left;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.mob-drawer-section-btn:active {
  background: #f0f6fe;
}

.mob-drawer-section-btn svg {
  color: #8fa4bc;
  transition: transform 0.25s ease, color 0.2s;
  flex-shrink: 0;
}

.mob-drawer-section.is-open .mob-drawer-section-btn svg {
  transform: rotate(180deg);
  color: var(--blue, #0656b9);
}

.mob-drawer-section.is-open .mob-drawer-section-btn {
  color: var(--blue, #0656b9);
  background: transparent;
}

.mob-drawer-section.is-open .mob-drawer-section-heading {
  background: rgba(6, 86, 185, 0.05);
}

.mob-drawer-section.is-open .mob-drawer-section-root {
  color: var(--blue, #0656b9);
}

.mob-drawer-links {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
  padding: 0 4px;
}

.mob-drawer-section.is-open .mob-drawer-links {
  grid-template-rows: 1fr;
}

.mob-drawer-links-inner {
  overflow: hidden;
}

.mob-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #2d4a6b;
  font-size: 14px;
  font-weight: 450;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  margin-bottom: 2px;
}

.mob-drawer-link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8daf0;
  flex-shrink: 0;
  transition: background 0.15s;
}

.mob-drawer-link:active {
  background: #edf4fe;
  color: var(--blue, #0656b9);
}

.mob-drawer-link:active::before {
  background: var(--blue, #0656b9);
}

/* Детализированная мобильная версия общего мегаменю. */
.mob-drawer-group-title {
  margin: 12px 12px 6px;
  color: #8290a3;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mob-drawer-group-title:first-child {
  margin-top: 6px;
}

.mob-drawer-link {
  align-items: center;
  gap: 10px;
}

.mob-drawer-link::before {
  display: none;
}

.mob-drawer-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid #dde5ed;
  border-radius: 9px;
  color: #3c4d62;
  background: #fff;
}

.mob-drawer-link-icon svg {
  width: 16px;
  height: 16px;
}

.mob-drawer-link-copy {
  display: block;
  min-width: 0;
  line-height: 1.25;
}

.mob-drawer-link-copy strong,
.mob-drawer-link-copy small {
  display: block;
  letter-spacing: 0;
}

.mob-drawer-link-copy strong {
  color: #1b2a3c;
  font-size: 13px;
  font-weight: 620;
}

.mob-drawer-link-copy small {
  margin-top: 2px;
  color: #7a899c;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.35;
}

.mob-drawer-link[aria-current="page"] {
  background: #edf4fb;
}

.mob-drawer-link[aria-current="page"] .mob-drawer-link-icon {
  color: var(--blue, #0656b9);
  border-color: #bfd1e4;
}

@media (max-width: 360px) {
  .mob-drawer-contacts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mob-drawer-contact {
    justify-content: flex-start;
    white-space: nowrap;
  }
}

/* Прямые ссылки (не выпадающие) */
.mob-drawer-direct {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px 0;
}

.mob-drawer-direct-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #f7fafd;
  border-radius: 14px;
  text-decoration: none;
  color: #0a1628;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.mob-drawer-direct-link svg {
  color: var(--blue, #0656b9);
  flex-shrink: 0;
}

.mob-drawer-direct-link:active {
  background: #e4eefc;
  color: var(--blue, #0656b9);
}

/* Кнопки-действия внизу drawer */
.mob-drawer-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 4px;
  border-top: 1px solid #f0f4fa;
  margin-top: 8px;
}

.mob-drawer-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: filter 0.18s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.mob-drawer-action--primary {
  background: var(--blue, #0656b9);
  color: #fff;
}

.mob-drawer-action--secondary {
  background: #f0f4fa;
  color: #0a1628;
}

.mob-drawer-action:active {
  filter: brightness(0.92);
  transform: scale(0.97);
}

/* ══ КОМПАКТНЫЙ ФУТЕР (мобилка) ═══════════════════════════════
   Колонки ссылок скрыты — дублируют drawer и нижнее меню
   ─────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .footer .ft-nav {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 28px 24px !important;
  }

  .footer .ft-body {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 42px 0 36px !important;
    border-bottom: 1px solid #edf1f7 !important;
  }

  .footer .ft-brand {
    display: grid !important;
    grid-template-columns: auto minmax(180px, .8fr) minmax(0, 1.8fr) !important;
    align-items: start !important;
    gap: 24px 32px !important;
    text-align: left !important;
  }

  .footer .ft-logo {
    margin: 0 !important;
  }

  .footer .ft-logo-img {
    height: 30px !important;
    width: auto !important;
  }

  .footer .ft-tagline {
    display: block !important;
    margin: 0 !important;
  }

  .footer .ft-contacts {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    margin-top: 0 !important;
    align-items: start !important;
    gap: 12px 20px !important;
    width: 100%;
  }

  .footer .ft-contact-link {
    font-size: 0.82rem !important;
  }

  .footer .ft-address {
    justify-content: flex-start !important;
    max-width: none !important;
    margin: 0 auto !important;
    font-size: 0.75rem !important;
    line-height: 1.45 !important;
  }

  .footer .ft-bottom {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 0 22px !important;
    text-align: center !important;
  }

  .footer .ft-bottom-links {
    justify-content: center !important;
    text-align: center !important;
  }

  .footer .ft-copy {
    font-size: 0.72rem !important;
    line-height: 1.4 !important;
    max-width: 22rem !important;
  }

  .footer .ft-bottom-links a,
  .footer .ft-bottom-links span {
    font-size: 0.71rem !important;
  }
}

@media (max-width: 900px) and (min-width: 721px) {
  .footer .ft-brand {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .footer .ft-contacts {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 720px) {
  .footer .ft-body {
    gap: 28px !important;
    padding: 34px 0 30px !important;
  }

  .footer .ft-brand {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
  }

  .footer .ft-logo {
    margin-bottom: 16px !important;
  }

  .footer .ft-tagline {
    margin-bottom: 22px !important;
  }

  .footer .ft-contacts {
    grid-template-columns: 1fr !important;
    gap: 9px !important;
  }

  .footer .ft-nav {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .footer .ft-col {
    padding: 0 !important;
    border-bottom: 1px solid #cfdeeb;
  }

  .footer .ft-col-title {
    padding-top: 14px;
    border-bottom: 0;
  }

  .footer .ft-links {
    padding: 0 0 10px 28px;
  }

  .footer .ft-links a {
    padding: 8px 0;
    border-bottom: 0;
  }
}
