/* =====================================================================
   Edunet - sửa lỗi giao diện theo báo cáo UI/UX 03/11/2026
   File riêng, nạp sau cùng trong <head> của các layout. Gỡ = bỏ dòng <link>.
   ===================================================================== */

/* ---------- BUG-003: nhãn "Tiết kiệm học phí 30%" dính mép trên header ---------- */
.header-p3-main li .nav-link:before {
    top: -1px;
    line-height: 14px;
    padding: 0 5px;
}
.header-p3-main li .nav-link[data-txt]:not([data-txt=""]):after {
    top: 13px;
}

/* ---------- BUG-013: ô nhập lỗi ở form đăng nhập/đăng ký phải nổi bật ---------- */
.signin-form .input-error,
.login-input-box .input-error,
input.input-error {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, .15) !important;
}
.signin-form .label-error,
.login-input-container + .label-error,
.label-error {
    display: block;
    margin: 4px 0 6px;
    font-size: 13px;
    color: #e53935;
}

/* ---------- BUG-006: logo tab tìm kiếm không bao giờ hiện alt text to đè form ---------- */
.menuSubItem .imageItem img {
    max-height: 34px;
    max-width: 100%;
    font-size: 11px;
    color: #94a3b8;
    overflow: hidden;
}

/* ---------- BUG-005: tràn ngang khi màn hình < 1292px ----------
   .session-item-large rộng bằng viewport nhưng không có padding, trong khi .row bên trong có margin -10px */
@media (max-width: 1291px) {
    html { overflow-x: hidden; }
    .session-item-large,
    .session-item-large-footer {
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box;
    }
    .owl-carousel .owl-nav button.owl-next { right: 0 !important; }
    .owl-carousel .owl-nav button.owl-prev { left: 0 !important; }
}

/* =====================================================================
   Màn hình hẹp (tablet dọc / điện thoại / cửa sổ trình duyệt thu nhỏ)
   ===================================================================== */
@media (max-width: 767px) {

    /* Nội dung bài viết, bảng trong trang chi tiết không được tràn */
    .info-item img, .info-item iframe, .info-item video { max-width: 100% !important; height: auto !important; }
    .info-item table {
        display: block;
        width: 100% !important;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tab tìm kiếm trang chủ (Khóa học / Trường học / Unica / Elsa): 1 hàng ngang, không đè lên ô nhập */
    .top-menu .menuItem { flex-wrap: nowrap !important; margin: 0 !important; }
    .top-menu .menuitemRow { width: 100% !important; }
    .top-menu .menuSubItem {
        flex: 1 1 0;
        width: auto !important;
        max-width: none !important;
        min-width: 0;
        padding: 0 2px !important;
        float: none !important;
    }
    .top-menu .menuSubItem .menuText {
        font-size: 12px !important;
        line-height: 1.25;
        white-space: normal;
        word-break: break-word;
    }
    .top-menu .menuSubItem .imageItem img { max-height: 24px; width: auto; }

    /* BUG-010: "Khóa học nổi bật" và "Xem thêm" không dính nhau */
    .index-course-full .text-top {
        left: 16px !important;
        right: auto !important;
        max-width: calc(100% - 140px);
    }
    .index-course-full .text-top .text-center { text-align: left !important; }
    .index-course-full .text-view-more a {
        left: auto !important;
        right: 16px !important;
        white-space: nowrap;
    }

    /* BUG-007: tiêu đề khóa học + nút "So sánh khóa học" */
    .info-title-khoahoc { flex-wrap: wrap; }
    .info-title-khoahoc .info-top { width: 100% !important; }
    .info-title-khoahoc h1#course_name_display {
        font-size: 22px !important;
        line-height: 1.3;
        white-space: normal;
        word-break: break-word;
    }
    .info-title-khoahoc .info-compare {
        position: static !important;
        width: auto !important;
        margin: 6px 0 0 !important;
    }
    .info-title-khoahoc .info-compare .dc_noibat_btn { width: auto !important; display: inline-block; }

    /* BUG-009: khối thông tin 2 cột -> 1 cột, mỗi dòng "nhãn | giá trị" */
    .detail-left-item.display-flex { flex-direction: column; }
    .detail-left-item .content-left,
    .detail-left-item .content-right {
        width: 100% !important;
        margin: 0 0 10px !important;
        box-sizing: border-box;
        display: grid !important;
        grid-template-columns: 44% 1fr;
        column-gap: 8px;
        align-items: start;
    }
    .detail-left-item .label-item,
    .detail-left-item .value-item {
        float: none !important;
        width: auto !important;
        margin: 0 0 8px !important;
        word-break: break-word;
    }
    .detail-left-item .detail-left-highligth { width: 100% !important; }

    /* Form tìm kiếm trang chủ: chiều cao cố định 400px -> nút "Tìm kiếm" đè ô cuối */
    .homesearch .form-search, .form-search { height: auto !important; max-height: none !important; min-height: 400px; }

    /* Thanh học phí cố định ở đáy trang chi tiết */
    .course-detail-info-bottom { align-items: center; gap: 8px; }
    .course-detail-info-bottom .course-price { flex: 1 1 auto; min-width: 0; width: auto !important; font-size: 14px; line-height: 1.35; }
    .course-detail-info-bottom .course-price > div { white-space: nowrap; }
    .course-detail-info-bottom .edunet-gift:empty { display: none; }
    .course-detail-info-bottom .edunet-receivedAdvise { flex: 0 0 auto; width: auto !important; }
    .course-detail-info-bottom .edunet-receivedAdvise .btn { white-space: nowrap; padding: 8px 12px; }
    /* BUG-008: widget "Gửi tin nhắn" (Tawk, style inline !important - không ghi đè được) luôn ở đáy phải,
       nên đẩy thanh học phí lên trên nó; nút Edunet AI nằm trên thanh học phí */
    .course-detail-info-bottom { bottom: 46px !important; top: auto !important; border-radius: 10px 10px 0 0; box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
    body:has(.course-detail-info-bottom) #chat-toggle { bottom: 128px !important; }

    /* Thanh tab trong trang chi tiết (Giới thiệu / Thông tin khóa học / ...) cuộn ngang thay vì bóp chữ */
    .khoahoc-tab-info .header-sticky {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        height: auto !important;
    }
    .khoahoc-tab-info .header-sticky .suggestion-tab {
        flex: 0 0 auto;
        width: auto !important;
        float: none !important;
        white-space: nowrap;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* BUG-015: tab sắp xếp ở trang tìm kiếm cuộn ngang, không wrap 2-3 dòng */
    .searchtab ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .searchtab ul li {
        flex: 0 0 auto;
        float: none !important;
        width: auto !important;
    }
    .searchtab ul li a { padding-left: 14px !important; padding-right: 14px !important; font-size: 13px !important; }

    /* Thẻ kết quả tìm kiếm: bố cục 3 cột (ảnh | thông tin | giá) cao cố định 186px -> cột thông tin còn 0px, chữ biến mất */
    .item-khoahoc-grid, .item-khoahoc-grid .item-khoahoc { height: auto !important; }
    .item-khoahoc-grid .item-khoahoc > .images-item,
    .item-khoahoc-grid .item-khoahoc > .midle-item,
    .item-khoahoc-grid .item-khoahoc > .right-item {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box;
    }
    .item-khoahoc-grid .item-khoahoc > .images-item .images-cover { width: 100% !important; height: 190px !important; }
    .item-khoahoc-grid .item-khoahoc > .images-item .images-cover img { width: 100% !important; height: 100% !important; object-fit: cover; }
    .item-khoahoc-grid .item-khoahoc > .midle-item { padding: 10px 12px !important; }
    .item-khoahoc-grid .item-khoahoc > .midle-item h4,
    .item-khoahoc-grid .item-khoahoc > .midle-item h5,
    .item-khoahoc-grid .item-khoahoc > .midle-item .info-item-detail,
    .item-khoahoc-grid .item-khoahoc > .midle-item .info-item-footer { width: auto !important; height: auto !important; }
    .item-khoahoc-grid { margin-bottom: 16px; }

    /* BUG-011 + BUG-014: footer xếp dọc, logo tách khỏi cột "Edunet", cột link 2 cột
       (main.css đặt .session-item-large-footer .footer-left/right width 25%/75% !important -> cần selector mạnh hơn) */
    footer .session-item-large-footer > div:first-child { flex-direction: column; }
    footer .session-item-large-footer .footer-left,
    footer .session-item-large-footer .footer-right { width: 100% !important; max-width: 100% !important; padding-right: 0 !important; }
    footer .session-item-large-footer .footer-left { margin-bottom: 16px; }
    footer .footer-left .content-text { font-size: 16px !important; line-height: 1.4; }
    footer .footer-right .row { margin-left: 0 !important; margin-right: 0 !important; }
    footer .footer-right .row > [class*="col-"] { width: 50% !important; float: left; }
    footer .footer-right .row a { white-space: normal; word-break: break-word; }

    /* Modal đăng nhập rộng cố định 520px -> co theo màn hình */
    .modelLogin { margin: 10px !important; }
}

/* Modal đăng nhập: style.css đặt width 35% khi <= 991px (tablet 768px chỉ còn ~270px) */
@media (max-width: 991px) {
    .modelLogin { width: auto !important; max-width: 520px; margin-left: auto !important; margin-right: auto !important; }
}

/* =====================================================================
   BUG-004: menu cho màn hình hẹp (nút ☰ trước đây trỏ tới #offcanvas-navbar không tồn tại)
   ===================================================================== */
.edn-mnav { display: none; }
.edn-mnav.open { display: block; position: fixed; inset: 0; z-index: 16000; }
.edn-mnav-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.edn-mnav-panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: 82%; max-width: 320px;
    background: #fff; overflow-y: auto; box-shadow: -4px 0 16px rgba(0, 0, 0, .2);
    display: flex; flex-direction: column; font-family: Arial, sans-serif;
}
.edn-mnav-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #eee; }
.edn-mnav-head img { height: 34px; }
.edn-mnav-close { background: none; border: 0; font-size: 28px; line-height: 1; color: #555; cursor: pointer; padding: 0 4px; }
.edn-mnav-panel a {
    display: block; padding: 13px 18px; color: #222 !important; font-size: 16px !important;
    border-bottom: 1px solid #f2f2f2; text-decoration: none;
}
.edn-mnav-panel a:active, .edn-mnav-panel a:hover { background: #f5f8ff; }
.edn-mnav-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; background: red; color: #fff; font-size: 11px; vertical-align: middle; }
.edn-mnav-group { padding: 14px 18px 6px; font-size: 12px; text-transform: uppercase; color: #888; letter-spacing: .3px; }
body.edn-mnav-lock { overflow: hidden; }
@media (min-width: 768px) { .edn-mnav.open { display: none; } }
/* icon ☰ dự phòng nếu font Font Awesome chưa tải được */
.edn-mnav-toggle .edn-bars { display: inline-block; width: 22px; height: 16px; position: relative; vertical-align: middle; }
.edn-mnav-toggle .edn-bars, .edn-mnav-toggle .edn-bars:before, .edn-mnav-toggle .edn-bars:after { border-top: 2px solid #333; }
.edn-mnav-toggle .edn-bars:before, .edn-mnav-toggle .edn-bars:after { content: ""; position: absolute; left: 0; right: 0; }
.edn-mnav-toggle .edn-bars:before { top: 5px; }
.edn-mnav-toggle .edn-bars:after { top: 12px; }
