.map-section {
  width: 100%;
  padding: 40px 0;
  background-color: #000;
  position: relative;
  margin: 0;
}

.map-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
  max-width: 100%;
}

.map-container {
  width: 100%;
  height: 500px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y; /* Позволяет вертикальный скролл страницы */
}

#map {
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none; /* Отключаем все touch-действия для самой карты */
}

/* ВАЖНО: для всех элементов внутри карты */
#map * {
  touch-action: auto;
}

/* Десктопные контакты */
.map-contacts.desktop-contacts {
  position: absolute;
  top: 40px;
  right: 40px;
  background: rgba(0, 0, 0, 0.95);
  padding: 20px;
  border-radius: 8px;
  max-width: 280px;
  color: #fff;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none; /* Не мешает взаимодействию с картой */
}

.map-contacts.desktop-contacts .contacts-content {
  pointer-events: auto; /* Но внутри можно кликать по ссылкам */
}

.contacts-content h3 {
  margin: 0 0 12px 0;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.contacts-content p {
  margin: 8px 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contacts-content p i {
  color: #007bff;
  width: 16px;
  text-align: center;
  font-size: 0.9rem;
}

.contacts-content .phone-link,
.contacts-content .email-link {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contacts-content .phone-link:hover,
.contacts-content .email-link:hover {
  color: #007bff;
}

/* Мобильные контакты */
.mobile-contacts {
  display: none;
  padding: 20px;
  text-align: center;
  background: #000;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-contacts .contacts-content {
  max-width: 600px;
  margin: 0 auto;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .map-container {
    height: 450px;
  }
}

@media (max-width: 768px) {
  .desktop-contacts {
    display: none;
  }

  .mobile-contacts {
    display: block;
  }

  .map-container {
    height: 400px;
    touch-action: pan-y; /* Убедимся, что на мобильных вертикальный скролл работает */
  }

  .map-section {
    padding: 30px 0;
  }

  .mobile-contacts .contacts-content h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .mobile-contacts .contacts-content p {
    font-size: 1rem;
    margin: 10px 0;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .map-container {
    height: 350px;
  }
  
  .map-section {
    padding: 25px 0;
  }
}

@media (max-width: 480px) {
  .map-container {
    height: 300px;
  }
  
  .map-section {
    padding: 20px 0;
  }
  
  .mobile-contacts {
    padding: 20px 15px;
  }
  
  .mobile-contacts .contacts-content h3 {
    font-size: 1.1rem;
  }
  
  .mobile-contacts .contacts-content p {
    font-size: 0.95rem;
  }
}

/* Оптимизация для touch-устройств */
@media (hover: none) and (pointer: coarse) {
  .map-container {
    -webkit-tap-highlight-color: transparent;
  }
  
  .contacts-content .phone-link,
  .contacts-content .email-link {
    padding: 4px 0;
    display: inline-block;
  }
}

/* Фикс для touch-устройств */
@media (hover: none) and (pointer: coarse) {
  .map-section {
    /* Разрешаем скролл всей секции */
    touch-action: auto;
  }
  
  .map-container {
    /* Важно: разрешаем все touch-действия */
    touch-action: auto;
    /* Убираем выделение при тапе */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }
  
  /* Для всех дочерних элементов карты тоже включаем touch-action */
  .map-container * {
    touch-action: auto !important;
  }
}

/* Дополнительный фикс для iOS Safari */
@supports (-webkit-touch-callout: none) {
  .map-container {
    /* Для iOS нужно явно разрешить pan-y (вертикальный скролл) */
    touch-action: pan-y;
  }
}