/* =====================================================================
   Listado de Ejercicios (tarea #61) – mismo lenguaje que el Body Map
   Marca Workfit: carbón #313537 + lima #C2F858, tipografía Inter.
   El lima va de fondo con texto negro o como acento sobre carbón,
   nunca como texto sobre fondo claro. Todo acotado a .wfx.
   ===================================================================== */

.wfx {
    --wfx-lima: #C2F858;
    --wfx-lima-hover: #B5F536;
    --wfx-carbon: #313537;
    --wfx-carbon-2: #3B4043;
    --wfx-fondo: #1C1F21;
    --wfx-panel: #26292B;
    --wfx-borde: rgba(255, 255, 255, 0.08);
    --wfx-borde-2: rgba(255, 255, 255, 0.16);
    --wfx-txt: #F5F7F8;
    --wfx-txt-2: #C3C9CD;
    --wfx-txt-3: #8C959B;

    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--wfx-txt);
    padding-bottom: 32px;
}

/* ---------- Cabecera ---------- */
.wfx-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 20px;
}

.wfx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #000;
    background: var(--wfx-lima);
    border-radius: 999px;
    padding: 4px 12px;
}

.wfx-hero h1 {
    margin: 10px 0 4px;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--wfx-txt);
}

.wfx-hero p {
    margin: 0;
    color: var(--wfx-txt-3);
    font-size: 15px;
}

/* ---------- Barra de búsqueda y filtros ---------- */
.wfx-bar {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(194, 248, 88, 0.06) 0%, rgba(194, 248, 88, 0) 55%),
        var(--wfx-fondo);
    border: 1px solid var(--wfx-borde);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.wfx-bar-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.wfx-search {
    flex: 1 1 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    background: var(--wfx-panel);
    border: 1px solid var(--wfx-borde-2);
    color: var(--wfx-txt-3);
    transition: border-color .2s, box-shadow .2s;
}

.wfx-search:focus-within {
    border-color: var(--wfx-lima);
    box-shadow: 0 0 0 3px rgba(194, 248, 88, 0.18);
}

.wfx .wfx-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--wfx-txt);
    font: inherit;
    font-size: 15px;
    padding: 0;
    box-shadow: none;
}

.wfx .wfx-search input::placeholder { color: var(--wfx-txt-3); }

.wfx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
}

.wfx-btn:active { transform: scale(.98); }

.wfx-btn-pri {
    background: var(--wfx-lima);
    border: 1px solid var(--wfx-lima);
    color: #000;
}

.wfx-btn-pri:hover { background: var(--wfx-lima-hover); }

.wfx-btn-ghost {
    background: transparent;
    border: 1px solid var(--wfx-borde-2);
    color: var(--wfx-txt-2);
}

.wfx-btn-ghost:hover,
.wfx-btn-ghost[aria-expanded="true"] {
    background: var(--wfx-carbon-2);
    color: var(--wfx-txt);
}

.wfx-btn-ghost .wfx-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--wfx-lima);
    color: #000;
    font-size: 12px;
    font-weight: 800;
}

.wfx-btn:focus-visible,
.wfx-chip button:focus-visible,
.wfx-card:focus-within {
    outline: 3px solid var(--wfx-lima);
    outline-offset: 2px;
}

/* Panel de filtros desplegable (mantiene los ids/clases que usa exercises.js) */
.wfx .advanced-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
    transition: max-height .35s ease, opacity .25s ease, margin-top .25s ease, padding-top .25s ease;
}

.wfx .advanced-filters.expanded {
    max-height: 600px;
    opacity: 1;
    margin-top: 16px;
    padding-top: 16px;
    border-top-color: var(--wfx-borde);
}

.wfx-field { min-width: 0; }

.wfx-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--wfx-txt-3);
}

.wfx .wfx-field select,
.wfx .wfx-field input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--wfx-borde-2);
    background: var(--wfx-panel);
    color: var(--wfx-txt);
    font: inherit;
    font-size: 14px;
    outline: none;
    box-shadow: none;
}

.wfx .wfx-field select:focus,
.wfx .wfx-field input:focus {
    border-color: var(--wfx-lima);
    box-shadow: 0 0 0 3px rgba(194, 248, 88, 0.18);
}

.wfx .wfx-field select option { background: var(--wfx-fondo); color: var(--wfx-txt); }

.wfx-duration {
    display: flex;
    gap: 8px;
}

/* Chips de filtros activos */
.wfx-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.wfx-chips:empty { display: none; }

.wfx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 4px 0 12px;
    border-radius: 999px;
    background: rgba(194, 248, 88, 0.12);
    border: 1px solid rgba(194, 248, 88, 0.45);
    color: var(--wfx-txt);
    font-size: 13px;
    font-weight: 600;
    animation: wfx-in .2s ease both;
}

.wfx-chip small {
    color: var(--wfx-txt-3);
    font-weight: 500;
    font-size: 12px;
}

.wfx-chip button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--wfx-txt-2);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.wfx-chip button:hover { background: rgba(255, 255, 255, 0.1); color: var(--wfx-txt); }

.wfx-chip-clear {
    background: none;
    border: 0;
    color: var(--wfx-txt-3);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px;
}

.wfx-chip-clear:hover { color: var(--wfx-txt); }

/* ---------- Barra de resultados ---------- */
.wfx-results {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.wfx-count {
    margin: 0;
    font-size: 15px;
    color: var(--wfx-txt-2);
}

.wfx-count b { color: var(--wfx-txt); font-weight: 800; }

.wfx-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wfx-seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 12px;
    background: var(--wfx-fondo);
    border: 1px solid var(--wfx-borde);
}

.wfx-seg button {
    width: 40px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--wfx-txt-3);
    cursor: pointer;
}

.wfx-seg button[aria-pressed="true"] {
    background: var(--wfx-carbon-2);
    color: var(--wfx-lima);
}

.wfx .wfx-tools select {
    min-height: 42px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid var(--wfx-borde-2);
    background: var(--wfx-fondo);
    color: var(--wfx-txt);
    font: inherit;
    font-size: 14px;
}

/* ---------- Tarjetas ---------- */
.wfx .exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 8px;
}

.wfx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--wfx-fondo);
    border: 1px solid var(--wfx-borde);
    border-radius: 18px;
    overflow: hidden;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s;
    animation: wfx-in .35s ease both;
}

.wfx-card:hover {
    transform: translateY(-4px);
    border-color: rgba(194, 248, 88, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* Foto completa, sin recortar (tarea #64): altura natural con un máximo y fondo carbón */
.wfx-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
    padding: 0;
    border: 0;
    background: var(--wfx-carbon);
    cursor: pointer;
    overflow: hidden;
}

.wfx .wfx-media img,
.wfx .wfx-media video {
    width: 100%;
    height: auto;
    max-height: 380px;
    object-fit: contain;
    display: block;
    transition: transform .4s ease;
}

.wfx-card:hover .wfx-media img,
.wfx-card:hover .wfx-media video { transform: scale(1.04); }

.wfx-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
}

.wfx-pill {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.wfx-pill-time { right: 10px; bottom: 10px; background: rgba(0, 0, 0, 0.7); color: #fff; }
.wfx-pill-level { left: 10px; top: 10px; background: var(--wfx-lima); color: #000; }
.wfx-pill-level.lvl-intermediate { background: #FCD34D; }
.wfx-pill-level.lvl-advanced { background: #FCA5A5; }

.wfx-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
    flex: 1;
}

.wfx-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--wfx-txt);
    cursor: pointer;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wfx-title:hover { color: var(--wfx-lima); }

.wfx-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wfx-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--wfx-panel);
    border: 1px solid var(--wfx-borde);
    color: var(--wfx-txt-2);
}

.wfx-tag-main {
    background: rgba(194, 248, 88, 0.12);
    border-color: rgba(194, 248, 88, 0.4);
    color: var(--wfx-txt);
}

.wfx-tag i { font-size: 11px; color: var(--wfx-txt-3); }
.wfx-tag-main i { color: var(--wfx-lima); }

.wfx-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--wfx-txt-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wfx-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--wfx-borde);
}

.wfx-who {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    font-size: 13px;
    color: var(--wfx-txt-2);
}

.wfx-who img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    background: var(--wfx-carbon-2);
}

.wfx-who span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wfx-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--wfx-txt-3);
    white-space: nowrap;
}

.wfx-actions {
    display: flex;
    gap: 6px;
}

.wfx-ibtn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid var(--wfx-borde-2);
    background: transparent;
    color: var(--wfx-txt-2);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.wfx-ibtn:hover { background: var(--wfx-carbon-2); color: var(--wfx-txt); }

.wfx-ibtn-pri {
    background: var(--wfx-lima);
    border-color: var(--wfx-lima);
    color: #000;
}

.wfx-ibtn-pri:hover { background: var(--wfx-lima-hover); color: #000; }

/* Vista de lista */
.wfx .exercises-grid.wfx-list {
    grid-template-columns: 1fr;
}

.wfx .wfx-list .wfx-card {
    flex-direction: row;
}

.wfx .wfx-list .wfx-media {
    width: 240px;
    flex: none;
    aspect-ratio: auto;
    min-height: 150px;
}

/* ---------- Estados ---------- */
.wfx-skel {
    border-radius: 18px;
    overflow: hidden;
    background: var(--wfx-fondo);
    border: 1px solid var(--wfx-borde);
}

.wfx-skel div {
    background: linear-gradient(90deg, var(--wfx-panel) 0%, var(--wfx-carbon-2) 50%, var(--wfx-panel) 100%);
    background-size: 200% 100%;
    animation: wfx-brillo 1.2s linear infinite;
    border-radius: 8px;
}

.wfx-skel .s-media { aspect-ratio: 16 / 10; border-radius: 0; }
.wfx-skel .s-line { height: 14px; margin: 14px 16px 0; }
.wfx-skel .s-line.short { width: 55%; margin-bottom: 18px; }

.wfx-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    border-radius: 20px;
    background: var(--wfx-fondo);
    border: 1px dashed var(--wfx-borde-2);
}

.wfx-empty .ico {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--wfx-carbon);
    color: var(--wfx-lima);
    font-size: 26px;
}

.wfx-empty h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; color: var(--wfx-txt); }
.wfx-empty p { margin: 0 0 16px; color: var(--wfx-txt-3); }

/* «Cargar más» / «Has visto todos» */
.wfx-more {
    display: flex;
    justify-content: center;
    padding: 20px 0 8px;
    min-height: 72px;
}

.wfx-more-state {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--wfx-txt-3);
}

.wfx-more-state .fa-check-circle { color: var(--wfx-lima); }

.wfx-spin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--wfx-borde-2);
    border-top-color: var(--wfx-lima);
    animation: wfx-giro .7s linear infinite;
}

/* ---------- Animaciones ---------- */
@keyframes wfx-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes wfx-brillo {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes wfx-giro {
    to { transform: rotate(360deg); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .wfx .advanced-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .wfx-bar { padding: 12px; border-radius: 16px; }
    .wfx-bar-row .wfx-btn { flex: 1 1 calc(50% - 5px); }
    .wfx .advanced-filters { grid-template-columns: 1fr; }
    .wfx .exercises-grid { grid-template-columns: 1fr; }
    .wfx .wfx-list .wfx-card { flex-direction: column; }
    .wfx .wfx-list .wfx-media { width: 100%; }
    .wfx-seg { display: none; }
}

/* =====================================================================
   Ficha del ejercicio (tarea #62)
   ===================================================================== */

/* Botón «me gusta» marcado (tarjetas y ficha) */
.wfx .wfx-like[aria-pressed="true"] {
    color: #000;
    background: var(--wfx-lima);
    border-color: var(--wfx-lima);
}

.wfx .wfx-like[aria-busy="true"] { opacity: .6; pointer-events: none; }

.wfx-crumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 16px;
    font-size: 14px;
    color: var(--wfx-txt-3);
    min-width: 0;
}

.wfx-crumbs > span {
    color: var(--wfx-txt-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wfx-crumbs .fa-chevron-right { font-size: 11px; }

.wfx-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--wfx-borde-2);
    background: transparent;
    color: var(--wfx-txt);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex: none;
}

.wfx-back:hover { background: var(--wfx-carbon-2); }
.wfx-back:focus-visible { outline: 3px solid var(--wfx-lima); outline-offset: 2px; }

.wfx-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.wfx-detail-main,
.wfx-detail-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.wfx-detail-side { position: sticky; top: 90px; }

/* Reproductor / foto de la ficha: tamaño natural, completa y grande (tarea #64) */
.wfx-player {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--wfx-borde);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}

.wfx .wfx-player video,
.wfx .wfx-player img {
    width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    background: #000;
}

.wfx .wfx-player-video { border-radius: 14px; }

.wfx .wfx-player-video iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

/* Imagen ampliable (abre el pop-up) */
.wfx-zoom {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.wfx-corrective .wfx-zoom {
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--wfx-borde);
}

.wfx .wfx-corrective .wfx-zoom img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.wfx-zoom-hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    opacity: .85;
    transition: opacity .2s, background .2s;
}

.wfx-zoom:hover .wfx-zoom-hint,
.wfx-zoom:focus-visible .wfx-zoom-hint { opacity: 1; background: var(--wfx-lima); color: #000; }

.wfx-zoom:focus-visible { outline: 3px solid var(--wfx-lima); outline-offset: 2px; }

.wfx-corrective-link { margin-top: 4px; }

/* Pop-up de imagen a pantalla completa */
.wfx-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 12, 13, 0.92);
    opacity: 0;
    transition: opacity .2s ease;
    cursor: zoom-out;
}

.wfx-lightbox.open { opacity: 1; }

.wfx-lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 48px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.wfx-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.wfx-lightbox-close:hover { background: #C2F858; color: #000; }
.wfx-lightbox-close:focus-visible { outline: 3px solid #C2F858; outline-offset: 2px; }

.wfx-detail-head {
    padding: 18px;
    border-radius: 20px;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(194, 248, 88, 0.06) 0%, rgba(194, 248, 88, 0) 55%),
        var(--wfx-fondo);
    border: 1px solid var(--wfx-borde);
}

.wfx-detail-head h1 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3.5vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--wfx-txt);
}

.wfx-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.wfx-chip-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--wfx-panel);
    border: 1px solid var(--wfx-borde);
    color: var(--wfx-txt-2);
    font-size: 13px;
    font-weight: 600;
}

.wfx-chip-meta i { color: var(--wfx-txt-3); }
.wfx-chip-meta.lvl-beginner { background: var(--wfx-lima); border-color: var(--wfx-lima); color: #000; }
.wfx-chip-meta.lvl-intermediate { background: #FCD34D; border-color: #FCD34D; color: #000; }
.wfx-chip-meta.lvl-advanced { background: #FCA5A5; border-color: #FCA5A5; color: #000; }
.wfx-chip-meta[class*="lvl-"] i { color: #000; }

.wfx-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wfx-count-pill {
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--wfx-carbon-2);
    color: var(--wfx-txt);
    font-size: 12px;
    font-weight: 800;
}

.wfx .wfx-like[aria-pressed="true"] .wfx-count-pill { background: #000; color: var(--wfx-lima); }

.wfx-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--wfx-txt-3);
}

.wfx-block {
    padding: 18px;
    border-radius: 20px;
    background: var(--wfx-fondo);
    border: 1px solid var(--wfx-borde);
}

.wfx-block h2 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--wfx-txt-3);
}

.wfx-block > p {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: var(--wfx-txt-2);
}

.wfx-sub {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--wfx-txt-3);
}

/* Pasos numerados */
.wfx-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: paso;
    display: grid;
    gap: 10px;
}

.wfx-steps li {
    counter-increment: paso;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 15px;
    line-height: 1.55;
    color: var(--wfx-txt-2);
}

.wfx-steps li::before {
    content: counter(paso);
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--wfx-lima);
    color: #000;
    font-size: 13px;
    font-weight: 800;
    margin-top: 1px;
}

/* Mini mapa del Body Map */
.wfx-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 14px;
    background: var(--wfx-panel);
}

.wfx-mini svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
}

.wfx-mini .muscle-group { color: #4A5155; pointer-events: none; }
.wfx-mini .muscle-group path { stroke: rgba(0, 0, 0, 0.35); stroke-width: 1; }
.wfx-mini .muscle-group.on-2 { color: rgba(194, 248, 88, 0.45); }
.wfx-mini .muscle-group.on {
    color: var(--wfx-lima);
    filter: drop-shadow(0 0 6px rgba(194, 248, 88, 0.6));
}

/* Instructor */
.wfx-coach-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wfx-coach-row img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--wfx-carbon-2);
    flex: none;
}

.wfx-coach-row b {
    display: block;
    font-size: 16px;
    color: var(--wfx-txt);
}

.wfx-coach-row small {
    display: block;
    font-size: 13px;
    color: var(--wfx-txt-3);
}

.wfx-coach-acts {
    display: flex;
    gap: 8px;
}

.wfx-coach-acts .wfx-btn { flex: 1; min-height: 44px; }

/* Relacionados */
.wfx-related { margin-top: 28px; }

.wfx-related h2 {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 800;
    color: var(--wfx-txt);
}

@media (max-width: 960px) {
    .wfx-detail-grid { grid-template-columns: 1fr; }
    .wfx-detail-side { position: static; }
}

@media (max-width: 640px) {
    .wfx-detail-head,
    .wfx-block { padding: 14px; border-radius: 16px; }
    .wfx-player { border-radius: 14px; }
    .wfx-detail-actions .wfx-btn { flex: 1 1 100%; }
    .wfx-crumbs > span { display: none; }
    .wfx-crumbs .fa-chevron-right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wfx-card,
    .wfx-chip,
    .wfx .advanced-filters,
    .wfx-media img,
    .wfx-media video,
    .wfx-skel div,
    .wfx-spin {
        animation: none !important;
        transition: none !important;
    }
}

/* =====================================================================
   (tarea #81) Banda de fondo detrás de la cabecera y los filtros del listado:
   la misma cuadrícula con aurora lima/turquesa de la home (.wfh-hero) y del Blog (.wfb-hero).
   Ocupa todo el ancho de la ventana y se funde con el fondo de la página por abajo.
   ===================================================================== */
.main-content:has(.wfx-top) { overflow-x: clip; } /* los 100vw no generan scroll horizontal; clip no rompe el sticky */

.wfx-top {
    position: relative;
    isolation: isolate;
    padding-top: 8px;
}

.wfx-top::before,
.wfx-top::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -140px;            /* sube por detrás de la cabecera fija de la web */
    bottom: -90px;          /* baja un poco por detrás del inicio de los resultados */
    left: 50%;
    width: 100vw;
    margin-left: -50vw;
    pointer-events: none;
}

/* Aurora: degradados radiales lima y turquesa sobre azul noche, desvaneciéndose hacia abajo */
.wfx-top::before {
    background:
        radial-gradient(55% 70% at 78% 22%, rgba(194, 248, 88, 0.13), transparent 62%),
        radial-gradient(45% 60% at 8% 85%, rgba(0, 179, 175, 0.10), transparent 62%),
        radial-gradient(40% 50% at 45% 0%, rgba(235, 248, 164, 0.06), transparent 70%),
        linear-gradient(180deg, #0B0E14 0%, #161B25 55%, #262E3D 100%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}

/* Cuadrícula fina de 56 px con máscara radial (igual que .wfh-hero-grid) */
.wfx-top::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: center top;
    -webkit-mask-image: radial-gradient(70% 70% at 50% 35%, #000 30%, transparent 80%);
    mask-image: radial-gradient(70% 70% at 50% 35%, #000 30%, transparent 80%);
}

/* La barra de filtros, un poco translúcida para que se intuya la aurora detrás */
.wfx-top .wfx-bar {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(194, 248, 88, 0.07) 0%, rgba(194, 248, 88, 0) 55%),
        rgba(28, 31, 33, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    .wfx-top::before,
    .wfx-top::after { top: -120px; bottom: -60px; }
    .wfx-top::after { background-size: 44px 44px; }
}

/* =====================================================================
   (tarea #81) Pop-up «Añadir a rutina» (listado y ficha). Usa la variante
   del modal de la #79 (.modal.wfa, auth-modal.css) y añade su contenido (.wfr-).
   ===================================================================== */
.modal.wfa:has(.wfr) { width: min(520px, 100%); max-width: 520px; }
.modal.wfa .wfr { display: grid; gap: 18px; margin: 0; }
.modal.wfa .wfr fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

.wfr-head { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
.wfr-thumb {
    flex: none; width: 64px; height: 64px; border-radius: 16px; overflow: hidden;
    display: grid; place-items: center; background: rgba(194, 248, 88, 0.12); color: #C2F858; font-size: 22px;
    border: 1px solid rgba(235, 248, 164, 0.18);
}
.wfr-thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.wfr-head-txt { min-width: 0; }
.wfr-head-txt small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #C2F858; }
.wfr-head-txt b {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 2px; font-size: 20px; font-weight: 900; line-height: 1.2; letter-spacing: -.02em; color: #fff;
}

.wfr-group legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94A3B8; }

.wfr-routines { display: grid; gap: 8px; max-height: min(40vh, 300px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
.wfr-routine {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px;
    border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); cursor: pointer;
    transition: border-color 200ms ease, background-color 200ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.wfr-routine:active { transform: scale(.99); }
.wfr-routine input { position: absolute; opacity: 0; pointer-events: none; }
.wfr-radio {
    flex: none; position: relative; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.28); transition: border-color 200ms ease, background-color 200ms ease;
}
.wfr-radio::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #1E2532;
    transform: scale(0); transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.wfr-routine:has(input:checked) { border-color: rgba(194, 248, 88, 0.6); background: rgba(194, 248, 88, 0.08); }
.wfr-routine input:checked + .wfr-radio { border-color: #C2F858; background: #C2F858; }
.wfr-routine input:checked + .wfr-radio::after { transform: scale(1); }
.wfr-routine input:focus-visible + .wfr-radio { outline: 3px solid #C2F858; outline-offset: 2px; }
.wfr-routine-txt { flex: 1; min-width: 0; }
.wfr-routine-txt b { display: block; font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfr-routine-txt small { display: block; margin-top: 2px; font-size: 13px; color: #94A3B8; }
.wfr-lvl { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #C2F858; color: #000; }
.wfr-lvl.lvl-intermediate { background: #FCD34D; }
.wfr-lvl.lvl-advanced { background: #FCA5A5; }

.wfr-new {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 40px; padding: 0 4px;
    border: 0; background: none; color: #C2F858; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}

.wfr-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wfr-field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94A3B8; }
.wfr-field small { display: block; margin-top: 4px; font-size: 12px; color: #94A3B8; text-align: center; }
.wfr-stepper {
    display: flex; align-items: center; min-height: 48px; border-radius: 14px; overflow: hidden;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.wfr-stepper:focus-within { border-color: #C2F858; box-shadow: 0 0 0 3px rgba(194, 248, 88, 0.18); }
.modal.wfa .wfr-stepper input {
    flex: 1; min-width: 0; width: 100%; height: 46px; padding: 0; border: 0; outline: none; background: transparent; box-shadow: none;
    color: #fff; font: inherit; font-size: 16px; font-weight: 800; text-align: center; -moz-appearance: textfield;
}
.modal.wfa .wfr-stepper input::-webkit-outer-spin-button,
.modal.wfa .wfr-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wfr-step {
    flex: none; width: 36px; height: 46px; display: grid; place-items: center; border: 0; background: none;
    color: #CBD5E1; font-size: 12px; cursor: pointer; transition: color 200ms ease, background-color 200ms ease, transform 140ms ease;
}
.wfr-step:active { transform: scale(.9); }

.wfr-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.wfr-actions .wfa-btn { margin: 0; }
.wfr-btn-ghost { background: rgba(255, 255, 255, 0.04); border: 1.5px solid rgba(255, 255, 255, 0.12) !important; color: #fff; }

.wfr-empty { display: grid; justify-items: center; gap: 8px; padding: 22px 12px; text-align: center; border: 1px dashed rgba(255, 255, 255, 0.14); border-radius: 18px; }
.wfr-empty-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(194, 248, 88, 0.12); color: #C2F858; font-size: 20px; }
.wfr-empty h3 { margin: 0; font-size: 19px; font-weight: 800; color: #fff; }
.wfr-empty p { margin: 0; font-size: 14px; color: #CBD5E1; }

@media (hover: hover) and (pointer: fine) {
    .wfr-routine:not(:has(input:checked)):hover { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.07); }
    .wfr-step:hover { color: #C2F858; background: rgba(255, 255, 255, 0.05); }
    .wfr-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
    .wfr-new:hover { text-decoration: underline; text-underline-offset: 3px; }
}

@media (max-width: 480px) {
    .wfr-fields { grid-template-columns: 1fr 1fr; }
    .wfr-fields .wfr-field:last-child { grid-column: 1 / -1; }
    .wfr-actions { grid-template-columns: 1fr; }
    .wfr-actions .wfa-btn-pri { order: -1; }
    .wfr-lvl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wfr-routine, .wfr-radio, .wfr-radio::after, .wfr-step { transition: none; }
}
