/* ---------------------------------------------------------------------------
 * Visor de resultados por distancia (SPEC 02)
 * Todos los estilos estan scopeados bajo .lt-res / prefijo lt-res- para no
 * pisar Bootstrap, freelancer.css ni estilos.css.
 * --------------------------------------------------------------------------- */

.lt-res {
    padding: 2rem 1rem 1rem;
    background: #f8f9fa;
    color: #212529;
}

.lt-res .lt-res-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.lt-res .lt-res-hidden {
    display: none !important;
}

/* -- Foco visible (SPEC 03, Paso 4) ---------------------------------------- */
.lt-res .lt-res-dist:focus-visible,
.lt-res .lt-res-gbtn:focus-visible,
.lt-res .lt-res-select:focus-visible,
.lt-res .lt-res-input:focus-visible,
.lt-res .lt-res-cert:focus-visible {
    outline: 2px solid #ff6b56;
    outline-offset: 2px;
}

/* -- Cabecera del evento ---------------------------------------------------- */
.lt-res .lt-res-cab {
    text-align: center;
    margin-bottom: 1.75rem;
}

.lt-res .lt-res-badge {
    display: inline-block;
    color: #ff6b56;
    border: 1px solid rgba(255, 107, 86, .4);
    background: rgba(255, 107, 86, .08);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.lt-res .lt-res-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #212529;
    margin: 0;
}

.lt-res .lt-res-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem 1.4rem;
    font-size: 13px;
    color: #6c757d;
    margin-top: 10px;
}

.lt-res .lt-res-meta-sub {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 5px;
}

.lt-res .lt-res-divider {
    width: 60px;
    height: 5px;
    background: #ff6b56;
    border-radius: 5px;
    margin: 16px auto 0;
}

/* -- Tarjetas de distancia -------------------------------------------------- */
.lt-res .lt-res-dists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.lt-res .lt-res-dist {
    background: #f1f2f3;
    border: 0;
    border-top: 3px solid transparent;
    border-radius: 12px;
    padding: .9rem .6rem;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: all .2s;
    font-family: inherit;
}

.lt-res .lt-res-dist:hover {
    background: #e9eaec;
}

.lt-res .lt-res-dist.is-active {
    background: #fff;
    border-top-color: #ff6b56;
}

.lt-res .lt-res-dist-name {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.lt-res .lt-res-dist-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    color: #212529;
}

.lt-res .lt-res-dist-sub {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #2f9e44;
    text-transform: uppercase;
}

/* -- Panel principal: filtros + stats + tabla ------------------------------- */
.lt-res .lt-res-panel {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    padding: 1.25rem 1.5rem;
}

.lt-res .lt-res-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}

.lt-res .lt-res-select {
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    cursor: pointer;
    max-width: 100%;
    font-family: inherit;
}

.lt-res .lt-res-select:focus {
    outline: none;
    border-color: #ff6b56;
    box-shadow: 0 0 0 2px rgba(255, 107, 86, .15);
}

.lt-res .lt-res-gender {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.lt-res .lt-res-gbtn {
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    color: #555;
    border: 0;
    transition: all .15s;
    font-family: inherit;
}

.lt-res .lt-res-gbtn.is-active {
    background: #212529;
    color: #fff;
}

.lt-res .lt-res-search {
    position: relative;
    flex: 1;
    min-width: 190px;
    max-width: 330px;
}

.lt-res .lt-res-search .fa {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 13px;
    pointer-events: none;
}

.lt-res .lt-res-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    font-size: 13px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    font-family: inherit;
}

.lt-res .lt-res-input:focus {
    outline: none;
    border-color: #ff6b56;
    box-shadow: 0 0 0 2px rgba(255, 107, 86, .15);
}

.lt-res .lt-res-count {
    margin-left: auto;
    font-size: 12px;
    color: #adb5bd;
}

/* -- Stats de la distancia activa ------------------------------------------ */
.lt-res .lt-res-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-bottom: 1rem;
}

.lt-res .lt-res-stat {
    background: #fff;
    border: 1px solid #e9ecef;
    border-top: 2px solid #ff6b56;
    border-radius: 12px;
    padding: .8rem 1rem;
    min-width: 0;
    overflow: hidden;
}

.lt-res .lt-res-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #adb5bd;
    margin-bottom: 5px;
}

.lt-res .lt-res-stat-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 17px;
    font-weight: 800;
    color: #212529;
}

.lt-res .lt-res-stat-sub {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -- Tabla ------------------------------------------------------------------ */
.lt-res .lt-res-table-wrap,
.lt-res .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.lt-res .lt-res-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 0;
}

.lt-res .lt-res-table thead th {
    background: #f0f0ee;
    padding: 9px 12px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #e0e0e0;
    border-top: 0;
    white-space: nowrap;
    vertical-align: middle;
}

.lt-res .lt-res-table tbody td {
    padding: 9px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #ebebeb;
    border-top: 0;
}

.lt-res .lt-res-table tbody tr:hover {
    background: #fff8f4;
}

.lt-res .lt-res-table .lt-res-num {
    text-align: center;
}

.lt-res .lt-res-table .lt-res-right {
    text-align: right;
}

/* Badge de posicion */
.lt-res .lt-res-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: #f0f0ee;
    color: #888;
    border: 1px solid #ddd;
}

.lt-res .lt-res-pos-gold {
    background: #fff3cd;
    color: #7a5500;
    border-color: #e8c200;
}

.lt-res .lt-res-pos-silver {
    background: #efefef;
    color: #555;
    border-color: #bbb;
}

.lt-res .lt-res-pos-bronze {
    background: #fde8dc;
    color: #7a3200;
    border-color: #c97a45;
}

/* Posicion de categoria vacia: guion sin badge */
.lt-res .lt-res-pos-none {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #ced4da;
}

/* Absorbido por el esquema no acumulativo */
.lt-res .lt-res-absorbed {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: #ff6b56;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    margin-top: 2px;
}

.lt-res .lt-res-dorsal {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #adb5bd;
    text-align: center;
}

.lt-res .lt-res-name {
    font-weight: 600;
    color: #212529;
}

.lt-res .lt-res-sub {
    font-size: 11px;
    color: #bbb;
    margin-top: 1px;
}

.lt-res .lt-res-cat,
.lt-res .lt-res-sex {
    display: inline-block;
    font-size: 10px;
    padding: 2px 9px;
    border-radius: 10px;
    font-weight: 700;
}

.lt-res .lt-res-cat.is-f,
.lt-res .lt-res-sex.is-f {
    background: #fce8f3;
    color: #9c1b6e;
}

.lt-res .lt-res-cat.is-m,
.lt-res .lt-res-sex.is-m {
    background: #e8f0fe;
    color: #1a56c4;
}

.lt-res .lt-res-time {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 700;
    color: #212529;
}

.lt-res .lt-res-pace {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #999;
}

.lt-res .lt-res-chip {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #ccc;
}

/* -- Estado vacio y footer del visor --------------------------------------- */
.lt-res .lt-res-empty {
    padding: 3rem;
    text-align: center;
    color: #adb5bd;
}

.lt-res .lt-res-footer {
    margin-top: 1.5rem;
    padding: 1.1rem 1.5rem .2rem;
    border-top: 1px solid #e9ecef;
    text-align: center;
    font-size: 11px;
    color: #bbb;
}

/* -- Responsive: cabecera y footer (SPEC 03, Paso 1) ------------------------- */
@media (max-width: 600px) {
    .lt-res .lt-res-title {
        font-size: 1.4rem;
    }

    .lt-res .lt-res-meta {
        flex-direction: column;
        align-items: center;
        gap: .2rem;
    }

    .lt-res .lt-res-meta-sub {
        word-break: break-word;
    }

    .lt-res .lt-res-cab {
        margin-bottom: 1.25rem;
    }

    .lt-res .lt-res-footer {
        font-size: 10px;
        padding: .8rem 1rem .2rem;
    }

    /* Tarjetas de distancia y stats: 2 por fila */
    .lt-res .lt-res-dists,
    .lt-res .lt-res-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Filtros apilados y busqueda a ancho completo */
    .lt-res .lt-res-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .lt-res .lt-res-search {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .lt-res .lt-res-count {
        margin-left: 0;
        text-align: center;
        width: 100%;
    }

    .lt-res .lt-res-gender {
        width: 100%;
    }

    .lt-res .lt-res-gbtn {
        flex: 1;
    }

    .lt-res .lt-res-select {
        width: 100%;
    }

    .lt-res .lt-res-input {
        box-sizing: border-box;
        max-width: 100%;
    }
}

@media (max-width: 375px) {
    .lt-res .lt-res-title {
        font-size: 1.25rem;
    }

    .lt-res {
        padding: 1.5rem .75rem 1rem;
    }
}

.lt-res-cert{ display:inline-block; font-size:12px; padding:4px 8px; border:1px solid #ddd; border-radius:4px; text-decoration:none; color:#1e3365; white-space:nowrap; }
.lt-res-cert:hover{ background:#f5f5f5; text-decoration:none; color:#1e3365; }


/* -- Lista de tarjetas compactas (SPEC 05) ---------------------------------- */
.lt-res .lt-res-cards {
    display: none;
}

.lt-res .lt-res-card {
    padding: 10px 12px;
    border-bottom: 1px solid #ebebeb;
    background: #fff;
    transition: background .15s;
}

.lt-res .lt-res-card:hover {
    background: #fff8f4;
}

.lt-res .lt-res-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lt-res .lt-res-card-head .lt-res-time {
    flex: 0 0 auto;
    white-space: nowrap;
}

.lt-res .lt-res-card-main {
    flex: 1;
    min-width: 0;
}

.lt-res .lt-res-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 6px;
}

.lt-res .lt-res-card-meta .lt-res-pace,
.lt-res .lt-res-card-meta .lt-res-chip {
    font-size: 12px;
    flex: 0 0 auto;
}

.lt-res .lt-res-card-meta .lt-res-chip {
    color: #999;
}

.lt-res .lt-res-card-meta .lt-res-cert {
    flex: 0 0 auto;
}

.lt-res .lt-res-card-meta .lt-res-absorbed {
    flex-basis: 100%;
}

/* Media query 767.98px: tarjetas en movil, tabla oculta */
@media (max-width: 767.98px) {
    .lt-res .lt-res-table-wrap {
        display: none !important;
    }

    .lt-res .lt-res-cards {
        display: block;
    }
}
