/* ============ Media queries ============ */
@media (max-width: 860px) {
  .details-grid { grid-template-columns: 1fr; }
  .details-meta { position: static; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .lb-nav { width: 44px; height: 44px; font-size: 1.4rem; }
  .lb-prev { left: .8rem; }
  .lb-next { right: .8rem; }

  /* Разрешаем pinch-zoom для планов */
  .plan-slide img {
    touch-action: pinch-zoom pan-x;
    cursor: default;
  }
}

@media (max-width: 640px) {
  .plans-tabs { display: none; }
  .plans-select {
    display: flex;
    justify-content: center;
  }
  .plans-group-tabs,
  .plans-submenu { display: none; }

  .plans-viewport {
    aspect-ratio: 4 / 3;
    height: 60vh;
    --plan-peek: 20%;
  }
  .plan-slide { padding: .75rem; }
  .plan-tab { font-size: .78rem; padding: .5rem .95rem; display: none; }
  .plan-slide img.is-horizontal {
    max-width: calc(100cqh - 1.5rem);
    max-height: calc(100cqw - 1.5rem);
    transform: rotate(-90deg);
  }
  .photo-caption.plan-caption { display: none; }
  .plan-slide .photo-caption.plan-caption {
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
  }

  .float-actions { bottom: max(1rem, env(safe-area-inset-bottom)); }
  .float-actions-left  { left: 1rem; }
  .float-actions-right { right: 1rem; }
  .float-share { display: inline-flex; }
  .hero-share  { display: none; }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; gap: .75rem; }
  .hero-content h1 { font-size: 2.8rem; }
  .meta-row { flex-direction: column; }
  .meta-value { text-align: left; }
}

@media (max-width: 480px) {
  .btn-label { display: none; }
  .modal-form-grid { grid-template-columns: 1fr; }
  #route-input {
    padding: 2rem 1.2rem;
    border-radius: 16px;
    width: calc(100vw - 2rem);
  }
}