/* Ayuda dentro del sistema (CAR-M-15): panel de pantalla, guía paso a paso, ayuda de ventanas
   y burbujas de los recorridos (driver.js). Usa los colores del sistema (style.css). */

/* ── Botón del libro (barra superior) ── */
.ayu-btn-guia .nav-badge { display: block; }
.ayu-btn-guia .nav-badge.d-none { display: none !important; }
/* En teléfonos style.css oculta el botón ? (title="Ayuda"); el libro sigue la misma regla */
@media (max-width: 768px) {
    .ayu-btn-guia { display: none; }
}

/* ── Textos y piezas compartidas ── */
.ayu-min0 { min-width: 0; }
.ayu-etiqueta {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--primary-color, #0253ac);
}
.ayu-subtitulo {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #475569;
    margin: 0 0 .75rem;
}
.ayu-subtitulo .bi { color: var(--primary-color, #0253ac); font-size: .95rem; }
.ayu-intro { color: #475569; }
.ayu-lead { color: #475569; font-size: .95rem; line-height: 1.6; margin-bottom: 1.25rem; }

/* Icono en recuadro con degradado (cabeceras, enlaces) */
.ayu-icono {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color, #0253ac) 0%, #3d8bd9 100%);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 6px 14px rgba(2, 83, 172, .22);
}
.ayu-icono-sm { width: 2.1rem; height: 2.1rem; border-radius: 10px; font-size: 1rem; box-shadow: none; }
.ayu-icono-lg { width: 3.2rem; height: 3.2rem; border-radius: 14px; font-size: 1.5rem; }
.ayu-icono-claro { background: #e8f1fb; color: var(--primary-color, #0253ac); }

.ayu-cabecera-suave {
    background: linear-gradient(180deg, #f2f7fd 0%, #fff 100%);
    border-bottom: 1px solid #e8eef5;
}

/* Paso a paso: números en círculo unidos por una línea */
.ayu-pasos {
    list-style: none;
    counter-reset: ayu-paso;
    padding-left: 0;
    margin: 0 0 .5rem;
    color: #334155;
}
.ayu-pasos li {
    counter-increment: ayu-paso;
    position: relative;
    min-height: 1.7rem;
    padding: .12rem 0 .9rem 2.4rem;
    line-height: 1.5;
}
.ayu-pasos li:last-child { padding-bottom: .1rem; }
.ayu-pasos li::before {
    content: counter(ayu-paso);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-color, #0253ac);
    color: var(--primary-color, #0253ac);
    font-size: .75rem;
    font-weight: 700;
}
.ayu-pasos li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(.85rem - 1px);
    top: 1.7rem;
    bottom: 0;
    width: 2px;
    border-radius: 2px;
    background: #d6e3f2;
}

/* Ten en cuenta */
.ayu-consejos { list-style: none; padding-left: 0; margin-bottom: .5rem; color: #334155; }
.ayu-consejos li { position: relative; padding-left: 1.4rem; margin-bottom: .45rem; line-height: 1.5; }
.ayu-consejos li:last-child { margin-bottom: 0; }
.ayu-consejos li::before {
    content: "";
    position: absolute;
    left: .35rem;
    top: .6em;
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
    background: #d97706;
}

.ayu-bloque { margin-bottom: 1.4rem; }
.ayu-nota {
    margin-bottom: 1.4rem;
    padding: .9rem 1rem;
    border: 1px solid #fde7b0;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    background: #fffbeb;
}
.ayu-nota .ayu-subtitulo { color: #92400e; margin-bottom: .6rem; }
.ayu-nota .ayu-subtitulo .bi { color: #d97706; }
.ayu-nota .ayu-consejos { color: #57472a; margin-bottom: 0; }

.ayu-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 2.2rem;
    padding: .12rem .4rem;
    border-radius: 6px;
    background: #eef4fb;
    color: var(--primary-color, #0253ac);
    font-size: .74rem;
    font-weight: 700;
}
.ayu-check { color: #16a34a; flex: 0 0 auto; }

/* Animación al cambiar de contenido */
.ayu-entrar { animation: ayu-entrar .28s ease-out; }
@keyframes ayu-entrar {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ayu-entrar { animation: none; }
}

/* ── Panel de la pantalla (offcanvas) ── */
.ayu-panel { width: 420px; max-width: 92vw; }
.ayu-panel .offcanvas-header { padding: 1.25rem 1.25rem 1.1rem; }
.ayu-panel .offcanvas-title { font-weight: 700; color: #0f172a; line-height: 1.25; }
.ayu-panel-cuerpo { padding: 1.25rem; }
.ayu-enlace-guia {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .75rem .9rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: .88rem;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ayu-enlace-guia:hover {
    border-color: rgba(2, 83, 172, .4);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}
.ayu-visto {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: #ecfdf3;
    color: #15803d;
    font-size: .8rem;
    font-weight: 600;
}
.ayu-panel-pie {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e8eef5;
    background: #f8fafc;
}
.ayu-panel-pie:empty { display: none; }
.ayu-panel-pie .btn-primary-custom { padding: .55rem 1rem; border-radius: 10px; font-weight: 600; }
.ayu-pie-nota { font-size: .75rem; color: #94a3b8; }

/* ── Guía paso a paso (modal) ── */
.ayu-guia { border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.ayu-guia .modal-header { padding: 1.1rem 1.5rem; align-items: center; }
.ayu-guia .modal-title { font-weight: 700; color: #0f172a; }
.ayu-guia .modal-footer { background: #f8fafc; border-top: 1px solid #e8eef5; padding: .75rem 1.5rem; }
.ayu-guia .modal-body { height: 65vh; }
.ayu-progreso { height: 6px; border-radius: 999px; background: #e2e8f0; }
.ayu-progreso .progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color, #0253ac), #3d8bd9);
    transition: width .4s ease;
}
.ayu-proxima {
    max-width: 320px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: .5rem;
    font-size: .8rem;
    color: #64748b;
}
.ayu-proxima strong { color: #334155; font-weight: 600; }

/* Índice */
.ayu-guia-indice { height: 100%; overflow-y: auto; padding: .75rem; background: #f8fafc; }
.ayu-guia-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .45rem .65rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: .84rem;
    color: #334155;
    transition: background .15s;
}
.ayu-guia-item:hover { background: rgba(2, 83, 172, .06); }
.ayu-guia-item.activa {
    background: #fff;
    color: var(--primary-color, #0253ac);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08), inset 3px 0 0 var(--primary-color, #0253ac);
}
.ayu-guia-item.nivel-0 { margin-top: .6rem; padding-top: .55rem; padding-bottom: .55rem; font-weight: 600; color: #0f172a; }
.ayu-guia-item.nivel-0:first-child { margin-top: 0; }
.ayu-guia-item.nivel-0.activa { color: var(--primary-color, #0253ac); }
.ayu-guia-item.nivel-1 { padding-left: 1.1rem; }
.ayu-guia-item.nivel-2 { padding-left: 1.9rem; }
.ayu-indice-icono {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    background: #e8f1fb;
    color: var(--primary-color, #0253ac);
    font-size: 1rem;
}
.ayu-guia-item.activa .ayu-indice-icono { background: var(--primary-color, #0253ac); color: #fff; }
.ayu-indice-cap {
    display: block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #94a3b8;
}

/* Contenido */
.ayu-guia-contenido { height: 100%; overflow-y: auto; padding: 2rem 2.5rem; background: #fff; }
.ayu-guia-cabecera {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.ayu-guia-titulo { font-weight: 700; color: #0f172a; margin: .15rem 0 0; line-height: 1.25; }
.ayu-guia-num { color: var(--primary-color, #0253ac); margin-right: .5rem; }
.ayu-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.ayu-tarjeta {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem .85rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: .86rem;
    color: #0f172a;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ayu-tarjeta:hover {
    border-color: rgba(2, 83, 172, .4);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}
.ayu-ir {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .9rem 1rem;
    border: 1px solid #dbe7f5;
    border-radius: 12px;
    background: #f5f9fe;
}

@media (max-width: 767.98px) {
    .ayu-guia .modal-body { height: auto; }
    .ayu-guia-indice { max-height: 30vh; border-bottom: 1px solid #e2e8f0; }
    .ayu-guia-contenido { padding: 1.25rem; }
    .ayu-ir { flex-wrap: wrap; }
}

/* ── Ayuda de ventanas ── */
.ayu-btn-ventana {
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    line-height: 1;
    color: var(--primary-color, #0253ac);
}
/* Marcas de la visita de ventanas */
.ayu-marca {
    display: table;
    margin: 0 0 .4rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.ayu-marca-req { background: #fee2e2; color: #b91c1c; }
.ayu-marca-opc { background: #e2e8f0; color: #475569; }
.ayu-marca-cond { background: #fef3c7; color: #92400e; }
.driver-popover.ayu-tour .ayu-pasos, .driver-popover.ayu-tour .ayu-consejos { margin: .5rem 0 0; }

/* Botón "¿Qué hago?" de los avisos de error */
.ayu-btn-error { font-size: .75rem; padding: .15rem .6rem; }

/* ── Burbujas de los recorridos (driver.js) ── */
.driver-popover.ayu-tour {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    padding: 1rem 1.1rem;
    max-width: 340px;
    font-family: inherit;
}
.driver-popover.ayu-tour .driver-popover-title { font-size: 1rem; font-weight: 700; color: #0f172a; }
.driver-popover.ayu-tour .driver-popover-description { font-size: .88rem; color: #475569; line-height: 1.45; }
.driver-popover.ayu-tour .driver-popover-footer {
    margin-top: .9rem;
    padding-top: .7rem;
    border-top: 1px solid #f1f5f9;
}
.driver-popover.ayu-tour .driver-popover-progress-text { font-size: .75rem; color: #94a3b8; }
.driver-popover.ayu-tour .driver-popover-footer button {
    text-shadow: none;
    font-size: .8rem;
    border-radius: 10px;
    padding: .35rem .8rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--primary-color, #0253ac);
}
.driver-popover.ayu-tour .driver-popover-footer button.driver-popover-next-btn {
    background: var(--primary-color, #0253ac);
    border-color: var(--primary-color, #0253ac);
    color: #fff;
}
.driver-popover.ayu-tour .driver-popover-footer button:disabled { opacity: .45; }
.driver-popover.ayu-tour .driver-popover-close-btn { color: #94a3b8; border-radius: 8px; }
