/* ============================================================
 * dbbfaqs — front /faqs page styles
 * Cargado solo en esta página vía registerStylesheet (controllers/front/listing.php).
 * Acoplado a los tokens del tema (bbb/_dev/scss/_tokens.scss); sin tokens nuevos.
 * Mapea el diseño de Lovable (src/pages/Faqs.tsx) a los tokens del tema.
 * ============================================================ */

.faq-page {
  max-width: var(--container-max-width, 1280px);
  margin: 0 auto;
  padding: 1rem var(--container-padding-x, 1rem) 4rem;
}

/* ── Header ─────────────────────────────────────────────── */
.faq-page__header {
  margin-bottom: 2rem;
}

.faq-page__title {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  /* .h-page */
  font-weight: var(--font-weight-light, 300);
  letter-spacing: -0.025em;
  color: var(--color-foreground);
  margin: 0 0 0.75rem;
}

.faq-page__subtitle {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-muted-foreground, #737373);
  margin: 0;
}

/* ── Search (pill, patrón de _header.scss) ──────────────── */
.faq-search {
  margin-bottom: 2.5rem;
}

.faq-search__box {
  display: flex;
  align-items: center;
  max-width: 36rem;
  border: 1px solid var(--color-border, #e6e6e6);
  border-radius: 9999px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-search__box:focus-within {
  border-color: var(--color-foreground, #171717);
}

.faq-search__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-foreground);
  padding: 0.625rem 1.25rem;
}

.faq-search__input::placeholder {
  color: var(--color-muted-foreground, #737373);
  font-weight: var(--font-weight-light, 300);
}

.faq-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.faq-search__clear,
.faq-search__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-foreground);
}

.faq-search__clear {
  padding: 0.25rem;
  margin-right: 0.25rem;
  cursor: pointer;
  border-radius: 9999px;
  transition: color 0.15s ease;
}

.faq-search__clear:hover {
  color: var(--color-muted-foreground);
}

.faq-search__clear svg {
  width: 16px;
  height: 16px;
  display: block;
}

.faq-search__icon {
  padding: 0.5rem 0.875rem;
  pointer-events: none;
}

.faq-search__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.faq-search__count {
  font-size: var(--font-size-xs, 0.75rem);
  color: var(--color-muted-foreground, #737373);
  margin: 0.75rem 0 0;
}

/* ── Category nav ───────────────────────────────────────── */
.faq-nav {
  margin-bottom: 2.5rem;
}

.faq-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.faq-nav__link {
  display: inline-block;
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: var(--font-weight-light, 300);
  letter-spacing: 0.025em;
  padding: 0.5rem 0.875rem;
  border: 1px solid rgba(23, 23, 23, 0.15);
  /* foreground/15 */
  color: var(--color-foreground);
  text-decoration: none;
  transition: var(--transition-base, all 0.2s ease);
}

.faq-nav__link:hover,
.faq-nav__link:focus {
  background: var(--color-foreground);
  color: var(--color-background);
  border-color: var(--color-foreground);
  text-decoration: none;
}

/* ── Sections + accordion ───────────────────────────────── */
.faq-sections {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.faq-section {
  scroll-margin-top: calc(var(--height-header, 82px) + 24px);
}

.faq-section__title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: var(--font-weight-medium, 500);
  color: var(--color-foreground);
  margin: 0 0 1rem;
}

.faq-accordion {
  border-top: 1px solid var(--color-border, #e6e6e6);
}

.faq-item {
  border-bottom: 1px solid var(--color-border, #e6e6e6);
}

.faq-item__heading {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-light, 300);
  color: var(--color-foreground);
  transition: opacity 0.15s ease;
}

.faq-item__trigger:hover {
  opacity: 0.7;
}

.faq-item__question {
  flex: 1 1 auto;
}

.faq-item__chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-muted-foreground, #737373);
  transition: transform 0.2s ease;
}

.faq-item__trigger[aria-expanded="true"] .faq-item__chevron {
  transform: rotate(180deg);
}

.faq-item__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.faq-item__answer {
  padding: 0 0 1rem;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: var(--font-weight-light, 300);
  line-height: 1.625;
  color: var(--color-muted-foreground, #737373);
}

.faq-item__answer> :first-child {
  margin-top: 0;
}

.faq-item__answer> :last-child {
  margin-bottom: 0;
}

.faq-item__answer p {
  margin: 0 0 0.75rem;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: inherit;
}

.faq-item__answer a {
  color: var(--color-foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.faq-item__answer ul,
.faq-item__answer ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

/* ── Empty / filtered-out states ────────────────────────── */
.faq-empty {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-muted-foreground, #737373);
}

.faq-item[hidden],
.faq-section[hidden],
.faq-nav__item[hidden] {
  display: none;
}