/* --- Course Detail Page CSS --- */
/* 1. Visual Section (Black) */
.cd-visual {background-color: #1b1c1d;color: #fff;padding: 40px 0;max-width: 1440px;margin: auto;padding: 50px;border-radius: 30px;}
.cd-visual2 {background-color: #007368;color: #fff;padding: 40px 0;max-width: 1440px;margin: auto;padding: 50px;border-radius: 30px;}
.cd-inner { display: flex; justify-content: space-between; align-items: flex-start; }
.cd-left { max-width: 760px; }

.badge-best { background-color: #00c471; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 4px; display: inline-block; margin-bottom: 12px; }
.cd-breadcrumb { font-size: 14px; color: #adb5bd; margin-bottom: 12px; font-weight: 500; }
.cd-title { font-size: 28px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }
.cd-desc { font-size: 15px; color: #dee2e6; line-height: 1.6; margin-bottom: 24px; }

.cd-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 14px; }
.cd-meta .stars { color: #ffc107; font-size: 14px; }
.cd-meta .score { color: #fff; font-weight: 700; margin-left: 4px; }
.cd-meta .review-cnt { color: #adb5bd; text-decoration: underline; }
.cd-meta .student-cnt { color: #adb5bd; }

.cd-instructor { font-size: 15px; font-weight: 500; margin-bottom: 20px; display: flex; align-items: center; gap: 6px; }
.cd-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-tags span { background: #343a40; color: #ced4da; padding: 6px 10px; border-radius: 4px; font-size: 13px; }

.cd-right { width: 340px; }
.video-box { background: white; border-radius: 8px; overflow: hidden; height: 200px; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; }
.instructor-intro { color: #333; }
.intro-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.intro-profile { display: flex; gap: 10px; align-items: center; }
.intro-profile img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.intro-txt { font-size: 12px; color: #666; }
.intro-txt strong { font-size: 14px; color: #333; display: block; margin-bottom: 4px; }
.preview-btn { width: 100%; background: #f8f9fa; border: 1px solid #dee2e6; padding: 10px; font-weight: 700; border-radius: 4px; cursor: pointer; margin-top: auto; }

/* 2. Body Layout */
.cd-body-layout { display: flex; gap: 40px; margin-top: 0; padding-top: 0; position: relative; }
.cd-main {flex: 1;padding-bottom: 100px;margin-top: 50px;}

/* Sticky Tabs */
.cd-tabs { position: sticky; top: 64px; background: white; border-bottom: 1px solid #dee2e6; z-index: 100; margin-bottom: 40px; }
.cd-tabs ul { display: flex; }
.cd-tabs li { margin-right: 24px; }
.cd-tabs a { display: block; padding: 16px 0; font-size: 15px; font-weight: 500; color: #495057; border-bottom: 2px solid transparent; }
.cd-tabs li.active a { color: #00c471; border-bottom-color: #00c471; font-weight: 700; }
.cd-tabs .count { color: #00c471; font-size: 12px; background: #e6fcf5; padding: 2px 6px; border-radius: 10px; margin-left: 4px; }

/* Content Section */
.partner-banner { background: #fff8e6; border: 1px solid #ffec99; border-radius: 8px; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.pb-left { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.icon-coin { width: 24px; height: 24px; background: #fab005; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; }
.btn-partner { background: #fd7e14; color: white; border: none; padding: 8px 16px; border-radius: 4px; font-weight: 700; font-size: 13px; cursor: pointer; }

.section-h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; color: #343a40; }
.review-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rs-card { border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; background: #f8f9fa; }
.rs-header { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: #868e96; }
.rs-user { font-weight: 700; color: #343a40; }
.rs-stars { color: #ffc107; font-size: 13px; margin-bottom: 12px; font-weight: 700; }
.rs-text { font-size: 14px; line-height: 1.6; color: #495057; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.learning-points-box { border: 1px solid #e9ecef; border-radius: 8px; padding: 24px; }
.learning-points-box ul li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 15px; color: #495057; }
.learning-points-box i { color: #00c471; margin-top: 4px; }

/* Curriculum */
.curriculum-list { border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; }
.curri-item { border-bottom: 1px solid #f1f3f5; }
.curri-item:last-child { border-bottom: none; }
.curri-head { background: #f8f9fa; padding: 16px 20px; font-weight: 600; font-size: 15px; cursor: pointer; display: flex; justify-content: space-between; }
.curri-meta { font-weight: 400; font-size: 13px; color: #868e96; }
.curri-sub { display: none; padding: 0; }
.curri-item.open .curri-sub { display: block; }
.curri-sub li {padding: 12px 20px !important;border-top: 1px solid #f1f3f5;font-size: 14px;display: flex;align-items: center;color: #495057;}
.curri-sub li i { margin-right: 10px; color: #adb5bd; }
.curri-sub li .btn-preview { margin-left: auto; margin-right: 10px; border: 1px solid #00c471; color: #00c471; background: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.curri-sub li .time { font-size: 12px; color: #adb5bd; margin-left: auto; }
.curri-sub li .btn-preview + .time { margin-left: 0; }


/* 3. Right Floating Side */
.cd-side { width: 320px; padding-top: 40px; }
.sticky-box { position: sticky; top: 130px; border: 1px solid #dee2e6; border-radius: 8px; background: white; overflow: hidden; }
.promo-badge { background: #ff4d4f; color: white; padding: 10px; font-size: 13px; font-weight: 700; text-align: center; }

.price-area { padding: 20px; border-bottom: 1px solid #f1f3f5; }
.price-label { font-size: 20px; font-weight: 800; color: #343a40; margin-bottom: 8px; }
.price-calc { font-size: 15px; margin-bottom: 6px; }
.discount-rate { color: #ff4d4f; font-weight: 700; margin-right: 4px; }
.original-price { color: #adb5bd; text-decoration: line-through; margin-right: 4px; }
.final-price { font-weight: 700; color: #343a40; }
.installment { font-size: 12px; color: #868e96; }

.action-btns { padding: 20px; padding-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.btn-apply { background: #00c471; color: white; padding: 14px; border-radius: 4px; font-weight: 700; font-size: 16px; border: none; cursor: pointer; transition: 0.2s; }
.btn-apply:hover { background: #00b365; }
.btn-cart { background: white; color: #495057; border: 1px solid #dee2e6; padding: 12px; border-radius: 4px; font-weight: 600; cursor: pointer; }
.btn-cart:hover { background: #f8f9fa; }

.gift-row { display: flex; gap: 10px; padding: 0 20px 20px 20px; border-bottom: 1px solid #f1f3f5; }
.btn-gift { flex: 1; background: #f8f9fa; border: 1px solid #f1f3f5; border-radius: 4px; font-size: 12px; color: #495057; cursor: pointer; padding: 8px; }
.icon-group { display: flex; gap: 6px; }
.icon-group button { width: 32px; border: 1px solid #dee2e6; background: white; border-radius: 4px; color: #868e96; cursor: pointer; }

.course-info-list { padding: 20px; font-size: 13px; }
.course-info-list li { display: flex; justify-content: space-between; margin-bottom: 10px; }
.course-info-list .label { color: #868e96; }
.course-info-list .val { color: #343a40; font-weight: 500; }

.qna-box { padding: 0 20px 20px; }
.qna-badge { display: block; background: #e6fcf5; color: #0ca678; font-size: 12px; text-align: center; padding: 10px; border-radius: 4px; font-weight: 600; }

.inquiry-link { padding: 15px 20px; border-top: 1px solid #f1f3f5; font-size: 13px; color: #495057; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.inquiry-link i { color: #adb5bd; margin-right: 6px; }
.inquiry-link .arr { color: #868e96; font-size: 11px; }

/* --- Mobile Bottom Bar & Layout Fix (Max Width: 768px) --- */
@media (max-width: 768px) {
    /* 1. 상단 비주얼 영역 최적화 */
    .cd-inner { flex-direction: column; padding: 0 16px; }
    .cd-left { width: 100%; margin-bottom: 20px; }
    .cd-right { width: 100%; display: none; } /* 모바일 우측 비디오 숨김 */
    
    .cd-title { font-size: 22px; line-height: 1.3; }
    .cd-desc { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    
    /* 2. 메인 컨텐츠 여백 확보 */
    .cd-body-layout { flex-direction: column; padding-bottom: 80px; } 
    .cd-main { width: 100%; }
    
    /* 3. PC용 사이드바는 무조건 숨김 */
    .cd-side { display: none !important; }

    /* 4. 탭 메뉴 가로 스크롤 */
    .cd-tabs { top: 60px; /* 헤더 높이만큼 띄움 */ }
    .cd-tabs ul { overflow-x: auto; white-space: nowrap; padding: 0 16px; -webkit-overflow-scrolling: touch; }
    .cd-tabs ul::-webkit-scrollbar { display: none; }
    .cd-tabs li { margin-right: 20px; flex-shrink: 0; }

    /* 5. 모바일 하단 고정 구매 바 (★ 가장 중요 ★) */
    .mobile-bottom-bar {
        display: flex !important; /* 모바일에서만 보이게 강제 */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: #fff;
        border-top: 1px solid #e4e4e4;
        z-index: 9999;
        padding: 0 16px;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.08);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .m-info { display: flex; flex-direction: column; justify-content: center; }
    .m-price { font-size: 18px; font-weight: 800; color: #343a40; }
    /* 할인율/상품명 등 */
    .m-desc { font-size: 11px; font-weight: 700; color: #fff; background: #ff4d4f; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 2px; width: fit-content; }

    .m-btns { display: flex; gap: 8px; align-items: center; }
    .btn-m-gift { 
        width: 44px; height: 44px; 
        border: 1px solid #dee2e6; border-radius: 4px; 
        background: white; color: #495057; 
        display: flex; align-items: center; justify-content: center; 
        font-size: 20px;
    }
    .btn-m-apply {
        background: #00c471; color: white; 
        border: none; border-radius: 4px;
        font-weight: 700; font-size: 16px; 
        height: 44px; padding: 0 24px;
    }
}

/* PC에서는 하단 바 숨김 */
.mobile-bottom-bar { display: none; }
