/* Адаптивные стили для сайта [НовыйБренд] */

/* Исправления для мобильного меню */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary-dark);
  padding: 0.5rem;
  margin-left: 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  z-index: 1002; /* Добавляем высокий z-index */
  position: relative;
}

.menu-toggle:hover {
  background-color: rgba(59, 89, 152, 0.1);
}

.menu-toggle:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Анимация для иконки бургера */
.menu-toggle .fa-bars {
  transition: transform 0.3s ease;
}

.nav-menu.active + .menu-toggle .fa-bars {
  transform: rotate(90deg);
}

/* Большие экраны и десктопы (до 1200px) */
@media screen and (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .network-visualization {
    height: 450px;
  }
}

/* Планшеты и маленькие ноутбуки (до 992px) */
@media screen and (max-width: 992px) {
  .container {
    max-width: 720px;
  }
  
  html {
    font-size: 15px;
  }
  
  .hero-container {
    flex-direction: column;
    position: relative;
    padding: 2rem 1.5rem; /* Уменьшаем паддинги для планшетов */
    justify-content: center; /* Центрируем контент */
    align-items: center; /* Центрируем по горизонтали */
    text-align: center; /* Центрируем текст */
  }
  
  .hero-content {
    max-width: 100%;
    text-align: center;
    position: relative; 
    z-index: 10; 
    background-color: transparent; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .hero-cta {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  
  .network-visualization {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;   
    opacity: 0.3;
  }

  .hero { 
    padding-top: 80px; 
    padding-bottom: 3rem; 
    text-align: center; /* Центрируем всю hero секцию */
  }
  
  /* Адаптация плавающих иконок */
  .floating-icon {
    font-size: 1.5rem;
    padding: 12px;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-image {
    order: -1;
  }
  
  /* Адаптация футера */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .footer-contact {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

/* Планшеты (до 768px) */
@media screen and (max-width: 768px) {
  .container {
    max-width: 540px;
    padding: 0 1rem; /* Добавляем паддинг */
  }
  
  html {
    font-size: 14px;
  }
  
  /* Улучшенная типографика */
  h1 {
    font-size: calc(var(--font-xxlarge) * 0.85);
    line-height: 1.2;
  }
  
  h2 {
    font-size: calc(var(--font-xlarge) * 0.9);
    line-height: 1.3;
    margin-bottom: 1.5rem;
  }
  
  h3 {
    font-size: calc(var(--font-medium) * 0.95);
    line-height: 1.4;
  }
  
  p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  
  /* Секции */
  .section {
    padding: 3rem 0;
  }
  
  .section-title {
    margin-bottom: 2rem;
    text-align: center; /* Центрируем заголовки */
  }
  
  .header {
    padding: 1rem 0;
  }
  
  /* Мобильное меню показываем */
  .menu-toggle {
    display: block;
  }
  
  nav {
    position: relative;
  }
  
  .nav-menu {
    display: none !important;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    background-color: var(--primary-white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    padding: 1rem 0;
    flex-direction: column;
    z-index: 1001;
    border-radius: 8px;
    margin: 0;
  }
  
  .nav-menu.active {
    display: flex !important;
  }
  
  .nav-menu li {
    margin: 0;
    margin-left: 0 !important;
    text-align: center;
    padding: 0.5rem 1rem;
  }
  
  .nav-menu a {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    display: block;
  }
  
  .nav-menu a:hover {
    background-color: rgba(59, 89, 152, 0.1);
  }
  
  .hero {
    min-height: auto; 
    padding-top: 100px; 
    padding-bottom: 2rem; 
    height: auto;
  }
  
  .hero-container {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .network-visualization {
    opacity: 0.25;
    display: none; /* Скрываем на планшетах для лучшей производительности */
  }
  
  /* Адаптация эффектов hero */
  .hero::before {
    opacity: 0.5;
  }
  
  .hero::after {
    display: none;
  }
  
  .floating-icon {
    font-size: 1.3rem;
    padding: 10px;
  }
  
  .btn-primary {
    padding: 0.9rem 2rem;
    font-size: 1rem;
  }
  
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about-image {
    order: -1;
  }
  
  /* FAQ адаптация */
  .faq-item {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background-color: var(--secondary-gray);
    border-radius: 8px;
  }
  
  .faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .faq-item p {
    font-size: 0.95rem;
  }
}

/* Мобильные устройства (до 576px) */
@media screen and (max-width: 576px) {
  .container {
    max-width: 100%;
    padding: 0 1rem; /* Увеличиваем паддинг для лучших отступов */
  }
  
  html {
    font-size: 14px;
  }
  
  /* Исправляем hero для мобильных */
  .hero {
    padding-top: 80px;
    padding-bottom: 3rem;
    min-height: auto; /* Убираем фиксированную высоту */
    text-align: center;
  }
  
  .hero-container {
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: auto; /* Убираем ограничения по высоте */
  }
  
  .hero-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .hero-title {
    font-size: calc(var(--font-xxlarge) * 0.8);
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
  }
  
  .hero-title .subtitle {
    font-size: 0.5em;
    display: block;
    margin-top: 0.5rem;
    text-align: center;
  }
  
  .hero-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 90%;
  }
  
  .hero-cta {
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center;
  }
  
  .network-visualization {
    height: 300px;
    opacity: 0.2;
  }
  
  .floating-icon {
    font-size: 1.3rem;
    padding: 10px;
  }
  
  .btn-primary {
    font-size: 1rem;
    padding: 1rem 2rem;
    width: auto;
    max-width: 280px;
  }
  
  /* Исправляем географическую секцию */
  .geography {
    padding: 4rem 0; /* Увеличиваем паддинг секции */
    overflow: visible; /* Убираем скрытие overflow */
  }
  
  .geography .container {
    padding: 0 1rem;
    overflow: visible;
  }
  
  .geography .section-title {
    margin-bottom: 2rem;
    text-align: center;
  }
  
  /* География мобильная версия - исправляем обрезку */
  .geography::before {
    opacity: 0.3;
  }
  
  .geography::after {
    display: none;
  }
  
  .countries-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
    overflow: visible; /* Убираем скрытие */
    min-height: auto; /* Позволяем естественную высоту */
  }
  
  .country-item {
    padding: 1rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 8px;
    min-height: 60px; /* Минимальная высота для однородности */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }
  
  .country-item span {
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
  }
  
  /* Уменьшаем эффекты для производительности */
  .country-item:hover {
    transform: translateY(-2px);
  }
  
  .country-item::before {
    display: none;
  }
  
  /* Исправляем условия - выравнивание текста */
  .conditions {
    padding: 4rem 0;
  }
  
  .conditions .container {
    padding: 0 1rem;
  }
  
  .conditions .section-title {
    text-align: center;
    margin-bottom: 2rem;
  }
  
  .conditions-simple-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 100%;
    margin: 0 auto;
  }
  
  .condition-simple-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: left; /* Выравниваем текст по левому краю */
    background-color: var(--primary-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(59, 89, 152, 0.1);
  }
  
  .condition-simple-icon {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    margin-top: 0.25rem;
    color: var(--primary-blue);
    min-width: 50px;
    text-align: center;
    flex-shrink: 0; /* Не сжимаем иконку */
  }
  
  .condition-simple-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
  }
  
  .condition-simple-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-weight: 600;
    text-align: left;
    line-height: 1.3;
  }
  
  .condition-simple-text p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin: 0;
    text-align: left;
    line-height: 1.5;
  }
  
  /* Общие стили для разделов */
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .about-text {
    text-align: center;
  }
  
  .about-illustration {
    order: -1;
  }
  
  .p2p-network {
    transform: scale(0.8);
  }
  
  /* Features grid для мобильных */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .feature-item {
    padding: 1.5rem;
    text-align: center;
  }
  
  .feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  .feature-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-align: center;
  }
  
  .feature-description {
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.6;
  }
}

/* Мобильные устройства (до 576px) - продолжение */
@media screen and (max-width: 576px) {
  /* География мобильная версия */
  .geography::before {
    opacity: 0.3;
  }
  
  .geography::after {
    display: none;
  }
  
  .countries-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-width: 100%;
    padding: 0;
  }
  
  .country-item {
    padding: 0.75rem;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  
  .country-item span {
    font-size: 0.85rem;
  }
  
  /* Уменьшаем эффекты для производительности */
  .country-item:hover {
    transform: translateY(-2px);
  }
  
  .country-item::before {
    display: none;
  }
  
  /* Условия */
  .conditions-simple-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .condition-simple-item {
    flex-direction: row;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 8px;
  }
  
  .condition-simple-icon {
    font-size: 2rem;
    margin-right: 1rem;
    margin-top: 0.25rem;
  }
  
  .condition-simple-text h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  
  .condition-simple-text p {
    font-size: 0.85rem;
  }
}

/* Улучшения для очень маленьких экранов (до 360px) */
@media screen and (max-width: 360px) {
  .countries-list {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 1.4rem;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
  
  .nav-menu li {
    margin: 0.5rem 0;
  }
  
  .menu-toggle {
    font-size: 1.3rem;
    padding: 0.4rem;
  }
}

/* Оптимизация для ландшафтной ориентации на мобильных */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 400px;
    padding-top: 70px;
  }
  
  .hero-container {
    padding: 1rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
}

/* Утилитные классы для мобильных */
@media screen and (max-width: 768px) {
  .mt-4 {
    margin-top: 1.5rem !important;
  }
  
  .mb-1 {
    margin-bottom: 0.5rem !important;
  }
  
  .mb-2 {
    margin-bottom: 1rem !important;
  }
  
  .mb-3 {
    margin-bottom: 1.5rem !important;
  }
  
  .text-center {
    text-align: center !important;
  }
  
  /* Скрываем overflow для предотвращения горизонтальной прокрутки */
  body {
    overflow-x: hidden;
  }
  
  /* Убедимся, что все элементы не выходят за границы */
  * {
    max-width: 100%;
  }
  
  /* Улучшаем касание */
  .btn, 
  .nav-menu a,
  .menu-toggle,
  .country-item,
  .faq-item {
    -webkit-tap-highlight-color: rgba(59, 89, 152, 0.2);
  }
}