/* ========================================
   CATALOG.CSS — Estilo Campus / Disney+
   Descodificación Transpersonal
   ======================================== */

/* ── Dark base (solo en página de cursos) ── */
body.catalog-dark {
    background: #0d1117;
    color: #e2e8f0;
}

/* ══════════════════════════════════════════
   HERO — cambia al hacer clic en una tarjeta
══════════════════════════════════════════ */
.catalog-main { min-height: 100vh; }

.cat-hero {
    position: relative;
    width: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #0d1117;
}

.cat-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: brightness(0.45) saturate(0.8);
    transition: opacity 0.5s ease;
    opacity: 0;
}
.cat-hero-bg.loaded { opacity: 1; }

.cat-hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right,  rgba(13,17,23,0.97) 0%, rgba(13,17,23,0.6) 55%, rgba(13,17,23,0.15) 100%),
        linear-gradient(to top,    rgba(13,17,23,1)    0%, transparent 60%);
    z-index: 1;
}

.cat-hero-body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 4%;
}

/* Info col */
.cat-hero-info { flex: 1; min-width: 0; touch-action: manipulation; }

.cat-hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #92700a, #ffd700);
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    padding: 0.25rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.cat-hero-title {
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.cat-hero-desc {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.65;
    margin-bottom: 1rem;
    max-width: 480px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
    font-size: 0.8rem;
    color: #64748b;
}
.cat-hero-meta span {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    color: #94a3b8;
}

.cat-hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.cat-hero-docentes { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.2rem; }
.cat-hero-docentes:empty { margin-top: 0; }
.cat-hero-docentes-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.45); }
.cat-hero-docente-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.cat-hero-docente-photo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #c9d6ee; }
.cat-hero-docente-name { font-size: 0.82rem; font-weight: 600; color: #e2e8f0; }

.cat-btn-primary {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: linear-gradient(135deg, #3c6ca8, #4a7bbd);
    color: #fff; font-weight: 700; font-size: 0.95rem;
    padding: 0.75rem 1.8rem; border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 18px rgba(60, 108, 168,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cat-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(60, 108, 168,0.55); color: #fff; }

.cat-btn-secondary {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);
    color: #e2e8f0; font-weight: 600; font-size: 0.95rem;
    padding: 0.75rem 1.6rem; border-radius: 8px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.18);
    transition: background 0.2s, transform 0.2s;
}
.cat-btn-secondary:hover { background: rgba(255,255,255,0.18); transform: translateY(-2px); color: #fff; }

/* Video col */
.cat-hero-video-wrap {
    flex: 0 0 380px;
    max-width: 380px;
}
.cat-hero-video-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    background: #000;
}
.cat-hero-video-box iframe {
    position: absolute;
    inset: 0; width: 100%; height: 100%;
    border: 0;
}

.yt-thumb-link {
    display: block;
    position: relative;
    width: 100%; height: 100%;
}
.yt-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 1.8rem;
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.2s;
    pointer-events: none;
}
.yt-thumb-link:hover .yt-play-btn {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Miniaturas bloqueadas de clases, debajo del video del hero */
.cat-hero-preview-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.cat-hero-preview-thumb {
    position: relative;
    flex: 1 1 0;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    background: #1a2a4a;
}
.cat-hero-preview-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.5) blur(1px);
}
.cat-hero-preview-lock {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.cat-hero-preview-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    border: 1.5px dashed rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
}
.cat-hero-preview-more-dots {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}
.cat-hero-preview-more-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-align: center;
    padding: 0 0.2rem;
}

/* Placeholder cuando no hay curso seleccionado */
.cat-hero-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 1rem; padding: 3rem 2rem; text-align: center;
    color: #334155;
    min-height: 280px;
}
.cat-hero-placeholder .ph-icon { font-size: 3rem; opacity: 0.4; }
.cat-hero-placeholder p { font-size: 1rem; opacity: 0.5; }

/* ══════════════════════════════════════════
   GRID DE CURSOS
══════════════════════════════════════════ */
.cat-grid-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 4% 4rem;
}

.cat-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cat-grid-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Filter toggle */
.cat-filter { display: flex; gap: 0.5rem; }
.cat-filter-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.cat-filter-btn.active,
.cat-filter-btn:hover {
    background: rgba(60, 108, 168,0.15);
    border-color: #3c6ca8;
    color: #3c6ca8;
}

/* Grid */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

/* ── Tarjeta ── */
.cat-card {
    border-radius: 10px;
    overflow: hidden;
    background: #161b22;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, outline 0.15s;
    outline: 2px solid transparent;
    position: relative;
    touch-action: manipulation;
}
.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.cat-card.active {
    outline: 2px solid #3c6ca8;
    box-shadow: 0 0 0 4px rgba(60, 108, 168,0.15), 0 12px 40px rgba(0,0,0,0.5);
}

.cat-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #1e293b;
}
.cat-card-thumb-ph {
    width: 100%; aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a2744, #0d1117);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; color: #334155;
}

.cat-card-type {
    position: absolute; top: 8px; right: 8px;
    font-size: 0.6rem; font-weight: 800;
    letter-spacing: 0.06em; padding: 0.18rem 0.55rem;
    border-radius: 4px; text-transform: uppercase;
}
.cat-card-type.gratis  { background: #16a34a; color: #fff; }
.cat-card-type.pago,
.cat-card-type.premium { background: linear-gradient(135deg,#3c6ca8,#4a7bbd); color: #fff; }
.cat-card-type.promo   { background: #7c3aed; color: #fff; }

.cat-card-body {
    padding: 0.8rem 0.9rem 1rem;
}
.cat-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cat-card-desc {
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Skeleton */
.cat-skeleton {
    border-radius: 10px;
    aspect-ratio: 16/10;
    background: linear-gradient(90deg, #161b22 25%, #1e2530 50%, #161b22 75%);
    background-size: 200% 100%;
    animation: cat-shine 1.4s infinite;
}
@keyframes cat-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty */
.cat-empty {
    text-align: center; padding: 4rem 2rem; color: #334155;
}
.cat-empty p { font-size: 1.1rem; margin-bottom: 1.2rem; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
    .cat-hero-body {
        flex-direction: column;
        padding: 2rem 5%;
        gap: 1.5rem;
    }
    .cat-hero-video-wrap {
        flex: none;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .cat-hero { min-height: unset; }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.8rem; }
    .cat-grid-header { flex-direction: column; align-items: flex-start; }
}

/* Cards ocultas por filtro */
.cat-card[hidden] { display: none; }
