.services-section {
  padding: 40px 20px;
  text-align: center;
  background-color: #f8f8f8;
}

.services-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.service-box {
  position: relative;
  width: 300px;
  height: 400px;
  background-size: cover;
  background-position: center;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* When in view */
.service-box.in-view {
  opacity: 1;
  transform: translateY(0);
}

.service-box:hover {
  transform: scale(1.03);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 37, 102, 0.7);
  z-index: 1;
}

.service-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.icon-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s ease;
}

.icon-title i {
  font-size: 48px;
  margin-bottom: 15px; /* Increased spacing between icon and title */
}

.icon-title h3 {
  font-size: 20px;
  margin: 0;
  color: #fff;
}

.service-hover {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-size: 14px;
  color: #fff;
  height: 100%;
  justify-content: space-between;
  padding: 20px 15px;
  box-sizing: border-box;
}

.service-hover ul {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0; 
}

.service-hover li {
  margin: 4px 0;
}

.service-hover p {
  font-weight: bold;
  font-size: 16px;
  margin-top: 0;
}

.service-box:hover .icon-title i {
  opacity: 0;
}

.service-box:hover .service-hover {
  display: flex;
}

/* ===== Learn More Button ===== */
.btn-services-learn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fdfdfd;
  background-color: #122566;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background-color 0.3s ease, transform 0.5s ease;
}

.btn-services-learn-more svg {
  margin-right: 8px;
  transform: rotate(30deg);
  transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.btn-services-learn-more span {
  transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

.btn-services-learn-more:hover {
  background-color: #0e1d50;
}

.btn-services-learn-more:hover svg {
  transform: translateX(5px) rotate(90deg);
}

.btn-services-learn-more:hover span {
  transform: translateX(6px);
}