/* =========================
   FAQ Zyltron
   ========================= */
:root {
  --ink: #111217;
  --muted: #6b7280;
  --stroke: #e7e7ee;
  --bg: #f9fafb;
  --white: #fff;

  --red-soft: #fff0f0;
  --red-text: #b91c1c;
  --green-soft: #f0fff4;
  --green-text: #15803d;
  --blue-soft: #f0f6ff;
  --blue-text: #1d4ed8;
  --violet-soft: #f8f0ff;
  --violet-text: #7e22ce;

  --radius: 14px;
  --shadow: 0 4px 12px rgba(0,0,0,.05);
  --ring: 0 0 0 3px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1000px, 92%); margin-inline: auto; }

/* ===== HEADER ===== */
.faq-header {
  background: #fff;
  border-bottom: 1px solid var(--stroke);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.faq-header .container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.faq-header .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background .2s ease, color .2s ease;
}
.faq-header .back:hover {
  background: var(--bg);
}

.faq-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: .2px;
}

.faq-header .logo-badge {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
}

/* ===== FILTROS ===== */
.faq-filters {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 18px 0;
}
.faq-filters::-webkit-scrollbar { display: none; }
.filter {
  flex-shrink: 0;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  background: #f0f0f0;
  color: #111;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.filter:hover { transform: translateY(-1px); }
.filter.active {
  background: #111;
  color: #fff;
}

/* ===== LISTA FAQ ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 60px;
}
.faq-item {
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.faq-item:hover { transform: translateY(-2px); }

/* ===== COLORES POR CATEGORÍA ===== */
.faq-item[data-cat="Emergencia"] { background: var(--red-soft); border-color: #fbcaca; }
.faq-item[data-cat="Emergencia"] .faq-question { color: var(--red-text); }

.faq-item[data-cat="Preventivo"] { background: var(--green-soft); border-color: #bfeccd; }
.faq-item[data-cat="Preventivo"] .faq-question { color: var(--green-text); }

.faq-item[data-cat="Ubicaciones"] { background: var(--blue-soft); border-color: #cbdafc; }
.faq-item[data-cat="Ubicaciones"] .faq-question { color: var(--blue-text); }

.faq-item[data-cat="Contactos"] { background: var(--violet-soft); border-color: #e2c6f7; }
.faq-item[data-cat="Contactos"] .faq-question { color: var(--violet-text); }

/* ===== PREGUNTA/RESPUESTA ===== */
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 18px;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 18px;
  color: #222;
  transition: max-height .3s ease, padding .3s ease;
}
.faq-answer p { margin: 8px 0; line-height: 1.5; }
.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 0 18px 16px;
}

/* ===== BOTÓN TOP ===== */
#scrollTop {
  position: fixed;
  right: 16px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
}
#scrollTop.show { display: flex; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .faq-question { font-size: .95rem; }
  .faq-header h1 { font-size: 1.05rem; }
}
