body {
  background: url('../img/bg/fondo-servicio.webp') center / cover no-repeat fixed;
  overflow-x: hidden;
}

.servicios-header {
  text-align: center;
  padding: 60px 20px 20px;
}

.titulo {
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: #222;
  text-shadow:
    1px 1px 4px rgba(255, 255, 255, 0.9),
    -1px -1px 3px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.03em;
  margin-bottom: 30px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.titulo:hover {
  transform: translateY(-3px) scale(1.05);
  text-shadow:
    2px 2px 6px rgba(0,0,0,0.15),
    -1px -1px 4px rgba(255,255,255,0.8);
  transition: text-shadow 0.3s ease;
  transition: transform 0.3s ease;
  cursor: default;
}

.titulo::after {
  content: '';
  display: block;
  height: 3px;
  width: 0;
  background: black;
  transition: width 0.3s ease;
  margin: 8px auto 0;
}

.titulo:hover::after {
  width: 60%;
}

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  max-width: 900px;
  margin: 50px auto;
  padding-bottom: 40px;
  min-height: 50vh;
  justify-content: center;
  align-content: center;
}

.servicio-card {
  min-height: 140px;
  padding: 30px 20px;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  cursor: pointer;
}

.servicio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px var(--accent-color);
}

.servicio-card i {
  font-size: 45px;
  color: #00B0F0;
  margin-bottom: 10px;
}

.servicio-card p {
  font-size: 20px;
  font-style: italic;
  font-weight: bold;
  margin: 0;
  color: #333;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  text-align: center;
  font-style: italic;
  font-size: 18px;
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  border: 3px solid #00B0F0;
  max-width: 500px;
  width: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: red;
}

#modal-description {
  list-style: none;
  padding: 0;
  margin-top: 15px;
  font-style: italic;
}

#modal-description li {
  padding: 8px 0;
  border-bottom: 1px solid #e6e6e6;
}

#modal-description li:last-child {
  border-bottom: none;
}

#modal-title {
  margin-bottom: 10px;
  color: #00B0F0;
}

@media (min-width: 1024px) and (max-width: 1440px) {

  .titulo{
    font-size: clamp(1.9rem, 2.8vw, 2.4rem);
    margin-bottom: 40px;
  }

  .servicios-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-content: center;
    gap: 30px;
    max-width: 1100px;
    padding-left: 15px; 
    padding-right: 15px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {

  .titulo{
    font-size: clamp(1.7rem, 3vw, 2.1rem);
    margin-bottom: 35px;
  }

  .servicios-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-content: center;
    gap: 25px;
    max-width: 900px;
    margin: 50px auto;
    padding-left: 15px; 
    padding-right: 15px;
  }

  .servicio-card {
    min-width: auto;
  }
}

@media (max-width: 767px) {

  .titulo{
    font-size: 1.6rem;
    padding-left: 10px;
    padding-right: 10px;
  }

  .servicios-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
    margin: 40px auto;
    padding-left: 15px; 
    padding-right: 15px;
    box-sizing: border-box;
  }

  .servicio-card {
    width: 100%;
    min-width: auto;
  }
}