@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary:        #ec4899;
    --primary-dark:   #db2777;
    --primary-light:  #fce7f3;
    --primary-muted:  rgba(236, 72, 153, 0.1);
    --blue:           #0284c7;
    --blue-light:     #e0f2fe;
    --bg-body:        #f8fafc;
    --bg-card:        #ffffff;
    --text-main:      #0f172a;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --border:         #e2e8f0;
    --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 14px rgba(0,0,0,0.08);
    --shadow-lg:      0 10px 28px rgba(0,0,0,0.09);
    --radius:         12px;
    --radius-lg:      16px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--primary); transition: color 0.2s; }

/* ─── ANIMACIÓN ENTRADA ──────────────────────────────────── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ayuda-main { animation: slideUp 0.45s ease-out; }

/* ─── HERO (nivel raíz) ──────────────────────────────────── */
.ayuda-hero {
    background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
    border-bottom: 1px solid var(--border);
    padding: 52px 20px 44px;
    text-align: center;
}

.ayuda-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.ayuda-icon-wrap {
    width: 52px; height: 52px;
    background: var(--primary-muted);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.ayuda-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.ayuda-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 30px;
}

/* Buscador hero */
.search-wrap { max-width: 680px; margin: 0 auto; }

.search-form {
    display: flex;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(236,72,153,0.12);
}

.search-select {
    background: transparent;
    border: none;
    border-right: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 12px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    max-width: 38%;
    cursor: pointer;
}
.search-select option { color: var(--text-main); }

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    padding: 12px 18px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}
.search-input::placeholder { color: var(--text-light); }

.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 50px;
    margin: 5px;
    display: flex; align-items: center; gap: 7px;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}
.search-btn:hover { background: var(--primary-dark); transform: scale(1.02); }

/* ─── HEADER COMPACTO (niveles internos) ─────────────────── */
.ayuda-header-compact {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-compact-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.ayuda-logo-small {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text-main); flex-shrink: 0;
}
.ayuda-logo-small .icon-sm {
    width: 34px; height: 34px;
    background: var(--primary-muted);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.ayuda-logo-small span { font-weight: 700; font-size: 0.95rem; }

.search-form-compact {
    flex: 1;
    display: flex;
    background: var(--bg-body);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    max-width: 500px;
    transition: border-color 0.2s;
}
.search-form-compact:focus-within { border-color: var(--primary); }
.search-form-compact input {
    flex: 1; border: none; background: transparent;
    padding: 8px 16px; font-size: 0.9rem; font-family: inherit;
    color: var(--text-main); outline: none;
}
.search-form-compact input::placeholder { color: var(--text-light); }
.search-form-compact button {
    background: none; border: none; padding: 8px 14px;
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center;
    transition: color 0.2s;
}
.search-form-compact button:hover { color: var(--primary); }

/* ─── CONTENEDOR PRINCIPAL ───────────────────────────────── */
.ayuda-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    font-size: 0.875rem; color: var(--text-muted);
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.breadcrumb a { color: var(--text-muted); font-weight: 500; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-light); margin: 0 2px; }
.breadcrumb .current { color: var(--text-main); font-weight: 600; }

/* ─── GRID DE CATEGORÍAS (nivel 1) ──────────────────────── */
.grid-categorias {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.tarjeta-categoria {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex; flex-direction: column; gap: 10px;
    text-decoration: none; color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}
.tarjeta-categoria::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.25s;
}
.tarjeta-categoria:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.tarjeta-categoria:hover::before { opacity: 1; }

.cat-icono {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cat-icono.tipo-pregunta { background: var(--primary-muted); color: var(--primary); }
.cat-icono.tipo-nota     { background: var(--blue-light);    color: var(--blue); }

.cat-titulo { font-size: 1.05rem; font-weight: 700; color: var(--text-main); line-height: 1.3; }
.cat-desc   { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; flex: 1; }

.cat-footer {
    display: flex; align-items: center; justify-content: space-between; margin-top: 4px;
}
.cat-badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.cat-badge.pregunta { background: var(--primary-muted); color: var(--primary); }
.cat-badge.nota     { background: var(--blue-light);    color: var(--blue); }

.cat-arrow {
    width: 28px; height: 28px;
    background: var(--primary-muted);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.tarjeta-categoria:hover .cat-arrow { background: var(--primary); color: #fff; transform: translateX(3px); }

/* ─── ENCABEZADO DE SECCIÓN (nivel 2) ────────────────────── */
.seccion-header {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.seccion-header h2 { font-size: 1.45rem; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.seccion-header p  { color: var(--text-muted); font-size: 0.95rem; }

/* ─── LISTA DE ARTÍCULOS (nivel 2) ───────────────────────── */
.lista-articulos { display: flex; flex-direction: column; gap: 10px; }

.item-articulo {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 20px;
    text-decoration: none; color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.item-articulo:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateX(4px); }

.art-icono {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.art-icono.tipo-pregunta { background: var(--primary-muted); color: var(--primary); }
.art-icono.tipo-nota     { background: var(--blue-light);    color: var(--blue); }

.art-info  { flex: 1; min-width: 0; }
.art-titulo { font-weight: 600; font-size: 1rem; color: var(--text-main); display: block; }
.art-desc   { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; display: block; }

.art-seccion { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 12px; margin-left: 8px; vertical-align: middle; display: inline; }
.art-seccion.pregunta { background: var(--primary-muted); color: var(--primary); }
.art-seccion.nota     { background: var(--blue-light);    color: var(--blue); }

.art-arrow { color: var(--text-light); transition: color 0.2s, transform 0.2s; flex-shrink: 0; }
.item-articulo:hover .art-arrow { color: var(--primary); transform: translateX(3px); }

.sin-resultados {
    text-align: center; padding: 48px 20px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-lg); color: var(--text-muted);
}
.sin-resultados p { font-size: 1rem; margin-top: 12px; }

/* ─── ARTÍCULO / CONTENIDO (nivel 3) ─────────────────────── */
.articulo-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.articulo-titulo { font-size: 1.65rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; line-height: 1.25; }
.articulo-desc   { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }

.rich-content { font-size: 1rem; color: var(--text-main); line-height: 1.8; }
.rich-content h1,.rich-content h2,.rich-content h3 { color: var(--text-main); margin: 28px 0 12px; font-weight: 700; }
.rich-content h2 { font-size: 1.2rem; }
.rich-content h3 { font-size: 1.05rem; }
.rich-content p  { margin-bottom: 14px; }
.rich-content a  { color: var(--primary); text-decoration: underline; }
.rich-content ul,.rich-content ol { padding-left: 22px; margin-bottom: 14px; }
.rich-content li { margin-bottom: 6px; }
.rich-content img {
    max-width: 100%; height: auto; border-radius: 10px;
    margin: 16px 0; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.rich-content strong { font-weight: 700; }
.rich-content code  { background: #f1f5f9; border-radius: 4px; padding: 2px 6px; font-size: 0.9em; }
.rich-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 12px 20px; margin: 16px 0;
    background: var(--primary-muted);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
}

/* ─── PASO SIGUIENTE ─────────────────────────────────────── */
.paso-siguiente { margin-top: 36px; }
.paso-siguiente-label { font-size: 0.78rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }

.paso-siguiente-link {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    background: #fff; border: 1.5px solid var(--border);
    border-radius: var(--radius-lg); text-decoration: none;
    box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.paso-siguiente-link:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.paso-siguiente-info  { flex: 1; padding-right: 16px; }
.paso-siguiente-titulo { font-weight: 700; color: var(--text-main); font-size: 1.05rem; margin-bottom: 3px; }
.paso-siguiente-desc   { font-size: 0.875rem; color: var(--text-muted); }
.paso-siguiente-icono {
    width: 40px; height: 40px; background: var(--primary-muted);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--primary); flex-shrink: 0; transition: background 0.2s, color 0.2s;
}
.paso-siguiente-link:hover .paso-siguiente-icono { background: var(--primary); color: #fff; }

/* ─── BOTÓN EDITAR ADMIN ─────────────────────────────────── */
.btn-editar-admin {
    position: absolute; top: 16px; right: 16px;
    font-size: 0.78rem; padding: 5px 11px;
    background: var(--primary-muted); border: 1px solid var(--primary);
    border-radius: 8px; color: var(--primary); font-weight: 600;
    text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
    transition: all 0.2s; z-index: 2;
}
.btn-editar-admin:hover { background: var(--primary); color: #fff; }

/* ─── BOTONES DE NAVEGACIÓN ──────────────────────────────── */
.btn-volver {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
    text-decoration: none; margin-top: 24px;
    padding: 8px 18px; border-radius: 50px;
    border: 1px solid var(--border);
    background: #fff; box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.btn-volver:hover { color: var(--primary); border-color: var(--primary); transform: translateX(-2px); }

.link-inicio {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    color: var(--text-light); font-size: 0.875rem; font-weight: 500;
    text-decoration: none; margin-top: 28px; padding: 10px;
    border-radius: 8px; transition: color 0.2s;
}
.link-inicio:hover { color: var(--primary); }

/* ─── FOOTER MÍNIMO ──────────────────────────────────────── */
.ayuda-footer {
    text-align: center; padding: 20px 0 0;
    font-size: 0.8rem; color: var(--text-light);
    border-top: 1px solid var(--border); margin-top: 48px;
}
.ayuda-footer a { color: var(--text-light); }
.ayuda-footer a:hover { color: var(--primary); }

/* ─── PORTAL SWITCHER ────────────────────────────────────── */
.ps-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #cbd5e1;
    margin-bottom: 8px;
}
.portal-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 6px;
    margin-bottom: 12px;
}
.ps-sep {
    color: #cbd5e1;
    font-size: 0.65rem;
    user-select: none;
    line-height: 1;
}
.ps-btn {
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    letter-spacing: 0.01em;
    transition: background 0.18s, color 0.18s;
    color: #94a3b8;
    white-space: nowrap;
}
.ps-btn:hover { color: #475569; }
.ps-particulares:hover,
.ayuda-footer .ps-particulares:hover { color: #6366f1; }
.ps-revendedores:hover,
.ayuda-footer .ps-revendedores:hover { color: #10b981; }
.ps-ayuda:hover,
.ayuda-footer .ps-ayuda:hover        { color: #ec4899; }
.ps-particulares.ps-active { background: #eef2ff; color: #6366f1; }
.ps-revendedores.ps-active { background: #ecfdf5; color: #10b981; }
.ps-ayuda.ps-active        { background: rgba(236,72,153,0.1); color: #ec4899; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .ayuda-hero { padding: 32px 16px 26px; }
    .ayuda-logo h1 { font-size: 1.5rem; }
    .ayuda-subtitle { font-size: 0.95rem; margin-bottom: 20px; }
    .search-select { display: none; }
    .grid-categorias { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
    .tarjeta-categoria { padding: 18px; }
    .ayuda-main { padding: 20px 16px 48px; }
    .articulo-wrap { padding: 20px 18px; }
    .articulo-titulo { font-size: 1.3rem; }
    .ayuda-header-compact { padding: 10px 14px; }
    .header-compact-inner { gap: 10px; }
    .ayuda-logo-small span { display: none; }
    .seccion-header { padding: 16px 18px; }
    .seccion-header h2 { font-size: 1.2rem; }
}

@media (max-width: 400px) {
    .search-btn span { display: none; }
    .search-btn { padding: 10px 14px; }
}

/* Override: evitar herencia de reglas del footer que afecten el switcher */
.portal-switcher .ps-btn {
    display: inline;
    margin-bottom: 0;
    font-size: 0.72rem;
    padding-left: 11px;
}
.portal-switcher .ps-btn:hover {
    padding-left: 11px;
    color: var(--primary);
}
