/* ═══════════════════════════════════════════
   LOGICRAFT — FAQS.CSS v1
   Extiende main.css · No duplica variables
   ═══════════════════════════════════════════ */

/* ─── FAQ HERO ───────────────────────────── */
.faq-hero {
  position: relative;
  padding: 160px 0 96px;
  background: var(--bg);
  overflow: hidden;
}

.faq-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 178, 150, .09) 0%, transparent 65%);
  pointer-events: none;
}

.faq-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(52, 178, 150, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 178, 150, .022) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 50% 0%, black 30%, transparent 100%);
}

.faq-hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.faq-hero__title {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.03em;
  line-height: 1.05;
  margin: 20px 0 20px;
}

.faq-hero__sub {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.75;
  max-width: 540px;
  margin: 0 auto 44px;
}

/* ─── SEARCH BAR ─────────────────────────── */
.faq-search {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.faq-search__input {
  width: 100%;
  background: rgba(4, 9, 14, .85);
  border: 1px solid var(--line);
  border-radius: 50px;
  padding: 16px 54px 16px 26px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: .95rem;
  outline: none;
  transition: border-color .3s, box-shadow .3s, background .3s;
  backdrop-filter: blur(8px);
}

.faq-search__input::placeholder { color: var(--text-muted); }

.faq-search__input:focus {
  border-color: rgba(52, 178, 150, .45);
  box-shadow: 0 0 0 4px rgba(52, 178, 150, .08), 0 8px 32px rgba(0, 0, 0, .3);
  background: rgba(4, 9, 14, .95);
}

.faq-search__icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
}

/* ─── CATEGORY TABS ──────────────────────── */
.faq-tabs {
  position: sticky;
  top: 78px;
  z-index: 100;
  background: rgba(6, 33, 44, .92);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  transition: box-shadow .3s;
}

.faq-tabs.elevated {
  box-shadow: 0 4px 32px rgba(0, 0, 0, .4), 0 1px 0 rgba(52, 178, 150, .07);
}

/* El padding va DENTRO del scroll, no en el container padre (que lo recortaría) */
.faq-tabs > .container {
  padding-left: 0;
  padding-right: 0;
}

.faq-tabs__inner {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
  padding-left: 48px;
  padding-right: 48px; /* padding dentro del scroll = último tab siempre visible */
}

.faq-tabs__inner::-webkit-scrollbar { display: none; }

.faq-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 50px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .25s var(--ease);
  letter-spacing: .01em;
  flex-shrink: 0;
}

.faq-tab:hover {
  border-color: var(--line-teal);
  color: var(--text);
  background: var(--teal-glow-sm);
}

.faq-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #04090e;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(52, 178, 150, .3);
}

/* Isotipo en tabs */
.faq-tab__iso {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: .85;
  transition: opacity .25s, filter .25s;
}

.faq-tab.active .faq-tab__iso { opacity: 1; filter: brightness(0); }
.faq-tab:hover .faq-tab__iso { opacity: 1; }

/* Isotipo en category tags (usa variable CSS definida en el HTML head) */
.faq-item__cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.faq-item__cat-tag::before {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  background-image: var(--isotipo-color-url, none);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  opacity: .75;
}

.faq-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50px;
  font-size: .63rem;
  font-weight: 700;
  background: var(--teal-glow-sm);
  border: 1px solid var(--line-teal);
  color: var(--teal);
  transition: inherit;
}

.faq-tab.active .faq-tab__count {
  background: rgba(4, 9, 14, .2);
  border-color: rgba(4, 9, 14, .15);
  color: #04090e;
}

/* ─── FAQ SECTION ────────────────────────── */
.faq-section {
  padding: 72px 0 120px;
}

.faq-list {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.faq-block__title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.faq-block__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── FAQ ITEM ───────────────────────────── */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
}

.faq-item:hover {
  border-color: rgba(52, 178, 150, .15);
}

.faq-item.open {
  border-color: rgba(52, 178, 150, .28);
  box-shadow: 0 8px 40px rgba(0, 0, 0, .25), 0 0 0 1px rgba(52, 178, 150, .05);
}

/* Question button */
.faq-item__question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .25s;
}

.faq-item__question:hover {
  background: rgba(255, 255, 255, .02);
}

.faq-item.open .faq-item__question {
  background: rgba(52, 178, 150, .04);
}

.faq-item__q-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.faq-item__cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  opacity: .75;
}

.faq-item__q-text {
  font-family: var(--font-body);
  font-size: .97rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.45;
  letter-spacing: -.01em;
}

/* Plus/minus icon */
.faq-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all .3s var(--ease);
  background: transparent;
}

.faq-item:hover .faq-item__icon {
  border-color: var(--line-teal);
  color: var(--teal);
}

.faq-item.open .faq-item__icon {
  background: var(--teal);
  border-color: var(--teal);
  color: #04090e;
  transform: rotate(45deg);
  box-shadow: 0 4px 16px rgba(52, 178, 150, .3);
}

/* Accordion panel */
.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s var(--ease);
}

.faq-item.open .faq-item__answer {
  max-height: 1000px;
}

.faq-item__answer-inner {
  padding: 20px 24px 26px;
  border-top: 1px solid var(--line);
}

/* Answer typography */
.faq-item__answer-inner p {
  font-size: .9rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 12px;
}

.faq-item__answer-inner p:last-child { margin-bottom: 0; }

.faq-item__answer-inner strong {
  color: var(--white);
  font-weight: 600;
}

/* Bullet lists */
.faq-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.faq-bullet {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .875rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.faq-bullet::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  margin-top: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(52, 178, 150, .4);
}

/* Check bullets */
.faq-bullet--check::before {
  background: none;
  content: '✓';
  color: var(--teal);
  font-size: .8rem;
  font-weight: 700;
  margin-top: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  line-height: 1.65;
}

/* Highlighted value pill */
.faq-highlight {
  display: inline-block;
  padding: 2px 9px;
  background: var(--teal-glow-sm);
  border: 1px solid var(--line-teal);
  border-radius: var(--radius-xs);
  color: var(--teal);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  font-family: var(--font-body);
}

/* Comparison table */
.faq-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
}

.faq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.faq-table th {
  background: rgba(52, 178, 150, .08);
  color: var(--teal);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .68rem;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-teal);
  white-space: nowrap;
}

.faq-table td {
  padding: 11px 16px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.55;
}

.faq-table tr:last-child td { border-bottom: none; }
.faq-table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.faq-table td strong { color: var(--white); font-weight: 600; }

/* Metrics block (uptime table style) */
.faq-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding: 16px;
  background: rgba(52, 178, 150, .04);
  border: 1px solid var(--line-teal);
  border-radius: var(--radius-xs);
}

.faq-metric {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  font-size: .82rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.faq-metric:last-child { border-bottom: none; }

.faq-metric__val {
  color: var(--teal);
  font-weight: 700;
  font-family: var(--font-head);
}

.faq-metric__label { color: var(--text-soft); }
.faq-metric__note { color: var(--text-muted); font-size: .78rem; }

/* Section divider inside answer */
.faq-answer-section {
  margin: 16px 0 8px;
}

.faq-answer-section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-answer-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ─── NO RESULTS ─────────────────────────── */
.faq-no-results {
  text-align: center;
  padding: 80px 24px;
  display: none;
  max-width: 840px;
  margin: 0 auto;
}

.faq-no-results.visible { display: block; }

.faq-no-results__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--text-muted);
  opacity: .4;
}

.faq-no-results p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 8px;
}

.faq-no-results small {
  font-size: .85rem;
  color: var(--teal);
  opacity: .8;
}

/* ─── CTA SECTION ────────────────────────── */
.faq-cta {
  padding: 0 0 100px;
}

/* ─── LIGHT THEME OVERRIDES ──────────────── */
.theme-light .faq-tabs {
  background: rgba(255, 255, 255, .92);
  border-color: rgba(0, 0, 0, .08);
}

.theme-light .faq-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, .1);
}

.theme-light .faq-item.open {
  border-color: rgba(52, 178, 150, .4);
}

.theme-light .faq-item__q-text { color: var(--text); }
.theme-light .faq-item.open .faq-item__question { background: rgba(52, 178, 150, .05); }

.theme-light .faq-item__answer-inner {
  border-color: rgba(0, 0, 0, .07);
}

.theme-light .faq-search__input {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(0, 0, 0, .15);
  color: var(--text);
}

.theme-light .faq-table-wrap { border-color: rgba(0, 0, 0, .1); }
.theme-light .faq-table th { background: rgba(52, 178, 150, .07); }
.theme-light .faq-table td { border-color: rgba(0, 0, 0, .07); }
.theme-light .faq-metrics { background: rgba(52, 178, 150, .05); }
.theme-light .faq-metric { border-color: rgba(0, 0, 0, .07); }
.theme-light .faq-answer-section-title::after { background: rgba(0, 0, 0, .08); }

/* ─── RESPONSIVE ─────────────────────────── */
@media (max-width: 1024px) {
  .faq-tabs { top: 78px; }
}

@media (max-width: 768px) {
  .faq-hero { padding: 120px 0 64px; }

  .faq-tabs {
    top: 66px;
    padding: 12px 0;
  }

  .faq-section { padding: 52px 0 72px; }

  .faq-item__question { padding: 18px 18px; }

  .faq-item__answer-inner { padding: 16px 18px 22px; }

  .faq-metric {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .faq-metric__note { display: none; }
}

@media (max-width: 480px) {
  .faq-hero { padding: 100px 0 52px; }

  .faq-tabs__inner { padding-right: 20px; }

  .faq-tab { padding: 8px 14px; font-size: .75rem; }

  .faq-item__q-text { font-size: .9rem; }

  .faq-table th, .faq-table td { padding: 9px 12px; font-size: .78rem; }

  .faq-cta { padding: 0 0 72px; }
}
