/* --- Секция услуг --- */
.services-section {
  padding: 60px 0;
  background: #f9fafc;
}

/* --- Контейнер и заголовок --- */
.services-section .container h2 {
  text-align: center;
  font-size: 2rem;
  color: #2e5aac;
  margin-bottom: 40px;
}

/* --- Сетка услуг --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

/* --- Карточка услуги --- */
.service-card {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.05),
    0 6px 15px rgba(0,0,0,0.08),
    0 12px 25px rgba(0,0,0,0.12);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
/* --- Градиент при наведении --- */
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(46, 90, 172, 0.04));
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: scale(1);
  z-index: 1;
}

.service-card:hover::before {
  opacity: 1;
  transform: scale(1.02);
}

/* --- Ссылка на весь блок --- */
.service-card a.card-link {
  position: absolute;
  inset: 0;
  z-index: 5; /* Поверх всех элементов */
  text-indent: -9999px;
  overflow: hidden;
}

/* Изображение на полную ширину, без отступов */
.service-card .img-wrapper {
  position: relative;
  left: -28px;
  width: calc(100% + 56px);
  margin-top: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  z-index: 2;
}

.service-card .img-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

/* Адаптивная компенсация padding'а */
@media (max-width: 900px) {
  .service-card .img-wrapper {
    left: -24px;
    width: calc(100% + 48px);
  }
}

@media (max-width: 600px) {
  .service-card .img-wrapper {
    left: -22px;
    width: calc(100% + 44px);
  }
}


/* --- Заголовок --- */
.service-card h3 {
  margin-top: 0;
  margin-bottom: 14px;
  color: #2e5aac;
  font-size: 1.35rem;
  line-height: 1.3;
  transition: color 0.35s ease;
  position: relative;
  z-index: 2;
}

.service-card:hover h3 {
  color: #1f3f8f;
}

/* --- Текст --- */
.service-card p {
  color: #333;
  line-height: 1.6;
  margin-bottom: 18px;
  transition: color 0.35s ease;
  position: relative;
  z-index: 2;
}

.service-card:hover p {
  color: #111;
}

/* --- Иконка стрелки справа --- */
.service-card::after {
  content: "→";
  position: absolute;
  right: 24px;
  bottom: 24px;
  font-size: 1.4rem;
  color: #2e5aac;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 2;
}

.service-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* --- Hover-анимация и тень --- */
.service-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.12),
    0 20px 40px rgba(0, 0, 0, 0.18);
}

/* --- Адаптивность --- */
@media (max-width: 900px) {
  .services-grid {
    gap: 20px;
  }

  .service-card {
    padding: 24px;
  }

  .service-card h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 600px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-card {
    padding: 22px;
  }

  .service-card h3 {
    font-size: 1.2rem;
  }

  .service-card::after {
    font-size: 1.2rem;
    right: 18px;
    bottom: 18px;
  }
}
