/* FAQ Styles */
.faq-wrapper {
  --alfaq-accent: #607c8a;
  margin: 1rem 0 2rem;
}

.faq-container {
  max-width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  font-family: inherit;
}

.faq-item {
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.9rem 1.25rem;
  border: none;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.faq-question:hover {
  background: #f7f8f6;
}

.faq-question:focus-visible {
  outline: 2px solid var(--alfaq-accent);
  outline-offset: -2px;
}

.faq-question .faq-toggle {
  flex: 0 0 auto;
  color: var(--alfaq-accent);
  transition: transform 0.25s ease;
}

.faq-item.active .faq-question .faq-toggle {
  transform: rotate(180deg);
}

.faq-item.active {
  box-shadow: inset 3px 0 0 var(--alfaq-accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fafafa;
}

.faq-answer-content {
  padding: 0.25rem 1.25rem 1.1rem;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.faq-answer-content p:last-child,
.faq-answer-content ul:last-child {
  margin-bottom: 0;
}

/* Sin JS: todo visible */
.no-js .faq-answer {
  max-height: none;
}

@media (max-width: 767px) {
  .faq-question {
    padding: 0.85rem 1rem;
  }

  .faq-answer-content {
    padding: 0.25rem 1rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-answer,
  .faq-question .faq-toggle {
    transition: none;
  }
}

/* Destino de los enlaces "#preguntas-frecuentes" (p. ej. desde la descripción corta):
   deja hueco para la cabecera fija del tema al saltar. */
#preguntas-frecuentes,
.faq-wrapper {
  scroll-margin-top: 170px;
}

html {
  scroll-behavior: smooth;
}

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