﻿/* =========================================================
   GWM Header + Topbar
   File: assets/css/components/header.css
   ========================================================= */

/* ---------------------------------------------------------
   Header Design Tokens
   --------------------------------------------------------- */

:root {
    --gwm-header-bg: #ffffff;
    --gwm-header-topbar-bg: #062d1d;
    --gwm-header-text: #09271c;
    --gwm-header-muted: #64748b;
    --gwm-header-gold: #a97812;
    --gwm-header-border: rgba(15, 23, 42, 0.10);
    --gwm-header-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);

    --gwm-menu-highlight-bg: rgba(200, 162, 74, 0.18);
    --gwm-menu-highlight-text: #0f3d2e;
    --gwm-parent-radius: 2px;
    --gwm-submenu-radius: 0px;
}

/* ---------------------------------------------------------
   Sticky Header Shell
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   Fixed Header Shell
   --------------------------------------------------------- */

.gwm-site-header,
.gwm-site-header * {
    box-sizing: border-box;
}

.gwm-site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    background: var(--gwm-header-bg);
    color: var(--gwm-header-text);
    border-bottom: 1px solid var(--gwm-header-border);
    box-shadow: var(--gwm-header-shadow);
    transform: none !important;
}

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

@media (max-width: 782px) {
    body.admin-bar .gwm-site-header {
        top: 46px !important;
    }
}

.gwm-main-header {
    background: var(--gwm-header-bg);
}

/* Prevent page content from hiding under fixed header */
body {
    padding-top: 55px !important;
}


/* ---------------------------------------------------------
   Topbar Utility Menu
   --------------------------------------------------------- */

.gwm-topbar {
    width: 100%;
    display: block;
    position: relative;
    z-index: 1001;
    background: var(--gwm-header-topbar-bg);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
    line-height: 1;
}

.gwm-topbar-inner {
    width: min(100% - 32px, 1180px);
    min-height: 38px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
}

.gwm-topbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.gwm-topbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.gwm-topbar-menu li {
    margin: 0;
    padding: 0;
}

.gwm-topbar-menu a {
    min-height: 13px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    border-right: 1px solid rgba(255, 255, 255, 0.884);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.gwm-topbar-menu li:last-child a {
    border-right: 0;
}

.gwm-topbar-menu a:hover,
.gwm-topbar-menu a:focus {
    color: #dad8d5;
    background: rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------------------------
   Header Layout
   --------------------------------------------------------- */

.gwm-header-inner {
    width: min(100% - 40px, 1240px);
    min-height: 76px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0px;
}

/* ---------------------------------------------------------
   Branding
   --------------------------------------------------------- */

.gwm-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    color: #0f172a;
    text-decoration: none;
}

.gwm-brand-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f3d2e;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gwm-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gwm-brand-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
}

.gwm-brand-tagline {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gwm-header-muted);
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.25;
}

/* Legacy branding fallback */
.gwm-site-branding {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-logo {
    max-height: 58px;
    width: auto;
}

.gwm-site-title {
    margin: 0;
    color: var(--gwm-header-text);
    font-size: clamp(1.08rem, 1.45vw, 1.45rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.gwm-site-title a {
    color: inherit;
    text-decoration: none;
}

.gwm-site-description {
    max-width: 310px;
    margin: 3px 0 0;
    color: var(--gwm-header-muted);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.45;
}

/* ---------------------------------------------------------
   Primary Navigation
   --------------------------------------------------------- */

.gwm-primary-navigation {
    position: static !important;
    min-width: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.gwm-dropdown-menu,
.gwm-dropdown-menu ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gwm-dropdown-menu {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.gwm-dropdown-menu a {
    text-decoration: none !important;
}

.gwm-dropdown-menu > li {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.gwm-dropdown-menu > li > a {
    min-height: 42px;
    padding: 11px 15px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    color: #0f172a;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.15;
    white-space: nowrap;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

/* Parent menu arrow */
.gwm-dropdown-menu > li.menu-item-has-children > a::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}

.gwm-dropdown-menu > li:hover > a::after,
.gwm-dropdown-menu > li:focus-within > a::after {
    transform: rotate(225deg) translateY(-1px);
}

/* Parent menu hover/current/active-child highlight */
.gwm-dropdown-menu > li:hover > a,
.gwm-dropdown-menu > li:focus-within > a,
.gwm-dropdown-menu > li.current-menu-item > a,
.gwm-dropdown-menu > li.current-menu-parent > a,
.gwm-dropdown-menu > li.current-menu-ancestor > a,
.gwm-dropdown-menu > li.current_page_item > a,
.gwm-dropdown-menu > li.current_page_parent > a,
.gwm-dropdown-menu > li.current_page_ancestor > a {
    color: var(--gwm-menu-highlight-text) !important;
    background: var(--gwm-menu-highlight-bg) !important;
    border-radius: var(--gwm-parent-radius) !important;
    transform: translateY(-1px);
}
/* Hide descriptions on top-level menu only */
.gwm-primary-navigation > ul > li > a .gwm-mega-menu-description,
.gwm-primary-navigation > ul > li > a .gwm-menu-description,
.gwm-primary-navigation > ul > li > a .menu-item-description,
.gwm-primary-navigation > ul > li > a .description,
.gwm-primary-navigation > ul > li > a .menu-description {
    display: none !important;
}

/* Show descriptions inside dropdown/mega menu */
.gwm-primary-navigation .sub-menu .gwm-mega-menu-description,
.gwm-primary-navigation .sub-menu .gwm-menu-description,
.gwm-primary-navigation .sub-menu .menu-item-description,
.gwm-primary-navigation .sub-menu .description,
.gwm-primary-navigation .sub-menu .menu-description {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
    color: #64748b !important;
}

/* ---------------------------------------------------------
   Dropdown / Submenu
   --------------------------------------------------------- */

.gwm-dropdown-menu > li > ul.sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 10000 !important;
    min-width: 250px !important;
    max-width: 310px !important;
    margin-top: 0 !important;
    padding: 10px !important;
    display: block !important;
    background: #ffffff !important;
    border: 0px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 2px !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px) !important;
    transition:
        opacity 0.18s ease,
        transform 0.2s ease,
        visibility 0.2s ease !important;
}

/* Invisible hover bridge to prevent dropdown disappearing */
.gwm-dropdown-menu > li.menu-item-has-children::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
    display: block;
    background: transparent;
    pointer-events: auto;
}

.gwm-dropdown-menu > li:hover > ul.sub-menu,
.gwm-dropdown-menu > li:focus-within > ul.sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

.gwm-dropdown-menu ul.sub-menu li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.gwm-dropdown-menu ul.sub-menu li a {
    padding: 10px 12px !important;
    border-radius: var(--gwm-submenu-radius) !important;
    display: block !important;
    color: #334155 !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease !important;
}

/* Submenu hover/current highlight */
.gwm-dropdown-menu ul.sub-menu li:hover > a,
.gwm-dropdown-menu ul.sub-menu li:focus-within > a,
.gwm-dropdown-menu ul.sub-menu li.current-menu-item > a,
.gwm-dropdown-menu ul.sub-menu li.current_page_item > a {
    color: var(--gwm-menu-highlight-text) !important;
    background: var(--gwm-menu-highlight-bg) !important;
    border-radius: var(--gwm-submenu-radius) !important;
    transform: translateX(3px);
}

/* ---------------------------------------------------------
   Mega Menu Panel Compatibility
   --------------------------------------------------------- */

.gwm-mega-panel,
.gwm-mega-menu-panel,
.sub-menu.gwm-mega-menu {
    background: inherit !important;
    border: 1px solid var(--gwm-header-border);
    border-radius: 2px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

/* ---------------------------------------------------------
   Header Actions
   --------------------------------------------------------- */

.gwm-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.gwm-header-action {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none !important;
    white-space: nowrap;
}

.gwm-header-visit {
    background: #0f3d2e;
}

.gwm-header-visit:hover,
.gwm-header-visit:focus {
    background: #14543f;
    color: #ffffff;
}

/* ---------------------------------------------------------
   Mobile Menu Toggle
   --------------------------------------------------------- */

.gwm-mobile-menu-toggle,
.gwm-menu-toggle {
    display: none !important;
}

.gwm-menu-toggle {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--gwm-color-border);
    border-radius: var(--gwm-radius-sm);
    background: #ffffff;
    color: var(--gwm-color-primary-dark);
}

.gwm-menu-toggle-line {
    width: 22px;
    height: 2px;
    display: block;
    background: currentColor;
    border-radius: 2px;
}

/* ---------------------------------------------------------
   Tablet Adjustments
   --------------------------------------------------------- */

@media (max-width: 1100px) and (min-width: 1024px) {
    .gwm-header-inner {
        grid-template-columns: 210px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .gwm-brand-tagline,
    .gwm-site-description {
        display: none;
    }

    .gwm-dropdown-menu > li > a {
        padding: 10px 11px;
        font-size: 12.5px;
    }

    .gwm-header-action {
        padding: 9px 12px;
        font-size: 12px;
    }
}

/* ---------------------------------------------------------
   Mobile Header
   --------------------------------------------------------- */

@media (max-width: 1023px) {
    .gwm-header-inner {
        width: min(100% - 28px, 100%);
        min-height: 74px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .gwm-brand-tagline,
    .gwm-site-description {
        display: none;
    }

    .gwm-mobile-menu-toggle {
        min-height: 42px;
        padding: 10px 16px;
        border: 0;
        border-radius: 2px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: #0f3d2e;
        color: #ffffff;
        font-weight: 900;
        cursor: pointer;
    }

    .gwm-primary-navigation {
        position: fixed !important;
        top: 88px !important;
        left: 16px !important;
        right: 16px !important;
        z-index: 10000 !important;
        max-height: calc(100vh - 110px) !important;
        overflow-y: auto !important;
        display: block !important;
        padding: 14px !important;
        background: #ffffff !important;
        border-radius: 2px !important;
        box-shadow: 0 28px 70px rgba(15, 23, 42, 0.18) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(12px) !important;
        transition:
            opacity 0.2s ease,
            transform 0.22s ease,
            visibility 0.22s ease !important;
    }

    .gwm-primary-navigation.is-open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    .gwm-dropdown-menu {
        display: block !important;
    }

    .gwm-dropdown-menu > li {
        border-bottom: 1px solid rgba(15, 23, 42, 0.07) !important;
    }

    .gwm-dropdown-menu > li > a {
        width: 100%;
        justify-content: space-between;
        border-radius: 2px !important;
    }

    .gwm-dropdown-menu > li.menu-item-has-children::after {
        display: none;
    }

    .gwm-dropdown-menu > li > ul.sub-menu {
        position: static !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 0 12px 14px !important;
        display: none !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 2px !important;
        box-shadow: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .gwm-dropdown-menu > li.is-open > ul.sub-menu {
        display: block !important;
    }

    .gwm-header-actions {
        display: none;
    }
}

/* ---------------------------------------------------------
   Small Mobile
   --------------------------------------------------------- */

@media (max-width: 767px) {
    .gwm-topbar {
        display: none;
    }

    .gwm-header-inner {
        width: min(100% - 24px, 100%);
        min-height: 72px;
        gap: 14px;
    }

    .gwm-brand-name,
    .gwm-site-title {
        max-width: 190px;
        font-size: 1rem;
    }
}