/* Courses listing & detail — modern layer */

/* Listing page: hero extends under transparent header */
.courses-page-modern--listing {
    background: #f4f6f9;
}

#page:has(.courses-page-modern--listing) > .header,
#page:has(.courses-page-modern--listing) header.header,
#page:has(.course-detail-page) > .header,
#page:has(.course-detail-page) header.header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    background: transparent !important;
    border-bottom: none;
    box-shadow: none;
}

#page:has(.courses-page-modern--listing) #logo img {
    filter: brightness(0) invert(1);
}

#page:has(.courses-page-modern--listing) #top_menu a,
#page:has(.courses-page-modern--listing) .main-menu > ul > li span > a {
    color: #fff !important;
}

#page:has(.courses-page-modern--listing) .main-menu > ul > li span > a:hover,
#page:has(.courses-page-modern--listing) .main-menu > ul > li span > a.active {
    color: #fff !important;
    opacity: 0.85;
}

.courses-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 55%, #4c1d95 100%);
    overflow: hidden;
}

.courses-page-modern--listing .courses-hero {
    min-height: 460px;
    align-items: center;
    margin-top: 0;
}

.courses-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.courses-page-modern--listing .courses-hero__bg {
    background-size: cover;
    background-position: center 35%;
}

.courses-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.12) 0%, rgba(15, 23, 42, 0.55) 100%);
}

.courses-page-modern--listing .courses-hero__overlay {
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.08) 0%,
        rgba(15, 23, 42, 0.22) 45%,
        rgba(15, 23, 42, 0.62) 100%
    );
}

.courses-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 7rem 0 3.5rem;
    text-align: right;
}

.courses-page-modern--listing .courses-hero__inner {
    padding-top: 8.5rem;
    padding-bottom: 4rem;
}

.courses-hero__title {
    color: #fff;
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 800;
    margin: 0 0 0.65rem;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
    letter-spacing: -0.02em;
}

.courses-hero__subtitle {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin: 0;
    max-width: 36rem;
    font-weight: 400;
}

.courses-filters-modern {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    padding: 0.85rem 0;
    position: relative;
    z-index: 5;
}

.courses-filters-modern .filters_listing ul {
    margin-bottom: 0;
}

.courses-listing-section {
    padding: 2.75rem 0 4rem;
}

.courses-section-heading {
    margin-bottom: 2rem;
}

.courses-section-heading__title {
    position: relative;
    display: inline-block;
    margin: 0;
    padding-bottom: 0.85rem;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a2e;
}

.courses-section-heading__title::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 3.5rem;
    height: 3px;
    border-radius: 999px;
    background: #e8a317;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (min-width: 992px) {
    .courses-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

.courses-load-more {
    margin-top: 2.5rem;
}

.course-card-modern {
    background: #fff;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(24, 39, 75, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(24, 39, 75, 0.11);
}

.course-card-modern__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef2f7;
    text-decoration: none;
}

.course-card-modern__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.course-card-modern:hover .course-card-modern__media img {
    transform: scale(1.04);
}

.course-card-modern__body {
    padding: 1rem 1rem 0.65rem;
    flex: 1;
}

.course-card-modern__title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.55;
    margin: 0 0 0.35rem;
}

.course-card-modern__title a {
    color: #1a1a2e;
    text-decoration: none;
}

.course-card-modern__title a:hover {
    color: #1d4ed8;
}

.course-card-modern__subtitle {
    color: #7a8499;
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-card-modern__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0.75rem 1rem 1rem;
    font-size: 0.74rem;
    color: #8b95a8;
}

.course-card-modern__meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-card-modern__meta i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.course-card-modern__meta .pe-7s-star {
    color: #e8a317;
    font-size: 1rem;
}

.course-card-modern__meta--muted {
    opacity: 0.75;
}

@media (max-width: 575.98px) {
    .course-card-modern__footer {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .course-card-modern__meta {
        max-width: 48%;
    }
}

.courses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-list-modern {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-height: 150px;
    height: 150px;
    background: #fff;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(24, 39, 75, 0.06);
    transition: box-shadow 0.2s ease;
}

.course-list-modern:hover {
    box-shadow: 0 12px 32px rgba(24, 39, 75, 0.1);
}

.course-list-modern__media {
    flex: 0 0 200px;
    width: 200px;
    max-width: 38%;
    height: 150px;
    max-height: 150px;
    overflow: hidden;
    background: #f1f5f9;
    display: block;
}

.course-list-modern__media img {
    width: 100%;
    height: 100%;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.course-list-modern__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    height: 150px;
    max-height: 150px;
    overflow: hidden;
}

.course-list-modern__top {
    min-width: 0;
}

.course-list-modern__price {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.course-list-modern__title {
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-list-modern__title a {
    color: #1a1a2e;
    text-decoration: none;
}

.course-list-modern__title a:hover {
    color: #1d4ed8;
}

.course-list-modern__desc {
    color: #7a8499;
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-list-modern__actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.course-list-modern__btn {
    display: inline-block;
    background: #2563eb;
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.2s ease;
}

.course-list-modern__btn:hover {
    background: #1d4ed8;
    color: #fff !important;
}

@media (max-width: 575.98px) {
    .course-list-modern__media {
        flex: 0 0 120px;
        width: 120px;
    }

    .course-list-modern__body {
        padding: 0.65rem 0.75rem;
    }

    .course-list-modern__title {
        font-size: 0.85rem;
    }

    .course-list-modern__desc {
        display: none;
    }
}

.course-detail-hero .courses-hero--detail {
    min-height: 0;
    display: block;
    background: #f4f6f9;
    overflow: visible;
}

.courses-hero--detail .courses-hero__cover {
    position: relative;
    z-index: 1;
    width: 100%;
    line-height: 0;
    background: #f4f6f9;
}

.courses-hero--detail .courses-hero__cover img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    object-position: center top;
    display: block;
    margin: 0 auto;
}

.courses-hero__overlay--detail {
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.42) 0%,
        rgba(15, 23, 42, 0.08) 28%,
        transparent 55%
    );
    z-index: 2;
}

@media (max-width: 767.98px) {
    .course-detail-hero {
        display: none;
    }

    #page:has(.course-detail-page) > .header,
    #page:has(.course-detail-page) header.header {
        position: relative;
        background: #fff !important;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    }

    .course-detail-page .bg_color_1 > .container.margin_60_35 {
        margin-top: 0;
        padding-top: 1.5rem;
    }

    .course-mobile-intro {
        background: #fff;
        border-bottom: 1px solid #e8eef7;
    }

    .course-mobile-intro__media {
        margin: 0;
        width: 100%;
        line-height: 0;
        background: #f4f6f9;
    }

    .course-mobile-intro__media img {
        width: 100%;
        height: auto;
        max-height: 450px;
        object-fit: contain;
        object-position: center;
        display: block;
    }

    .course-mobile-intro__body {
        padding: 1rem 1rem 1.15rem;
    }

    .course-mobile-intro__title {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 800;
        line-height: 1.5;
        color: #0f172a;
    }

    .course-detail-page {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .course-mobile-buy-bar {
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.1);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .course-mobile-buy-bar__btn {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        margin: 0 !important;
        padding: 13px 16px !important;
        border-radius: 12px !important;
        font-size: 0.95rem;
        font-weight: 700;
    }

    .course-mobile-buy-bar__price {
        display: inline-flex;
        align-items: baseline;
        gap: 4px;
        font-weight: 800;
        white-space: nowrap;
    }

    .course-mobile-buy-bar__price small {
        font-size: 0.72rem;
        font-weight: 600;
        opacity: 0.9;
    }
}

.course-show-main h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
}

.course-show-main .tf {
    color: #475569;
    line-height: 1.85;
    font-size: 0.95rem;
}

.course-show-main #lessons .intro_title h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e3a8a;
}

.box_detail.course-sidebar-modern {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e8eef7;
    box-shadow: 0 12px 36px rgba(24, 39, 75, 0.1);
}

.course-purchase-box__media {
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 14px;
    background: #f1f5f9;
}

.course-purchase-box__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.course-purchase-box__actions {
    padding: 0;
}

.course-purchase-mobile {
    margin-bottom: 1.25rem;
}

.course-purchase-mobile .course-purchase-box__actions {
    margin-top: 0.85rem;
}

.course-sidebar-desktop-purchase .course-purchase-box__actions {
    padding: 1rem 1.1rem 0.25rem;
}

.course-sidebar-desktop-purchase .course-purchase-box__media {
    border-radius: 0;
    aspect-ratio: 4 / 3;
}

.box_detail.course-sidebar-modern figure {
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.box_detail.course-sidebar-modern figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.secondary_nav.sticky_horizontal {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.secondary_nav.sticky_horizontal ul li a.active,
.secondary_nav.sticky_horizontal ul li a:hover {
    color: #1d4ed8;
}

@media (max-width: 991.98px) {
    .courses-page-modern--listing .courses-hero {
        min-height: 340px;
    }

    .courses-page-modern--listing .courses-hero__inner {
        padding-top: 7rem;
        padding-bottom: 2.75rem;
    }
}

@media (max-width: 575.98px) {
    .courses-page-modern--listing .courses-hero {
        min-height: 280px;
    }

    .courses-listing-section {
        padding: 2rem 0 3rem;
    }

    .courses-section-heading {
        margin-bottom: 1.35rem;
    }
}

/* Course reviews */
.course-reviews__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1rem;
}

.course-reviews__count {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.course-reviews__form-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.course-reviews__form-wrap[hidden] {
    display: none !important;
}

.course-reviews__label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.course-reviews__textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 110px;
}

.course-reviews__form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 0.75rem;
}

.course-reviews__error {
    color: #b91c1c;
    font-size: 0.85rem;
}

.course-reviews__error[hidden] {
    display: none !important;
}

.course-reviews__counter {
    color: #64748b;
}

.course-reviews__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-reviews__empty {
    text-align: center;
    color: #64748b;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    margin: 0;
}

.course-reviews__more-wrap {
    text-align: center;
    margin-top: 1.25rem;
}

.course-comment-card {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(24, 39, 75, 0.05);
}

.course-comment-card__inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.course-comment-card__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1d4ed8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.course-comment-card__body {
    flex: 1;
    min-width: 0;
}

.course-comment-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.course-comment-card__author {
    font-weight: 700;
    color: #1e3a8a;
}

.course-comment-card__date {
    font-size: 0.82rem;
    color: #64748b;
}

.course-comment-card__badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #b45309;
    border: 1px solid #fed7aa;
}

.course-comment-card__text {
    color: #334155;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.course-comment-card--pending {
    opacity: 0.92;
    border-style: dashed;
}

.course-comment-card--pending .course-comment-card__text {
    filter: blur(1.5px);
    user-select: none;
}
