/* =============================================================================
   Course Detail Page — Udemy-style
   corsi.coreform.it
   ============================================================================= */

/* ── Page wrapper — dark band via pseudo-element ── */
.cd-page-wrapper {
    padding-top: var(--cf-navbar-height);
    position: relative;
}

/* Full-width dark band behind the hero section */
.cd-page-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cd-hero-band-h, 340px);
    background: #1c1d1f;
    z-index: 0;
}

.cd-page-wrapper > .container-xl {
    position: relative;
    z-index: 1;
}

/* ── Two-column flex layout ── */
#cd-two-col {
    gap: 0;
    align-items: flex-start;
}

/* ── Left column ── */
.cd-left-col {
    flex: 1;
    min-width: 0;
}

/* ── Hero text section (dark bg from wrapper::before) ── */
.cd-hero-section {
    padding: 2.5rem 0 2rem;
    color: #fff;
}

.cd-breadcrumb {
    font-size: 12px;
    color: #cec0fc;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cd-breadcrumb a {
    color: #cec0fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cd-breadcrumb span { color: #6a6f73; }

.cd-hero-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    margin-bottom: 0.75rem;
}

.cd-hero-subtitle {
    font-size: 1.125rem;
    color: #d1d7dc;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.cd-hero-brief {
    font-size: 14px;
    color: #d1d7dc;
    margin-bottom: 12px;
}

.cd-hero-badge {
    display: inline-block;
    background: #eceb98;
    color: #3d3c0a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cd-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #d1d7dc;
    margin-bottom: 0.5rem;
}

.cd-stars { display: flex; align-items: center; gap: 3px; }
.cd-stars .fa-star { color: #f4c430; font-size: 12px; }

.cd-rating-num {
    color: #cec0fc;
    font-weight: 700;
    font-size: 14px;
}

.cd-reviews-count {
    color: #d1d7dc;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 13px;
}

.cd-hero-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #d1d7dc;
    margin-top: 10px;
}

.cd-hero-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Content section (white bg) ── */
.cd-content-section {
    background: #fff;
    padding: 2rem 0 3rem;
}

/* ── RIGHT COLUMN — CSS sticky, never disappears ── */
.cd-right-col {
    width: 340px;
    margin-left: 40px;
    flex-shrink: 0;
    /* CSS native sticky — stays visible always */
    position: sticky;
    top: calc(var(--cf-navbar-height) + 16px);
    align-self: flex-start;
    /* Scrollable if sidebar is taller than viewport */
    max-height: calc(100vh - var(--cf-navbar-height) - 32px);
    overflow-y: auto;
    /* Hide scrollbar visually */
    scrollbar-width: none;
}

.cd-right-col::-webkit-scrollbar { display: none; }

/* ── Sidebar card ── */
.cd-sidebar-card {
    background: #fff;
    border: 1px solid #d1d7dc;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

.cd-sidebar-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.cd-sidebar-body {
    padding: 20px;
}

.cd-sidebar-price { margin-bottom: 16px; }

.cd-price-current {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1c1d1f;
    line-height: 1;
}

.cd-price-original {
    font-size: 1rem;
    color: #6a6f73;
    text-decoration: line-through;
    margin-left: 8px;
}

.cd-price-discount {
    font-size: 13px;
    font-weight: 700;
    color: #b91c1c;
    margin-top: 4px;
}

.cd-price-timer {
    font-size: 12px;
    color: #6a6f73;
    margin-top: 6px;
}

.cd-cta-btn {
    display: block;
    width: 100%;
    background: var(--cf-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 10px;
    line-height: 1.4;
}

.cd-cta-btn:hover { background: var(--cf-primary-dark); color: #fff; }

.cd-cta-secondary {
    display: block;
    width: 100%;
    background: transparent;
    color: #1c1d1f;
    border: 1px solid #1c1d1f;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
    margin-bottom: 12px;
}

.cd-cta-secondary:hover { background: #f7f9fa; color: #1c1d1f; }

.cd-sidebar-guarantee {
    font-size: 12px;
    color: #6a6f73;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 0;
}

.cd-sidebar-includes {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    font-size: 13px;
    color: #1c1d1f;
}

.cd-sidebar-includes li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.cd-sidebar-includes li i {
    color: #6a6f73;
    width: 16px;
    text-align: center;
    font-size: 13px;
}

.cd-sidebar-contact {
    border-top: 1px solid #d1d7dc;
    margin-top: 16px;
    padding-top: 16px;
}

.cd-sidebar-contact-title {
    font-size: 13px;
    font-weight: 700;
    color: #1c1d1f;
    margin-bottom: 10px;
}

.cd-contact-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cd-contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1c1d1f;
    text-decoration: none;
    padding: 7px 10px;
    border: 1px solid #d1d7dc;
    border-radius: 4px;
    transition: background 0.1s;
}

.cd-contact-link:hover { background: #f7f9fa; color: #1c1d1f; }

.cd-contact-link i {
    width: 16px;
    text-align: center;
    color: var(--cf-primary);
}

/* ── Section boxes (main content) ── */
.cd-section {
    border: 1px solid #d1d7dc;
    padding: 24px;
    margin-bottom: 24px;
    background: #fff;
}

.cd-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1c1d1f;
    margin-bottom: 16px;
}

/* ── What you'll learn ── */
.cd-learn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.cd-learn-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #1c1d1f;
    line-height: 1.4;
}

.cd-learn-item i {
    color: #1c1d1f;
    font-size: 11px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* ── Course includes ── */
.cd-includes-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cd-includes-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1c1d1f;
}

.cd-includes-list li i {
    color: #1c1d1f;
    width: 18px;
    text-align: center;
    font-size: 13px;
}

/* ── Accordion ── */
.cd-accordion-item {
    border-top: 1px solid #d1d7dc;
}

.cd-accordion-btn {
    width: 100%;
    background: #f7f9fa;
    border: none;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #1c1d1f;
    transition: background 0.1s;
}

.cd-accordion-btn:hover { background: #eef0f2; }

.cd-accordion-btn[aria-expanded="true"] .cd-acc-icon { transform: rotate(180deg); }

.cd-acc-icon {
    transition: transform 0.2s;
    font-size: 12px;
    flex-shrink: 0;
    margin-left: 12px;
}

.cd-accordion-body {
    padding: 16px 24px;
    font-size: 14px;
    color: #1c1d1f;
    border-top: 1px solid #d1d7dc;
    background: #fff;
    line-height: 1.6;
}

.cd-accordion-body p:last-child { margin-bottom: 0; }

/* ── Description collapse ── */
.cd-description {
    font-size: 14px;
    color: #1c1d1f;
    line-height: 1.7;
    position: relative;
}

.cd-description.is-collapsed {
    max-height: 220px;
    overflow: hidden;
}

.cd-description.is-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
}

.cd-show-more {
    background: transparent;
    border: none;
    color: #5624d0;
    font-size: 14px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.cd-show-more:hover { color: #401b9c; }

/* ── CTA band ── */
.cd-cta-band {
    background: #f7f9fa;
    border-top: 1px solid #d1d7dc;
    border-bottom: 1px solid #d1d7dc;
    padding: 20px 0;
    margin-bottom: 24px;
}

.cd-cta-band-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cd-cta-band-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1c1d1f;
}

/* ── Reviews ── */
.cd-reviews-section { margin-bottom: 0; }

.cd-rating-overview {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 16px 0 20px;
}

.cd-rating-big { text-align: center; flex-shrink: 0; }

.cd-rating-big-num {
    font-size: 3.5rem;
    font-weight: 700;
    color: #1c1d1f;
    line-height: 1;
}

.cd-rating-big-stars {
    color: #f4c430;
    font-size: 15px;
    margin-top: 4px;
}

.cd-rating-big-label {
    font-size: 12px;
    color: #6a6f73;
    margin-top: 4px;
}

.cd-rating-bars { flex: 1; }

.cd-rating-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.cd-rating-bar-track {
    flex: 1;
    height: 8px;
    background: #d1d7dc;
    border-radius: 4px;
    overflow: hidden;
}

.cd-rating-bar-fill {
    height: 100%;
    background: #6a6f73;
    border-radius: 4px;
}

.cd-review-card {
    padding: 20px 0;
    border-top: 1px solid #d1d7dc;
}

.cd-review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.cd-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1c1d1f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.cd-review-name { font-size: 14px; font-weight: 700; color: #1c1d1f; }
.cd-review-date { font-size: 12px; color: #6a6f73; }

.cd-review-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.cd-review-stars i { font-size: 12px; color: #f4c430; }

.cd-review-title {
    font-size: 14px;
    font-weight: 700;
    color: #1c1d1f;
    margin-bottom: 4px;
}

.cd-review-body { font-size: 14px; color: #1c1d1f; line-height: 1.6; }

.cd-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--cf-primary);
    font-weight: 600;
}

/* ── Mobile sidebar ── */
.cd-mobile-sidebar {
    background: #f7f9fa;
    border-top: 1px solid #d1d7dc;
}

/* ── WhatsApp FAB ── */
.cd-whatsapp-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 999;
    font-size: 26px;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
}

.cd-whatsapp-fab:hover { background: #1da851; color: #fff; transform: scale(1.08); }

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .cd-right-col { display: none !important; }
    .cd-hero-section { padding: 1.5rem 0 1rem; }
    .cd-content-section { padding: 1.5rem 0 2rem; }
    .cd-learn-grid { grid-template-columns: 1fr; }
    .cd-includes-list { grid-template-columns: 1fr; }
    .cd-rating-overview { flex-direction: column; gap: 16px; align-items: flex-start; }
    .cd-cta-band-inner { flex-direction: column; align-items: flex-start; }
}
