/* ==========================================
   Course Sidebar Layout
   ========================================== */

.course-page {
    display: flex;
    min-height: 100vh;
    padding-top: 80px;
}

/* --- Sidebar --- */
.course-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--color-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: var(--space-4) 0;
    margin-left: var(--space-6);
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    border-radius: 20px;
    position: sticky;
    top: calc(80px + var(--space-4));
    height: calc(100vh - 80px - var(--space-4) * 2);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

@media (min-width: 1200px) {
    .course-sidebar {
        margin-left: var(--space-8);
    }
}

.course-sidebar::-webkit-scrollbar {
    width: 6px;
}

.course-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.course-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Category group */
.course-sidebar__group {
    margin-bottom: 0;
}

.course-sidebar__group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.course-sidebar__group-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.course-sidebar__group-label {
    font-family: var(--ff-heading);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    text-align: left;
    flex: 1;
}

.course-sidebar__chevron {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 200ms ease;
    flex-shrink: 0;
}

.course-sidebar__group.collapsed .course-sidebar__chevron {
    transform: rotate(-90deg);
}

/* Group items — visible by default */
.course-sidebar__group-items {
    list-style-type: none;
    margin: 0;
    padding: 4px 0 8px 0;
    display: block;
}

.course-sidebar__group-items li {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.course-sidebar__group.collapsed .course-sidebar__group-items {
    display: none;
}

.course-sidebar__item {
    display: block;
    width: 100%;
    padding: 8px 20px 8px 28px;
    border: none;
    background: none;
    text-align: left;
    font-family: var(--ff-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 150ms ease;
    border-left: 3px solid transparent;
}

.course-sidebar__item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.course-sidebar__item.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

/* --- Main Content --- */
.course-content {
    flex: 1;
    min-width: 0;
    padding: 40px 48px;
}

.course-panel {
    display: none;
}

.course-panel.active {
    display: block;
}

/* Two-column: info left, gallery right */
.course-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.course-panel__right {
    position: sticky;
    top: 100px;
    align-self: stretch;
}

/* Course header */
.course-header {
    margin-bottom: 20px;
}

.course-header h1 {
    font-family: var(--ff-heading);
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0 0 14px 0;
}

.course-specs {
    display: flex;
    gap: 12px;
}

.course-spec {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 16px;
    background: var(--color-gray-50);
    border-radius: 8px;
    border: 1px solid var(--color-gray-200);
}

.course-spec__value {
    font-family: var(--ff-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.course-spec__label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* WRT-PRO dual pricing */
.course-spec--dual .course-spec__value {
    font-size: 0.95rem;
}

.course-spec--dual .course-spec__or {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Description */
.course-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

/* Action buttons */
.course-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.course-actions .btn-inquiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--color-primary);
    color: var(--text-on-primary);
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 250ms ease;
    text-decoration: none;
}

.course-actions .btn-inquiry:hover {
    background: var(--color-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.course-actions .btn-inquiry svg {
    width: 10px;
    height: 12px;
}

.course-actions .btn-courses {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 250ms ease;
    text-decoration: none;
}

.course-actions .btn-courses:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Image gallery — fills the right column height */
.course-gallery {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 100%;
    min-height: 300px;
}

.course-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.course-gallery img.active {
    display: block;
}

.course-gallery .gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.45);
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: 2;
}

.course-gallery:hover .gallery-btn {
    opacity: 0.8;
}

.course-gallery .gallery-btn:hover {
    opacity: 1;
}

.course-gallery .gallery-prev {
    left: 10px;
}

.course-gallery .gallery-next {
    right: 10px;
}

/* --- Course Schedule Table --- */
.course-schedule {
    margin-top: 32px;
}

.course-schedule__title {
    font-family: var(--ff-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.course-schedule .program-table-wrap {
    margin-top: 8px;
}

/* Empty state */
.course-schedule__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
    background: var(--color-gray-50);
    border-radius: 12px;
    border: 1px dashed var(--color-gray-300);
}

.course-schedule__empty-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.course-schedule__whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 250ms ease;
    text-decoration: none;
}

.course-schedule__whatsapp:hover {
    background: #1da851;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.course-schedule__whatsapp i {
    font-size: 18px;
}

/* Mobile select — hidden on desktop */
.course-mobile-select-wrap {
    display: none;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .course-page {
        flex-direction: column;
        padding-top: 68px;
        overflow-x: hidden;
        width: 100%;
    }

    /* Hide sidebar tab strip — replaced by select dropdown */
    .course-sidebar {
        display: none !important;
    }

    /* Mobile course select */
    .course-mobile-select-wrap {
        display: block;
        width: 100%;
        padding: 8px 16px;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-gray-200);
        box-sizing: border-box;
    }

    .course-mobile-select {
        width: 100%;
        padding: 10px 14px;
        font-family: var(--ff-body);
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-primary);
        background: var(--color-gray-50);
        border: 1px solid var(--color-gray-300);
        border-radius: 8px;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        padding-right: 36px;
        cursor: pointer;
    }

    .course-content {
        padding: 24px 16px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .course-panel {
        width: 100%;
        max-width: 100%;
    }

    .course-panel__grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .course-panel__grid > * {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .course-description,
    .course-header h1,
    .course-specs,
    .course-actions,
    .course-schedule {
        max-width: 100%;
    }

    .course-panel__right {
        position: static;
    }

    .course-gallery {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .course-header h1 {
        font-size: 1.4rem;
    }

    .course-specs {
        flex-wrap: wrap;
    }

    .course-actions {
        flex-direction: column;
    }

    .course-actions .btn-inquiry,
    .course-actions .btn-courses {
        text-align: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .course-schedule__empty {
        width: 100%;
        box-sizing: border-box;
    }

    .course-schedule__whatsapp {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
}
