/* ========== DEXRabbit - Финальная мобильная адаптация ========== */
/* Версия: 2025-10-04-final-fix */
/* Объединение всех адаптивных правил без конфликтов */

/* ========== БАЗОВЫЕ ПРАВИЛА ========== */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

/* ========== ИЗОБРАЖЕНИЯ И МЕДИА ========== */
img, video, iframe, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== КОНТЕЙНЕРЫ ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ========== НАВИГАЦИЯ BEAUTIFUL - МОБИЛЬНАЯ ========== */
@media (max-width: 768px) {
  .nav-beautiful__container {
    padding: 10px 16px;
    min-height: 60px;
  }

  .nav-beautiful__logo-img {
    width: 36px;
    height: 36px;
  }

  .nav-beautiful__logo-title {
    font-size: 17px;
  }

  .nav-beautiful__logo-slogan {
    font-size: 9px;
  }

  .nav-beautiful__menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(40px);
    flex-direction: column;
    padding: 20px;
    gap: 12px;
    overflow-x: hidden;  /* Запрет горизонтального скролла */
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  .nav-beautiful.open .nav-beautiful__menu {
    transform: translateX(0);
  }

  .nav-beautiful__btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    justify-content: space-between;
  }

  .nav-beautiful__dropdown {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    margin-top: 8px;
    max-height: 0;
    max-width: none !important;
    min-width: auto !important;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .nav-beautiful__dropdown-wrapper.open .nav-beautiful__dropdown,
  .nav-beautiful__dropdown-wrapper:hover .nav-beautiful__dropdown,
  .nav-beautiful__dropdown-wrapper.is-open .nav-beautiful__dropdown,
  .nav-beautiful__dropdown-wrapper:focus-within .nav-beautiful__dropdown {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0s;
  }

  .nav-beautiful__cta {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    justify-content: center;
    margin-top: 12px;
  }
}

/* ========== HERO СЕКЦИЯ ========== */
.hero {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 60px;
  position: relative;
  z-index: 200; /* ВЫШЕ navbar (z-index: 100), контент НЕ перекрывается */
}

.hero-title {
  text-align: center;
  margin: 0 auto 20px;
  font-size: clamp(26px, 6vw, 48px);
  line-height: 1.2;
}

.hero-subtitle {
  text-align: center;
  margin: 0 auto 32px;
  max-width: 800px;
  font-size: clamp(15px, 3.5vw, 20px);
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .hero {
    padding-top: 160px;
    padding-bottom: 50px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    padding: 0 1rem;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* ========== СЕКЦИИ ========== */
.section {
  padding-top: 60px;
  padding-bottom: 60px;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2,
.section-header p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-header p {
  max-width: 700px;
}

@media (max-width: 768px) {
  .section {
    padding-top: 50px;
    padding-bottom: 50px;
  }

  .section-header h2,
  .section-header p {
    padding: 0 0.5rem;
  }
}

/* ========== ТИПОГРАФИКА ========== */
h1 { font-size: clamp(24px, 5vw, 48px); }
h2 { font-size: clamp(20px, 4vw, 38px); }
h3 { font-size: clamp(18px, 3.5vw, 30px); }
p { font-size: clamp(14px, 3vw, 18px); line-height: 1.7; }

h1, h2, h3, h4, h5, h6, p, span, a, button {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ========== КАРТОЧКИ ========== */
.card, .investor-card {
  padding: 20px;
}

.card h3, .investor-card h3 {
  font-size: clamp(17px, 3vw, 22px);
  margin-bottom: 12px;
}

.card p, .investor-card p {
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .card, .investor-card {
    padding: 18px;
  }
}

/* ========== КНОПКИ ========== */
.btn, .cta-button {
  padding: 12px 24px;
  font-size: 15px;
  min-height: 48px;
  touch-action: manipulation;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .btn, .cta-button {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* ========== GRID СИСТЕМЫ ========== */
.grid, .investors-grid, .feature-grid, .highlight-grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 32px);
  width: 100%;
}

@media (max-width: 768px) {
  .grid, .investors-grid, .feature-grid, .highlight-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .grid, .investors-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .grid, .investors-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px;
  }
}

/* ========== SAFE AREA (вырезы на экране) ========== */
.nav-beautiful {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-top: env(safe-area-inset-top);
}

.nav-beautiful__menu {
  padding-bottom: env(safe-area-inset-bottom);
}

.footer {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

/* ========== TOUCH TARGETS (минимум 44x44px) ========== */
@media (max-width: 768px) {
  .btn, a, button, .nav-beautiful__btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ========== ПРЕДОТВРАЩЕНИЕ ZOOM НА iOS ========== */
@media (max-width: 768px) {
  input, textarea, select {
    font-size: 16px; /* Минимум 16px чтобы iOS не зумил */
  }
}

/* ========== ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ ========== */
@media (max-width: 768px) and (orientation: landscape) {
  .nav-beautiful__container {
    height: 48px;
    padding: 8px 12px;
  }

  .nav-beautiful__menu {
    top: 48px;
    height: calc(100vh - 48px);
  }

  .hero {
    padding-top: 60px;
    padding-bottom: 30px;
  }

  .section {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  h1 { font-size: clamp(20px, 4vw, 28px) !important; }
  h2 { font-size: clamp(18px, 3.5vw, 24px) !important; }
  p { font-size: clamp(14px, 2.5vw, 16px) !important; }
}

/* ========== ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (<360px) ========== */
@media (max-width: 359px) {
  .nav-beautiful__logo-title {
    font-size: 15px;
  }

  .nav-beautiful__logo-slogan {
    display: none;
  }

  .hero-title {
    font-size: 22px;
  }

  .card, .investor-card {
    padding: 14px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* ========== GALAXY FOLD (<320px) ========== */
@media (max-width: 320px) {
  .nav-beautiful__wrapper {
    padding: 0 6px;
    height: 48px;
  }

  .nav-beautiful__logo-slogan {
    display: none;
  }

  .nav-beautiful__cta {
    display: none;
  }

  .hero-title {
    font-size: 20px;
  }

  .container {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ========== БОЛЬШИЕ DESKTOP (>1200px) ========== */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
    padding-left: 32px;
    padding-right: 32px;
  }

  .section {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

/* ========== PERFORMANCE ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== ПЕЧАТЬ ========== */
@media print {
  .nav-beautiful, .footer, .btn {
    display: none !important;
  }

  * {
    background: white !important;
    color: black !important;
  }
}