
/* ==========================================
   LONG VIET - MEGA MENU
   Brand: Blue / Orange / Gold
========================================== */

:root {
    --lv-blue: #087BAA;
    --lv-orange: #F26522;
    --lv-gold: #C69A4D;
    --lv-text: #333333;
    --lv-muted: #777777;
    --lv-border: #e5e5e5;
    --lv-background: #ffffff;
    --lv-hover: #f5f8fa;
}

/* ==========================================
   HEADER & NAVIGATION
========================================== */

.header-content {
    position: relative !important;
    z-index: 1000;
}

.header-content .container,
.header-content .row,
.header-content .navbar,
.header-content .navbar-collapse {
    overflow: visible !important;
}

.header-content .navbar {
    position: static !important;
    margin-bottom: 0;
}

#menu-main-menu {
    position: static !important;
}

#menu-main-menu > li {
    position: static !important;
}

/* Menu chính */
#menu-main-menu > li > a {
    transition: background 0.25s ease, color 0.25s ease;
}

/* Menu đang hover */
#menu-main-menu > li.mega-menu-item:hover > .mega-menu-link,
#menu-main-menu > li.mega-menu-item.is-open > .mega-menu-link {
    background: var(--lv-orange);
    color: #ffffff;
}

/* Mũi tên */
.mega-menu-arrow {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin: -4px 0 0 7px;
    transition: transform 0.25s ease;
}

#menu-main-menu > li.mega-menu-item:hover
> .mega-menu-link .mega-menu-arrow,
#menu-main-menu > li.mega-menu-item.is-open
> .mega-menu-link .mega-menu-arrow {
    transform: rotate(225deg);
    margin-top: 4px;
}

/* Ẩn nút toggle trên desktop */
@media (min-width: 768px) {
    #menu-main-menu .mega-menu-toggle {
        display: none !important;
    }
}

/* ==========================================
   MEGA MENU PANEL
========================================== */

.mega-menu-panel {
    position: absolute !important;

    top: 100% !important;
    left: 50% !important;
    right: auto !important;

    width: calc(100vw - 80px) !important;
    max-width: 1400px !important;
    min-width: 0 !important;

    box-sizing: border-box;

    padding: 28px 40px 35px;

    background: var(--lv-background) !important;

    border-top: 3px solid var(--lv-gold);

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);

    z-index: 99999 !important;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    /* Không dịch chuyển panel khi mở */
    transform: translateX(-50%);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

/* Vùng kết nối giữa menu cha và panel */
.mega-menu-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -15px;
    height: 15px;
}

/* Hiển thị khi hover hoặc mở bằng JS */
#menu-main-menu > li.mega-menu-item:hover
> .mega-menu-panel,

#menu-main-menu > li.mega-menu-item.is-open
> .mega-menu-panel,

#menu-main-menu > li.mega-menu-item:focus-within
> .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%);
}

/* Nội dung bên trong */
.mega-menu-inner {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
}

/* ==========================================
   CATEGORY GRID
========================================== */

.mega-menu-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));

    column-gap: 30px;
    row-gap: 45px;

    width: 100%;

    padding: 0;
    margin: 0;

    list-style: none;
}

.mega-menu-column {
    min-width: 0;
    list-style: none;
}

/* Tiêu đề danh mục cấp 2 */
.mega-menu-category {
    display: block;

    color: var(--lv-blue) !important;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;

    text-transform: uppercase;

    padding: 0 0 9px;
    margin-bottom: 9px;

    border-bottom: 1px solid var(--lv-gold);

    text-decoration: none !important;

    transition: color 0.2s ease;
}

.mega-menu-category:hover {
    color: var(--lv-orange) !important;
}

/* ==========================================
   CATEGORY LEVEL 3
========================================== */

.mega-menu-children {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-children li {
    padding: 0;
    margin: 0;
}

.mega-menu-children a {
    display: block;

    color: var(--lv-muted);

    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;

    padding: 6px 10px;

    text-decoration: none !important;

    border-radius: 3px;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        padding-left 0.2s ease;
}

.mega-menu-children a:hover {
    color: var(--lv-orange);
    background: var(--lv-hover);
    padding-left: 17px;
}

/* Danh mục hiển thị dạng phẳng */
.mega-menu-column > a:not(.mega-menu-category) {
    display: block;
    padding: 7px 10px;
    color: var(--lv-muted);
    font-size: 14px;
    text-decoration: none;
}

.mega-menu-column > a:not(.mega-menu-category):hover {
    color: var(--lv-orange);
    background: var(--lv-hover);
}

/* ==========================================
   RESPONSIVE - TABLET
========================================== */

@media (min-width: 768px) and (max-width: 1100px) {

    .mega-menu-panel {
        width: calc(100vw - 40px) !important;
        padding: 25px 25px;
    }

    .mega-menu-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 30px 20px;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
========================================== */

@media (max-width: 767px) {

    .header-content .navbar,
    .header-content .navbar-collapse {
        position: relative !important;
    }

    #menu-main-menu > li {
        position: relative !important;
    }

    /* Nút mở menu mobile */
    .mega-menu-toggle {
        display: inline-flex !important;

        position: absolute;
        right: 0;
        top: 0;

        width: 40px;
        height: 40px;

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

        border: none;
        background: transparent;

        cursor: pointer;
    }

    /* Menu mobile */
    .mega-menu-panel {
        display: none;

        position: static !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        left: auto !important;
        right: auto !important;

        padding: 15px 10px;

        box-shadow: none;
        border-top: 1px solid var(--lv-border);

        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: none;
        transition: none;
    }

    #menu-main-menu > li.mega-menu-item.is-open
    > .mega-menu-panel {
        display: block;
    }

    .mega-menu-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 12px;
    }

    .mega-menu-category {
        font-size: 13px;
    }

    .mega-menu-children a {
        font-size: 12px;
        padding: 6px;
    }
}
