/* Centro de ayuda (/ayuda/). Usa los tokens y piezas de /subpages.css.
   Las páginas las genera reservai-herramientas/generadores/ayuda_web.py (repo reservai-hq). */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 16px; border-radius: 10px;
  background: #fff; color: var(--primary); font-weight: 700;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

/* ── Cabecera ── */
.help-head { padding-bottom: 48px; }
.help-head .topbar { margin-bottom: 40px; }
.help-head .page-title h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); }
.help-home .help-head .page-title h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); }

.help-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; }
.help-crumbs li { color: var(--text-on-blue); }
.help-crumbs li + li::before { content: "›"; margin-right: 6px; opacity: 0.7; }
.help-crumbs a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.help-crumbs a:hover { text-decoration-color: #fff; }

/* ── Buscador ── */
.help-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 28px;
  max-width: 640px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 18px 40px -18px rgba(3, 24, 72, 0.6);
}
.help-search-icon { position: absolute; left: 18px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.help-search input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 12px 0 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}
.help-search input::placeholder { color: var(--muted); }
.help-search input:focus { outline: none; }
.help-search:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55), 0 18px 40px -18px rgba(3, 24, 72, 0.6); }
.help-search button {
  margin-right: 6px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.help-search button:hover { background: var(--primary-700); }
.help-search-compact { margin-top: 22px; max-width: 460px; }
.help-search-compact input { height: 46px; font-size: 0.95rem; }
.help-search-compact button { min-height: 36px; padding: 0 16px; font-size: 0.9rem; }

/* ── Portada ── */
.help-main { padding: 48px 0 88px; }

.help-chips ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.help-chips a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--tint); color: var(--primary);
  font-weight: 700; font-size: 0.9rem; box-shadow: inset 0 0 0 1px var(--line);
}
.help-chips a:hover { background: var(--primary-soft); }

.help-section { padding-top: 44px; scroll-margin-top: 16px; }
.help-section h2 { font-size: 1.45rem; line-height: 1.2; }
.help-section-desc { margin-top: 6px; color: var(--muted); line-height: 1.6; }

.help-cards { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.help-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 16px 18px; border-radius: var(--radius-md);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 26px -18px rgba(6, 34, 92, 0.35);
  transition: box-shadow 200ms ease, transform 160ms var(--ease-out);
}
.help-card:hover { box-shadow: inset 0 0 0 1px rgba(11, 79, 192, 0.45), 0 16px 32px -18px rgba(6, 34, 92, 0.45); }
.help-card:active { transform: scale(0.99); }
.help-card-title { font-weight: 700; color: var(--ink); line-height: 1.35; }
.help-card-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

/* ── Resultados del buscador ── */
.help-results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.help-results-head h2 { font-size: 1.3rem; }
.help-results-clear { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.help-results ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.help-results .help-card small { font-size: 0.78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.help-results mark { background: var(--primary-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.help-noresults { padding: 22px; border-radius: var(--radius-md); background: var(--tint); color: var(--ink-soft); line-height: 1.6; }

/* ── Artículo ── */
.help-main.has-toc { width: min(1060px, calc(100% - 40px)); }
.has-toc .help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.help-article.prose { padding: 0; }
.help-article h2 { scroll-margin-top: 16px; }
.help-article h3 { font-size: 1.08rem; line-height: 1.3; margin: 30px 0 10px; letter-spacing: -0.02em; scroll-margin-top: 16px; }
.help-article h2 + h3 { margin-top: 14px; }
.help-article p + h3, .help-article ul + h3, .help-article ol + h3 { margin-top: 28px; }
.help-article ul + ul, .help-article p + .table-wrap { margin-top: 12px; }
.help-article ul + p, .help-article ol + p, .help-article .callout + p, .help-article figure + p { margin-top: 14px; }

.help-toc {
  position: sticky; top: 20px;
  padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--tint); box-shadow: inset 0 0 0 1px var(--line);
}
.help-toc-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: 0.9rem; color: var(--ink); margin-bottom: 8px; }
.help-toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { display: block; padding: 5px 0; font-size: 0.9rem; line-height: 1.4; color: var(--ink-soft); font-weight: 600; }
.help-toc a:hover { color: var(--primary); }

/* Pasos numerados */
.prose ol.steps { list-style: none; padding-left: 0; counter-reset: paso; gap: 10px; }
.prose ol.steps > li { counter-increment: paso; position: relative; padding-left: 42px; min-height: 30px; }
.prose ol.steps > li::before {
  content: counter(paso);
  position: absolute; left: 0; top: 0.1em;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-family: "Sora", sans-serif; font-weight: 800; font-size: 0.85rem;
}
.prose p + ol.steps, .prose ol.steps + p { margin-top: 14px; }

/* Avisos */
.callout {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--tint);
  border-left: 4px solid var(--primary);
}
.callout p { font-size: 0.97rem; }
.callout p + p { margin-top: 8px; }
.callout-tip { background: #ecfbf2; border-left-color: #1a9e55; }
.callout-warn { background: #fff7e8; border-left-color: #d98a00; }

/* Capturas */
.prose figure { margin: 22px 0; }
.prose figure img {
  display: block; width: 100%; height: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(6, 34, 92, 0.45);
  background: var(--tint);
}
.prose figure.shot-tall img { max-width: 320px; margin: 0 auto; }
.prose figcaption { margin-top: 8px; font-size: 0.86rem; color: var(--muted); text-align: center; line-height: 1.5; }

/* Anterior / siguiente */
.help-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.help-pn {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 18px; border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 200ms ease;
}
.help-pn:hover { box-shadow: inset 0 0 0 1px rgba(11, 79, 192, 0.45); }
.help-pn small { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.help-pn span { font-weight: 700; color: var(--primary); line-height: 1.35; }
.help-pn-prev small::before { content: "← "; }
.help-pn-next { text-align: right; grid-column: 2; }
.help-pn-next small::after { content: " →"; }

/* Contacto */
.help-contact {
  margin-top: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 30px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.help-contact h2 { font-size: 1.35rem; margin-bottom: 6px; color: #fff; }
.help-contact p { color: var(--text-on-blue); font-size: 0.95rem; line-height: 1.6; max-width: 46ch; }
.help-contact-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .has-toc .help-layout { display: block; }
  .help-toc { position: static; margin-bottom: 32px; }
}

@media (max-width: 720px) {
  .help-head { padding-bottom: 36px; }
  .help-main { padding: 32px 0 64px; }
  .help-cards, .help-prevnext { grid-template-columns: 1fr; }
  .help-pn-next { grid-column: auto; }
  .help-prevnext > span:empty { display: none; }
  .help-contact { flex-direction: column; align-items: stretch; padding: 24px 20px; }
  .help-contact-actions .btn-wa, .help-contact-actions .btn-ghost { white-space: normal; }
}

@media (max-width: 480px) {
  .wrap, .narrow, .help-main.has-toc { width: calc(100% - 32px); }
  .topbar-home { display: none; }
  .help-search input { height: 50px; font-size: 16px; }
  .help-search button { padding: 0 14px; }
  .help-search:not(.help-search-compact) input::placeholder { font-size: 0.9rem; }
}

/* Texto de un mensaje de WhatsApp (bloques ``` del Markdown) */
.help-msg {
  margin: 16px 0;
  padding: 14px 16px;
  max-width: 460px;
  border-radius: 4px 14px 14px 14px;
  background: #fff;
  box-shadow: 0 0 0 10px #e5ddd5, 0 1px 1px rgba(0, 0, 0, 0.12);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prose .help-msg { margin: 26px 10px; }
.help-msg code { background: none; padding: 0; font-family: "Plus Jakarta Sans", sans-serif; font-size: inherit; color: inherit; }

/* Modo app (?app=1, ver ayuda.js): fuera los artículos de alta y pagos */
.help-app [data-app="false"]:not(body) { display: none !important; }
.help-app li:has(> [data-app="false"]) { display: none !important; }
.help-app body[data-app="false"] main::before {
  content: "Este artículo es del panel web.";
  display: block;
  margin-bottom: 16px;
  font-weight: 700;
}

/* Cabecera en blanco (2-nov-2026): migas y buscador sobre fondo claro */
.help-crumbs li { color: var(--muted); }
.help-crumbs a { color: var(--ink); text-decoration-color: rgba(13, 26, 58, 0.25); }
.help-crumbs a:hover { text-decoration-color: var(--ink); }
.help-search { box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -22px rgba(6, 34, 92, 0.45); }
.help-search:focus-within { box-shadow: 0 0 0 3px var(--primary-soft), 0 18px 40px -22px rgba(6, 34, 92, 0.45); }
