/* ============================================================
   DMTT DESKTOP MENU
   - Căn thẳng toàn bộ menu cấp 1
   - Có mũi tên cho menu có submenu
   - Menu cha vẫn click được bình thường
   - Không dùng JS
   ============================================================ */


/* ============================================================
   1. THANH MENU
   ============================================================ */

.dmtt-desktop-nav {
    position: relative;
    z-index: 900;

    width: 100%;

    background: #fff;
    border-bottom: 1px solid #e5e5e5;

    font-family: inherit;
}

.dmtt-desktop-nav__inner {
    width: 100%;
    max-width: 1480px;

    margin: 0 auto;
    padding: 0 20px;

    box-sizing: border-box;
}


/* ============================================================
   2. MENU CẤP 1
   ============================================================ */

.dmtt-desktop-menu {
    display: flex;
    align-items: stretch;

    height: 54px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.dmtt-desktop-menu > li {
    position: relative;

    display: flex;
    align-items: stretch;

    height: 54px;

    margin: 0;
    padding: 0;

    list-style: none;
}


/* Link cấp 1 */

.dmtt-desktop-menu > li > a {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    height: 54px;

    padding: 0 18px;

    box-sizing: border-box;

    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1;

    color: #333;

    text-decoration: none;
    white-space: nowrap;

    background: transparent;

    border: 0;
    border-bottom: 3px solid transparent;

    transition:
        color .15s ease,
        background-color .15s ease,
        border-color .15s ease;
}


/* Có submenu -> chừa chỗ cho mũi tên */

.dmtt-desktop-menu > li.menu-item-has-children > a {
    padding-right: 34px;
}


/* Hover */

.dmtt-desktop-menu > li:hover > a,
.dmtt-desktop-menu > li:focus-within > a {
    color: #222;
    background: #f7f7f7;

    border-bottom-color: #f7941d;
}


/* Menu active */

.dmtt-desktop-menu > li.current-menu-item > a,
.dmtt-desktop-menu > li.current-menu-parent > a,
.dmtt-desktop-menu > li.current-menu-ancestor > a {
    color: #222;

    border-bottom-color: #f7941d;
}


/* ============================================================
   3. MŨI TÊN MENU CẤP 1
   Chỉ xuất hiện nếu có submenu
   Đặt trên LI để không xung đột icon / pseudo của link
   ============================================================ */

.dmtt-desktop-menu > li.menu-item-has-children::after {
    content: "";

    position: absolute;

    right: 16px;
    top: 50%;

    width: 6px;
    height: 6px;

    border-right: 1.4px solid #555;
    border-bottom: 1.4px solid #555;

    transform:
        translateY(-65%)
        rotate(45deg);

    pointer-events: none;

    transition: transform .15s ease;
}


/* Khi hover thì xoay nhẹ */

.dmtt-desktop-menu > li.menu-item-has-children:hover::after,
.dmtt-desktop-menu > li.menu-item-has-children:focus-within::after {
    transform:
        translateY(-35%)
        rotate(225deg);
}


/* ============================================================
   4. SUBMENU CẤP 2
   ============================================================ */

.dmtt-desktop-menu .sub-menu {
    position: absolute;

    top: 100%;
    left: 0;

    z-index: 1000;

    width: 260px;
    min-width: 260px;

    margin: 0;
    padding: 8px;

    box-sizing: border-box;

    list-style: none;

    background: #fff;

    border: 1px solid #e7e7e7;
    border-radius: 8px;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, .10);

    opacity: 0;
    visibility: hidden;

    transform: translateY(4px);

    pointer-events: none;

    transition:
        opacity .14s ease,
        visibility .14s ease,
        transform .14s ease;
}


/* Mở submenu */

.dmtt-desktop-menu li:hover > .sub-menu,
.dmtt-desktop-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
}


/* ============================================================
   5. ITEM CẤP 2
   ============================================================ */

.dmtt-desktop-menu .sub-menu > li {
    position: relative;

    display: block;

    height: auto;

    margin: 0;
    padding: 0;

    list-style: none;
}

.dmtt-desktop-menu .sub-menu > li > a {
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-height: 42px;

    padding: 8px 14px;

    box-sizing: border-box;

    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;

    color: #333;

    text-decoration: none;

    background: transparent;

    border: 0;
    border-radius: 6px;

    transition:
        color .12s ease,
        background-color .12s ease;
}

.dmtt-desktop-menu .sub-menu > li:hover > a,
.dmtt-desktop-menu .sub-menu > li:focus-within > a {
    color: #111;
    background: #f5f5f5;
}


/* ============================================================
   6. MENU CON CÓ CẤP 3
   ============================================================ */

.dmtt-desktop-menu .sub-menu > li.menu-item-has-children > a {
    padding-right: 35px;
}


/* Mũi tên sang phải */

.dmtt-desktop-menu .sub-menu > li.menu-item-has-children::after {
    content: "";

    position: absolute;

    right: 15px;
    top: 21px;

    width: 6px;
    height: 6px;

    border-top: 1.4px solid #555;
    border-right: 1.4px solid #555;

    transform:
        translateY(-50%)
        rotate(45deg);

    pointer-events: none;
}


/* ============================================================
   7. SUBMENU CẤP 3
   ============================================================ */

.dmtt-desktop-menu .sub-menu .sub-menu {
    top: -8px;

    left: calc(100% + 8px);

    transform: translateX(4px);
}

.dmtt-desktop-menu .sub-menu li:hover > .sub-menu,
.dmtt-desktop-menu .sub-menu li:focus-within > .sub-menu {
    transform: translateX(0);
}


/* ============================================================
   8. ACTIVE SUBMENU
   ============================================================ */

.dmtt-desktop-menu .sub-menu .current-menu-item > a,
.dmtt-desktop-menu .sub-menu .current-menu-parent > a,
.dmtt-desktop-menu .sub-menu .current-menu-ancestor > a {
    color: #111;
    background: #f5f5f5;
}


/* ============================================================
   9. RESET RIÊNG CHO MENU DMTT
   ============================================================ */

.dmtt-desktop-nav ul,
.dmtt-desktop-nav li {
    list-style: none;
}

.dmtt-desktop-nav a {
    text-decoration: none;
}


/* Không cho pseudo của theme Electro chen vào link */

.dmtt-desktop-menu > li > a::before,
.dmtt-desktop-menu > li > a::after {
    content: none !important;
    display: none !important;
}


/* ============================================================
   10. MOBILE / TABLET
   ============================================================ */

@media (max-width: 991px) {

    .dmtt-desktop-nav {
        display: none !important;
    }

}