.jms-home-services {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(4.5rem, 7vw, 6.5rem) 1rem;
  background:
    radial-gradient(
      circle at 8% 10%,
      rgba(190, 21, 34, 0.07),
      transparent 28%
    ),
    radial-gradient(
      circle at 92% 85%,
      rgba(0, 0, 0, 0.035),
      transparent 26%
    ),
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fafafa 100%
    );
}

.jms-home-services::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -180px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(190, 21, 34, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.jms-home-services::after {
  content: "";
  position: absolute;
  bottom: -220px;
  left: -180px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.jms-home-services .container {
  position: relative;
  z-index: 2;
}

.servicos-header {
  max-width: 780px;
  margin: 0 auto 3rem;
  text-align: center;
}

.servicos-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-red, #be1522);
}

.servicos-eyebrow::before,
.servicos-eyebrow::after {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--color-red, #be1522);
}

.titulo-servicos {
  margin: 0 0 0.9rem;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: #171717;
}

.titulo-servicos span {
  position: relative;
  color: var(--color-red, #be1522);
}

.titulo-servicos span::after {
  content: "";
  position: absolute;
  left: 4%;
  bottom: -5px;
  width: 92%;
  height: 4px;
  border-radius: 999px;
  background: var(--color-red, #be1522);
  opacity: 0.16;
}

.subtitulo-servicos {
  max-width: 650px;
  margin: 0 auto;
  color: #676767;
  font-size: 1.02rem;
  line-height: 1.7;
}

.servicos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.servico-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.065);
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.05),
    0 18px 45px rgba(0, 0, 0, 0.055);
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.servico-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.servico-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      #eeeeee,
      #dddddd
    );
}

.card-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 45%,
      rgba(0, 0, 0, 0.18) 100%
    );
  pointer-events: none;
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 -40px 50px rgba(0, 0, 0, 0.08);
}

.card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.4s ease;
}

.media-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(
      145deg,
      var(--color-red, #be1522),
      #9e111c
    );
  color: #fff;
  box-shadow:
    0 8px 20px rgba(190, 21, 34, 0.28),
    0 2px 5px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.media-badge svg,
.media-badge i {
  width: 21px;
  height: 21px;
}

.card-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem 1.35rem 1.45rem;
}

.card-title {
  position: relative;
  padding-right: 2.2rem;
  margin: 0 0 0.65rem;
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: #1d1d1d;
  transition: color 0.25s ease;
}

.card-title::after {
  content: "→";
  position: absolute;
  top: -1px;
  right: 0;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3f3f3;
  color: var(--color-red, #be1522);
  font-size: 0.92rem;
  font-weight: 700;
  transition:
    transform 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
}

.card-desc {
  flex: 1;
  margin: 0;
  color: #686b70;
  font-size: 0.94rem;
  line-height: 1.65;
}

.card-body::after {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-top: 1.1rem;
  border-radius: 999px;
  background: var(--color-red, #be1522);
  opacity: 0.72;
  transition:
    width 0.3s ease,
    opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .servico-card:hover {
    transform: translateY(-7px);
    border-color: rgba(190, 21, 34, 0.14);
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.07),
      0 28px 60px rgba(0, 0, 0, 0.1);
  }

  .servico-card:hover .card-media img {
    transform: scale(1.055);
    filter: saturate(1.05) contrast(1.02);
  }

  .servico-card:hover .media-badge {
    transform: translateY(-2px) rotate(-3deg);
    box-shadow:
      0 12px 25px rgba(190, 21, 34, 0.34),
      0 3px 7px rgba(0, 0, 0, 0.13);
  }

  .servico-card:hover .card-title {
    color: var(--color-red, #be1522);
  }

  .servico-card:hover .card-title::after {
    transform: translateX(3px);
    background: var(--color-red, #be1522);
    color: #fff;
  }

  .servico-card:hover .card-body::after {
    width: 55px;
    opacity: 1;
  }
}

.servico-card > a:focus-visible {
  outline: 3px solid rgba(190, 21, 34, 0.25);
  outline-offset: 4px;
  border-radius: 20px;
}

@media (max-width: 1000px) {
  .servicos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .jms-home-services {
    padding: 4rem 1rem;
  }

  .servicos-header {
    margin-bottom: 2.2rem;
  }

  .servicos-eyebrow {
    margin-bottom: 0.7rem;
    font-size: 0.68rem;
  }

  .servicos-eyebrow::before,
  .servicos-eyebrow::after {
    width: 17px;
  }

  .titulo-servicos {
    font-size: clamp(2rem, 9vw, 2.55rem);
  }

  .subtitulo-servicos {
    max-width: 520px;
    font-size: 0.94rem;
    line-height: 1.6;
  }

  .servicos-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .servico-card {
    border-radius: 18px;
  }

  .card-media {
    aspect-ratio: 16 / 9.5;
  }

  .card-body {
    padding: 1.2rem 1.2rem 1.3rem;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-desc {
    font-size: 0.91rem;
  }

  .media-badge {
    top: 13px;
    left: 13px;
    width: 43px;
    height: 43px;
    border-radius: 13px;
  }
}

@media (max-width: 420px) {
  .jms-home-services {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .servicos-header {
    margin-bottom: 1.9rem;
  }

  .card-media {
    aspect-ratio: 16 / 10;
  }

  .card-body {
    padding: 1.1rem;
  }

  .card-title {
    padding-right: 2rem;
  }

  .card-title::after {
    width: 27px;
    height: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .servico-card,
  .card-media img,
  .media-badge,
  .card-title,
  .card-title::after,
  .card-body::after {
    transition: none;
  }
}