.tm-services {
  padding: 0.45rem 0.7rem 2.2rem;
}

.tm-services__container {
  max-width: 1700px;
}

.tm-services__header {
  margin-bottom: 0.85rem;
}

.tm-services__title {
  margin: 0;
  font-size: clamp(2.1rem, 2.1vw, 2.45rem);
  line-height: 1.1;
  font-weight: 700;
  color: #252525;
}

.tm-services__title span {
  color: #0c94d2;
}

.tm-services__headline {
  width: 330px;
  max-width: 78vw;
  margin: 0.55rem auto 0.85rem;
  height: 3px;
  border-radius: 20px;
  background: #312b9f;
  position: relative;
}

.tm-services__headline::before,
.tm-services__headline::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #312b9f;
  transform: translateY(-50%);
}

.tm-services__headline::before {
  left: -4px;
}

.tm-services__headline::after {
  right: -4px;
}

.tm-services__tabs {
  display: inline-flex;
  align-items: center;
  background: #f3f3f3;
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  overflow: hidden;
}

.tm-services__tab {
  min-width: 136px;
  border: 0;
  background: transparent;
  color: #343a8e;
  padding: 0.52rem 1.4rem;
  font-size: 1.05rem;
  line-height: 1;
}

.tm-services__tab.is-active {
  background: #322ca2;
  color: #ffffff;
}

.tm-services__board {
  background: #efefef;
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  padding: 1.9rem 1.1rem 2.5rem;
  overflow: visible;
}

#div_productos {
  display: none;
}

.act_pos_carrusel {
  position: relative;
}

#carruselservicios .carousel-item {
  padding-top: 55px;
  padding-bottom: 22px;
  padding-left: 40px;
  padding-right: 40px;
}

.contenedorservicio {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  gap: 0.9rem;
  align-items: stretch;
}

.certificado_carrusel_container {
  min-height: auto;
}

.tm-service-card {
  background: #ececec;
  border-radius: 9px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.415);
  height: 330px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
}

.tm-service-card__icon-wrap {
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: #312b9f;
  margin: -50px auto 0;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-service-card__icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tm-service-card__body {
  padding: 1rem 0.95rem 0;
  text-align: center;
  min-height: 150px;
}

.tm-service-card__title {
  margin: 0 0 0.52rem;
  font-size: clamp(1.2rem, 1.55vw, 1.7rem);
  line-height: 1.08;
  font-weight: 700;
  color: #404040;
}

.tm-service-card__text {
  margin: 0;
  font-size: 1rem;
  text-align: justify;
  line-height: 1.24;
  color: #4f4f4f;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tm-service-card__cta {
  margin: 1.25rem auto 0;
  min-width: 126px;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #312b9f;
  background: linear-gradient(180deg, #dddddd 0%, #b6b6b6 100%);
  box-shadow: 0 5px 9px rgba(0, 0, 0, 0.415);
}

.tm-service-card__cta:hover {
  color: #242080;
}

.tm-service-card__bar {
  margin-top: auto;
  height: 18px;
  background: #089dcc;
  border-bottom-right-radius: 9px;
  border-bottom-left-radius: 9px;
}

.servicio_carrusel_indicators {
  bottom: -30px;
  margin-bottom: 0;
}

.serv_btn_img{
    width: 150px;
}

.servicio_carrusel_indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  margin: 0 4px;
  opacity: 1;
  background: #b7b7b7;
}

.servicio_carrusel_indicators .active {
  background: #312b9f;
}

.tm-service-modal {
  z-index: 3000;
}

body.tm-service-modal-open .modal-backdrop.show {
  z-index: 2990;
  background-color: rgba(27, 30, 49, 0.36);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tm-service-modal__dialog {
  width: min(1200px, calc(100vw - 4rem));
  max-width: min(1200px, calc(100vw - 4rem));
  margin: 2rem auto;
}

.tm-service-modal__content {
  background: #ffffff;
  border: 0;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
  min-height: 780px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tm-service-modal__background {
  position: absolute;
  inset: 0;
  background: url('/static/img/servicios/fondo_modal.png') center/cover no-repeat;
  pointer-events: none;
  z-index: 0;
}

.tm-service-modal__header {
  justify-content: center;
  padding: 2.8rem 2rem 1.8rem;
  border-bottom: 0;
  background: transparent;
  position: relative;
  z-index: 1;
}

.tm-service-modal__title {
  max-width: 90%;
  color: #5e5e5e;
  font-size: clamp(1.9rem, 2vw, 2.8rem);
  line-height: 1.12;
  text-align: center;
}

.tm-service-modal__body {
  padding: 1rem 4.2rem 4.5rem !important;
  color: #505050;
  font-size: 15px;
  line-height: 1.3;
  flex: 1 1 auto;
  max-height: calc(78vh - 10.5rem);
  overflow-y: auto;
  text-align: justify;
  position: relative;
  z-index: 1;
  background: transparent;
}

.tm-service-modal__body p,
.tm-service-modal__body li {
  font-size: inherit;
  line-height: inherit;
}

.tm-service-modal__body ul,
.tm-service-modal__body ol {
  padding-left: 1.4rem;
}

.tm-service-modal__close {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 2;
}

.tm-service-modal__close::before,
.tm-service-modal__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #312b9f;
}

.tm-service-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.tm-service-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}



@media (max-width: 1399px) {
  .tm-services__tab {
    min-width: 132px;
    font-size: 1rem;
  }

  .tm-service-card {
    height: 330px;
  }
}

@media (max-width: 1099px) {
  .tm-service-card {
    height: 330px;
  }

  .tm-service-modal__dialog {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    margin: 0.75rem auto;
  }

  .tm-service-modal__header {
    padding: 4.5rem 1.25rem 1rem;
  }

  .tm-service-modal__title {
    max-width: 100%;
    font-size: clamp(1.25rem, 6vw, 1.7rem);
  }

  .tm-service-modal__body {
    padding: 0.25rem 1.2rem 2rem !important;
    font-size: 15px;
    line-height: 1.4;
    max-height: calc(100vh - 8rem);
    margin: 0 0.75rem 0.75rem;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 14px;
  }

  .tm-service-modal__close {
    top: 0.65rem;
    right: 0.65rem;
  }
}

@media (max-width: 767px) {
  .tm-services {
    padding: 0.3rem 0.5rem 2rem;
  }

  .tm-services__title {
    font-size: clamp(1.7rem, 8vw, 2.05rem);
  }

  .tm-services__tab {
    min-width: 118px;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
  }

  .tm-services__board {
    border-radius: 16px;
    padding: 1.6rem 0.75rem 2.2rem;
  }

  #carruselservicios .carousel-item {
    padding-top: 55px;
    padding-bottom: 22px;
    padding-left: 40px;
    padding-right: 40px;
  }

  .contenedorservicio {
    gap: 0.7rem;
  }

  .tm-service-card {
    height: 330px;
  }

  .tm-service-modal__background {
    background-position: center top;
  }
}
