/* Compartir cursos desde tarjetas públicas */
.course-foot { gap: 8px; }
.course-instructor { min-width: 0; }
.course-instructor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-foot-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.course-share-trigger {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px;
    background: #fff; color: var(--brand-700); font: inherit; font-size: 10.5px;
    font-weight: 700; cursor: pointer; white-space: nowrap;
}
.course-share-trigger:hover { border-color: var(--brand-200); background: #F0F9FD; }
.course-share-trigger .icon { width: 12px; height: 12px; }

.course-share-modal,
.course-share-qr {
    position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center;
    padding: 20px; background: rgba(7, 26, 45, .62); backdrop-filter: blur(2px);
}
.course-share-modal[hidden],
.course-share-qr[hidden] { display: none; }
.course-share-dialog {
    position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px);
    overflow: auto; background: #fff; border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
    font-family: inherit; color: var(--ink);
}
.course-share-close {
    position: absolute; right: 14px; top: 14px; width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: #F1F5F9; color: #475569;
    font-size: 18px; line-height: 1; cursor: pointer; z-index: 2;
}
.course-share-close .icon { width: 15px; height: 15px; }
.course-share-head { display: flex; gap: 12px; padding: 20px 20px 10px; }
.course-share-head-icon {
    width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: #E8F4FA; color: var(--brand-700);
}
.course-share-head-icon .icon { width: 18px; height: 18px; }
.course-share-kicker { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-700); }
.course-share-head h2 { margin: 3px 0 3px; font-size: 20px; line-height: 1.15; letter-spacing: -.025em; color: var(--navy); }
.course-share-head p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

.course-share-preview {
    margin: 0 20px; padding: 12px; display: flex; gap: 12px; align-items: center;
    border: 1px solid var(--line); border-radius: 13px; background: #F8FBFD;
}
.course-share-preview-cover {
    width: 76px; height: 76px; border-radius: 10px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; background: linear-gradient(135deg, var(--share-color, #0D78A6), #0B1B2B);
    overflow: hidden;
}
.course-share-preview-cover .icon { width: 27px; height: 27px; }
.course-share-preview-main { min-width: 0; }
.course-share-code { display: block; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); }
.course-share-preview-main strong { display: block; margin: 2px 0 3px; font-size: 13px; line-height: 1.25; color: var(--navy); }
.course-share-preview-main small { display: block; font-size: 10px; line-height: 1.45; color: var(--muted); }
.course-share-preview-main small b { color: var(--success); }

.course-share-link { display: flex; gap: 6px; margin: 14px 20px 0; }
.course-share-link input {
    flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line);
    border-radius: 8px; background: #F8FAFC; color: #334155; font: inherit; font-size: 10px;
}
.course-share-link button {
    display: inline-flex; align-items: center; gap: 4px; padding: 0 11px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    color: var(--brand-700); font: inherit; font-size: 10px; font-weight: 700; cursor: pointer;
}
.course-share-link button .icon { width: 13px; height: 13px; }
.course-share-label { margin: 14px 20px 7px; font-size: 9.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase; color: var(--muted); }
.course-share-channels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; padding: 0 20px; }
.course-share-channel {
    min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 6px 3px; border: 1px solid var(--line); border-radius: 9px;
    background: #fff; color: var(--muted); font: inherit; font-size: 9px; font-weight: 700;
    text-decoration: none; cursor: pointer;
}
.course-share-channel:hover { border-color: var(--brand-200); color: var(--brand-700); background: #F0F9FD; }
.course-share-channel .icon { width: 16px; height: 16px; }
.course-share-channel strong { font-size: 17px; line-height: 1; font-weight: 800; }
.course-share-channel.is-whatsapp { color: #128C4A; }
.course-share-channel.is-linkedin { color: #0A66C2; }
.course-share-channel.is-facebook { color: #1877F2; }
.course-share-channel.is-x { color: #0F172A; }
.course-share-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px 8px; flex-wrap: wrap; }
.course-share-download,
.course-share-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 8px 11px; border-radius: 8px; font: inherit; font-size: 10.5px;
    font-weight: 800; cursor: pointer; text-decoration: none;
}
.course-share-download { border: 1px solid var(--line); background: #fff; color: var(--brand-700); }
.course-share-download:hover { border-color: var(--brand-200); background: #F0F9FD; }
.course-share-primary { border: 0; background: var(--brand-700); color: #fff; }
.course-share-primary:hover { background: var(--brand-800); }
.course-share-download .icon,
.course-share-primary .icon { width: 14px; height: 14px; }
.course-share-note { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0 20px 16px; font-size: 9px; color: var(--muted); }
.course-share-note .icon { width: 12px; height: 12px; }

.course-share-qr-card { position: relative; width: min(300px, 100%); padding: 22px; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.course-share-qr-card h3 { margin: 0 0 12px; font-size: 17px; color: var(--navy); }
.course-share-qr-card p { margin: 10px 0 0; font-size: 11px; color: var(--muted); }
.course-share-qr-canvas { min-height: 220px; display: flex; align-items: center; justify-content: center; }
.course-share-qr-canvas img,
.course-share-qr-canvas canvas { max-width: 220px; height: auto; }
.course-share-canvas { display: none; }

@media (max-width: 760px) {
    .course-share-modal { align-items: end; padding: 0; }
    .course-share-dialog { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .course-share-head { padding: 18px 16px 9px; }
    .course-share-preview { margin: 0 16px; }
    .course-share-link { margin: 12px 16px 0; }
    .course-share-label { margin: 12px 16px 6px; }
    .course-share-channels { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 16px; }
    .course-share-actions { padding: 12px 16px 6px; }
    .course-share-download, .course-share-primary { flex: 1; }
    .course-share-note { padding: 0 16px 14px; }
    .course-share-close { right: 10px; top: 10px; }
}

@media (max-width: 370px) {
    .course-share-trigger { padding: 5px 6px; }
    .course-share-trigger { font-size: 0; gap: 0; }
    .course-share-trigger .icon { width: 14px; height: 14px; }
    .course-foot-actions { gap: 4px; }
}

body.course-share-open { overflow: hidden; }
