/* Planovo — mobile overrides (landing + legal). Load after site-legal.css */

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

.landing-page {
  overflow-x: clip;
  max-width: 100%;
}

/* Solution block — mockup admin panel */
@media (max-width: 1024px) {
  .solution-content {
    min-width: 0;
    width: 100%;
    gap: 32px;
  }

  .solution-text,
  .solution-visual {
    min-width: 0;
    max-width: 100%;
  }

  .solution-description,
  .solution-text .section-title {
    overflow-wrap: anywhere;
  }

  .solution-points .point {
    min-width: 0;
  }

  .mockup-container {
    max-width: 100% !important;
    width: 100%;
    transform: none !important;
    margin-left: auto;
    margin-right: auto;
  }

  .mockup-container:hover {
    transform: none !important;
  }

  .mockup-body {
    min-width: 0;
    max-width: 100%;
    min-height: 0;
  }

  .mockup-main {
    min-width: 0;
    max-width: 100%;
    padding: 14px;
    overflow: hidden;
  }

  .mockup-toolbar {
    flex-wrap: wrap;
  }

  .mockup-btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    white-space: normal;
    line-height: 1.3;
  }

  .mockup-timetable {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .mockup-row {
    min-width: 300px;
  }

  .mockup-sidebar {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .landing-page .hero {
    min-height: 0 !important;
    padding: calc(56px + env(safe-area-inset-top, 0)) 0 32px !important;
  }

  .landing-page .hero-title {
    font-size: clamp(1.25rem, 5vw, 1.65rem) !important;
    line-height: 1.2;
  }

  .landing-page .hero-subtitle {
    font-size: clamp(0.82rem, 3.2vw, 0.94rem) !important;
    line-height: 1.5;
  }

  .landing-page .section-title {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem) !important;
    line-height: 1.25;
  }

  .landing-page .section-subtitle {
    font-size: clamp(0.82rem, 3vw, 0.94rem) !important;
    max-width: 36ch;
  }

  .problem,
  .solution,
  .niches,
  .demos,
  .features,
  .how-it-works {
    padding: 32px 0 !important;
  }

  .lead-section {
    padding: 32px 0 !important;
  }

  .lead-intro .section-title {
    font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  }

  .problem-card,
  .niche-card,
  .feature-card {
    padding: 14px !important;
  }

  .hero-buttons {
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .niche-feature span,
  .demo-card-features li span {
    font-size: 0.88rem;
  }

  .mockup-main {
    padding: 12px;
  }

  .mockup-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .mockup-title {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .mockup-row {
    min-width: 280px;
    grid-template-columns: 36px repeat(5, minmax(0, 1fr)) !important;
  }

  .mockup-row .cell {
    overflow: hidden;
    word-break: break-word;
    padding: 4px;
  }

  .legal-page-nav .landing-container {
    flex-wrap: wrap;
    gap: 10px;
  }

  .legal-back {
    font-size: 0.85rem;
  }

  .legal-doc {
    padding: 32px 16px 64px;
  }

  .legal-doc h1 {
    font-size: 1.55rem;
  }

  .legal-doc h2 {
    font-size: 1.05rem;
  }

  .cookie-banner {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1 1 auto;
    text-align: center;
    white-space: normal;
    min-height: 44px;
  }

  /* Problem — aura clipping / overlap (fallback без mobile-layout) */
  .landing-page .problem.problem-aura-enhanced {
    overflow: visible;
  }

  .landing-page .problem.problem-aura-enhanced .landing-container,
  .landing-page .problem.problem-aura-enhanced .problem-grid {
    overflow: visible;
  }

  .landing-page .problem.problem-aura-enhanced .problem-card {
    position: relative;
    z-index: 0;
    overflow: visible;
  }

  .landing-page .problem.problem-aura-enhanced .problem-card.is-aura-hot {
    z-index: 2;
  }

  /* Mockup — все 5 вкладок, горизонтальный скролл */
  .mockup-container.mockup-interactive .mockup-body {
    flex-direction: column;
    height: auto;
    min-height: 380px;
    overflow: visible;
  }

  .mockup-container.mockup-interactive .mockup-sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100% !important;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 8px;
    gap: 8px;
  }

  .mockup-container.mockup-interactive .mockup-sidebar::-webkit-scrollbar {
    display: none;
  }

  .mockup-container.mockup-interactive .mockup-nav-item {
    flex: 0 0 auto;
    width: auto !important;
    min-height: 44px;
    padding: 8px 12px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  /* Process — вертикальный стек (PR #20) */
  .how-it-works.process-enhanced .process-timeline-wrap {
    min-height: 0 !important;
  }

  /* Niches — карусель (fallback без mobile-layout) */
  .landing-page .niches-carousel {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 16px;
  }

  .landing-page .niches-carousel-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    --niche-slide-w: 100%;
  }

  .landing-page .niches-carousel .niches-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    width: auto;
  }

  .landing-page .niches-carousel .niche-card {
    flex: 0 0 var(--niche-slide-w, 100%);
    width: var(--niche-slide-w, 100%);
    max-width: var(--niche-slide-w, 100%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .landing-page .niches-carousel .niche-features {
    flex: 1 1 auto;
  }

  .landing-page .niches-grid .niche-demo-btn,
  .landing-page .niches-grid .demo-card-btn {
    margin-top: auto !important;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .landing-page .niches-carousel-next {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #6366f1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    touch-action: manipulation;
  }
}

@media (max-width: 480px) {
  .landing-container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero {
    padding-top: 88px;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 6px 12px;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .lead-checkbox {
    font-size: 0.78rem;
  }

  .lead-field input,
  .lead-field select,
  .lead-field textarea {
    font-size: 16px;
  }

  .legal-doc h1 {
    font-size: 1.35rem;
  }

  .landing-footer .footer-brand p {
    max-width: none;
  }
}
