/* ==========================================================================
   Course Catalog v2 ("/courses-new") — scoped styling.
   Everything here is namespaced under .courses-v2 so it cannot leak into,
   or be affected by, any other page's CSS (including the original /courses
   page and custom.css / style.css).
   ========================================================================== */

.courses-v2 {
    --cv2-red: var(--psychoverse-red, #E4302C);
    --cv2-red-hover: var(--psychoverse-red-hover, #c92420);
    --cv2-dark: var(--psychoverse-dark, #0f172a);
    --cv2-navy: var(--psychoverse-navy, #0b1329);
    --cv2-slate: var(--psychoverse-slate, #475569);
    --cv2-border: var(--psychoverse-border, #e2e8f0);
    --cv2-bg-light: var(--psychoverse-bg-light, #f8fafc);
    --cv2-green: #16a34a;
    --cv2-green-bg: #ecfdf3;
    --cv2-radius: 12px;
    padding: 40px 0 60px;
    background: #fff;
    color: var(--cv2-dark);
}

.courses-v2 * {
    box-sizing: border-box;
}

.courses-v2 .cv2_container {
    max-width: 1320px;
}

.courses-v2 .cv2_layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: flex-start;
}

/* ---------------- Sidebar ---------------- */

.courses-v2 .cv2_sidebar {
    position: sticky;
    top: 24px;
}

.courses-v2 .cv2_filter_card {
    background: #fff;
    border: 1px solid var(--cv2-border);
    border-radius: var(--cv2-radius);
    padding: 20px;
}

.courses-v2 .cv2_filter_card_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.courses-v2 .cv2_filter_card_head h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cv2-dark);
}

.courses-v2 .cv2_clear_btn {
    background: none;
    border: none;
    color: var(--cv2-red);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
}

.courses-v2 .cv2_clear_btn:hover {
    text-decoration: underline;
}

.courses-v2 .cv2_accordion {
    border-top: 1px solid var(--cv2-border);
    padding: 14px 0;
}

.courses-v2 .cv2_accordion:first-of-type {
    border-top: none;
    padding-top: 6px;
}

.courses-v2 .cv2_accordion summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--cv2-dark);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.courses-v2 .cv2_accordion summary::-webkit-details-marker {
    display: none;
}

.courses-v2 .cv2_accordion summary::after {
    content: '\2304';
    font-size: 16px;
    color: var(--cv2-slate);
    transition: transform .2s ease;
}

.courses-v2 .cv2_accordion[open] summary::after {
    transform: rotate(180deg);
}

.courses-v2 .cv2_check_list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.courses-v2 .cv2_check_list li {
    margin-bottom: 8px;
}

.courses-v2 .cv2_checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--cv2-slate);
    cursor: pointer;
}

.courses-v2 .cv2_checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--cv2-red);
    cursor: pointer;
    margin: 0;
}

.courses-v2 .cv2_label_name {
    line-height: 1.3;
}

/* ---------------- Toolbar ---------------- */

.courses-v2 .cv2_toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.courses-v2 .cv2_result_count {
    font-size: 15px;
    color: var(--cv2-slate);
}

.courses-v2 .cv2_result_count strong {
    color: var(--cv2-dark);
    font-weight: 700;
}

.courses-v2 .cv2_toolbar_right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.courses-v2 .cv2_sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--cv2-slate);
}

.courses-v2 .cv2_sort_select {
    border: 1px solid var(--cv2-border);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13.5px;
    color: var(--cv2-dark);
    background: #fff;
}

.courses-v2 .cv2_view_toggle {
    display: flex;
    border: 1px solid var(--cv2-border);
    border-radius: 8px;
    overflow: hidden;
}

.courses-v2 .cv2_view_btn {
    border: none;
    background: #fff;
    color: var(--cv2-slate);
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.courses-v2 .cv2_view_btn + .cv2_view_btn {
    border-left: 1px solid var(--cv2-border);
}

.courses-v2 .cv2_view_btn.is-active {
    background: var(--cv2-red);
    color: #fff;
}

/* ---------------- Grid / List container toggle ---------------- */

.courses-v2 .cv2_courses_wrapper .cv2_grid,
.courses-v2 .cv2_courses_wrapper .cv2_list {
    display: none;
}

.courses-v2 .cv2_courses_wrapper[data-view="grid"] .cv2_grid {
    display: grid;
}

.courses-v2 .cv2_courses_wrapper[data-view="list"] .cv2_list {
    display: flex;
}

/* ---------------- Grid cards ---------------- */

.courses-v2 .cv2_grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.courses-v2 .cv2_card {
    border: 1px solid var(--cv2-border);
    border-radius: var(--cv2-radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s ease, transform .2s ease;
}

.courses-v2 .cv2_card:hover {
    box-shadow: 0 12px 24px -12px rgba(15, 23, 42, .18);
    transform: translateY(-2px);
}

.courses-v2 .cv2_card_thumb_link {
    display: block;
}

.courses-v2 .cv2_card_thumb {
    position: relative;
    height: 170px;
    width: 100%;
    background: linear-gradient(135deg, var(--cv2-navy) 0%, var(--cv2-red) 140%);
    background-size: cover;
    background-position: center;
}

.courses-v2 .cv2_badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: var(--cv2-red);
    box-shadow: 0 4px 10px -3px rgba(0, 0, 0, .3);
}

.courses-v2 .cv2_badge_free {
    background: var(--cv2-green);
}

.courses-v2 .cv2_badge_sm {
    top: 8px;
    right: 8px;
    font-size: 11px;
    padding: 3px 9px;
}

.courses-v2 .cv2_card_body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.courses-v2 .cv2_category_label {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--cv2-red);
}

.courses-v2 .cv2_card_title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cv2-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.courses-v2 .cv2_card_body a {
    text-decoration: none;
}

.courses-v2 .cv2_rating_cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.courses-v2 .cv2_rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--cv2-slate);
}

.courses-v2 .cv2_rating i {
    color: #f5a524;
}

.courses-v2 .cv2_cart_store {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cv2-bg-light);
    color: var(--cv2-red);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.courses-v2 .cv2_cart_store:hover {
    background: var(--cv2-red);
    color: #fff;
}

.courses-v2 .cv2_meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12.5px;
    color: var(--cv2-slate);
    border-top: 1px solid var(--cv2-border);
    padding-top: 10px;
    margin-top: 2px;
}

.courses-v2 .cv2_meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ---------------- List rows ---------------- */

.courses-v2 .cv2_list {
    flex-direction: column;
    gap: 14px;
}

.courses-v2 .cv2_row {
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--cv2-border);
    border-radius: var(--cv2-radius);
    padding: 12px;
    background: #fff;
    transition: box-shadow .2s ease;
}

.courses-v2 .cv2_row:hover {
    box-shadow: 0 10px 20px -14px rgba(15, 23, 42, .25);
}

.courses-v2 .cv2_row_thumb_link {
    flex-shrink: 0;
}

.courses-v2 .cv2_row_thumb {
    position: relative;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cv2-navy) 0%, var(--cv2-red) 140%);
    background-size: cover;
    background-position: center;
}

.courses-v2 .cv2_row_body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.courses-v2 .cv2_row_body a {
    text-decoration: none;
}

.courses-v2 .cv2_row_title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--cv2-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.courses-v2 .cv2_row_meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12.5px;
    color: var(--cv2-slate);
}

.courses-v2 .cv2_row_meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.courses-v2 .cv2_row_side {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.courses-v2 .cv2_row_side .cv2_badge {
    position: static;
    box-shadow: none;
}

/* ---------------- Empty state ---------------- */

.courses-v2 .cv2_empty_state {
    text-align: center;
    padding: 70px 20px;
    border: 1px dashed var(--cv2-border);
    border-radius: var(--cv2-radius);
    background: var(--cv2-bg-light);
}

.courses-v2 .cv2_empty_thumb img {
    width: 60px;
    margin-bottom: 14px;
}

.courses-v2 .cv2_empty_state h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--cv2-dark);
    margin: 0;
}

/* ---------------- Pagination ---------------- */

.courses-v2 .cv2_pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 991px) {
    .courses-v2 .cv2_layout {
        grid-template-columns: 1fr;
    }

    .courses-v2 .cv2_sidebar {
        position: static;
    }

    .courses-v2 .cv2_grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .courses-v2 .cv2_grid {
        grid-template-columns: 1fr;
    }

    .courses-v2 .cv2_row {
        flex-wrap: wrap;
    }

    .courses-v2 .cv2_row_side {
        width: 100%;
        justify-content: space-between;
        padding-top: 10px;
        border-top: 1px solid var(--cv2-border);
    }

    .courses-v2 .cv2_toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Typography system — Psycho-verse design system
   Montserrat Alternates (headings/display) · Montserrat (body)
   ========================================================================== */

.courses-v2 {
    --cv2-font-display: 'Montserrat Alternates', sans-serif;
    --cv2-font-body: 'Montserrat', sans-serif;
    --cv2-font-mono: 'Montserrat', monospace;
    font-family: var(--cv2-font-body);
}

.courses-v2 .cv2_filter_card_head h5,
.courses-v2 .cv2_accordion summary {
    font-family: var(--cv2-font-display);
    font-weight: 700;
}

/* Course titles carry the display face */
.courses-v2 .cv2_card_title,
.courses-v2 .cv2_row_title {
    font-family: var(--cv2-font-display);
    font-weight: 700;
    color: var(--cv2-navy);
}

.courses-v2 .cv2_empty_state h1 {
    font-family: var(--cv2-font-display);
    font-weight: 700;
    color: var(--cv2-navy);
}

/* Numerics and prices */
.courses-v2 .cv2_badge_price,
.courses-v2 .cv2_rating span,
.courses-v2 .cv2_meta span,
.courses-v2 .cv2_row_meta span,
.courses-v2 .cv2_result_count strong {
    font-family: var(--cv2-font-body);
    font-weight: 600;
}

.courses-v2 .cv2_result_count strong {
    color: var(--cv2-red);
    font-weight: 700;
}

/* Category eyebrow keeps the body face for legibility at small size */
.courses-v2 .cv2_category_label {
    font-family: var(--cv2-font-body);
    font-weight: 700;
}
