
.services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  text-align: center;
  padding: 20px;
}

.service-card {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  background: linear-gradient(135deg, #5c1616, rgb(247, 1, 1));
  color: #ffffff;
  text-align: center;
  position: relative;
  transition: transform 0.3s;
  overflow: hidden; /* Удерживаем содержимое внутри карточки */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Оставляем пространство для описания и кнопки */
  max-height: 250px; /* Общая высота карточки */
}

.service-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.service-card .description {
  margin: 10px 0; /* Отступы для описания */
  overflow: hidden;
  text-overflow: ellipsis; /* Многоточие, если текст длинный */
  white-space: nowrap; /* Запрет переноса текста */
  max-height: 40px; /* Ограничиваем высоту описания */
  line-height: 1.5;
}

.learn-more {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  padding: 10px 15px;
  background-color: rgba(117, 20, 20, 0.123); /* Фон кнопки */
  border-radius: 5px;
  transition: background-color 0.3s, color 0.3s;
  text-align: center;
  margin-top: auto; /* Отодвигаем кнопку вниз */
  align-self: center; /* Центрируем кнопку */
}

.learn-more:hover {
  background-color: rgba(0, 0, 0, 0);
  color: #888888;
}


.description {
  flex-grow: 1; /* Контент занимает доступное пространство */
  overflow: hidden;
  text-overflow: ellipsis; /* Обрезаем текст с многоточием */
  white-space: nowrap; /* Запрещаем перенос текста */
  margin-bottom: 10px; /* Отступ от кнопки */
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 5, 5, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #3f3e3e94;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-height: 90vh; /* Используем vh (высота экрана) для гибкости */
  overflow-y: auto; /* Вертикальная прокрутка при необходимости */
  overflow-x: hidden; /* Убираем горизонтальную прокрутку */
  text-align: left; /* Текст выровнен по левому краю для удобства */
  position: relative;
}

/* Для смартфонов */
@media screen and (max-width: 768px) {
  .modal-content {
    width: 95%; /* Окно почти на всю ширину экрана */
    max-height: 85vh; /* Меньше высота для сохранения видимости */
    padding: 15px; /* Уменьшаем отступы */
    font-size: 14px; /* Меньше шрифт для мобильных */
  }
}

/* Для прокручиваемого текста внутри окна */
.modal-content p, .modal-content ul, .modal-content li {
  margin: 0 0 10px;
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 24px;
  color: #ff0303;
  cursor: pointer;
}
.detailed-description {
  max-height: 700px; /* Фиксируем высоту области с детальным описанием */
  overflow-y: auto; /* Вертикальная прокрутка при необходимости */
  overflow-x: hidden; /* Убираем горизонтальную прокрутку */
  padding: 10px; /* Внутренние отступы */
  background-color: rgba(0, 0, 0, 0); /* Лёгкий фон для выделения */
  border-radius: 5px; /* Закругляем углы */
  margin-top: 10px; /* Отступ от основного текста или других элементов */
  color: #e2e1e1; /* Контрастный текст */
  text-align: left; /* Выравнивание текста по левому краю */
  line-height: 1.6; /* Удобный интервал между строками */
}

h3 {
  font-size: 20px;
  font-weight: bold;
  color: #e2e1e1;
}

h4 {
  font-size: 16px;
  color: #e2e1e1;
}

h5 {
  font-size: 13px;
  color: #e2e1e1;
}