/* =====================================================
   Catálogo Humano360 — Estilos unificados
   ===================================================== */

:root {
    --primary: #2ea3f2;
    --primary-dark: #1e87cf;
    --secondary: #29c4a9;
    --accent: #974df3;
    --accent-dark: #7d35d6;
    --text: #5a6273;
    --heading: #1f2937;
    --muted: #9ca3af;
    --bg: #f5f7fa;
    --bg-soft: #eef2f7;
    --white: #ffffff;
    --border: #e5e7eb;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
    --shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 14px 40px rgba(15, 23, 42, 0.12);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-soft: linear-gradient(135deg, rgba(46,163,242,0.08) 0%, rgba(41,196,169,0.08) 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
}

.container { max-width: 1280px; margin: 0 auto; padding: 30px 24px; }
@media (min-width: 1300px) { .container { max-width: 1400px; } }
@media (min-width: 1500px) { .container { max-width: 1600px; } }
@media (min-width: 1800px) { .container { max-width: 1820px; } }
@media (min-width: 2100px) { .container { max-width: 2000px; } }
@media (min-width: 2500px) { .container { max-width: 2300px; } }
@media (min-width: 3000px) { .container { max-width: 2700px; } }

/* Modo embebido (dentro de un <iframe>): ocupa todo el ancho disponible, fondo transparente */
html.embedded, body.embedded { background: transparent !important; min-height: auto; }
html.embedded body, body.embedded { padding: 0 !important; }
html.embedded .container, body.embedded .container { max-width: 100% !important; padding: 10px 0 0 !important; }
body.embedded .hero { margin-top: 0; }
@media (min-width: 1100px) {
    body.embedded .main-layout { grid-template-columns: 260px 1fr; gap: 24px; }
    body.embedded .catalog-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (min-width: 1700px) {
    body.embedded .main-layout { grid-template-columns: 280px 1fr; gap: 28px; }
    body.embedded .catalog-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 2300px) {
    body.embedded .main-layout { grid-template-columns: 300px 1fr; gap: 32px; }
    body.embedded .catalog-grid { grid-template-columns: repeat(6, 1fr); }
}

h1, h2, h3 { color: var(--heading); margin: 0 0 12px; line-height: 1.25; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* =====================================================
   HERO del catálogo
   ===================================================== */
.hero {
    background: var(--gradient);
    color: white;
    padding: 32px 36px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
}
.hero::after {
    content: "";
    position: absolute;
    bottom: -120px; left: 30%;
    width: 220px; height: 220px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.hero-content {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title stats"
        "desc  stats";
    column-gap: 32px;
    row-gap: 4px;
    align-items: center;
}
.hero h1 {
    grid-area: title;
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: -0.5px;
}
.hero p {
    grid-area: desc;
    font-size: 16px; opacity: 0.92; max-width: 640px; margin: 0;
}
.hero-stats {
    grid-area: stats;
    display: flex; flex-direction: column; gap: 8px;
    margin: 0;
    align-self: center;
}
.hero-stat {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.22);
    min-width: 170px;
    display: flex; align-items: baseline; gap: 10px;
}
.hero-stat strong { font-size: 20px; color: white; line-height: 1; }
.hero-stat span { font-size: 12.5px; opacity: 0.9; }
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        grid-template-areas: "title" "desc" "stats";
    }
    .hero-stats { flex-direction: row; flex-wrap: wrap; margin-top: 16px; }
    .hero-stat { min-width: 0; }
}

/* =====================================================
   Layout principal
   ===================================================== */
.main-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .hero { padding: 32px 22px; }
    .hero h1 { font-size: 26px; }
}

/* =====================================================
   Sidebar de filtros
   ===================================================== */
.sidebar {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
    border: 1px solid var(--border);
    will-change: transform;
}
body.embedded .sidebar { position: relative; top: auto; }
.sidebar-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--muted);
    margin: 0 0 16px;
    display: flex; align-items: center; gap: 8px;
}
.search-container { margin-bottom: 22px; }
.search-container > label {
    font-size: 13px; font-weight: 600;
    color: var(--heading);
    display: block; margin-bottom: 8px;
}
.search-wrapper { position: relative; }
.search-wrapper i {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); pointer-events: none;
}
.search-input {
    width: 100%; padding: 11px 14px 11px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit;
    background: var(--bg);
    transition: 0.2s;
}
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(46,163,242,0.15);
}

.filter-group {
    border-top: 1px solid var(--border);
    padding: 14px 0;
}
.filter-group:last-child { border-bottom: 1px solid var(--border); }
.filter-group-header {
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 14px;
    color: var(--heading);
    padding: 4px 0;
    user-select: none;
    transition: color 0.2s;
}
.filter-group-header:hover { color: var(--primary); }
.filter-group-header i { transition: transform 0.25s; font-size: 12px; color: var(--muted); }
.filter-group.active .filter-group-header i { transform: rotate(180deg); color: var(--primary); }
.filter-group-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
}
.filter-group.active .filter-group-content {
    max-height: 600px;
    padding: 12px 0 4px;
    overflow-y: auto;
}
.filter-group-content label {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0;
    font-size: 13.5px;
    cursor: pointer;
    color: var(--text);
    transition: color 0.15s;
}
.filter-group-content label:hover { color: var(--heading); }
.filter-group-content input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px; height: 16px;
    cursor: pointer; flex-shrink: 0;
}
.filter-clear {
    margin-top: 16px;
    width: 100%; padding: 9px 12px;
    border: 1.5px solid var(--border);
    background: white; color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px; font-weight: 600;
    transition: 0.2s;
}
.filter-clear:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg);
}

/* =====================================================
   Contenido principal
   ===================================================== */
.main-content > section { margin-bottom: 36px; }

.section-header {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 16px;
    flex-wrap: wrap; gap: 8px;
}
.section-header h2 {
    font-size: 22px; font-weight: 700;
    margin: 0;
    display: flex; align-items: center; gap: 10px;
}
.section-header h2 i { color: var(--primary); }
.results-count {
    font-size: 14px; color: var(--muted);
    background: white;
    padding: 4px 12px; border-radius: 20px;
    border: 1px solid var(--border);
}

/* Grid de cursos */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.catalog-grid.filtering { opacity: 0.4; transform: translateY(4px); }
.catalog-grid { transition: opacity 0.25s, transform 0.25s; }

.course-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 240px;
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.course-image {
    height: 96px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}
.course-image::before {
    content: "";
    position: absolute;
    top: -40%; right: -20%;
    width: 140px; height: 140px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
}
.course-image::after {
    content: "";
    position: absolute;
    bottom: -60%; left: -10%;
    width: 110px; height: 110px;
    background: rgba(255,255,255,0.10);
    border-radius: 50%;
}
.course-image i {
    color: white;
    font-size: 38px;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}
.course-card-body {
    padding: 16px 20px 18px;
    display: flex; flex-direction: column; flex: 1;
}
.course-card .family-tag {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: inline-flex; align-items: center; gap: 6px;
}
.course-card h3 {
    font-size: 15.5px; font-weight: 600;
    margin: 0 0 12px;
    color: var(--heading);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-card .meta {
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; color: var(--muted);
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.course-card .meta .hours {
    background: var(--bg-soft);
    color: var(--heading);
    padding: 3px 9px; border-radius: 12px;
    font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px;
}
.course-card .meta .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; }

/* Paginación */
.pagination {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 6px; margin-top: 28px;
}
.pagination .page-btn {
    min-width: 38px; height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--heading);
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center;
}
.pagination .page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.pagination .page-btn.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow);
}
.pagination .page-btn:disabled {
    opacity: 0.4; cursor: not-allowed;
}
.pagination .page-ellipsis {
    color: var(--muted); padding: 0 4px; user-select: none;
}
.pagination .page-info {
    margin-left: 12px; font-size: 13px; color: var(--muted);
    flex-basis: 100%; text-align: center;
}
@media (min-width: 600px) {
    .pagination .page-info { flex-basis: auto; margin-left: 16px; }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    color: var(--muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; color: var(--border); display: block; }
.empty-state p { margin: 0; font-size: 15px; }

/* =====================================================
   FAQ
   ===================================================== */
#faq-section {
    margin-top: 40px;
    background: white;
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
}
.faq-item:last-child { border-bottom: 0; }
.faq-q {
    cursor: pointer;
    padding: 16px 0;
    font-weight: 600;
    color: var(--heading);
    display: flex; justify-content: space-between; align-items: center;
    user-select: none;
}
.faq-q i { color: var(--primary); transition: transform 0.25s; }
.faq-item.active .faq-q i { transform: rotate(180deg); }
.faq-a {
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: var(--text);
    font-size: 14.5px;
}
.faq-item.active .faq-a { max-height: 300px; padding: 0 0 16px; }

/* =====================================================
   Vista de detalle (ficha)
   ===================================================== */
#detail-view { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.btn-back {
    background: white;
    border: 1.5px solid var(--border);
    color: var(--heading);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer; font-size: 14px; font-weight: 600;
    margin-bottom: 24px;
    transition: 0.2s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-back:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(-3px);
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 44px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.header::before {
    content: "";
    position: absolute;
    top: -100px; right: -60px;
    width: 320px; height: 320px;
    background: rgba(255,255,255,0.10);
    border-radius: 50%;
}
/* Logos solo visibles al imprimir */
.header-logo, .cta-logo { display: none; }
.header-content { position: relative; z-index: 1; }
.badge-family {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(6px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px; font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.25);
}
.course-title {
    color: white;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.25;
    letter-spacing: -0.4px;
}
.course-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    align-items: center; justify-content: space-between;
}
.code-badge {
    background: rgba(255,255,255,0.18);
    color: white;
    padding: 6px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    border: 1px solid rgba(255,255,255,0.22);
    display: inline-flex; align-items: center; gap: 6px;
}
.pdf-btn {
    background: white !important;
    color: var(--accent) !important;
    border: 1px solid white !important;
    cursor: pointer;
    transition: 0.25s;
    text-decoration: none;
}
.pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.card {
    background: white;
    padding: 28px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    border: 1px solid var(--border);
}
.section-title {
    font-size: 19px; font-weight: 700;
    color: var(--heading);
    margin: 0 0 16px;
    display: flex; align-items: center; gap: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-soft);
}
.section-title i {
    color: var(--primary);
    background: var(--gradient-soft);
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    font-size: 16px;
}
.objective-text {
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--text);
    margin: 0;
    padding: 16px 20px;
    background: var(--gradient-soft);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
}

/* Bloque de contenidos en texto plano (CSV crudo) */
.contents-raw {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text);
    background: #fafbfd;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 22px;
    white-space: normal;
}
.contents-raw br + br { content: ""; display: block; margin-top: 8px; }

/* Temario no disponible: invitación a solicitarlo */
.contents-request {
    text-align: center;
    padding: 36px 28px;
    background: var(--gradient-soft);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
}
.contents-request i {
    font-size: 34px;
    color: var(--primary);
    margin-bottom: 14px;
    display: block;
}
.contents-request p { margin: 6px 0; }
.contents-request a { color: var(--primary); font-weight: 600; }

/* Lista de unidades */
.contents-list { list-style: none; padding: 0; margin: 0; }
.unit-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.unit-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.unit-header {
    padding: 14px 18px;
    display: flex; align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--heading);
    font-size: 14.5px;
    background: var(--gradient-soft);
}
.unit-header > i.fa-book-open {
    color: var(--accent); font-size: 14px; flex-shrink: 0;
}
.unit-header > i.fa-chevron-down {
    margin-left: auto;
    color: var(--muted); font-size: 12px;
    transition: transform 0.25s;
}
.unit-item.active .unit-header { background: var(--gradient-soft); }
.unit-item.active .unit-header > i.fa-chevron-down { transform: rotate(180deg); color: var(--primary); }
.unit-topics {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease;
    list-style: none;
    margin: 0;
    padding: 0 18px;
    background: #fafbfd;
}
.unit-item.active .unit-topics { max-height: 500px; padding: 12px 18px 16px; }
.unit-topics li {
    padding: 5px 0;
    font-size: 13.5px;
    color: var(--text);
    display: flex; align-items: flex-start; gap: 8px;
    line-height: 1.5;
}
.unit-topics li i {
    color: var(--secondary);
    margin-top: 5px; font-size: 11px; flex-shrink: 0;
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.info-card {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: transform 0.25s, box-shadow 0.25s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.info-card i {
    font-size: 26px;
    margin-bottom: 10px;
    display: block;
}
.info-card.duration i { color: var(--primary); }
.info-card.mode i { color: var(--secondary); }
.info-card.certificate i { color: var(--accent); }
.info-card.fundae i { color: #f59e0b; }
.info-card .value {
    font-size: 22px; font-weight: 700;
    color: var(--heading);
    margin-bottom: 4px;
}
.info-card .label {
    font-size: 12.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--muted);
}

/* CTA */
.cta-section {
    text-align: center;
    background: var(--gradient);
    color: white;
    padding: 36px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.cta-section h3 {
    color: white;
    font-size: 22px;
    margin-bottom: 8px;
}
.cta-section p { opacity: 0.95; margin-bottom: 20px; font-size: 15px; }
.btn-cta {
    display: inline-flex; align-items: center; gap: 10px;
    background: white;
    color: var(--accent);
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 700;
    border: none; cursor: pointer;
    font-size: 15px;
    transition: transform 0.25s, box-shadow 0.25s;
    text-decoration: none;
}
.btn-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
    color: var(--accent-dark);
}

.footer { padding: 16px 0; }

/* =====================================================
   Popover Compartir
   ===================================================== */
.share-pop {
    position: absolute;
    z-index: 10000;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 16px 18px;
    width: 320px;
    animation: sharePopIn 0.18s ease;
}
@keyframes sharePopIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.share-pop-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--heading);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}
.share-pop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.share-pop-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 6px;
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.18s;
    font-family: inherit;
    color: var(--heading);
}
.share-pop-btn i {
    font-size: 22px;
    color: var(--ico-color, var(--primary));
    transition: transform 0.18s;
}
.share-pop-btn span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}
.share-pop-btn:hover {
    background: white;
    border-color: var(--ico-color, var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.share-pop-btn:hover i { transform: scale(1.1); }
@media (max-width: 480px) {
    .share-pop { width: calc(100vw - 24px); left: 12px !important; }
}

/* Print */
@page {
    size: A4 portrait;
    margin: 1cm;
}
@media print {
    /* ---------- Base ---------- */
    html, body {
        background: white !important;
        color: #1f2937 !important;
        font-size: 11pt;
        line-height: 1.4;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body { padding: 0 !important; }
    .container { max-width: 100% !important; padding: 0 !important; }

    /* ---------- Elementos a ocultar ---------- */
    .sidebar, .btn-back, .pdf-btn, #faq-section,
    #catalog-view { display: none !important; }

    /* ---------- CTA al final del PDF ---------- */
    .cta-section {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 16px 22px !important;
        margin-top: 14px !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .cta-section h3 { font-size: 13pt !important; margin: 0 0 4px !important; }
    .cta-section p { font-size: 10pt !important; margin: 0 0 10px !important; opacity: 0.95 !important; }
    .cta-section .btn-cta {
        background: white !important;
        color: var(--accent) !important;
        padding: 8px 18px !important;
        font-size: 11pt !important;
        border-radius: 20px !important;
        box-shadow: none !important;
    }
    .cta-section .btn-cta i { display: none; }
    /* URL visible bajo el botón porque en papel no se puede hacer click */
    .cta-section .btn-cta::after {
        content: " — humano360.com/contacto/";
        font-weight: 400 !important;
        font-size: 10pt !important;
    }

    /* ---------- Cabecera del curso ---------- */
    .header {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
        padding: 20px 24px !important;
        margin-bottom: 14px !important;
        box-shadow: none !important;
        page-break-after: avoid;
        break-after: avoid;
    }
    .header::before, .header::after { display: none; }
    /* Logos visibles solo aquí (en impresión/PDF) */
    .header-logo {
        display: block !important;
        position: absolute;
        top: 14px; right: 20px;
        height: 36px; width: auto;
        z-index: 2;
    }
    .cta-logo {
        display: block !important;
        height: 48px; width: auto;
        margin: 0 auto 12px;
    }
    .badge-family {
        padding: 4px 10px !important;
        font-size: 10pt !important;
        margin-bottom: 8px !important;
        background: rgba(255,255,255,0.25) !important;
    }
    .course-title {
        font-size: 18pt !important;
        margin-bottom: 10px !important;
        line-height: 1.2 !important;
    }
    .course-meta { gap: 8px !important; }
    .code-badge {
        padding: 3px 9px !important;
        font-size: 9pt !important;
        background: rgba(255,255,255,0.22) !important;
    }

    /* ---------- Tarjetas ---------- */
    .card {
        padding: 14px 18px !important;
        margin-bottom: 12px !important;
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        /* SIN page-break-inside: avoid → si el objetivo es muy largo, puede partirse
           entre páginas y evita dejar la primera página casi en blanco */
    }
    /* Solo las cards pequeñas (info-grid) se mantienen juntas */
    .card:has(.info-grid) { page-break-inside: avoid; break-inside: avoid; }

    /* ---------- Títulos de sección ---------- */
    .section-title {
        font-size: 13pt !important;
        margin-bottom: 10px !important;
        padding-bottom: 6px !important;
        page-break-after: avoid;
        break-after: avoid;
    }
    .section-title i {
        width: 24px !important;
        height: 24px !important;
        font-size: 11pt !important;
        background: #e5e7eb !important;
        color: var(--primary) !important;
    }

    /* ---------- Objetivo ---------- */
    .objective-text {
        background: #f3f4f6 !important;
        border-left-width: 3px !important;
        padding: 10px 14px !important;
        font-size: 10.5pt !important;
        line-height: 1.5 !important;
        color: #1f2937 !important;
    }

    /* ---------- Unidades ---------- */
    .contents-list { gap: 0 !important; }
    .unit-item {
        margin-bottom: 8px !important;
        border: 1px solid #d1d5db !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .unit-header {
        background: #f3f4f6 !important;
        padding: 8px 12px !important;
        font-size: 11pt !important;
    }
    .unit-header > i.fa-book-open { font-size: 11pt !important; }
    .unit-item.active .unit-topics {
        max-height: none !important;
        padding: 8px 12px 10px !important;
        background: white !important;
    }
    .unit-topics li {
        padding: 2px 0 !important;
        font-size: 10.5pt !important;
        color: #374151 !important;
        line-height: 1.4 !important;
    }
    .unit-topics li i { font-size: 9pt !important; margin-top: 6px !important; }

    /* ---------- Info-grid: 4 tarjetas en una fila ---------- */
    .info-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }
    .info-card {
        padding: 10px 6px !important;
        background: #f9fafb !important;
        border: 1px solid #d1d5db !important;
        box-shadow: none !important;
    }
    .info-card i { font-size: 16pt !important; margin-bottom: 4px !important; }
    .info-card .value { font-size: 12pt !important; }
    .info-card .label { font-size: 8.5pt !important; letter-spacing: 0.2px !important; }

    /* ---------- Anti-orphans ---------- */
    h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid; }
    p, li { orphans: 3; widows: 3; }
}

/* Responsive ficha */
@media (max-width: 700px) {
    .header { padding: 28px 22px; }
    .course-title { font-size: 22px; }
    .card { padding: 22px 18px; }
    .course-meta { flex-direction: column; align-items: flex-start; }
}
