/* صفحه جزئیات دوره — الهام از کارت‌محور SabzLearn */

.cd-page {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: #f3f4f6;
    padding: 16px 0 48px;
}

.cd-shell {
    position: relative;
    z-index: 1;
    max-width: 920px;
}

/* ── Breadcrumb ── */
.cd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #9ca3af;
    margin-bottom: 16px;
}

.cd-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.cd-breadcrumb a:hover {
    color: var(--primary, #0891b2);
}

.cd-staff-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Banner ── */
.cd-banner {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #e5e7eb;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.cd-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cd-banner__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #9ca3af;
}

/* ── Head ── */
.cd-head {
    margin-bottom: 20px;
}

.cd-head__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cd-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.cd-tag--featured {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.cd-tag--online {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.cd-tag--in-person {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.cd-tag--installment {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
    color: #9a3412;
    gap: 6px;
}

.cd-tag--installment .cd-tag__sub {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.9;
    padding-right: 4px;
    border-right: 1px solid rgba(154, 52, 18, 0.2);
    margin-right: 2px;
}

.cd-head__title {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    font-weight: 800;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cd-head__event {
    margin: 12px 0 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(20, 184, 166, 0.08));
    border: 1px solid rgba(13, 148, 136, 0.25);
    border-radius: 12px;
    color: #0f766e;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
}

.cd-stat-box--event strong {
    font-size: 0.95rem;
    line-height: 1.4;
}

.cd-head__lead {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.75;
    margin: 0 0 10px;
}

.cd-head__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #374151;
}

/* ── Discount card ── */
.cd-discount-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cd-discount-card strong {
    color: #dc2626;
    font-size: 1rem;
}

.cd-discount-card span {
    font-size: 0.82rem;
    color: #9ca3af;
}

/* ── Access card (owned / free) ── */
.cd-access-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 18px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 45%, #fff 100%);
    border: 1px solid rgba(16, 185, 129, 0.22);
    box-shadow:
        0 4px 20px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.cd-access-card__glow {
    position: absolute;
    top: -40px;
    left: -30px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.cd-access-card__main {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 240px;
    min-width: 0;
}

.cd-access-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #10b981 0%, #0891b2 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
    font-size: 1.35rem;
}

.cd-access-card__copy {
    min-width: 0;
}

.cd-access-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.cd-access-card__title {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #064e3b;
    line-height: 1.45;
    margin-bottom: 4px;
}

.cd-access-card__meta {
    margin: 0;
    font-size: 0.82rem;
    color: #047857;
    opacity: 0.85;
    line-height: 1.6;
}

.cd-access-card__actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cd-access-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cd-access-card__btn--primary {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    box-shadow: 0 8px 22px rgba(8, 145, 178, 0.32);
}

.cd-access-card__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(8, 145, 178, 0.38);
    color: #fff;
}

.cd-access-card__btn--ghost {
    background: rgba(255, 255, 255, 0.85);
    color: #0f766e;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.cd-access-card__btn--ghost:hover {
    background: #fff;
    color: #065f46;
    transform: translateY(-1px);
}

.cd-access-card--in-person {
    background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 45%, #fff 100%);
    border-color: rgba(124, 58, 237, 0.22);
    box-shadow:
        0 4px 20px rgba(124, 58, 237, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cd-access-card--in-person .cd-access-card__glow {
    background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, transparent 70%);
}

.cd-access-card__main--stacked {
    align-items: flex-start;
}

.cd-access-card__icon--in-person {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}

.cd-access-card__badge--in-person {
    background: rgba(124, 58, 237, 0.12);
    color: #5b21b6;
}

.cd-access-card--in-person .cd-access-card__title {
    color: #4c1d95;
}

.cd-access-card__message {
    margin: 0;
    font-size: 0.9rem;
    color: #5b21b6;
    line-height: 1.85;
}

.cd-access-card__message p {
    margin: 0;
}

.cd-progress-mini {
    padding: 10px 0 2px;
}

.cd-progress-mini__row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.84rem;
    color: #475569;
}

.cd-progress-mini__row span:last-child {
    font-weight: 700;
    color: #0f172a;
}

.cd-progress-mini__bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}

.cd-progress-mini__bar span {
    display: block;
    height: 100%;
    background: #0f766e;
    border-radius: 999px;
}

.cd-progress-mini__note {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.cd-lesson--session-paid {
    border-color: rgba(15, 118, 110, 0.18);
    background: rgba(240, 253, 250, 0.55);
}

.cd-lesson--session-next {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(255, 251, 235, 0.7);
}

.cd-lesson--session-locked {
    opacity: 0.72;
}

.cd-lesson__chip--paid {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.cd-lesson__chip--next {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.cd-access-card__btn--due {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.32);
    animation: cd-pay-due-pulse 2s ease-in-out infinite;
}

@keyframes cd-pay-due-pulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(220, 38, 38, 0.28); }
    50% { box-shadow: 0 12px 28px rgba(220, 38, 38, 0.48); }
}

/* ── Coming soon ── */
.cd-coming-soon {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 55%, #fff 100%);
    border: 1px solid rgba(245, 158, 11, 0.28);
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.1);
}

.cd-coming-soon__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.28);
}

.cd-coming-soon__copy {
    min-width: 0;
}

.cd-coming-soon__badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.cd-coming-soon__copy strong {
    display: block;
    font-size: 1rem;
    color: #92400e;
    margin-bottom: 4px;
    line-height: 1.45;
}

.cd-coming-soon__copy p {
    margin: 0;
    font-size: 0.84rem;
    color: #a16207;
    line-height: 1.7;
}

.cd-coming-soon--finished {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-color: #cbd5e1;
}

.cd-coming-soon--finished .cd-coming-soon__icon {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.cd-coming-soon__badge--finished {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.cd-coming-soon--finished .cd-coming-soon__copy strong {
    color: #334155;
}

.cd-coming-soon--finished .cd-coming-soon__copy p {
    color: #64748b;
}

/* ── Buy bar ── */
.cd-buy-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    flex-wrap: wrap;
}

.cd-buy-bar__price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cd-buy-bar__old {
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.cd-buy-bar__amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
}

.cd-buy-bar__amount small {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.cd-buy-bar__action {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: min(100%, 220px);
}

.cd-buy-bar__action .cd-btn-buy {
    width: 100%;
    margin: 0;
}

.cd-buy-bar__action .cd-alert {
    margin: 0;
    font-size: 0.82rem;
    padding: 8px 12px;
}

/* ── Installment pay card ── */
.cd-pay-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 55%, #f0fdfa 100%);
    border: 1px solid rgba(8, 145, 178, 0.18);
    border-radius: 22px;
    padding: 18px 16px 16px;
    margin-bottom: 14px;
    box-shadow:
        0 10px 30px rgba(8, 145, 178, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.cd-pay-card__glow {
    position: absolute;
    top: -60px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.28) 0%, transparent 70%);
    pointer-events: none;
}

.cd-pay-card__top {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.cd-pay-card__price-block {
    min-width: 0;
}

.cd-pay-card__old {
    display: block;
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.cd-pay-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cd-pay-card__price {
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    font-weight: 900;
    color: #0f172a;
    line-height: 1.1;
}

.cd-pay-card__currency {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
}

.cd-pay-card__price-note {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: #0f766e;
    font-weight: 600;
}

.cd-pay-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(8, 145, 178, 0.28);
}

.cd-pay-card__modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.cd-pay-card__mode {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.cd-pay-card__mode.is-active {
    border-color: #0891b2;
    background: #f0fdfa;
    box-shadow: 0 4px 14px rgba(8, 145, 178, 0.12);
}

.cd-pay-card__mode-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecfeff;
    color: #0e7490;
    flex-shrink: 0;
}

.cd-pay-card__mode.is-active .cd-pay-card__mode-icon {
    background: #0891b2;
    color: #fff;
}

.cd-pay-card__mode-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cd-pay-card__mode-copy strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.cd-pay-card__mode-copy small {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.4;
}

.cd-pay-card__installment-panel {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(8, 145, 178, 0.22);
}

.cd-pay-card__count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.cd-pay-card__count-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: #334155;
}

.cd-pay-card__count-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cd-pay-card__count-tab {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.cd-pay-card__count-tab.is-active {
    background: #0891b2;
    border-color: #0891b2;
    color: #fff;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.24);
}

.cd-pay-card__schedule {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cd-pay-schedule__item {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: start;
}

.cd-pay-schedule__marker {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 800;
}

.cd-pay-schedule__item.is-current .cd-pay-schedule__marker {
    background: linear-gradient(135deg, #0891b2, #14b8a6);
    color: #fff;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.28);
}

.cd-pay-schedule__body {
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.cd-pay-schedule__item.is-current .cd-pay-schedule__body {
    border-color: rgba(8, 145, 178, 0.28);
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.cd-pay-schedule__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.cd-pay-schedule__head strong {
    font-size: 0.88rem;
    color: #0f172a;
}

.cd-pay-schedule__amount {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0e7490;
    white-space: nowrap;
}

.cd-pay-schedule__amount small {
    font-size: 0.72rem;
    font-weight: 600;
}

.cd-pay-schedule__meta {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
}

.cd-pay-schedule__chip {
    display: inline-flex;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(8, 145, 178, 0.12);
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 800;
}

.cd-pay-card__action .cd-btn-buy {
    width: 100%;
    margin: 0;
}

.cd-pay-card__action .cd-note {
    margin-top: 8px;
}

/* ── Stat grid ── */
.cd-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.cd-stat-box {
    background: #fff;
    border-radius: 16px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cd-stat-box__icon {
    font-size: 1.1rem;
    color: var(--primary, #0891b2);
    opacity: 0.85;
}

.cd-stat-box strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    overflow-wrap: anywhere;
}

.cd-stat-box span:last-child {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* ── Panels ── */
.cd-panel {
    background: #fff;
    border-radius: 20px;
    padding: 22px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04);
}

.cd-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
    margin: 0 0 16px;
}

.cd-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.9rem;
}

.cd-panel__count {
    margin-right: auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 999px;
}

.cd-empty {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0;
}

/* ── Description expand ── */
.cd-desc-wrap {
    position: relative;
}

.cd-desc-wrap.is-collapsed .course-description-wrap {
    max-height: clamp(520px, 72vh, 760px);
    overflow: hidden;
}

.cd-desc-wrap.is-collapsed .cd-desc-fade {
    display: block;
}

.course-description-wrap {
    position: relative;
}

.course-description {
    font-size: 0.92rem;
    line-height: 1.85;
    color: #374151;
    overflow-wrap: anywhere;
}

.course-description h2,
.course-description h3,
.course-description h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 1.2em 0 0.5em;
}

.course-description p {
    margin: 0 0 0.85em;
}

.course-description img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1em 0;
    display: block;
}

.course-description video,
.course-description .course-desc-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0;
    background: #111827;
    display: block;
}

.cd-video-player {
    position: relative;
    width: 100%;
    margin: 1em 0;
    border-radius: 14px;
    overflow: hidden;
    background: #111827;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}

.cd-video-player .course-desc-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 0;
}

.cd-video-player.is-poster .course-desc-video {
    cursor: pointer;
}

.cd-video-player__play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    z-index: 2;
    transition: transform 0.2s ease, background 0.2s ease;
}

.cd-video-player__play::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid #0f766e;
}

.cd-video-player__play:hover {
    transform: scale(1.05);
    background: #fff;
}

.cd-video-player.is-playing .cd-video-player__play {
    display: none;
}

.course-description iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 180px;
    border: 0;
    border-radius: 12px;
    margin: 1em 0;
    display: block;
}

.course-description figure {
    margin: 1em 0;
}

.course-description figure img,
.course-description figure video {
    margin: 0;
}

.cd-desc-fade {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.92) 55%, #fff 100%);
    pointer-events: none;
}

.cd-desc-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 220px;
    margin: 8px auto 0;
    padding: 12px 22px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f766e;
    cursor: pointer;
    z-index: 2;
    line-height: 1.2;
}

.cd-desc-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ecfeff;
    color: #0f766e;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.cd-desc-wrap:not(.is-collapsed) .cd-desc-toggle {
    color: #374151;
}

.cd-desc-wrap:not(.is-collapsed) .cd-desc-toggle__icon {
    background: #f3f4f6;
    color: #374151;
}

.cd-desc-actions {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.cd-desc-toggle:hover {
    background: #f9fafb;
    border-color: #99f6e4;
}

/* ── Curriculum ── */
.cd-panel--curriculum {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.cd-curriculum-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.cd-curriculum-head .cd-panel__title {
    margin-bottom: 0;
}

.cd-curriculum-summary {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cd-curriculum-summary__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(8, 145, 178, 0.08);
    border: 1px solid rgba(8, 145, 178, 0.14);
    color: #0e7490;
    font-size: 0.78rem;
    font-weight: 700;
}

.cd-curriculum {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cd-chapter {
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.cd-chapter.is-open {
    border-color: rgba(8, 145, 178, 0.28);
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.1);
}

.cd-chapter__head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    transition: background 0.15s ease;
}

.cd-chapter__head:hover {
    background: rgba(8, 145, 178, 0.04);
}

.cd-chapter.is-open .cd-chapter__head {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.06) 0%, rgba(255, 255, 255, 0) 100%);
    border-bottom: 1px solid #eef2f7;
}

.cd-chapter__index {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

.cd-chapter__info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    flex: 1;
}

.cd-chapter__title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.45;
}

.cd-chapter__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: #6b7280;
}

.cd-chapter__meta span {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    font-weight: 600;
}

.cd-chapter__chevron {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    transition: transform 0.22s ease, background 0.15s ease, color 0.15s ease;
}

.cd-chapter.is-open .cd-chapter__chevron {
    transform: rotate(180deg);
    background: rgba(8, 145, 178, 0.12);
    color: #0891b2;
}

.cd-chapter__body {
    display: none;
    padding: 10px 14px 14px;
}

.cd-chapter.is-open .cd-chapter__body {
    display: block;
}

/* ── Lessons ── */
.cd-lesson {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 14px;
    margin-bottom: 8px;
    border: 1px solid #eef2f7;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cd-lesson:last-child {
    margin-bottom: 0;
}

.cd-lesson::before {
    content: '';
    position: absolute;
    right: 28px;
    top: calc(100% - 4px);
    width: 2px;
    height: 8px;
    background: #e5e7eb;
}

.cd-lesson:last-child::before {
    display: none;
}

.cd-lesson--playable:hover {
    transform: translateX(-3px);
    border-color: rgba(8, 145, 178, 0.28);
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.1);
}

.cd-lesson--locked {
    background: #f9fafb;
    border-style: dashed;
    border-color: #e5e7eb;
}

.cd-lesson__index {
    flex-shrink: 0;
    width: 28px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0891b2;
    text-align: center;
}

.cd-lesson__index--muted {
    color: #9ca3af;
}

.cd-lesson__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.9rem;
}

.cd-lesson__icon--video {
    background: rgba(8, 145, 178, 0.12);
    color: #0891b2;
}

.cd-lesson__icon--audio {
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
}

.cd-lesson__icon--text {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.cd-lesson__icon--locked {
    background: #eef2f7;
    color: #9ca3af;
}

.cd-lesson__body {
    flex: 1;
    min-width: 0;
}

.cd-lesson__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #1f2937;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.cd-lesson--locked .cd-lesson__title {
    color: #6b7280;
}

.cd-lesson__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.cd-lesson__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
}

.cd-lesson__chip--free {
    background: #ecfdf5;
    color: #047857;
}

.cd-lesson__chip--ready {
    background: rgba(8, 145, 178, 0.1);
    color: #0e7490;
}

.cd-lesson__chip--locked {
    background: #fef3c7;
    color: #92400e;
}

.cd-lesson__play {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
    font-size: 0.72rem;
    padding-right: 2px;
}

.cd-lesson--playable:hover .cd-lesson__play {
    transform: scale(1.06);
}

/* ── Prerequisites ── */
.cd-prereq {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.92rem;
    color: #374151;
}

.cd-prereq__icon {
    color: #059669;
}

/* ── Instructor ── */
.cd-instructor-bio {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.cd-instructor-bio__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cd-instructor-bio__avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #0891b2);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.cd-instructor-bio__body strong {
    display: block;
    font-size: 0.95rem;
    color: #111827;
    margin-bottom: 2px;
}

.cd-instructor-bio__title {
    display: block;
    font-size: 0.82rem;
    color: #9ca3af;
    margin-bottom: 8px;
}

.cd-instructor-bio__body p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #6b7280;
}

/* ── Reviews ── */
.cd-reviews {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cd-review {
    padding: 14px;
    background: #f9fafb;
    border-radius: 14px;
    border: 1px solid #f3f4f6;
}

.cd-review__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.cd-review__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary, #0891b2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.cd-review__meta {
    flex: 1;
    min-width: 0;
}

.cd-review__meta strong {
    display: block;
    font-size: 0.88rem;
    color: #111827;
}

.cd-review__meta span {
    font-size: 0.78rem;
    color: #9ca3af;
}

.cd-review__stars {
    flex-shrink: 0;
}

.cd-review__text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #374151;
}

.cd-review__date {
    display: block;
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 2px;
}

.cd-review--mine {
    border-color: #a7f3d0;
    background: #f0fdf4;
}

.cd-review__badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.cd-empty--reviews {
    margin-bottom: 16px;
}

/* ── Review compose form ── */
.cd-review-compose {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.cd-review-compose__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
}

.cd-review-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cd-review-form__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.cd-review-form__textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    background: #fafafa;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cd-review-form__textarea:focus {
    outline: none;
    border-color: var(--primary, #0891b2);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
    background: #fff;
}

.cd-review-form__error {
    margin: 6px 0 0;
    font-size: 0.78rem;
    color: #dc2626;
}

.cd-review-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: flex-start;
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: #22c55e;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.cd-review-form__submit:hover {
    background: #16a34a;
}

.cd-star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
}

.cd-star-input__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cd-star-input__star {
    cursor: pointer;
    font-size: 1.35rem;
    color: #d1d5db;
    transition: color 0.12s ease, transform 0.12s ease;
    line-height: 1;
}

.cd-star-input__star:hover {
    transform: scale(1.08);
}

.cd-star-input__star.is-active {
    color: #f59e0b;
}

.cd-review-hint {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.cd-review-hint p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.cd-review-hint__link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary, #0891b2);
    text-decoration: none;
}

.cd-review-hint__link:hover {
    text-decoration: underline;
}

/* ── Login hint ── */
.cd-login-hint {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: #fdf6e7;
    border-radius: 14px;
    border: 1px solid #fde68a;
}

.cd-login-hint__icon {
    flex-shrink: 0;
    font-size: 1.2rem;
    color: #d97706;
    margin-top: 2px;
}

.cd-login-hint p {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: #78350f;
    line-height: 1.6;
}

.cd-login-hint__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary, #0891b2);
    cursor: pointer;
}

.cd-login-hint__link:hover {
    text-decoration: underline;
}

/* ── Purchase buttons ── */
.cd-btn-buy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 45%, #f97316 100%);
    color: #fff;
    box-shadow:
        0 8px 24px rgba(234, 88, 12, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    white-space: nowrap;
}

.cd-btn-buy:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow:
        0 12px 30px rgba(234, 88, 12, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.cd-btn-buy--success {
    background: var(--primary, #0891b2);
}

.cd-btn-buy--success:hover {
    background: #0e7490;
}

.cd-btn-buy--ghost {
    background: #f3f4f6;
    color: #374151;
}

.cd-btn-buy--ghost:hover {
    background: #e5e7eb;
    color: #111827;
}

.cd-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cd-alert--owned {
    background: #ecfdf5;
    color: #065f46;
}

.cd-alert--pending {
    background: #fef3c7;
    color: #92400e;
}

.cd-alert--rejected {
    background: #fef2f2;
    color: #991b1b;
}

.cd-note {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 6px 0 0;
    text-align: center;
}

.auth-modal-inline-link {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    color: var(--primary, #0891b2);
    cursor: pointer;
    text-decoration: underline;
}

/* ── Related courses ── */
.cd-related {
    margin-top: 28px;
    margin-bottom: 0;
    padding: 22px 20px 28px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
}

.cd-related + #reviews {
    margin-top: 56px;
}

.cd-related__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.cd-related__scroll {
    overflow: hidden;
    margin: 0 -4px;
}

.cd-related .novia-grid-3 {
    gap: 18px;
    align-items: stretch;
}

.cd-related .course-preview {
    min-width: 0;
    height: 100%;
}

.cd-related .course-preview-body {
    padding: 18px 18px 16px;
}

.cd-related .course-preview-body h3 {
    font-size: 1rem;
    line-height: 1.55;
}

.cd-related .course-preview-img {
    height: 160px;
}

.cd-related .course-preview-footer {
    gap: 12px;
    padding-top: 12px;
}

.cd-related .course-preview-price {
    font-size: 0.95rem;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .cd-page {
        padding: 10px 0 80px;
    }

    .cd-banner {
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .cd-stat-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cd-stat-box {
        flex-direction: row;
        text-align: right;
        padding: 12px 14px;
        gap: 12px;
    }

    .cd-stat-box strong {
        flex: 1;
    }

    .cd-stat-box span:last-child {
        font-size: 0.75rem;
    }

    .cd-buy-bar,
    .cd-access-card {
        position: sticky;
        bottom: 12px;
        z-index: 40;
        box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
    }

    .cd-access-card {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        border-radius: 18px;
    }

    .cd-access-card__main {
        flex: none;
    }

    .cd-access-card__icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 1.15rem;
    }

    .cd-access-card__title {
        font-size: 0.95rem;
    }

    .cd-access-card__actions {
        flex-direction: column;
        width: 100%;
    }

    .cd-access-card__btn {
        width: 100%;
    }

    .cd-coming-soon {
        flex-direction: column;
        padding: 16px;
    }

    .cd-coming-soon__icon {
        width: 42px;
        height: 42px;
    }

    .cd-panel {
        border-radius: 16px;
        padding: 18px 16px;
    }

    .cd-instructor-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cd-curriculum-head {
        flex-direction: column;
        align-items: stretch;
    }

    .cd-curriculum-summary {
        width: 100%;
    }

    .cd-curriculum-summary__item {
        flex: 1;
        justify-content: center;
    }

    .cd-chapter__head {
        padding: 14px;
        gap: 10px;
    }

    .cd-chapter__index {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        font-size: 0.72rem;
    }

    .cd-chapter__title {
        font-size: 0.88rem;
    }

    .cd-lesson {
        padding: 10px 12px;
        gap: 8px;
    }

    .cd-lesson__index {
        display: none;
    }

    .cd-lesson__icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .cd-lesson__title {
        font-size: 0.82rem;
    }

    .cd-lesson__play {
        width: 30px;
        height: 30px;
    }

    .cd-pay-card__top {
        flex-direction: column;
    }

    .cd-pay-card__badge {
        align-self: flex-start;
    }

    .cd-pay-card__modes {
        grid-template-columns: 1fr;
    }

    .cd-pay-schedule__head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (min-width: 641px) {
    .cd-buy-bar__action {
        flex: 0 0 auto;
        min-width: 200px;
        max-width: 280px;
    }
}
