/* Mobile / touch optimization for Вывези */
:root {
  --touch: 44px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* —— Top bar / hamburger —— */
.top {
  position: relative;
  z-index: 50;
  gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  border-radius: 12px;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .18s ease, opacity .18s ease;
}

.top.is-nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.top.is-nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}
.top.is-nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.cookie-bar {
  display: none;
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(14,22,32,0.96);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.cookie-bar.is-on { display: block; }

.cookie-bar__row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cookie-bar p {
  margin: 0;
  font-size: 0.88rem;
  color: #c5d0db;
  line-height: 1.4;
  flex: 1 1 200px;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 6px);
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(10, 16, 24, 0.98);
    box-shadow: 0 18px 40px rgba(0,0,0,0.45);
    max-height: min(70vh, 520px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .top.is-nav-open .nav { display: flex; }

  .nav .btn,
  .nav form,
  .nav .switch {
    width: 100%;
  }

  .nav .btn {
    justify-content: center;
    min-height: var(--touch);
    padding: 12px 14px;
  }

  .nav form { display: grid; }

  .wrap {
    padding: 10px 14px 88px;
  }
  .page-landing .wrap--landing {
    padding: 0 0 72px;
  }
  .page-landing .top,
  .page-landing .foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .card h1 {
    font-size: 1.25rem;
    line-height: 1.25;
  }

  .btn {
    min-height: 44px;
  }

  /* iOS: не зумить поля при фокусе */
  input, select, textarea {
    font-size: 16px !important;
    max-width: 100%;
  }

  .foot {
    padding: 8px 14px 28px;
    gap: 8px 12px;
    font-size: 0.78rem;
  }
}

@media (max-width: 560px) {
  .top {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .logo { font-size: 1.28rem; }

  .muted { font-size: 0.92rem; margin-bottom: 12px; }

  .land-form-actions .btn,
  .wiz-actions .btn,
  form > .btn-primary,
  form > button.btn-primary {
    width: 100%;
    justify-content: center;
  }

  .route-map { height: 240px; }
  .route-map--lg { height: 280px; }

  .route-map__tools {
    padding: 8px;
    gap: 6px;
  }

  .route-map__chk {
    padding: 8px 10px;
    font-size: 0.72rem;
    min-height: 36px;
  }

  .route-map__hint {
    font-size: 0.72rem;
    padding: 8px 10px;
  }

  .city-picker__list {
    max-height: 45vh;
  }

  .city-picker__item {
    padding: 12px;
    min-height: 44px;
  }

  .stat-grid { gap: 8px; }
  .stat { padding: 12px; }
  .stat__value { font-size: 1.25rem; }

  .list-row { padding: 12px 0; }
  .list-row__top { gap: 6px; }

  .wiz-step {
    min-width: 0;
    flex: 1 1 calc(33.33% - 8px);
    padding: 8px 6px;
    font-size: 0.72rem;
    text-align: center;
  }

  .land-tabs {
    grid-template-columns: 1fr;
    margin: 10px 0 12px;
  }

  .land-tab { padding: 14px; min-height: 56px; }

  .land-chip {
    padding: 10px 12px;
    font-size: 0.78rem;
    min-height: 40px;
  }

  .land-corridors {
    max-height: 140px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .cookie-bar__row {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-bar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Cabinet mobile */
@media (max-width: 860px) {
  .cab { gap: 12px; }

  .cab-side {
    padding: 12px;
    border-radius: 16px;
  }

  .cab-user {
    padding: 0 4px 10px;
    margin-bottom: 10px;
  }

  .cab-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .cab-nav::-webkit-scrollbar { display: none; }

  .cab-nav__label { display: none; }

  .cab-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 12px;
    min-height: 44px;
  }

  .cab-nav__ico { display: none; }

  .cab-balance {
    margin-top: 10px;
  }

@media (max-width: 560px) {
  .cab-nav {
    grid-template-columns: unset;
  }

  .land-hero {
    min-height: min(42vh, 340px);
    border-radius: 16px;
  }

  .land-brand {
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .land-lead {
    font-size: 1rem;
    max-width: none;
  }

  .land-cta .btn {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }

  .land-card {
    padding: 16px;
    border-radius: 16px;
  }

  .land-card h2 { font-size: 1.3rem; }

  .land-card--map .route-map,
  .land-card--map .route-map--lg {
    height: 260px;
    min-height: 220px;
  }

  .land-map-links .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .land-hero__map { animation: none; }
  .nav-toggle span { transition: none; }
}
