/* =========================================================
   QTECH GLOBAL MEGA MENU
========================================================= */

:root {
    --qtech-header-height: 87.5625px;
    /*
     * Responsive menu fallback height.
     * If JS sets --qtech-responsive-header-height, that value wins.
     */
    --qtech-responsive-header-height: 66px;
    --qtech-responsive-header-bottom: 0px; /* legacy; no longer used by CSS */
}

body.qtech-menu-open {
    overflow: hidden !important;
}

.qtech-global-menu {
    position: relative;

    z-index: 900;

    width: 100%;

    max-height: 0;

    overflow: hidden;

    background: var(--qtech-surface);
    
    border-bottom: 1px solid var(--qtech-border);

    opacity: 0;

    visibility: hidden;

    transform: translateY(-8px);

    transition:
        max-height 420ms cubic-bezier(.4,0,.2,1),
        opacity 180ms ease,
        transform 220ms ease,
        visibility 0s linear 420ms;
}


.qtech-global-menu.is-open {
    max-height: 850px;

    opacity: 1;

    visibility: visible;

    transform: translateY(0);

    transition:
        max-height 420ms cubic-bezier(.4,0,.2,1),
        opacity 180ms ease,
        transform 220ms ease,
        visibility 0s;
}


/* =========================================================
   SHELL
========================================================= */

.qtech-global-menu-shell {
    width: min(1200px, calc(100% - 48px));

    margin: 0 auto;

    padding: 24px 0 30px;
}


/* =========================================================
   HEADER
========================================================= */

.qtech-global-menu-header {
    display: flex;

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

    gap: 24px;

    margin-bottom: 20px;
}


.qtech-global-menu-heading {
    color: var(--qtech-heading);

    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
}

/* =========================================================
   QTECH MEGA MENU — CLOSE CONTROL
========================================================= */

.qtech-global-menu-close {
    appearance: none !important;
    -webkit-appearance: none !important;

    box-sizing: border-box !important;

    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;

    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;

    flex: 0 0 34px !important;

    margin: 0 !important;
    padding: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: transparent !important;

    border: 1px solid var(--qtech-border) !important;
    border-radius: 50% !important;

    color: var(--qtech-text-muted) !important;

    font-family: Arial, sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    cursor: pointer !important;

    box-shadow: none !important;

    transition:
        color 160ms ease,
        border-color 160ms ease,
        background-color 160ms ease !important;
}

.qtech-global-menu-close span {
    display: block !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    color: inherit !important;

    font-size: inherit !important;
    line-height: 1 !important;

    transform: translateY(-1px);
}

.qtech-global-menu-close:hover {
    color: var(--qtech-red) !important;

    border-color: rgba(179,27,52,.30) !important;

    background: rgba(179,27,52,.05) !important;
}

.qtech-global-menu-close:focus-visible {
    outline: 2px solid var(--qtech-red) !important;
    outline-offset: 2px !important;
}



/* =========================================================
   QTECH MEGA MENU — ARCHITECTURE TABS
========================================================= */

.qtech-global-menu-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px !important;

    margin-bottom: 26px !important;
    padding: 4px !important;

    background: var(--qtech-stone);
    border-radius: 7px;
}

.qtech-global-menu-tab {
    display: inline-flex;
    align-items: center;

    min-height: 38px;

    padding: 0 14px !important;

    background: transparent !important;

    border: 0 !important;
    border-radius: 5px !important;

    color: var(--qtech-text) !important;

    font-size: 13px !important;
    font-weight: 650 !important;

    text-decoration: none;

    transition:
        color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease !important;
}

.qtech-global-menu-tab:hover {
    color: var(--qtech-red) !important;

    background: var(--qtech-surface-translucent) !important;
}

.qtech-global-menu-tab.is-active {
    color: var(--qtech-red) !important;
    background: var(--qtech-surface) !important;
    box-shadow: var(--qtech-action-shadow);
}

.qtech-global-menu-tab:focus-visible {
    outline: 2px solid var(--qtech-red);
    outline-offset: 2px;
}


/* =========================================================
   PANELS
========================================================= */

.qtech-global-menu-panel[hidden] {
    display: none !important;
}


.qtech-global-menu-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    align-items: start;

    gap: 32px 40px;
}


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

.qtech-global-menu-group-title {
    margin: 0;
    margin-bottom: 9px;

    color: var(--qtech-red);

    font-size: 11px !important;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: .075em;

    text-transform: uppercase;
}


/* =========================================================
   LINKS
========================================================= */

.qtech-global-menu-links {
    margin: 0;
    padding: 0;

    list-style: none;
}


.qtech-global-menu-links li {
    margin: 0;
    padding: 0;
}


.qtech-global-menu-links a {
    display: inline-block;

    padding: 5px 0;

    color: var(--qtech-heading);

    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;

    text-decoration: none;

    transition:
        color 160ms ease,
        transform 160ms ease;
}


.qtech-global-menu-links a:hover,
.qtech-global-menu-links a:focus-visible {
    color: var(--qtech-red);

    transform: translateX(3px);
}


/* =========================================================
   VIEW ALL
========================================================= */

.qtech-global-menu-viewall {
    margin-top: 26px;
    padding-top: 17px;

    border-top: 1px solid var(--qtech-border);
}


.qtech-global-menu-viewall a {
    color: var(--qtech-red);

    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;

    text-decoration: none;

    text-transform: uppercase;
}


.qtech-global-menu-viewall a:hover,
.qtech-global-menu-viewall a:focus-visible {
    color: var(--qtech-heading);
}


/* =========================================================
   FOOTER
========================================================= */

.qtech-global-menu-footer {
    display: none;
}

/* =========================================================
   QTECH HEADER ACTIONS
========================================================= */

/* Shared header action sizing */
.qtech-menu-trigger,
.ast-header-button-1 .ast-custom-button {
    min-height: 38px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 6px !important;

    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 700 !important;

    letter-spacing: .035em !important;

    text-transform: uppercase;
}

/* =========================================================
   MENU TRIGGER
========================================================= */

.qtech-menu-trigger {
    min-width: 0 !important;

    padding: 0 11px !important;

    background: var(--qtech-red) !important;

    border: 1px solid var(--qtech-red) !important;

    color: #ffffff !important;

    gap: 7px !important;

    transition:
        background-color 160ms ease,
        border-color 160ms ease !important;
}


.qtech-menu-trigger:hover,
.qtech-menu-trigger:focus-visible {
    background: var(--qtech-red-hover) !important;
    border-color: var(--qtech-red-hover) !important;
    color: #ffffff !important;
}


.qtech-menu-trigger:focus-visible {
    outline: 2px solid var(--qtech-red) !important;
    outline-offset: 3px !important;
}


/* Burger is hidden on larger screens */
.qtech-menu-trigger-icon {
    display: none;

    width: 21px;

    flex-direction: column;

    gap: 4px;
}


.qtech-menu-trigger-icon span {
    display: block;

    width: 21px;
    height: 2px;

    background: currentColor;

    border-radius: 2px;

    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

/* =========================================================
   GET HELP — QUIETER CTA
========================================================= */

.ast-header-button-1 .ast-custom-button {
    padding: 0 15px !important;

    background: transparent !important;

    border: 1px solid rgba(179, 27, 52, .35) !important;

    color: var(--qtech-red) !important;

    box-shadow: none !important;

    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease !important;
}

.ast-header-button-1 .ast-custom-button:hover,
.ast-header-button-1 .ast-custom-button:focus-visible {
    background: rgba(179, 27, 52, .06) !important;

    border-color: var(--qtech-red) !important;

    color: var(--qtech-red) !important;
}

.ast-builder-layout-element[data-section="section-hb-social-icons-1"],
.ast-builder-layout-element[data-section="section-hb-button-1"] {
    margin-left: 0 !important;
}

/* =========================================================
   QTECH HEADER SEARCH
========================================================= */

.site-header .ast-search-menu-icon {
    margin: 0 !important;
}

.site-header .ast-search-menu-icon .search-form {
    min-width: 0 !important;
}

.site-header .ast-search-menu-icon .search-field {
    width: 220px !important;
    height: 38px !important;

    padding: 0 38px 0 12px !important;

    background: var(--qtech-input-bg) !important;

    border: 1px solid var(--qtech-input-border) !important;
    border-radius: 6px !important;

    color: var(--qtech-input-text) !important;

    font-size: 14px !important;
    line-height: 1 !important;

    box-shadow: none !important;

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease !important;
}

.site-header .ast-search-menu-icon .search-field::placeholder {
    color: var(--qtech-input-placeholder) !important;
}

.site-header .ast-search-menu-icon .search-field:focus {
    border-color: var(--qtech-red) !important;

    box-shadow: 0 0 0 3px rgba(179,27,52,.08) !important;

    outline: 0 !important;
}

/* Search icon */
.site-header .ast-search-menu-icon .search-submit,
.site-header .ast-search-menu-icon .ast-icon {
    color: var(--qtech-red) !important;
    fill: var(--qtech-red) !important;
}

.site-header-primary-section-right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* =========================================================
   QTECH MEGA MENU — INTERNAL SEARCH
========================================================= */

.qtech-global-menu-search {
    display: none;
}

.qtech-global-search-form {
    position: relative;
    width: 100%;
    margin: 0;
}

.qtech-global-search-field {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 46px 0 14px;
    background: var(--qtech-surface-soft);
    border: 1px solid var(--qtech-input-border);
    border-radius: 7px;
    color: var(--qtech-input-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    outline: none;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.qtech-global-search-field::placeholder {
    color: var(--qtech-input-placeholder);
    opacity: 1;
}

.qtech-global-search-field:focus {
    background: var(--qtech-input-bg);
    border-color: var(--qtech-red);
    box-shadow: 0 0 0 3px rgba(179,27,52,.08);
}

.qtech-global-search-submit {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--qtech-red);
    cursor: pointer;
}

.qtech-global-search-submit:hover {
    color: var(--qtech-heading);
}

.qtech-global-search-submit:focus-visible {
    outline: 2px solid var(--qtech-red);
    outline-offset: -3px;
    border-radius: 6px;
}

/* =========================================================
   QTECH RESPONSIVE MENU SYSTEM
   One responsive architecture; no overlapping legacy blocks.
========================================================= */

/* =========================================================
   STICKY SITE HEADER
========================================================= */

.site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 3000;
}


/* Desktop WordPress admin bar */
@media (min-width: 783px) {

    body.admin-bar .site-header {
        top: 32px !important;
    }

}


/* Mobile WordPress admin bar is hidden */
@media (max-width: 782px) {

    html {
        margin-top: 0 !important;
    }

    body.admin-bar #wpadminbar {
        display: none !important;
    }

    body.admin-bar .site-header {
        top: 0 !important;
    }

}

/* =========================================================
   DESKTOP — 1200px+
========================================================= */

@media (min-width: 1200px) {

    .qtech-global-menu {
        position: sticky;
        top: var(--qtech-header-height);
        z-index: 2900;
    }

    body.admin-bar .qtech-global-menu {
        top: calc(var(--qtech-header-height) + 32px);
    }

    .qtech-menu-trigger {
        display: inline-flex !important;
    }

    .qtech-global-menu-close {
        display: inline-flex !important;
    }
}

/* =========================================================
   TABLET + MOBILE — ≤1199px
   Astra owns the visible burger / X.
========================================================= */

@media (max-width: 1199px) {

    #masthead,
    .site-header,
    .ast-mobile-header-wrap,
    .ast-mobile-header-wrap .ast-primary-header-bar,
    .ast-mobile-header-wrap .site-primary-header-wrap {
        overflow: visible !important;
    }

    .ast-mobile-header-wrap,
    .ast-mobile-header-wrap .ast-primary-header-bar {
        position: relative;
        z-index: 99999 !important;
    }

    #masthead.site-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 99999 !important;
        isolation: isolate;
    }

    .site-content,
    #content {
        position: relative;
        z-index: 1;
    }

    .site-header,
    .ast-mobile-header-wrap,
    .ast-mobile-header-wrap .ast-primary-header-bar,
    .ast-mobile-header-wrap .site-primary-header-wrap {
        margin-top: 0 !important;
        padding-top: 0 !important;
        background: var(--qtech-light, #f7f5f1) !important;
    }

    .site-header,
    body.admin-bar .site-header {
        top: 0 !important;
    }

    .ast-desktop-header {
        display: none !important;
    }

    .ast-mobile-header-wrap {
        display: block !important;
    }

    .ast-mobile-header-wrap .ast-above-header-bar,
    .ast-mobile-header-wrap .ast-below-header-bar,
    .ast-above-header-wrap,
    .ast-below-header-wrap {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .ast-mobile-header-wrap .ast-primary-header-bar {
        border: 0 !important;
        box-shadow: none !important;
    }

    .ast-mobile-header-wrap .site-primary-header-wrap {
        min-height: 0 !important;
    }

    .qtech-menu-trigger {
        display: none !important;
    }

    .menu-toggle.main-header-menu-toggle {
        position: relative !important;
        z-index: 3100 !important;
        margin: 0 !important;
        background: var(--qtech-red) !important;
        border-color: var(--qtech-red) !important;
        color: #ffffff !important;
        box-shadow: none !important;
    }

    .qtech-global-menu {
        position: fixed !important;

        top: var(--qtech-responsive-header-height) !important;

        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        width: 100% !important;
        height: auto !important;
        max-height: 0 !important;
        margin: 0 !important;

        overflow: hidden !important;

        background: var(--qtech-surface) !important;

        z-index: 100000 !important;

        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);

        transition:
            max-height 260ms cubic-bezier(.4,0,.2,1),
            opacity 160ms ease,
            transform 180ms ease,
            visibility 0s linear 260ms;
    }

    .qtech-global-menu.is-open {
        max-height: calc(
            100dvh -
            var(--qtech-responsive-header-height)
        ) !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;

        opacity: 1;
        visibility: visible;
        transform: translateY(0);

        transition:
            max-height 260ms cubic-bezier(.4,0,.2,1),
            opacity 160ms ease,
            transform 180ms ease,
            visibility 0s;
    }

    .qtech-global-menu-header,
    .qtech-global-menu-close {
        display: none !important;
    }

    .qtech-global-menu-shell {
        width: min(100% - 40px, 1000px);
        margin: 0 auto;
        padding-top: 18px;
    }

    #ast-mobile-site-navigation,
    .ast-builder-menu-mobile[data-section="section-header-mobile-menu"],
    .ast-mobile-header-content {
        display: none !important;
    }
}

/* =========================================================
   TABLET — 768px–1199px
========================================================= */

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

    .qtech-global-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 36px;
    }
}

/* =========================================================
   QTECH HEADER — TABLET / SMALL DESKTOP CLEANUP
   Prevent duplicate Astra header rows
   ========================================================= */

@media (min-width: 923px) and (max-width: 1199px) {

    /* Hide Astra desktop header row */
    .ast-desktop-header {
        display: none !important;
    }

    /* Force mobile/tablet header to be the only visible header */
    .ast-mobile-header-wrap {
        display: block !important;
    }

    /* Prevent any desktop primary-header bar from leaking through */
    .ast-primary-header-bar.ast-primary-header {
        display: none !important;
    }

    /* Keep mobile/tablet primary bar visible */
    .ast-mobile-header-wrap .ast-primary-header-bar {
        display: block !important;
    }

    /* Desktop header-builder rows */
    #ast-desktop-header,
    .ast-desktop-header,
    .site-header-primary-section-left:not(
        .ast-mobile-header-wrap *
    ) {
        display: none !important;
    }

    /* Mobile/tablet header */
    #ast-mobile-header,
    .ast-mobile-header-wrap {
        display: block !important;
    }
}

/* =========================================================
   MOBILE — ≤767px
========================================================= */

@media (max-width: 767px) {

    .site-header,
    .ast-mobile-header-wrap,
    .ast-mobile-header-wrap .ast-primary-header-bar,
    .ast-mobile-header-wrap .site-primary-header-wrap {
        top: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .qtech-global-menu-shell {
        width: 100%;
        padding: 18px 18px 30px;
    }

    .qtech-global-menu-search {
        display: block;
        width: 100%;
        margin: 0 0 16px;
    }

    .ast-header-search {
        display: none !important;
    }

    .qtech-global-menu-tabs {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;

        gap: 2px !important;

        margin-bottom: 20px !important;
        padding: 4px !important;
    }

    .qtech-global-menu-tab {
        width: 100%;

        min-height: 38px;

        padding: 0 10px !important;

        text-align: left;

        font-size: 12px !important;
        line-height: 1.3 !important;
    }

    .qtech-global-menu-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .qtech-global-menu-group-title {
        font-size: 10px;
    }

    .qtech-global-menu-links a {
        display: block;
        padding: 6px 0;
        font-size: 14px;
    }

    .qtech-global-menu-links a:hover,
    .qtech-global-menu-links a:focus-visible {
        transform: none;
    }

    .qtech-global-menu-footer {
        display: block;
        margin-top: 28px;
        padding-top: 18px;
        border-top: 1px solid var(--qtech-border);
    }

    .qtech-global-menu-help {
        color: var(--qtech-red);
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qtech-global-menu,
    .qtech-global-menu *,
    .qtech-global-menu *::before,
    .qtech-global-menu *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 1199px) {
    .qtech-global-menu {
        top: var(--qtech-responsive-header-height) !important;
    }
}

@media (min-width: 783px) and (max-width: 1199px) {
    .qtech-global-menu {
        top: calc(
            var(--qtech-responsive-header-height) + 32px
        ) !important;
    }
}

@media (min-width: 1200px) {
    .qtech-global-menu {
        z-index: 100100 !important;
    }
}
