/* Desplazamiento a respuestas en móvil (evita que el navbar tape el inicio) */
@media (max-width: 767.98px) {
    #wizard-paso-4,
    #wizard-resultado-ancla,
    #wizard-error-calcular,
    #wizard-paso-3-cargando,
    #prompt-respuesta-card,
    #busqueda-ia-resultado,
    #busqueda-ia-alerta {
        scroll-margin-top: 4.5rem;
    }
}

/* Stepper liviano — móvil y escritorio */
.ri-stepper-wrap {
    --ri-azul: #0d6efd;
    --ri-verde: #16a34a;
    --ri-borde: #e9ecef;
}

/* Migas compactas (sustituye círculos grandes) */
.stepper-trail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .35rem;
    font-size: .8rem;
    color: #6c757d;
    margin-bottom: .75rem;
    min-height: 1.25rem;
}
.stepper-trail .trail-chip {
    border: 1px solid var(--ri-borde);
    background: #fff;
    border-radius: 999px;
    padding: .2rem .55rem;
    color: #495057;
    cursor: pointer;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stepper-trail .trail-chip.done { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.stepper-trail .trail-chip.active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }
.stepper-trail .trail-sep { color: #ced4da; user-select: none; }

.stepper-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .65rem;
    color: #212529;
}

.stepper-search { position: relative; margin-bottom: .65rem; }
.stepper-search-bajo { margin-top: .5rem; margin-bottom: 0; }
.stepper-acciones-mapa { margin: .65rem 0 .25rem; }
.stepper-mapa-aviso { line-height: 1.3; }
.stepper-search .form-control {
    border-radius: 10px;
    padding: .5rem .75rem .5rem 2.25rem;
    font-size: .95rem;
}
.stepper-search .stepper-search-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    pointer-events: none;
}
.stepper-sinresultados, .stepper-vacio, .stepper-cargando {
    color: #6c757d;
    font-size: .9rem;
    padding: .35rem 0;
}
.stepper-aviso-lista { font-size: .8rem; color: #6c757d; margin-bottom: .5rem; }

.stepper-skip-piso {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0;
    margin-bottom: .65rem;
    text-decoration: none;
    font-size: .875rem;
}

/* Opciones: chips livianos */
.stepper-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .25rem;
}
.opt-btn {
    border: 1px solid var(--ri-borde);
    background: #fff;
    color: #212529;
    border-radius: 10px;
    padding: .5rem .75rem;
    font-weight: 500;
    font-size: .9rem;
    cursor: pointer;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-align: left;
    transition: border-color .12s, background .12s, box-shadow .12s;
}
.opt-btn:hover { border-color: #adb5bd; background: #f8f9fa; }
.opt-btn.selected {
    border-color: var(--ri-azul);
    background: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}
.opt-btn .bi { font-size: 1rem; opacity: .85; }
.opt-sede .bi { color: #4f46e5; }
.opt-edificio .bi { color: #e11d48; }
.opt-piso .bi { color: #0ea5e9; }
.opt-lugar .bi { color: #16a34a; }

/* Category Cards: sede / edificio / piso (origen y destino) */
.stepper-options.stepper-category-cards {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: .55rem;
}
.stepper-category-cards .opt-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-height: 3.25rem;
}
.stepper-category-cards .opt-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.stepper-category-cards .opt-card.selected {
    border-color: var(--ri-azul);
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, .25);
}
.stepper-category-cards .opt-card-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
}
.stepper-category-cards .opt-card-icon .bi {
    font-size: 1.15rem;
    opacity: 1;
}
.stepper-category-cards .opt-sede .opt-card-icon { background: #eef2ff; }
.stepper-category-cards .opt-edificio .opt-card-icon { background: #fff1f2; }
.stepper-category-cards .opt-piso .opt-card-icon { background: #e0f2fe; }
.stepper-category-cards .opt-card-title {
    flex: 1 1 auto;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    min-width: 0;
}
.stepper-category-cards .opt-card-chevron {
    color: #94a3b8;
    font-size: 1rem;
    flex-shrink: 0;
}
.stepper-category-cards .opt-card.selected .opt-card-chevron {
    color: var(--ri-azul);
}

/* Lugares: lista vertical (sin deslizar a la izquierda) */
.stepper-options.stepper-options-lista {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: .45rem;
}
.stepper-options-lista .opt-btn {
    width: 100%;
    justify-content: flex-start;
}

.stepper-nav {
    display: flex;
    margin-top: .75rem;
}
.stepper-nav .btn-atras {
    border: 0;
    background: transparent;
    color: #6c757d;
    padding: .25rem 0;
    font-size: .875rem;
    font-weight: 500;
}
.stepper-nav .btn-atras:disabled { opacity: .35; }

.stepper-resumen {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: .65rem .85rem;
}
.stepper-resumen .check {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--ri-verde); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: .85rem;
}
.stepper-resumen .sel-nombre { font-weight: 600; font-size: .95rem; }
.stepper-resumen .sel-ruta { font-size: .75rem; color: #6c757d; }
.stepper-resumen .btn-cambiar {
    margin-left: auto;
    background: #fff; color: var(--ri-verde);
    border: 1px solid var(--ri-verde); border-radius: 999px;
    padding: .25rem .65rem; font-size: .8rem; font-weight: 600; cursor: pointer;
}

.stepper-bloqueado {
    color: #6c757d; background: #f8f9fa;
    border: 1px dashed #dee2e6; border-radius: 10px;
    padding: .75rem; text-align: center; font-size: .9rem;
}

/* Tarjetas del formulario guiado */
.ri-guiado-card { border: 1px solid #eee !important; box-shadow: none !important; }
.ri-guiado-card .card-body { padding: 1rem !important; }
.ri-guiado-titulo { font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; }

/* Escritorio: category cards en 2 columnas; lugares en lista */
@media (min-width: 768px) {
    .stepper-options.stepper-category-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .6rem;
    }
    .stepper-options.stepper-options-lista {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: .5rem;
    }
    .stepper-titulo { font-size: 1.05rem; }
}

/* Móvil */
@media (max-width: 767.98px) {
    .container.ri-publico { padding-top: 1rem !important; padding-bottom: 1.5rem !important; }

    .stepper-category-cards .opt-card {
        padding: .95rem 1rem;
        min-height: 3.5rem;
    }
    .stepper-category-cards .opt-card-title {
        font-size: 1.05rem;
    }

    /* Legacy: si quedara ri-scroll-x, no forzar scroll horizontal en pisos */
    .stepper-options.ri-scroll-x:not(.stepper-category-cards) {
        flex-wrap: wrap;
        overflow-x: visible;
    }
    .stepper-scroll-hint {
        display: none;
    }
}

/* Piso y lugar: buscador siempre visible */
.stepper-busca-activo .stepper-search { display: block !important; }

.ri-paso-texto { font-size: .95rem; }
@media (min-width: 768px) {
    .ri-paso-texto { font-size: 1.05rem; }
}
