/* =======================================================
    MOBILE & TABLET (Dưới 1024px) dành riêng menu
   ======================================================= */
@media (max-width: 1023px) {
    .search-box-mobile {
        display: block;
        flex-shrink: 0;
    }
    .nav-menu_mobile .top-header-wrap {
        padding: 8px 15px;
    }
    .logo-sbe {
        padding-left: 15px;
        margin-top: 8px;
        display: inline-block;
    }
    .top-header-wrap {
        background-color: #a62823;
    }
    /* Hiện nút Hamburger */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        width: 38px;
        height: 38px;
    }
    .menu-toggle i {
        display: flex;
        font-size: 24px;
        color: #333;
    }
    .menu-toggle .icon-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        background-color: #f1f2f2;
        border-radius: 50%;
    }

    .menu-toggle .icon-close {
        display: none;
    }

    .menu-toggle.is-active .icon-open {
        display: none;
    }

    .menu-toggle.is-active .icon-close {
        display: flex;
    }

    /* Biến Menu ngang thành Off-canvas (Trượt từ phải sang) */
    .nav-menu {
        position: fixed;
        top: 139px;
        right: 0;
        width: 100%;
        height: calc(100dvh - 139px);
        background-color: #ffffff;
        padding-top: 0px;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transform: translateX(100%);
    }
    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        padding-left: 15px;
        padding-right: 15px;
        flex: 1;
        overflow-y: auto;
    }
    .nav-link {
        padding: 16px 0;
        display: flex;
        justify-content: space-between;
        font-size: 16px;
    }
    /* menu cấp 2 */
    /* fix mũi tên xoay khi active */
    .has-submenu.active .arrow {
        transform: rotate(0);
    }
    .submenu,
    .child-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        overflow: hidden;
        background-color: #fff;
        padding: 0 30px 0 15px;
        max-height: 0;
        transition: max-height 0.4s ease;
    }
    .child-menu {
        padding: 0 0 0 20px;
    }

    .submenu-link {
        color: #333;
        font-family: "Be Vietnam Pro";
        font-size: 15px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px; /* 133.333% */
    }
    .submenu li:not(:first-child) .submenu-link,
    .child-menu li:not(:first-child) .child-menu-link {
        border-top: 1px dashed rgba(0, 0, 0, 0.1);
    }
    .submenu > li,
    .child-menu > li {
        padding: 0 0;
    }

    .has-submenu.active .nav-link {
        border-radius: 12px;
        background: #f6f6f6;
    }
    .has-child-menu > .submenu-link .arrow {
        display: none;
    }

    .child-menu-link {
        color: #333;
        font-family: "Be Vietnam Pro";
        font-size: 15px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px; /* 133.333% */
        padding: 12px 0;
    }
    .nav-item__mobile {
        display: block;
    }
    .nav-item {
        display: block;
        height: auto;
    }
    .header__wrap .nav-link {
        padding: 16px 16px 16px 16px;
    }
    .arrow i {
        font-size: 18px;
    }

    .lang-options {
        left: -8px;
    }
    .arrow {
        display: inline-flex;
        transform: rotate(-90deg);
    }
    .header__wrap .nav-link {
        font-size: 17px;
    }
    .submenu-link {
        font-size: 15px;
    }
    .container {
        padding: 0 16px;
    }
    .menu-mobile-copyright {
        display: block;
        max-width: 100%;
        flex-shrink: 0;
        padding: 20px;
        margin: 0;
        text-align: center;
    }
    .top-header {
        position: sticky;
        top: 0;
        height: 60px;
    }
    .header {
        top: 60px;
    }
    .has-submenu > .nav-link .arrow {
        display: inline-block;
    }
}

/* 1. Điện thoại di động (Mobile Portrait) - Nhỏ hơn 576px */
@media (max-width: 575.98px) {
    .banner-mobi {
        display: block;
    }

    .banner-desktop {
        display: none;
    }
    .section-title {
        font-size: 25px;
    }
    .heading-wrap {
        flex-direction: column;
        align-items: normal;
    }
    .heading {
        margin-bottom: 8px;
    }
    .banner-slick .slick-slide img {
        height: auto;
    }
    .top-header-wrap .dtu-logo {
        gap: 12px;
    }
    .top-header-wrap .dtu-logo .title {
        font-size: 13px;
        max-width: 185px;
        line-height: 16px;
    }
    .menu-top-mobile {
        display: none;
    }
    .about__grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .about__ranking-badge {
        right: 24px;
    }
    .news__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .admissions__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .testimonial__wrap {
        width: auto;
    }
    .testimonial__text {
        font-size: 15px;
    }
    .testimonial__text-sm {
        font-size: 17px;
    }
    .testimonial__author p:first-child {
        font-size: 11px;
    }

    .facilities__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .facilities__wrap .item--lg {
        grid-column: auto;
    }
    .facilities__wrap .item.item--lg .item__content,
    .facilities__wrap .item .item__content {
        max-width: 300px;
    }
    .footer__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .p-60,
    .p-40 {
        padding-left: 0;
    }
    .footer__bottom {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .main-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .has-img {
        grid-template-columns: repeat(1, 1fr);
    }
    .events-list .item {
        grid-template-columns: repeat(1, 1fr);
    }
    .main-grid.order-change {
        grid-template-columns: repeat(1, 1fr);
    }
    .desc-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .programs-layout {
        grid-template-columns: repeat(1, 1fr);
    }
    .member-layout {
        grid-template-columns: repeat(1, 1fr);
    }
    .gallery-list {
        grid-template-columns: repeat(1, 1fr);
    }
    .captcha-wrap {
        min-height: 55px;
    }
    .form-field__captcha {
        max-width: 100%;
    }
    .logo img {
        max-width: 180px;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item--tall {
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }
    .main-grid.main-grid-member {
        grid-template-columns: repeat(1, 1fr);
    }
    .info-cards-group {
        grid-template-columns: repeat(1, 1fr);
    }
    .award__list {
        grid-template-columns: repeat(1, 1fr);
    }
    .news__list {
        grid-template-columns: repeat(1, 1fr);
    }
    .faculty-card.active::before {
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.85) 100%);
    }

    .faculty-card.active .faculty-card__body {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .faculty-card.active .faculty-card__btn {
        background-color: #b91c1c;
    }

    .faculty-card.active .faculty-card__btn .btn-icon::before {
        content: "-";
    }
    .gallery-block .see-more-btn,
    .facilities-block .see-more-btn,
    .admissions .see-more-btn,
    .news-others-wrap .see-more-btn {
        position: static;
        display: flex;
        margin: 24px auto 0;
        text-align: center;
        transform: none;
    }
    .news-others {
        height: auto;
    }

    .main-70 {
        padding-top: 20px;
    }
    .sidemenu-has-order {
        position: static;
        order: 2;
    }
    .testimonial--bg::before {
        content: "";
        position: absolute;
        left: 5%;
        bottom: 0;
        width: 45%;
        height: 30%;
        background-image: url("../img/toanha.svg");
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        opacity: 0.3;
    }
    .testimonial--bg::after {
        content: "";
        position: absolute;
        right: 18%;
        bottom: 22%;
        width: 12%;
        height: 12%;
        background-image: url("../img/conco.svg");
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        opacity: 0.3;
    }
    .testimonial__wrap {
        padding-bottom: 25%;
    }
    .testimonial {
        background-image: url("../img/BG-conco-mobile.png");
        aspect-ratio: 1 / 1;
        background-position: left;
    }
    .program__slick-daotao .slick-slide {
        margin: 0 12px;
    }
    .program__slick-daotao .slick-list {
        margin: 0 -12px;
    }
    .banner-slick .slick-slide img {
        aspect-ratio: 1/1;
    }
    .search-article {
        grid-template-columns: repeat(1, 1fr);
        gap: 1rem;
    }
}

/* 2. Điện thoại quay ngang & Tablet nhỏ (Mobile Landscape / Small Tablet) - Từ 576px đến dưới 768px */
@media (min-width: 576px) and (max-width: 767.98px) {
    .banner-mobi {
        display: block;
    }

    .banner-desktop {
        display: none;
    }
    .section-title {
        font-size: 25px;
    }
    .heading-wrap {
        flex-direction: column;
        align-items: normal;
    }
    .heading {
        margin-bottom: 8px;
    }
    .banner-slick .slick-slide img {
        height: auto;
    }
    .top-header-wrap .dtu-logo {
        gap: 12px;
    }
    .top-header-wrap .dtu-logo .title {
        font-size: 13px;
        max-width: 185px;
    }
    .menu-top-mobile {
        display: none;
    }
    .about__grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .about__ranking-badge {
        right: 24px;
    }
    .news__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .admissions__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .testimonial__wrap {
        width: auto;
    }
    .testimonial__text {
        font-size: 16px;
    }
    .testimonial__author p:first-child {
        font-size: 13px;
    }
    .testimonial {
        background-position: bottom center;
    }
    .facilities__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .facilities__wrap .item--lg {
        grid-column: auto;
    }
    .facilities__wrap .item.item--lg .item__content,
    .facilities__wrap .item .item__content {
        max-width: 300px;
    }
    .footer__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .p-60,
    .p-40 {
        padding-left: 0;
    }
    .footer__bottom {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .main-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .has-img {
        grid-template-columns: repeat(1, 1fr);
    }
    .main-grid.order-change {
        grid-template-columns: repeat(1, 1fr);
    }
    .programs-layout {
        grid-template-columns: repeat(1, 1fr);
    }
    .member-layout {
        grid-template-columns: repeat(1, 1fr);
    }
    .gallery-list {
        grid-template-columns: repeat(1, 1fr);
    }
    .captcha-wrap {
        min-height: 55px;
    }
    .form-field__captcha {
        max-width: 100%;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item--tall {
        grid-row: auto;
        aspect-ratio: 4 / 3;
    }
    .main-grid.main-grid-member {
        grid-template-columns: repeat(1, 1fr);
    }
    .testimonial--bg::before {
        content: "";
        position: absolute;
        left: 5%;
        bottom: 0;
        width: 45%;
        height: 30%;
        background-image: url("../img/toanha.svg");
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        opacity: 0.3;
    }
    .testimonial--bg::after {
        content: "";
        position: absolute;
        right: 18%;
        bottom: 22%;
        width: 12%;
        height: 12%;
        background-image: url("../img/conco.svg");
        background-repeat: no-repeat;
        background-size: cover;
        background-position: center;
        opacity: 0.3;
    }
    .testimonial__wrap {
        padding-bottom: 25%;
    }
    .testimonial {
        background-image: url("../img/BG-conco-mobile.png");
        aspect-ratio: 1 / 1;
        background-position: left;
    }
    .program__slick-daotao .slick-slide {
        margin: 0 12px;
    }
    .program__slick-daotao .slick-list {
        margin: 0 -12px;
    }
    .sidemenu-has-order {
        position: static;
        order: 2;
    }
}

/* 3. Tablet tiêu chuẩn (Ví dụ: iPad đứng) - Từ 768px đến dưới 992px */
@media (min-width: 768px) and (max-width: 991.98px) {
    .banner-mobi {
        display: none;
    }

    .banner-desktop {
        display: block;
    }
    .section-title {
        font-size: 25px;
    }
    .heading-wrap {
        flex-direction: column;
        align-items: normal;
    }
    .heading {
        margin-bottom: 8px;
    }
    .banner-slick .slick-slide img {
        height: auto;
    }
    .top-header-wrap .dtu-logo {
        gap: 12px;
    }
    .top-header-wrap .dtu-logo .title {
        font-size: 13px;
        max-width: 185px;
    }
    .menu-top-mobile {
        display: none;
    }
    .about__grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .about__ranking-badge {
        right: 24px;
    }
    .news__wrap {
        grid-template-columns: repeat(1, 1fr);
    }
    .admissions__wrap {
        grid-template-columns: repeat(2, 1fr);
    }
    .testimonial__wrap {
        width: auto;
    }
    .testimonial__text {
        font-size: 16px;
    }
    .testimonial__author p:first-child {
        font-size: 13px;
    }
    .facilities__wrap {
        grid-template-columns: repeat(2, 1fr);
    }

    .facilities__wrap .item.item--lg .item__content {
        max-width: 400px;
    }
    .facilities__wrap .item .item__content {
        max-width: 300px;
    }
    .footer__wrap {
        grid-template-columns: repeat(2, 1fr);
    }
    .p-60,
    .p-40 {
        padding-left: 0;
    }
    .footer__bottom {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .news-hot img {
        width: 100%;
    }
    .news-others .slick-slide {
        /* padding: 0 15px; */
    }
    .main-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .has-img {
        grid-template-columns: repeat(1, 1fr);
    }
    .events-list .item {
        grid-template-columns: 2fr 3fr;
    }
    .main-grid.order-change {
        grid-template-columns: repeat(1, 1fr);
    }
    .programs-layout {
        grid-template-columns: repeat(2, 1fr);
    }
    .member-layout {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-grid.main-grid-member {
        grid-template-columns: repeat(1, 1fr);
    }
    .testimonial__wrap {
        padding-bottom: 0px;
    }
    .testimonial {
        background-image: url("../img/BG-conco-full-1440.png");
        background-position: bottom center;
        aspect-ratio: 5 / 2;
    }
    .member-avatar img {
        flex: 1;
        display: block;
        min-width: 0;
    }
    .member-avatar .content {
        flex: 1;
    }
    .member-avatar {
        display: flex;
    }
    .sidemenu-has-order {
        position: static;
        order: 2;
    }
}

/* 4. Laptop & Desktop nhỏ (Tablet ngang / Laptop) - Từ 992px đến dưới 1200px */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .banner-mobi {
        display: none;
    }

    .banner-desktop {
        display: block;
    }
    .nav-list {
        gap: 28px;
    }
    .logo img {
        max-width: 160px;
    }
    .banner-slick .slick-slide img {
        height: auto;
    }
    .about__ranking-badge {
        bottom: 60px;
    }
    .news__wrap {
        grid-template-columns: repeat(3, 1fr);
    }
    .testimonial__wrap {
        width: 100%;
    }
    .has-img {
        grid-template-columns: repeat(1, 1fr);
    }
    .events-list .item {
        grid-template-columns: 2fr 3fr;
    }
    .programs-layout {
        grid-template-columns: repeat(2, 1fr);
    }
    .member-layout {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .captcha-wrap {
        min-height: 55px;
    }
    .form-field__captcha {
        max-width: 100%;
    }
    .header__wrap .nav-link {
        font-size: 13px;
    }
    .arrow {
        margin-left: 4px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .testimonial__wrap {
        padding-bottom: 0;
    }
    .testimonial {
        background-image: url("../img/BG-conco-full-1440.png");
        aspect-ratio: 5 / 2;
    }
    .info-cards-group {
        grid-template-columns: repeat(2, 1fr);
    }
    .submenu,
    .child-menu {
        width: 220px;
    }
}

/* màn lap nhỏ đến 1440 */
@media (min-width: 1200px) and (max-width: 1440px) {
    .testimonial {
        background-image: url("../img/BG-conco-full-1440.png");
        aspect-ratio: 5 / 2;
    }
}

/* 5. Desktop lớn (Màn hình máy bàn, iMac) - Từ 1200px trở lên */
@media (min-width: 1200px) {
    /* CSS ở đây chỉ chạy trên các màn hình rộng */
    .banner-mobi {
        display: none;
    }

    .banner-desktop {
        display: block;
    }
    .faculty-card:hover::before {
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.85) 100%);
    }

    .faculty-card:hover .faculty-card__body {
        max-height: 400px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .faculty-card:hover .faculty-card__btn {
        background-color: #b91c1c;
    }

    .faculty-card:hover .faculty-card__btn .btn-icon::before {
        content: "-";
    }
    .submenu-link:hover {
        color: var(--red-se);
    }
    .nav-list .nav-link:hover {
        color: var(--red-se);
    }
}
/* fix menu tràn container */
@media (min-width: 1024px) and (max-width: 1199px) {
    /* xử lý menu con của 2 menu cuối tránh tràn lề */
    /* 1 menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 1) .submenu {
        left: auto;
        right: 0;
    }
    /* 4 menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 4) .child-menu {
        left: auto;
        right: 100%;
    }
}
@media (min-width: 1200px) and (max-width: 1365px) {
    /* xử lý menu con của 2 menu cuối tránh tràn lề */
    /* menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 2) .submenu {
        left: auto;
        right: 0;
    }
    /* menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 6) .child-menu {
        left: auto;
        right: 100%;
    }
}
@media (min-width: 1366px) and (max-width: 1600px) {
    /* menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 2) .submenu {
        left: auto;
        right: 0;
    }
    /* menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 5) .child-menu {
        left: auto;
        right: 100%;
    }
}
@media (min-width: 1920px) {
    /* menu cuối cùng sang trái */
    .nav-list > .nav-item:nth-last-child(-n + 3) .child-menu {
        left: auto;
        right: 100%;
    }
}
/* fix full avatar chitiet nhansu */
.member-avatar img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
}
