/* ============================================================
   MENZIL LOGISTICS - PROFESSIONAL MOBILE CSS v5 (FINAL)
   Адаптирован под реальные классы: .nav-link, .lang-btn, .sidebar-link
   ============================================================ */

html, body {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {

  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* === ТИПОГРАФИКА === */
  body { font-size: 15px !important; line-height: 1.5 !important; }
  h1 { font-size: 26px !important; line-height: 1.2 !important; }
  h2 { font-size: 22px !important; line-height: 1.3 !important; }
  h3 { font-size: 18px !important; line-height: 1.3 !important; }

  /* === ШАПКА === */
  header, .header, .navbar, .top-bar {
    padding: 12px 16px 12px 64px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
  }

  /* Скрываем все .nav-link и .lang-btn на мобильных (они в гамбургер-меню) */
  .nav-link, .lang-btn {
    display: none !important;
  }

  /* Главное меню в шапке */
  header > div, .header-container, .navbar > div {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }

  /* Логотип компактный */
  .logo, header img, .navbar-brand {
    max-width: 100px !important;
    height: auto !important;
    flex-shrink: 0 !important;
  }

  /* === HERO БЛОК === */
  .hero, section.hero, .banner {
    padding: 30px 16px 40px !important;
    text-align: center !important;
  }

  .hero h1, .hero-title {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }

  .hero p, .hero-subtitle {
    font-size: 15px !important;
    line-height: 1.5 !important;
  }

  /* === КНОПКИ HERO === */
  .hero .btn, .hero button.btn, .hero a.btn,
  .btn-white, .btn-outline-white {
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    min-height: 52px !important;
    border-radius: 10px !important;
    margin: 6px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Группа кнопок hero — вертикально */
  .hero-actions, .hero-buttons, .hero .button-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* === ОТСЛЕДИТЬ ГРУЗ === */
  input[placeholder*="ML-"], input[placeholder*="штрих"], input[placeholder*="отсле"] {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    min-height: 52px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
  }

  /* === КАЛЬКУЛЯТОР - типы груза === */
  .cargo-type-btn {
    padding: 12px 16px !important;
    font-size: 14px !important;
    min-height: 48px !important;
  }

  /* === СТАТИСТИКА === */
  .stats, .stat-block, .statistics {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding: 16px 0 !important;
  }

  .stat-item .number, .stats .stat-number {
    font-size: 22px !important;
    font-weight: 700 !important;
  }

  .stat-item .label, .stats .stat-label {
    font-size: 10px !important;
  }

  /* === КАРТОЧКИ УСЛУГ === */
  .services, .services-grid, .features-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  /* === ФОРМЫ === */
  form input, form select, form textarea,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"] {
    width: 100% !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
    margin-bottom: 10px !important;
  }

  form button[type="submit"], .btn-primary {
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    min-height: 52px !important;
    border-radius: 10px !important;
  }

  /* === КАБИНЕТ - СКРЫВАЕМ САЙДБАР (он в гамбургер-меню) === */
  .sidebar, aside.sidebar, nav.sidebar {
    display: none !important;
  }

  /* Основной контент кабинета на всю ширину */
  .main-content, .cabinet-content, .dashboard-content,
  [id^="page-"] .content,
  [id^="page-client"] > div,
  [id^="page-warehouse"] > div,
  [id^="page-admin"] > div {
    margin-left: 0 !important;
    padding: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* === ТАБЛИЦЫ → КАРТОЧКИ === */
  table {
    display: block !important;
    width: 100% !important;
  }

  table thead { display: none !important; }
  table tbody, table tr { display: block !important; width: 100% !important; }

  table tr {
    margin-bottom: 12px !important;
    padding: 14px !important;
    background: rgba(0,0,0,0.25) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
  }

  table td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 0 !important;
    border: none !important;
    font-size: 14px !important;
    gap: 12px !important;
  }

  table td[data-label]::before {
    content: attr(data-label) ":";
    font-weight: 600 !important;
    color: rgba(255,255,255,0.55) !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  /* === КАМЕРА СКАНЕР === */
  #camera-scanner-modal {
    padding: 0 !important;
  }

  #camera-scanner-modal > div {
    width: 100% !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 16px !important;
  }

  /* === МОДАЛЬНЫЕ ОКНА === */
  .modal-content, .modal > div {
    max-width: 95% !important;
    margin: 10px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
  }

  /* === КОНТЕЙНЕРЫ === */
  .container, .wrapper, main {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* === МАЛЕНЬКИЕ ЭКРАНЫ === */
@media (max-width: 380px) {
  .hero h1, h1 { font-size: 24px !important; }
}
