/* ================================================================
   Header Stylesheet Module
   ================================================================ */
#masthead {
    position: sticky !important;
    top: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Reset focus/outline */
[data-section="section-header-mobile-trigger"] .ast-button-wrap .ast-mobile-menu-trigger-minimal:focus,
.ast-builder-menu-mobile .main-navigation .menu-item.menu-item-has-children>.ast-menu-toggle {
    border: none;
    outline: none;
    box-shadow: none;
}

.main-header-menu>.menu-item>.menu-link {
    outline: none;
}

/* Desktop submenu */
.main-header-menu .sub-menu .menu-link {
    padding: 10px 20px;
}

/* Mobile: ẩn Astra gốc */
#ast-mobile-header .ast-mobile-header-content {
    display: none !important;
}

/* Toggle button icon (Fix) */
.main-header-menu-toggle .mobile-menu-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 32px;
    height: 32px;
}

.main-header-menu-toggle .wt-icon {
    position: absolute;
    display: flex !important;
    transition: opacity 0.25s ease, transform 0.3s ease;
}

/* Mặc định: hiện hamburger, ẩn X */
.main-header-menu-toggle .wt-icon-menu {
    opacity: 1 !important;
    transform: rotate(0deg) scale(1) !important;
}

.main-header-menu-toggle .wt-icon-close {
    opacity: 0 !important;
    transform: rotate(-90deg) scale(0.5) !important;
}

/* Khi mở: ẩn hamburger, hiện X */
.main-header-menu-toggle.wt-menu-open .wt-icon-menu {
    opacity: 0 !important;
    transform: rotate(90deg) scale(0.5) !important;
}

.main-header-menu-toggle.wt-menu-open .wt-icon-close {
    opacity: 1 !important;
    transform: rotate(0deg) scale(1) !important;
}

/* Drawer: menu items */
#wt-drawer .ast-builder-menu-mobile,
#wt-drawer .ast-main-header-bar-alignment,
#wt-drawer .main-header-bar-navigation,
#wt-drawer .site-navigation,
#wt-drawer .main-navigation {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

#wt-drawer .main-header-menu {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background-color: white !important;
}

#wt-drawer .menu-item {
    display: block !important;
    width: 100% !important;
}

#wt-drawer .menu-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    color: #1a1a1a !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    text-decoration: none !important;
    background-color: white !important;
    font-family: var(--akm-font-body) !important;
    font-weight: 600 !important;
}

/* Drawer: Active / Current Menu Item */
#wt-drawer .current-menu-item > .menu-link,
#wt-drawer .current_page_item > .menu-link,
#wt-drawer .current-menu-ancestor > .menu-link,
#wt-drawer .menu-link[aria-current="page"] {
    color: #745D46 !important;
    font-weight: 700 !important;
}

#wt-drawer .menu-link:hover,
#wt-drawer .menu-link:active {
    color: #745D46 !important;
}

/* Drawer: submenu */
#wt-drawer .sub-menu {
    display: none;
}

#wt-drawer .sub-menu .menu-link {
    padding-left: 36px !important;
    font-size: 14px !important;
    color: #555 !important;
    background: #fafafa !important;
}

/* Drawer: ẩn element Astra thừa */
#wt-drawer .ast-menu-toggle,
#wt-drawer .dropdown-menu-toggle,
#wt-drawer .ast-icon.icon-arrow {
    display: none !important;
}

.ast-builder-grid-row.ast-grid-center-col-layout {
    display: flex !important;
    justify-content: space-between !important;
}

.site-header-primary-section-left.site-header-section-left {
    width: fit-content !important;
}

.site-header-primary-section-right.ast-grid-right-section {
    width: fit-content !important;
}

.site-header-primary-section-left-center.ast-grid-left-center-section,
.site-header-primary-section-right-center.ast-grid-right-center-section {
    display: none !important;
}

.info-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    font-size: 14px !important;
}

.info-item img {
    width: 16px !important;
    height: 16px !important;
}

.ast-above-header-bar.ast-above-header.site-header-focus-item {
    border: none !important;
    height: fit-content !important;
    min-height: 0 !important;
}

.top-bar-info>p:empty {
    display: none !important;
}

.ast-header-html-1,
.ast-header-html-1>.ast-header-html,
.ast-header-html-1>.ast-header-html>.ast-builder-html-element,
.ast-header-html-1>.ast-header-html>.ast-builder-html-element>.top-bar {
    width: 100% !important;
}

.site-branding.ast-site-identity {
    padding: 0 !important;
}

.phone-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    gap: 4px 8px;
    line-height: normal !important;
}

/* Mobile Breakpoint < 923px */
@media (max-width: 922px) {
    #masthead {
        display: flex !important;
        flex-direction: column !important;
    }

    .ast-mobile-header-wrap .ast-primary-header-bar,
    .ast-primary-header-bar .site-primary-header-wrap {
        min-height: 70px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Hiển thị mobile header lên trên cùng */
    #ast-mobile-header {
        display: block !important;
        order: 1 !important;
    }

    /* Giữ #ast-desktop-header ở vị trí bên dưới để hiển thị below-header */
    #ast-desktop-header {
        display: block !important;
        order: 2 !important;
    }

    /* Ẩn main header bar của desktop, giữ lại below-header */
    #ast-desktop-header>.ast-main-header-wrap {
        display: none !important;
    }

    #ast-desktop-header .ast-below-header-wrap {
        display: block !important;
    }

    #ast-mobile-header .ast-builder-grid-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .ast-header-break-point .main-header-menu-toggle,
    .main-header-menu-toggle {
        display: flex !important;
    }

    .ast-desktop-header-content,
    #masthead .main-header-bar-navigation {
        display: none !important;
    }

    .phone-contact {
        font-size: 14px !important;
    }
}

@media (min-width: 923px) {
    #masthead {
        display: block !important;
    }

    #ast-desktop-header {
        display: block !important;
        order: initial !important;
    }

    #ast-desktop-header>.ast-main-header-wrap {
        display: block !important;
    }

    #ast-mobile-header {
        display: none !important;
    }

}