/* services-card.css - adaptado para usar variables globales */

/* ======= SECCIÓN ======= */
.services-section {
  position: relative;
  max-width: 100%;
  padding: var(--padding-sections-pc);
  background-color: var(--color-bg);
}

/* ======= ENCABEZADO ======= */
.services-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 3rem;
}

.services-sub {
  color: var(--color-green);
  font-size: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-paragraph);
}

#services-sub-highlight {
  color: var(--color-light-green);
}

#services-title {
  font-size: clamp(28px, 12vw, 72px);
  margin: 12px 0;
  color: var(--color-green-title);
  font-weight: 700;
  line-height: var(--font-lh-title);
  font-family: var(--font-title);
}

.services-intro {
  max-width: 900px;
  font-family: var(--font-paragraph);
  font-size: clamp(18px, 2vw, 24px);
  line-height: var(--font-lh-paragraph);
  color: var(--color-text-paragraph);
  margin: 0;
}

/* ======= TARJETAS ======= */
.services-items {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 60px;
}

.service-card {
  max-width: 1440px;
  display: flex;
  height: fit-content;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  transition: transform 0.35s, box-shadow 0.35s;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.service-card img {
  min-height: 100%;
  max-width: 50%;
  object-fit: cover;
  display: block;
}

.service-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 2vw, 20px);
}

.service-card h4 {
  font-family: var(--font-title);
  color: var(--color-green-title);
  font-size: var(--font-size-title);
  line-height: var(--font-lh-title);
  text-align: left;
  margin: 0;
}

.service-card .sub {
  font-family: var(--font-title);
  color: var(--color-light-green);
  font-size: clamp(14px, 4vw, 20px);
  margin: 0 0 15px;
  font-weight: 500;
}

.service-card p {
  font-family: var(--font-paragraph);
  font-size: var(--font-size-paragraph);
  line-height: var(--font-lh-paragraph);
  color: var(--color-text-paragraph);
  margin-bottom: 25px;
}

.service-card .actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.service-card .btn {
  padding: 10px 26px;
  background-color: var(--color-green-title);
  color: var(--color-bg);
  font-family: var(--font-paragraph);
  font-size: var(--font-size-button);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.service-card .btn:hover {
  background: var(--color-light-green);
  color: #fff;
}

.service-card .btn.secondary {
  background: var(--color-light-green);
  color: #fff;
  border-color: transparent;
}

.service-card .btn.secondary:hover {
  background: var(--color-green-title);
}

/* ======= MODAL ======= */
.services-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.services-modal[aria-hidden="false"] {
  display: flex;
}

.services-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.55);
  backdrop-filter: blur(6px);
}

.services-modal-inner {
  position: relative;
  width: 100%;
  max-width: 95%;

  height: 95%;
  background: var(--color-green);
  color: var(--color-text);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalShow 0.4s ease-out;
}

@keyframes modalShow {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.services-modal-close {
  position: absolute;
  right: 20px;
  top: 10px;
  z-index: 3;
  background: transparent;
  border: none;
  font-size: clamp(32px, 3vw, 48px);
  cursor: pointer;
  color: var(--color-bg);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.services-modal-close:hover {
  opacity: 1;
}

.services-modal-grid {
  display: flex;
  width: 100%;
  height: 100%;
}

.services-modal-figure {
  min-width: 30%;
  max-width: 35%;
}

.services-modal-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.services-modal-body {
  padding: clamp(16px, 2vw, 22px);
  font-family: var(--font-paragraph);
  color: var(--color-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: 100%;
  overflow: hidden;
  flex-direction: column;
}

.services-modal-body h3 {
  font-family: var(--font-title);
  font-size: var(--font-size-title);
  line-height: var(--font-lh-title);
  text-align: left;
  margin: 0;
}

.services-modal-desc p {
  margin: 0 0 12px;
  color: #ccc;
  font-size: var(--font-size-paragraph);
}

.services-modal-desc h4 {
  margin: 14px 0 10px;
  font-size: var(--font-size-button);
  color: #e8e6df;
}

.services-modal-desc ul,
.services-modal-desc ol {
  margin: 0 0 14px 18px;
  color: #ccc;
}

.services-modal-book {
  display: inline-block;
  padding: 12px 18px;
  background: var(--color-light-green);
  color: var(--color-text-rgb);
  border-radius: 12px;
  font-weight: 500;
  font-size: var(--font-size-button);
  text-decoration: none;
  transition: background 0.3s;
  margin: 0.5rem 0;
}

.services-modal-book:hover {
  background: var(--color-green-title);
}

/* ======= RESPONSIVE ======= */
@media (max-width: 900px) {
  .services-section {
    padding: var(--padding-sections-mobile);
  }

  .services-items {
    gap: 30px;
  }

  .service-card {
    display: flex;
    flex-direction: column;
  }

  .service-card img {
    max-width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
  }

  .service-card .btn {
    padding: 10px 26px;
    margin-bottom: 1rem;
  }

  .services-modal-grid {
    flex-direction: column;
  }
  .services-modal-close {
    position: absolute;
    padding: 0 10px;
    right: 5px;
    top: 5px;
    z-index: 3;
    background: var(--color-green);
    border: none;
    border-radius: 25px;
    font-size: clamp(36px, 3vw, 48px);
    cursor: pointer;
    color: var(--color-bg);
    opacity: 0.8;
    transition: opacity 0.2s;
  }

  .services-modal-figure {
    max-width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
  }

  .services-modal-body h3 {
    position: static;
    font-family: var(--font-title);
    font-size: var(--font-size-title);
    line-height: var(--font-lh-title);
    text-align: left;
    margin: 0;
  }

  .service-card .btn.secondary {
    background: var(--color-light-green);
    color: #fff;
    border-color: transparent;
    position: fixed;
  }
}

/* Mantiene el título fijo en la parte superior */
#services-modal-title {
  position: sticky;
  top: 0;
  background: var(--color-green);
  z-index: 2;
  margin-bottom: clamp(0.2rem, 2.5vw, 0.6rem);
}

/* Crea espacio y permite scroll del contenido */
#services-modal-desc {
  flex: 1;
  overflow-y: auto;
  margin-top: 5px;
  min-height: 0; /* 👈 clave para que el scroll funcione en flex */
  max-height: max-content;
}

/* Mantiene el botón en el fondo */
.services-modal-actions {
  position: sticky;
  bottom: 0;
  background: var(--color-green);
  justify-content: center;
  text-align: left;
  z-index: 2;
}
@media (max-width: 900px) {
  .services-modal-actions {
    text-align: center;
  }
}

.services-modal-desc a {
  color: #ccc;
  text-decoration: underline; /* Subrayado o none si no quieres */
  transition: color 0.3s ease;
}
