/**
 * Menu Tech — estilos do componente (estático).
 *
 * @package Menu_Tech
 */

/**
 * Wrapper do shortcode [menu_tech]: força largura da viewport mesmo dentro de
 * colunas/container com max-width (Divi, blocos, etc.).
 */
.mtk-menu-tech-shortcode-root {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    overflow-x: hidden;
}

@supports (overflow: clip) {
    .mtk-menu-tech-shortcode-root {
        overflow-x: clip;
    }
}

.mtk-menu-tech-header {
    --pg-blue: #29478F;
    --pg-grey: #393E41;
    --pg-yellow: #7A7A67;
    --pg-font: 'Barlow', Arial, Helvetica, sans-serif;
    --pg-font-condensed: var(--pg-font);
    --pg-menu-bg: #393e41;
    --mtk-dropdown-bg: #393e41;
    --mtk-header-height: 90px;
    --mtk-header-max-width: 1500px;
    --mtk-header-gutter: clamp(16px, 3vw, 32px);
    font-family: var(--pg-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    left: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

@supports (overflow: clip) {
    .mtk-menu-tech-header {
        overflow-x: clip;
    }
}

.mtk-menu-tech-layout-host {
    display: block !important;
    justify-content: initial !important;
    align-items: initial !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

.mtk-menu-tech-layout-host > :not(.mtk-menu-tech-layout-branch) {
    display: none !important;
}

@supports selector(:has(*)) {
    .wp-block-group:has(.mtk-menu-tech-header),
    .wp-block-template-part:has(.mtk-menu-tech-header) {
        display: block !important;
        justify-content: initial !important;
        align-items: initial !important;
        width: 100% !important;
        max-width: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .wp-block-group:has(.mtk-menu-tech-header) > :not(:has(.mtk-menu-tech-header)):not(.mtk-menu-tech-header),
    .wp-block-template-part:has(.mtk-menu-tech-header) > :not(:has(.mtk-menu-tech-header)):not(.mtk-menu-tech-header) {
        display: none !important;
    }
}

/**
 * Barra desktop: marca à esquerda, links centrados na área livre, CTA à direita.
 * Reforço além das utilities Tailwind (temas/builders por vezes alteram flex).
 */
.mtk-menu-tech-header .mtk-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--mtk-header-height);
    min-height: var(--mtk-header-height);
    box-sizing: border-box;
    gap: 16px;
}

.mtk-menu-tech-header .mtk-header-shell {
    width: 100%;
    max-width: var(--mtk-header-max-width);
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--mtk-header-gutter);
    padding-left: var(--mtk-header-gutter);
    box-sizing: border-box;
}

.mtk-menu-tech-header .mtk-header-bar__brand {
    flex: 0 0 auto;
    min-width: 0;
}

.mtk-menu-tech-header .mtk-header-bar__nav {
    flex: 0 1 auto;
    justify-content: center;
    min-width: 0;
    gap: clamp(14px, 1.6vw, 28px);
}

.mtk-menu-tech-header .mtk-header-bar__actions {
    flex: 0 0 auto;
    gap: clamp(16px, 1.6vw, 24px);
}

.mtk-menu-tech-header .mtk-header-bar__mobile-toggle {
    margin-left: auto;
}

.mtk-menu-tech-header .mtk-logo-img {
    width: clamp(128px, 16vw, 185px);
    max-width: min(42vw, 185px);
    height: auto;
}

@media (min-width: 1280px) {
    .mtk-menu-tech-header .mtk-header-bar {
        justify-content: center;
        gap: clamp(24px, 3vw, 56px);
    }
}

@media (min-width: 1280px) and (max-width: 1360px) {
    .mtk-menu-tech-header .mtk-nav-link {
        font-size: 13px;
        letter-spacing: 0.025em;
    }

    .mtk-menu-tech-header .mtk-btn-quote {
        padding-right: 18px !important;
        padding-left: 18px !important;
    }
}

@media (max-width: 420px) {
    .mtk-menu-tech-header {
        --mtk-header-height: 76px;
    }

    .mtk-menu-tech-header .mtk-logo-img {
        width: clamp(118px, 38vw, 150px);
    }
}

/* Nome do site quando não há logo (utilitários Tailwind equivalentes não estão no build) */
.mtk-menu-tech-header .mtk-logo-text-fallback {
    display: inline-block;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (min-width: 768px) {
    .mtk-menu-tech-header .mtk-logo-text-fallback {
        font-size: 1rem;
    }
}

.mtk-menu-tech-header .mtk-logo-home-link {
    text-decoration: none;
    color: inherit;
}

.mtk-pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Menu Desktop */
.mtk-menu-tech-header .mtk-nav-link {
    font-family: var(--pg-font-condensed);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 32px 0;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease-in-out;
    white-space: nowrap;
    text-decoration: none;
}

/* Âncoras: temas costumam sublinhar links; botões do dropdown não herdam isso */
.mtk-menu-tech-header a.mtk-nav-link,
.mtk-menu-tech-header a.mtk-nav-link:link,
.mtk-menu-tech-header a.mtk-nav-link:visited,
.mtk-menu-tech-header a.mtk-nav-link:hover,
.mtk-menu-tech-header a.mtk-nav-link:active {
    text-decoration: none !important;
}

.mtk-menu-tech-header .mtk-nav-item:hover .mtk-nav-link,
.mtk-menu-tech-header .mtk-nav-link:focus {
    color: #93c5fd;
    outline: none;
    text-decoration: none;
}

.mtk-menu-tech-header .mtk-chevron {
    width: 14px;
    height: 14px;
    margin-left: 6px;
    color: var(--pg-yellow);
    transition: transform 0.2s ease, color 0.2s ease;
}

.mtk-menu-tech-header .mtk-nav-item:hover .mtk-chevron {
    transform: rotate(180deg);
    color: #93c5fd;
}

/* Dropdown */
.mtk-menu-tech-header .mtk-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-top: 3px solid var(--pg-blue);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    min-width: 240px;
    z-index: 100;
    background-color: var(--mtk-dropdown-bg);
    position: absolute;
    left: 50% !important;
}

.mtk-menu-tech-header .mtk-nav-item:hover .mtk-dropdown,
.mtk-menu-tech-header .mtk-nav-item:focus-within .mtk-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.mtk-menu-tech-header .mtk-dropdown-link {
    font-family: var(--pg-font);
    display: block;
    padding: 14px 24px;
    font-size: 14px;
    line-height: 1.25;
    letter-spacing: 0;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s;
    font-weight: 500;
    text-decoration: none !important;
}

.mtk-menu-tech-header .mtk-dropdown-link:last-child {
    border-bottom: none;
}

.mtk-menu-tech-header .mtk-dropdown-link:hover {
    background-color: rgba(0, 0, 0, 0.3);
    color: #93c5fd;
    padding-left: 28px;
    text-decoration: none !important;
}

/* Botão Orçamento */
.mtk-menu-tech-header .mtk-btn-quote {
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--pg-font) !important;
    font-weight: 600 !important;
    line-height: 1.2;
    letter-spacing: 0;
    background-color: rgba(255, 255, 255, 0.24);
    padding: 12px 21px !important;
    transition: all 300ms ease 0ms;
    white-space: nowrap;
    display: inline-block;
    text-decoration: none;
}

.mtk-menu-tech-header .mtk-btn-quote:hover {
    color: #0959b8 !important;
    background-color: #ffffff !important;
    border: 1px solid #ffffff !important;
    padding: 12px 21px !important;
}

/* Botão Orçamento Mobile */
.mtk-menu-tech-header .mtk-btn-quote-mobile {
    width: 100%;
    text-align: center;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--pg-font) !important;
    font-weight: 600 !important;
    line-height: 1.2;
    letter-spacing: 0;
    background-color: rgba(255, 255, 255, 0.24);
    padding: 12px 21px !important;
    transition: all 300ms ease 0ms;
    display: inline-block;
    text-decoration: none;
}

.mtk-menu-tech-header .mtk-btn-quote-mobile:hover {
    color: #0959b8 !important;
    background-color: #ffffff !important;
    border: 1px solid #ffffff !important;
    padding: 12px 21px !important;
}

/* Estilos GTranslate */
.mtk-menu-tech-header .mtk-gtranslate-wrapper .gtranslate_wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mtk-menu-tech-header .glink img {
    transition: opacity 0.2s;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    display: inline-block !important;
}

.mtk-menu-tech-header .glink:hover img {
    opacity: 0.8;
}

/* Scrollbar Mobile */
.mtk-menu-tech-header .mtk-mobile-scroll::-webkit-scrollbar {
    width: 4px;
}

.mtk-menu-tech-header .mtk-mobile-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.mtk-menu-tech-header .mtk-mobile-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.mtk-menu-tech-header #mtk-mobile-menu {
    top: var(--mtk-header-height);
    height: calc(100vh - var(--mtk-header-height));
    max-height: calc(100vh - var(--mtk-header-height));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

@supports (height: 100dvh) {
    .mtk-menu-tech-header #mtk-mobile-menu {
        height: calc(100dvh - var(--mtk-header-height));
        max-height: calc(100dvh - var(--mtk-header-height));
    }
}

/* Mobile Styles — gutter único para links, botões e subitens */
.mtk-menu-tech-header {
    --mtk-mobile-gutter: 24px;
    --mtk-mobile-sublink-indent: 40px;
}

.mtk-menu-tech-header .mtk-mobile-group {
    width: 100%;
}

.mtk-menu-tech-header #mtk-mobile-menu > nav {
    width: 100%;
    padding-right: 0;
    padding-left: 0;
}

.mtk-menu-tech-header .mtk-mobile-link,
.mtk-menu-tech-header .mtk-mobile-btn {
    font-family: var(--pg-font-condensed);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 18px var(--mtk-mobile-gutter);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.03em;
    color: #ffffff;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    background-color: var(--pg-menu-bg);
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none !important;
}

.mtk-menu-tech-header .mtk-mobile-link:active,
.mtk-menu-tech-header .mtk-mobile-btn:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.mtk-menu-tech-header .mtk-mobile-link:hover,
.mtk-menu-tech-header .mtk-mobile-btn:hover {
    color: #93c5fd;
    text-decoration: none !important;
}

/* Submenu mobile: opacity + translateY + max-height (grid 0fr/1fr não anima em vários navegadores) */
.mtk-menu-tech-header .mtk-mobile-submenu {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    overflow: hidden;
    transition:
        max-height 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
        opacity 0.25s cubic-bezier(0.165, 0.84, 0.44, 1),
        visibility 0.25s linear,
        transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mtk-menu-tech-header .mtk-mobile-submenu.is-open {
    max-height: min(100vh, 3200px);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mtk-menu-tech-header .mtk-mobile-submenu-inner {
    border-top: 3px solid transparent;
    transition: border-color 0.2s ease;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.mtk-menu-tech-header .mtk-mobile-submenu.is-open .mtk-mobile-submenu-inner {
    border-top-color: var(--pg-blue);
}

@media (prefers-reduced-motion: reduce) {
    .mtk-menu-tech-header .mtk-mobile-submenu,
    .mtk-menu-tech-header .mtk-mobile-submenu-inner,
    .mtk-menu-tech-header .mtk-mobile-btn .mtk-mobile-chevron {
        transition: none;
    }
}

.mtk-menu-tech-header .mtk-mobile-btn .mtk-mobile-chevron {
    color: var(--pg-yellow);
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), color 0.2s ease;
}

.mtk-menu-tech-header .mtk-mobile-btn.mtk-mobile-btn--expanded .mtk-mobile-chevron {
    transform: rotate(180deg);
    color: #93c5fd;
}

.mtk-menu-tech-header .mtk-mobile-sublink {
    font-family: var(--pg-font);
    display: block;
    padding: 16px var(--mtk-mobile-gutter) 16px var(--mtk-mobile-sublink-indent);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: rgba(0, 0, 0, 0.15);
    text-decoration: none !important;
}

.mtk-menu-tech-header .mtk-mobile-sublink:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.mtk-menu-tech-header .mtk-mobile-sublink:hover {
    color: #93c5fd;
    padding-left: calc(var(--mtk-mobile-sublink-indent) + 4px);
    transition: padding-left 0.2s;
    text-decoration: none !important;
}

/* Ocultar menu no Divi Visual Builder */
body.et-fb .mtk-menu-tech-header,
.et-fb .mtk-menu-tech-header {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    z-index: -9999 !important;
    pointer-events: none !important;
}

.mtk-menu-tech-header,
.mtk-menu-tech-header * {
    box-sizing: border-box;
}

/* Reset só no hambúrguer e triggers desktop — NÃO em .mtk-mobile-btn (itens do painel) */
.mtk-menu-tech-header .mtk-nav-trigger,
.mtk-menu-tech-header #mtk-mobile-toggle {
    background: transparent !important;
    border: none !important;
    padding: 0;
    cursor: pointer;
    color: #ffffff !important;
    font: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    outline: none !important;
}

.mtk-menu-tech-header .mtk-mobile-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: #ffffff !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none !important;
    outline: none !important;
}

.mtk-menu-tech-header .mtk-nav-trigger {
    justify-content: center;
    display: inline-flex;
    font-family: var(--pg-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0.03em !important;
    padding: 32px 0 !important;
    text-transform: uppercase;
}

.mtk-menu-tech-header .mtk-mobile-btn {
    justify-content: space-between;
    width: 100%;
    padding: 18px var(--mtk-mobile-gutter) !important;
    font-family: var(--pg-font-condensed) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase;
    text-align: left;
}

.mtk-menu-tech-header #mtk-mobile-toggle {
    justify-content: center;
    line-height: 0;
}

/* Depois da regra genérica de button (ganha do background !important do reset) */
.mtk-menu-tech-header button.mtk-mobile-btn.mtk-mobile-btn--expanded {
    background: rgba(0, 0, 0, 0.2) !important;
    color: #93c5fd !important;
}

.mtk-menu-tech-header .mtk-nav-link svg,
.mtk-menu-tech-header .mtk-mobile-btn svg,
.mtk-menu-tech-header #mtk-mobile-toggle svg {
    display: inline-block;
    vertical-align: middle;
    fill: none;
}

/* Hambúrguer mobile apenas — chevrons do desktop (.mtk-nav-trigger) usam .mtk-chevron (14px) */
.mtk-menu-tech-header #mtk-mobile-toggle svg {
    width: 32px !important;
    height: 32px !important;
    display: block;
    color: #ffffff !important;
}

.mtk-menu-tech-header .mtk-logo-img,
.mtk-menu-tech-header .mtk-gtranslate-wrapper img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Forçar visibilidade do menu mobile quando a classe hidden é removida */
.mtk-menu-tech-header #mtk-mobile-menu:not(.mtk-tw-hidden) {
    display: block !important;
}

/* Suporte Admin Bar WordPress */
body.admin-bar .mtk-menu-tech-header {
    top: 32px !important;
}

body.admin-bar .mtk-menu-tech-header #mtk-mobile-menu {
    top: calc(var(--mtk-header-height) + 32px) !important;
    height: calc(100vh - var(--mtk-header-height) - 32px);
    max-height: calc(100vh - var(--mtk-header-height) - 32px);
}

@supports (height: 100dvh) {
    body.admin-bar .mtk-menu-tech-header #mtk-mobile-menu {
        height: calc(100dvh - var(--mtk-header-height) - 32px);
        max-height: calc(100dvh - var(--mtk-header-height) - 32px);
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .mtk-menu-tech-header {
        top: 46px !important;
    }

    body.admin-bar .mtk-menu-tech-header #mtk-mobile-menu {
        top: calc(var(--mtk-header-height) + 46px) !important;
        height: calc(100vh - var(--mtk-header-height) - 46px);
        max-height: calc(100vh - var(--mtk-header-height) - 46px);
    }

    @supports (height: 100dvh) {
        body.admin-bar .mtk-menu-tech-header #mtk-mobile-menu {
            height: calc(100dvh - var(--mtk-header-height) - 46px);
            max-height: calc(100dvh - var(--mtk-header-height) - 46px);
        }
    }
}

@media (min-width: 1280px) {
    .mtk-menu-tech-header #mtk-mobile-menu {
        display: none !important;
    }
}
