/* Visual Mega Menu -> Layout Theme integration.
 *
 * This file is the ONLY frontend stylesheet for VMM when it is rendered by
 * Layout Theme. The plugin's standalone front.css is intentionally skipped by
 * the theme (see inc/mega-menu.php) so Home and inner pages cannot drift apart
 * because of competing defaults.
 */ .header__main-menu .theme-vmm-header, .header__main-menu .theme-vmm-header * {
    box-sizing: border-box;
}
.header__main-menu .theme-vmm-header {
    --theme-vmm-rail-width: 215px;
    --theme-vmm-panel-width: 926px;
    --theme-vmm-menu-height: 395px;
    --theme-vmm-accent: var(--vmm-accent, #d4a30f);
    position: relative;
    width: 100%;
    z-index: 130;
    font-family: inherit;
}
/* Trigger: same geometry as the legacy Home menu header. */ .header__main-menu .theme-vmm-header .vmm-trigger {
    display: inline-flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid #e6e6e6;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
    background: #fafafa;
    color: #f58715;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, .15);
    font-size: 12px;
    line-height: 18px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.header__main-menu .theme-vmm-header .vmm-trigger > .fa-bars {
    width: 20px;
    margin: 0;
    font-size: 18px;
    line-height: 18px;
    text-align: center;
}
/* Shared dropdown structure. */ .header__main-menu .theme-vmm-header > .vmm-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    display: grid;
    width: min(calc(var(--theme-vmm-rail-width) + var(--theme-vmm-panel-width)), calc(100vw - 24px));
    min-height: var(--theme-vmm-menu-height);
    grid-template-columns: var(--theme-vmm-rail-width) minmax(0, 1fr);
    background: #fff;
    border: 1px solid #e6e6e6;
    border-top: 0;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease, visibility .12s ease;
}
.header__main-menu .theme-vmm-header.is-hover-open > .vmm-dropdown, .header__main-menu .theme-vmm-header.is-open > .vmm-dropdown, .header__main-menu .theme-vmm-header.is-forced-open > .vmm-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* -------------------------------------------------------------------------
 * Shared desktop left rail. Home and inner pages use this exact same block.
 * ---------------------------------------------------------------------- */ @media (min-width: 992px) {
    .header__main-menu .theme-vmm-header .vmm-category-list {
        display: flex;
        width: var(--theme-vmm-rail-width);
        height: var(--theme-vmm-menu-height);
        min-height: var(--theme-vmm-menu-height);
        flex-direction: column;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #fafafa;
        border-right: 1px solid #e6e6e6;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item {
        position: relative;
        display: flex;
        flex: 1 1 0;
        min-height: 0;
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-category {
        display: grid;
        width: 100%;
        height: 100%;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) 14px;
        align-items: center;
        gap: 8px;
        margin: 0;
        padding: 8px 14px;
        border: 0;
        border-bottom: 1px solid #dcdcdc;
        background: transparent;
        color: #333;
        text-align: left;
        cursor: pointer;
        transition: background-color .08s ease, color .08s ease;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item:last-child .vmm-category {
        border-bottom: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item.has-link .vmm-category {
        padding-right: 42px;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item.has-link .vmm-arrow {
        display: none;
    }
    .header__main-menu .theme-vmm-header .vmm-category:hover,     .header__main-menu .theme-vmm-header .vmm-category.is-active {
        background: var(--theme-vmm-accent);
        color: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy {
        display: flex;
        min-width: 0;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy strong {
        display: block;
        margin: 0;
        color: inherit;
        font-size: 18px;
        line-height: 1.1;
        font-weight: 700;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy small {
        display: block;
        min-width: 0;
        margin: 0;
        overflow: hidden;
        color: #838383;
        font-size: 12px;
        line-height: 1.35;
        font-weight: 400;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .header__main-menu .theme-vmm-header .vmm-category:hover .vmm-category-copy small,     .header__main-menu .theme-vmm-header .vmm-category.is-active .vmm-category-copy small {
        color: rgba(255, 255, 255, .92);
    }
    .header__main-menu .theme-vmm-header .vmm-arrow {
        display: block;
        color: #bbb;
        font-size: 18px;
        line-height: 1;
        text-align: right;
    }
    .header__main-menu .theme-vmm-header .vmm-category:hover .vmm-arrow,     .header__main-menu .theme-vmm-header .vmm-category.is-active .vmm-arrow {
        color: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-category-go {
        position: absolute;
        top: 50%;
        right: 10px;
        z-index: 2;
        display: inline-flex;
        width: 28px;
        height: 28px;
        align-items: center;
        justify-content: center;
        transform: translateY(-50%);
        border-radius: 50%;
        color: #bbb;
        font-size: 16px;
        line-height: 1;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item:hover .vmm-category-go,     .header__main-menu .theme-vmm-header .vmm-category.is-active ~ .vmm-category-go,     .header__main-menu .theme-vmm-header .vmm-category-item:focus-within .vmm-category-go {
        color: #fff;
        background: rgba(255, 255, 255, .14);
    }
    /* ---------------------------------------------------------------------
     * Shared desktop content panel. No Home-only typography/spacing rules.
     * ------------------------------------------------------------------ */     .header__main-menu .theme-vmm-header .vmm-content-area {
        position: relative;
        min-width: 0;
        height: var(--theme-vmm-menu-height);
        min-height: var(--theme-vmm-menu-height);
        overflow: hidden;
        background: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-content {
        position: absolute;
        inset: 0;
        display: block;
        margin: 0;
        padding: 20px 26px 24px;
        overflow: auto;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .09s ease;
    }
    .header__main-menu .theme-vmm-header .vmm-content.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    /*
     * IMPORTANT: an active panel must not be hit-testable while its parent
     * dropdown/content area is hidden.
     *
     * `.vmm-content.is-active` explicitly sets `visibility: visible` and
     * `pointer-events: auto`. Without the guards below it can override the
     * hidden parent and leave an invisible 926px hover layer over the page.
     * Hovering the banner/content then makes the menu appear even though the
     * pointer never entered the category menu.
     */     .header__main-menu .theme-vmm-header:not(.theme-vmm-home) > .vmm-dropdown .vmm-content.is-active {
        visibility: hidden;
        pointer-events: none;
    }
    .header__main-menu .theme-vmm-header:not(.theme-vmm-home).is-hover-open > .vmm-dropdown .vmm-content.is-active,     .header__main-menu .theme-vmm-header:not(.theme-vmm-home).is-open > .vmm-dropdown .vmm-content.is-active,     .header__main-menu .theme-vmm-header:not(.theme-vmm-home).is-forced-open > .vmm-dropdown .vmm-content.is-active {
        visibility: visible;
        pointer-events: auto;
    }
    .header__main-menu .theme-vmm-header .vmm-content-grid {
        display: grid;
        grid-template-columns: repeat(var(--vmm-cols, 4), minmax(0, 200px));
        justify-content: start;
        align-content: start;
        gap: 20px 28px;
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-column {
        min-width: 0;
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-section {
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-section + .vmm-section {
        margin-top: 18px;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 {
        margin: 0 0 5px;
        padding: 0;
        color: var(--theme-vmm-accent);
        font-size: 16px;
        line-height: 1.25;
        font-weight: 700;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 > a {
        display: inline;
        margin: 0;
        padding: 0;
        color: inherit;
        font-size: inherit;
        line-height: inherit;
        font-weight: inherit;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section li {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section ul a {
        display: inline-block;
        margin: 0;
        padding: 2px 0;
        color: #333;
        font-size: 14px;
        line-height: 1.25;
        font-weight: 400;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 > a:hover,     .header__main-menu .theme-vmm-header .vmm-section ul a:hover {
        color: var(--theme-vmm-accent);
        text-decoration: none;
    }
    /* Inner pages use exactly the same 395px rail/panel geometry as Home. */     .header__main-menu .theme-vmm-header:not(.theme-vmm-home) > .vmm-dropdown {
        height: var(--theme-vmm-menu-height);
        min-height: var(--theme-vmm-menu-height);
    }
    /* Home keeps only one special behavior: the left rail is permanently
       visible next to the slider and its height follows the slider variable. */     .header__main-menu .theme-vmm-home > .vmm-dropdown {
        width: var(--theme-vmm-rail-width);
        height: var(--home-hero-height, var(--theme-vmm-menu-height));
        min-height: var(--home-hero-height, var(--theme-vmm-menu-height));
        grid-template-columns: var(--theme-vmm-rail-width);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
    }
    .header__main-menu .theme-vmm-home .vmm-category-list {
        height: var(--home-hero-height, var(--theme-vmm-menu-height));
        min-height: var(--home-hero-height, var(--theme-vmm-menu-height));
    }
    .header__main-menu .theme-vmm-home .vmm-content-area {
        position: absolute;
        top: -1px;
        left: calc(var(--theme-vmm-rail-width) - 1px);
        width: min(var(--theme-vmm-panel-width), calc(100vw - 245px));
        height: calc(var(--home-hero-height, var(--theme-vmm-menu-height)) + 1px);
        min-height: calc(var(--home-hero-height, var(--theme-vmm-menu-height)) + 1px);
        border: 1px solid #e6e6e6;
        background: #fff;
        box-shadow: 2px 2px 4px rgba(0, 0, 0, .1);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .12s ease, visibility .12s ease;
    }
    /* The Home rail is always visible, but the mega panel is not. Keep the
       active panel completely inert until a level-1 category is hovered. */     .header__main-menu .theme-vmm-home:not(.is-theme-panel-open) .vmm-content-area .vmm-content.is-active {
        visibility: hidden;
        pointer-events: none;
    }
    .header__main-menu .theme-vmm-home.is-theme-panel-open .vmm-content-area {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .header__main-menu .theme-vmm-home.is-theme-panel-open .vmm-content-area .vmm-content.is-active {
        visibility: visible;
        pointer-events: auto;
    }
}
/* Tablet: preserve the theme's 991px breakpoint, but keep VMM self-contained. */ @media (min-width: 768px) and (max-width: 991px) {
    .header__main-menu .theme-vmm-header .vmm-trigger {
        width: 100%;
        min-height: 40px;
        color: #fff;
        background: #d4a30f;
        border-color: #d4a30f;
        box-shadow: none;
    }
    .header__main-menu .theme-vmm-header > .vmm-dropdown {
        position: static;
        display: none;
        width: 100%;
        min-height: 0;
        max-height: 75vh;
        grid-template-columns: 1fr;
        overflow: auto;
        border-top: 1px solid #e6e6e6;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
    }
    .header__main-menu .theme-vmm-header.is-open > .vmm-dropdown,     .header__main-menu .theme-vmm-header.is-hover-open > .vmm-dropdown,     .header__main-menu .theme-vmm-header.is-forced-open > .vmm-dropdown {
        display: grid;
    }
    .header__main-menu .theme-vmm-header .vmm-category-list {
        margin: 0;
        padding: 0;
        background: #fff;
        border-right: 0;
        border-bottom: 1px solid #e5e5e5;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item {
        position: relative;
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-category {
        display: grid;
        width: 100%;
        min-height: 58px;
        grid-template-columns: minmax(0, 1fr) 18px;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border: 0;
        border-bottom: 1px solid #ededed;
        background: transparent;
        color: #222;
        text-align: left;
    }
    .header__main-menu .theme-vmm-header .vmm-category:hover,     .header__main-menu .theme-vmm-header .vmm-category.is-active {
        background: var(--theme-vmm-accent);
        color: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 3px;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy strong {
        font-size: 16px;
        line-height: 1.2;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy small {
        color: #8a8a8a;
        font-size: 12px;
        line-height: 1.3;
    }
    .header__main-menu .theme-vmm-header .vmm-category.is-active small,     .header__main-menu .theme-vmm-header .vmm-category:hover small {
        color: rgba(255,255,255,.9);
    }
    .header__main-menu .theme-vmm-header .vmm-arrow {
        color: #bbb;
        font-size: 18px;
        line-height: 1;
    }
    .header__main-menu .theme-vmm-header .vmm-category.is-active .vmm-arrow,     .header__main-menu .theme-vmm-header .vmm-category:hover .vmm-arrow {
        color: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item.has-link .vmm-category {
        padding-right: 46px;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item.has-link .vmm-arrow {
        display: none;
    }
    .header__main-menu .theme-vmm-header .vmm-category-go {
        position: absolute;
        top: 50%;
        right: 13px;
        z-index: 2;
        display: inline-flex;
        width: 28px;
        height: 28px;
        align-items: center;
        justify-content: center;
        transform: translateY(-50%);
        color: #777;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-content-area {
        min-height: 0;
        overflow: visible;
        background: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-content {
        position: static;
        display: none;
        padding: 22px;
        overflow: visible;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .header__main-menu .theme-vmm-header .vmm-content.is-active {
        display: block;
    }
    .header__main-menu .theme-vmm-header .vmm-content-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }
    .header__main-menu .theme-vmm-header .vmm-section + .vmm-section {
        margin-top: 18px;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 {
        margin: 0 0 5px;
        color: var(--theme-vmm-accent);
        font-size: 16px;
        line-height: 1.25;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 a {
        color: inherit;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section li {
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-section ul a {
        display: inline-block;
        padding: 2px 0;
        color: #333;
        font-size: 14px;
        line-height: 1.25;
        text-decoration: none;
    }
}
/* Mobile: the theme already provides the slide-in drawer, so VMM is rendered
   directly inside it and does not need a second trigger. */ @media (max-width: 767px) {
    .header__main-menu .theme-vmm-header .vmm-trigger {
        display: none;
    }
    .header__main-menu .theme-vmm-header > .vmm-dropdown {
        position: static;
        display: grid !important;
        width: 100%;
        min-height: 0;
        max-height: none;
        grid-template-columns: 1fr;
        overflow: visible;
        border: 0;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        box-shadow: none;
    }
    .header__main-menu .theme-vmm-header .vmm-category-list {
        margin: 0;
        padding: 0;
        background: #fff;
        border-right: 0;
        border-bottom: 1px solid #e5e5e5;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item {
        position: relative;
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-category {
        display: grid;
        width: 100%;
        min-height: 56px;
        grid-template-columns: minmax(0, 1fr) 18px;
        align-items: center;
        gap: 8px;
        padding: 9px 14px;
        border: 0;
        border-bottom: 1px solid #ededed;
        background: transparent;
        color: #222;
        text-align: left;
    }
    .header__main-menu .theme-vmm-header .vmm-category:hover,     .header__main-menu .theme-vmm-header .vmm-category.is-active {
        background: var(--theme-vmm-accent);
        color: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy strong {
        font-size: 16px;
        line-height: 1.2;
    }
    .header__main-menu .theme-vmm-header .vmm-category-copy small {
        color: #8a8a8a;
        font-size: 12px;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header__main-menu .theme-vmm-header .vmm-category.is-active small,     .header__main-menu .theme-vmm-header .vmm-category:hover small {
        color: rgba(255,255,255,.9);
    }
    .header__main-menu .theme-vmm-header .vmm-arrow {
        color: #bbb;
        font-size: 18px;
        line-height: 1;
    }
    .header__main-menu .theme-vmm-header .vmm-category.is-active .vmm-arrow,     .header__main-menu .theme-vmm-header .vmm-category:hover .vmm-arrow {
        color: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item.has-link .vmm-category {
        padding-right: 46px;
    }
    .header__main-menu .theme-vmm-header .vmm-category-item.has-link .vmm-arrow {
        display: none;
    }
    .header__main-menu .theme-vmm-header .vmm-category-go {
        position: absolute;
        top: 50%;
        right: 13px;
        z-index: 2;
        display: inline-flex;
        width: 28px;
        height: 28px;
        align-items: center;
        justify-content: center;
        transform: translateY(-50%);
        color: #777;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-content-area {
        min-height: 0;
        overflow: visible;
        background: #fff;
    }
    .header__main-menu .theme-vmm-header .vmm-content {
        position: static;
        display: none;
        padding: 18px 16px 24px;
        overflow: visible;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .header__main-menu .theme-vmm-header .vmm-content.is-active {
        display: block;
    }
    .header__main-menu .theme-vmm-header .vmm-content-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .header__main-menu .theme-vmm-header .vmm-section + .vmm-section {
        margin-top: 18px;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 {
        margin: 0 0 5px;
        color: var(--theme-vmm-accent);
        font-size: 16px;
        line-height: 1.25;
    }
    .header__main-menu .theme-vmm-header .vmm-section h4 a {
        color: inherit;
        text-decoration: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    .header__main-menu .theme-vmm-header .vmm-section li {
        margin: 0;
        padding: 0;
    }
    .header__main-menu .theme-vmm-header .vmm-section ul a {
        display: inline-block;
        padding: 3px 0;
        color: #333;
        font-size: 14px;
        line-height: 1.3;
        text-decoration: none;
    }
}

/* TT - Uniform Mega Menu category labels (homepage + inner pages). */
.header__main-menu .theme-vmm-header .vmm-category-copy {
    text-transform: uppercase;
}
.header__main-menu .theme-vmm-header .vmm-category-copy strong {
    font-size: 14px;
}
.header__main-menu .theme-vmm-header .vmm-category-copy small {
    font-size: 12px;
}

/* --------------------------------------------------------------------------
 * TT: Keep the desktop category rail exactly as wide as the "Danh muc" bar.
 * The bar changes width across breakpoints and while the sticky header shrinks.
 * Use the actual .tl-home-mega width instead of a fixed 215px rail.
 * The existing dropdown grid + panel position use the same rail variable.
 * Mobile/tablet menu rendering remains unchanged.
 * ----------------------------------------------------------------------- */
@media (min-width: 993px) {
    .header__main-menu.tl-home-mega {
        container-type: inline-size;
    }

    .header__main-menu.tl-home-mega .theme-vmm-header {
        --theme-vmm-rail-width: 100cqw;
    }

    .header__main-menu.tl-home-mega .theme-vmm-header .vmm-category-list {
        width: var(--theme-vmm-rail-width);
        max-width: var(--theme-vmm-rail-width);
    }
}

/* Icon upload dùng chung cho header Homepage, trang con và admin preview. */
.header__main-menu .theme-vmm-header .vmm-category-main { display:flex; align-items:center; gap:8px; min-width:0; }
.header__main-menu .theme-vmm-header .vmm-category-icon { display:block; width:20px; height:20px; max-width:20px; max-height:20px; flex:0 0 20px; object-fit:contain; }
