.services-section {
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.45) 0%, rgba(240, 253, 244, 0) 100%);
}

.services-section__container {
  max-width: min(100%, 1200px);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 2.5rem);
}

.services-carousel {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.services-carousel__header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  display: grid;
  gap: 0.75rem;
}

.services-carousel__title {
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  font-weight: 700;
  color: #14532d;
  margin: 0;
}

.services-carousel__subtitle {
  margin: 0;
  color: #475569;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.65;
}

.services-carousel__wrapper {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.services-carousel__window {
  overflow: hidden;
}

.services-carousel__track {
  --card-gap: clamp(1rem, 3vw, 1.5rem);
  display: flex;
  gap: var(--card-gap);
  transition: transform 0.45s ease;
  will-change: transform;
  align-items: stretch;
}

.service-card {
  flex: 0 0 calc((100% - (var(--card-gap) * 2)) / 3);
  background-color: #ffffff;
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: 0 22px 40px -28px rgba(15, 118, 110, 0.4);
  border: 1px solid rgba(15, 118, 110, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 100%;
}

.service-card__title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
}

.service-card__summary {
  margin: 0;
  color: #475569;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.6em * 3);
}

.service-card__button {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.service-card__button:hover,
.service-card__button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px -22px rgba(13, 148, 136, 0.55);
  outline: none;
}

.services-carousel__nav {
  width: clamp(2.75rem, 6vw, 3.25rem);
  height: clamp(2.75rem, 6vw, 3.25rem);
  border-radius: 999px;
  border: 1px solid rgba(14, 116, 144, 0.18);
  background-color: #ffffff;
  color: #0f172a;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.services-carousel__nav span {
  font-size: 1.5rem;
}

.services-carousel__nav:hover,
.services-carousel__nav:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(14, 116, 144, 0.35);
  box-shadow: 0 14px 26px -18px rgba(14, 116, 144, 0.55);
  outline: none;
}

.services-carousel__nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.services-modals {
  position: relative;
  z-index: 10;
}

.service-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  z-index: 1000;
}

.service-modal.is-visible {
  display: flex;
}

.service-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
}

.service-modal__dialog {
  position: relative;
  max-width: min(560px, 100%);
  width: 100%;
  background-color: #ffffff;
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 34px 60px -36px rgba(15, 118, 110, 0.55);
  display: grid;
  gap: 1.25rem;
  outline: none;
}

.service-modal__close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1rem);
  right: clamp(0.75rem, 2vw, 1rem);
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: #0f172a;
}

.service-modal__title {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.6rem);
  color: #0f172a;
}

.service-modal__description {
  margin: 0;
  color: #475569;
  line-height: 1.7;
  font-size: clamp(1rem, 1.5vw, 1.05rem);
}

.service-modal__action {
  justify-self: start;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1023px) {
  .services-section__container {
    padding-inline: clamp(1rem, 6vw, 1.75rem);
  }

  .services-carousel__wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "window window"
      "prev next";
    row-gap: clamp(1rem, 4vw, 1.5rem);
    column-gap: clamp(2rem, 10vw, 3.5rem);
    justify-content: center;
  }

  .services-carousel__nav--prev,
  .services-carousel__nav--next {
    position: static;
    transform: none;
    justify-self: center;
  }

  .services-carousel__nav--prev {
    grid-area: prev;
    justify-self: end;
  }

  .services-carousel__nav--next {
    grid-area: next;
    justify-self: start;
  }

  .services-carousel__window {
    grid-area: window;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .services-carousel__header {
    text-align: left;
    gap: 0.45rem;
  }

  .services-carousel__wrapper {
    column-gap: clamp(1.5rem, 8vw, 2.25rem);
    row-gap: clamp(0.85rem, 6vw, 1.25rem);
  }

  .services-carousel__nav {
    width: clamp(2.4rem, 7vw, 2.85rem);
    height: clamp(2.4rem, 7vw, 2.85rem);
  }

  .service-card {
    flex: 0 0 100%;
    padding: clamp(1.25rem, 6vw, 1.75rem);
    border-radius: 1rem;
  }

  .service-card__title {
    font-size: 1.08rem;
    min-height: auto;
  }

  .service-card__summary {
    font-size: 0.92rem;
    min-height: auto;
  }

  .service-card__button {
    width: 100%;
    justify-content: center;
  }

  .service-modal__dialog {
    max-height: 90vh;
    overflow-y: auto;
  }
}
