/* Main styling for services section */
.services {
  padding: 80px 0;
  position: relative;
  background: linear-gradient(180deg, rgba(218, 218, 218, 0.2) 0%, rgba(255, 255, 255, 0.9) 100%);
  overflow: hidden;
}

.services::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/images/logos/LOGO_ALUNASA_FINAL.png') no-repeat center center;
  background-size: 50%;
  opacity: 0.04;
  z-index: 0;
}

.services .service-item {
  position: relative;
  overflow: visible;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  margin-bottom: 30px;
  background: #fff;
}

.services .service-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.services .img {
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  height: 240px;
}

.services .img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
  z-index: 1;
}

.services .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.services .details {
  background: #fff;
  padding: 60px 25px 30px;
  margin: -50px 20px 0;
  position: relative;
  text-align: center;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
  z-index: 2;
  transition: background 0.4s ease;
  /* Ensure the container has enough space for the icon */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.services .details .icon {
  width: 80px;
  height: 80px;
  background: var(--brand-blue, #323275);
  color: #fff;
  border: 6px solid #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
  position: absolute;
  top: -40px;
  left: calc(50% - 40px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 3;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.services .details h3 {
  font-family: 'Futura Bold', sans-serif;
  margin: 15px 0 15px;
  font-size: 22px;
  transition: color 0.3s ease;
  color: var(--brand-dark, #1d1d1b);
}

.services .details p {
  color: var(--brand-gray, #3c3c3b);
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 20px;
  transition: none;
  font-family: 'Futura Medium', sans-serif;
}

/* Hover effects - simplified and fixed */
.services .service-item .details {
  background: #fff;
  opacity: 1;
}

.services .service-item:hover .details {
  background: #fff;
  opacity: 1;
}

.services .service-item:hover .details h3 {
  color: var(--brand-blue, #323275);
}

/* Fix for the flickering icon */
.services .service-item .details .icon {
  will-change: transform;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Ensure icon is visible at all times */
  visibility: visible !important;
  opacity: 1 !important;
}

.services .service-item:hover .details .icon {
  background: #fff;
  color: var(--brand-blue, #323275);
  border-color: var(--brand-blue, #323275);
  transform: scale(1.05);
}

.services .service-item:hover .img img {
  transform: scale(1.1);
}

/* Simplified icon styling */
.services .service-item .details .icon i {
  display: inline-block;
}

.services a.text-decoration-none {
  display: block;
  height: 100%;
}

/* Section title styling */
.section-title {
  text-align: center;
  padding-bottom: 30px;
  position: relative;
  margin: 0 auto 20px;
  display: inline-block;
  z-index: 1;
}

.services .container:first-of-type {
  margin-bottom: 20px;
}

.section-title h2 {
  font-size: 38px;
  font-family: 'Futura Bold', sans-serif;
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 20px;
  color: var(--brand-blue, #1d1d1b);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.section-title h2:after {
  content: "";
  position: absolute;
  display: block;
  width: 80px;
  height: 4px;
  background: var(--brand-blue, #323275);
  bottom: 0;
  left: calc(50% - 40px);
  border-radius: 2px;
}

.section-title p {
  margin: 0 auto;
  font-size: 18px;
  color: var(--brand-gray, #3c3c3b);
  max-width: 700px;
  position: relative;
  font-family: 'Futura Medium', sans-serif;
  text-shadow: none;
  filter: none;
}

.section-title p:before,
.section-title p:after {
  content: '•';
  color: var(--brand-blue, #323275);
  display: inline-block;
  margin: 0 10px;
  font-size: 20px;
  vertical-align: middle;
}

/* Add subtle design elements to the section */
.services::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: var(--brand-blue, #323275);
  opacity: 0.05;
  border-radius: 50%;
  transform: translate(30%, 30%);
  z-index: -1;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .services {
    padding: 60px 0;
  }
  
  .section-title h2 {
    font-size: 32px;
  }
  
  .section-title p {
    font-size: 16px;
  }
  
  .services .img {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .services {
    padding: 50px 0;
  }
  
  .services .details {
    margin: -40px 15px 0;
    padding: 50px 20px 25px;
  }
  
  .services .img {
    height: 200px;
  }
  
  .services .details .icon {
    width: 70px;
    height: 70px;
    top: -35px;
    left: calc(50% - 35px);
    font-size: 28px;
  }
  
  .section-title {
    padding-bottom: 30px;
  }
  
  .section-title h2 {
    font-size: 28px;
  }
}

@media (max-width: 576px) {
  .services .img {
    height: 180px;
  }
  
  .services .details h3 {
    font-size: 20px;
  }
  
  .services .details p {
    font-size: 14px;
  }
}
