/* Services CTA */
.services-cta{
  background: #ffefdf;
  padding: clamp(2.5rem, 6vw, 4rem) 1rem 4.5rem;
}

/* TITULO DE CARTAS */
.services-cta__header{
  max-width: 70rem;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
}

.services-title{
  color: #524D46;
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 6vw, 3.1rem);
  margin: 0;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}
.services-end-subtitle{
  color: #524D46;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  margin: 2rem auto 0;
  font-weight: 700;
  text-align: center;
  padding: 0 1.25rem;
  line-height: 1.5;
  max-width: 70rem;
}

.services-cta__inner{
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
}

.service-card-wrap{
  position: relative;
  width: 100%;
  max-width: 40rem;
  z-index: 0; 
  overflow: visible; 
}

/* CARTAS TRASERAS (MAS OSCURAS) */
.service-card-wrap::before{
  content: '';
  position: absolute;
  top: -1.5rem;
  left: -1.25rem;
  width: calc(100% + 1.25rem); /*ANCHURA DE CARTA TRASERA*/
  height: calc(100% + 1.25rem); /*ALTURA DE CARTA TRASERA*/
  background: #4D2F10;
  border-radius: 2.4rem;
  z-index: 0; 
  box-shadow: 0 18px 40px rgba(0,0,0,0.14);
  transition: transform 360ms cubic-bezier(.2,.9,.3,1), box-shadow 360ms ease;
}

.service-card-wrap:hover::before,
.service-card-wrap:focus-within::before{
  /* make the back card lift a bit more on hover for a clearer separation */
  transform: translateY(-18px) translateX(4px) scale(1.004);
  box-shadow: 0 28px 50px rgba(0,0,0,0.18);
}

.service-card{
  position: relative;
  z-index: 3; 
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: auto;
  min-height: auto;
  border-radius: 2rem;
  padding: 1.75rem;
  box-shadow: 0 18px 38px rgba(0,0,0,0.12);
  overflow: visible;
  transform: translateY(0.7rem);
  transition: transform 360ms cubic-bezier(.2,.9,.3,1), box-shadow 360ms ease, filter 280ms ease;
  transform-origin: center bottom;
  will-change: transform;
}

/* CÍRCULO (detrás de la carta) */
.service-circle{
  position: absolute;
  right: -13rem; 
  top: 50%;
  transform: translateY(-50%);
  width: 14rem; 
  height: 14rem;
  background: rgba(245,240,232,0.98); 
  border-radius: 50%; /*CIRCUNFERENCIA*/
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  z-index: 1; 
  pointer-events: none;
  display: none;
  border: 6px solid rgba(255,255,255,0.45);
}

.service-card-wrap{
  perspective: 1200px; 
}

.service-card-wrap:hover .service-card,
.service-card:focus-visible,
.service-card-wrap:focus-within .service-card{
  transform: translateY(-18px) rotateX(3.6deg) scale(1.02);
  box-shadow: 0 30px 60px rgba(0,0,0,0.25);
  filter: brightness(1.02);
  z-index: 6; 
}

.service-card:focus-visible,
.service-card-wrap:focus-within .service-card{ outline: 3px solid rgba(138,94,60,0.12); outline-offset: 6px; }

.service-card-wrap:hover .service-circle{
  transform: translateY(-50%) scale(1.06);
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
}

.service-card-wrap:hover .service-circle-img{
  transform: translateY(-50%) scale(1.08) translateX(6%);
  box-shadow: 0 20px 50px rgba(0,0,0,0.22);
  z-index: 10; 
}

.service-circle,
.service-circle-img{
  transition: transform 360ms cubic-bezier(.2,.9,.3,1), box-shadow 360ms ease, filter 280ms ease;
}

.service-card__titulo{
  transition: transform 420ms cubic-bezier(.2,.9,.3,1);
}
.service-card-wrap:hover .service-card__titulo,
.service-card:focus-visible .service-card__titulo,
.service-card-wrap:focus-within .service-card__titulo{ transform: translateZ(12px); }

/* APARICION DE TEXTO PEQUEÑO (DESPLAZADO) */
.service-badges{
  position: absolute;
  top: -4rem;
  right: 1.5rem; /* MOVER VERTICALEMNTE */
  left: auto;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  align-items: center;
  pointer-events: none;
  z-index: 2; 
}
.service-badge{
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  /* preserve the case as written in the HTML (was forcing lowercase) */
  text-transform: none;
  color: rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.12);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(12px) scale(.96);
  opacity: 0;
  transition: transform 160ms cubic-bezier(.2,.9,.3,1), opacity 160ms ease;
  transition-delay: 0ms;
}


.service-card-wrap:hover .service-badge,
.service-card-wrap:focus-within .service-badge{
  transition-duration: 320ms;
  transform: translateY(0) scale(1);
  opacity: 1;
}

.service-card-wrap:hover .service-badge:nth-child(1),
.service-card-wrap:focus-within .service-badge:nth-child(1){ transition-delay: 40ms; }
.service-card-wrap:hover .service-badge:nth-child(2),
.service-card-wrap:focus-within .service-badge:nth-child(2){ transition-delay: 120ms; }
.service-card-wrap:hover .service-badge:nth-child(3),
.service-card-wrap:focus-within .service-badge:nth-child(3){ transition-delay: 200ms; }

@media (max-width:1023px){
  .service-badges{
    display: none;
  }
}

/* color por variante (izquierda/derecha) si quieres diferenciarlo) */
.service-card-wrap.service-card--izquierda .service-circle{
  background: #AC9E8F;
}

.service-card-wrap.service-card--derecha .service-circle{
  background: #AC9E8F;
}
/* CÍRCULO DE LA IMAGEN (detrás de la carta) */
.service-circle-img{
  position: absolute;
  right: -11rem; 
  top: 50%;
  transform: translateY(-50%);
  width: 10rem; 
  height: 10rem;
  background-color: rgba(245,240,232,0.98); 
  background-size: cover;
  background-position: center;
  border-radius: 50%; /*CIRCUNFERENCIA*/
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  z-index: 7; 
  pointer-events: none;
  display: none;
  border: 6px solid rgba(255,255,255,0.45);
}

/* color por variante (izquierda/derecha) si quieres diferenciarlo) */
.service-card-wrap.service-card--izquierda .service-circle-img{
  background-image: url('/images/servicio-arquitecta.jpg');
}

.service-card-wrap.service-card--derecha .service-circle-img{
  background-image: url('/images/servicio-abogado.jpg');
}

.service-card.service-card--izquierda{
  background: #B69B77;
  color: #fff;
}

.service-card.service-card--derecha{
  background: #B69B77;
  color: #fff;
}

.service-card__titulo{
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 4.5vw, 2.35rem);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
}

.service-card__subtitulo{
  margin: 0;
  color: #3C3935;
  line-height: 1.5;
  font-size: 1.05rem;
  padding: 0;
}

.service-card--derecha .service-card__subtitulo{
  color: #3C3935;
}

@media (min-width:1024px){
  .services-cta{
    padding: 4.5rem 2rem 6rem;
  }
  .services-cta__inner{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: clamp(2.5rem, 18vw, 17rem);
    align-items: stretch;
  }
  .service-card-wrap{
    width: 100%;
    max-width: none;
    height: auto;
  }
  .service-card-wrap::before{
    top: -3.2rem;
    left: -3rem;
    width: calc(100% + 3rem);
    height: calc(100% + 2rem);
    border-radius: 3rem;
  }
  .service-card{
    min-height: 16rem;
    padding: 3rem;
  }
  .service-badges{
    display: flex;
  }
  .service-circle,
  .service-circle-img{
    display: block;
  }
  .service-card__subtitulo{
    padding: 10px 50px 0 0;
    font-size: 1.15rem;
  }
}

/* Ajustes solo para pantallas intermedias (ej. 1280px) sin tocar 1920px */
@media (min-width:1024px) and (max-width:1440px){
  .services-cta{
    padding: 3.4rem clamp(1rem, 4vw, 3rem) 5.2rem;
  }
  .services-cta__inner{
    gap: clamp(1.2rem, 11vw, 11rem);
    padding: 0 clamp(1rem, 8.5vw, 7rem);
    max-width: 72rem;
    justify-items: center;
  }
  .service-card-wrap{
    max-width: 32rem;
    transform: scale(0.92);
    transform-origin: center top;
  }
  .service-card-wrap::before{
    top: -2.4rem;
    left: -2rem;
    width: calc(100% + 2.2rem);
    height: calc(100% + 1.6rem);
    border-radius: 2.6rem;
  }
  .service-card{
    min-height: 14rem;
    padding: 2.6rem 2.4rem;
  }
  .service-circle{
    right: -8.2rem;
    width: 12.4rem;
    height: 12.4rem;
  }
  .service-circle-img{
    right: -6.1rem;
    width: 9.2rem;
    height: 9.2rem;
  }
  .service-badges{
    top: -3.1rem;
    gap: 0.4rem;
  }
  .service-badge{
    font-size: 1rem;
    padding: 0.18rem 0.5rem;
  }
  .service-card__titulo{
    font-size: clamp(1.5rem, 3.3vw, 2.2rem);
  }
  .service-card__subtitulo{
    padding: 10px 24px 0 0;
    font-size: 1.05rem;
  }
}
