/* Complemento para anclas de sitelinks y preguntas frecuentes.
   No modifica styles.css ni la funcionalidad existente. */

html {
  scroll-behavior: smooth;
}

:where(
  #inicio,
  #reconocimientos,
  #calculadora,
  #servicios,
  #financiamiento,
  #proyectos,
  #clientes,
  #preguntas,
  #resenas,
  #lead-form,
  #contacto-final
) {
  scroll-margin-top: 110px;
}

.faq-section {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 15%, rgba(59, 213, 119, 0.09), transparent 27%),
    radial-gradient(circle at 92% 82%, rgba(13, 46, 62, 0.08), transparent 30%),
    #f7faf8;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.faq-item {
  align-self: start;
  overflow: hidden;
  border: 1px solid #dce9e1;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(7, 32, 21, 0.06);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.faq-item:hover,
.faq-item[open] {
  transform: translateY(-2px);
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: 0 18px 42px rgba(7, 32, 21, 0.1);
}

.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 20px 58px 20px 22px;
  color: #0f1f2d;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eaf8ef;
  color: #159957;
  font-size: 22px;
  font-weight: 700;
  transform: translateY(-50%);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.faq-item[open] summary::after {
  content: "−";
  background: #159957;
  color: #ffffff;
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  padding: 0 22px 22px;
}

.faq-answer p {
  margin: 0;
  color: #52636c;
  line-height: 1.7;
}

.faq-cta {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

@media (max-width: 820px) {
  :where(
    #inicio,
    #reconocimientos,
    #calculadora,
    #servicios,
    #financiamiento,
    #proyectos,
    #clientes,
    #preguntas,
    #resenas,
    #lead-form,
    #contacto-final
  ) {
    scroll-margin-top: 86px;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .faq-item summary {
    min-height: 70px;
    padding: 18px 52px 18px 18px;
    font-size: 15px;
  }

  .faq-item summary::after {
    right: 16px;
  }

  .faq-answer {
    padding: 0 18px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .faq-item,
  .faq-item summary::after {
    transition: none;
  }
}
