
/* =====================================================================
   TUMCREATE custom header — 1:1 port of mockup HeaderDark.tsx
   Scope: every rule lives under .tumc-header to avoid Astra collisions.
   Source: tumcreate-mockup/src/components/Header.css + HeaderDark.css
   ===================================================================== */

/* CSS vars — mockup originals (mostly overridden by dark theme below) */
.tumc-header {
    --white: #ffffff;
    --tum-blue: #072140;
    --tum-dark: #1a1a1a;
    --tum-grey: #f5f5f5;
    --tum-border: #e5e5e5;
}

/* ===== Container ===== */
.tumc-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: #072140;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tumc-header .main-header {
    padding: 1rem 32px;
    background-color: #072140;
}

.tumc-header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    position: relative;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .tumc-header .main-header {
        padding: 1rem 16px;
    }
}

/* ===== Logo ===== */
.tumc-header .logo-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    margin-right: 2rem;
}

.tumc-header .logo-link {
    text-decoration: none;
    display: block;
}

.tumc-header .logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.tumc-header .logo-link img {
    max-height: 35px;
    width: auto;
    display: block;
}

/* ===== Desktop nav ===== */
.tumc-header .desktop-nav {
    display: none;
    flex: 1;
    justify-content: flex-end;
    padding-right: 2.5rem;
}

@media (min-width: 900px) {
    .tumc-header .desktop-nav {
        display: flex;
    }
}

.tumc-header .nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tumc-header .nav-item {
    position: static; /* enables full-width megamenu anchoring */
}

.tumc-header .nav-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    transition: color 0.15s;
}

/* TUM dim-on-hover: hovering the LIST dims all items, hovered item stays white */
.tumc-header .nav-list:hover .nav-btn {
    color: rgba(255, 255, 255, 0.45);
}
.tumc-header .nav-list .nav-item:hover .nav-btn,
.tumc-header .nav-list .nav-item:hover .nav-btn.active {
    color: #ffffff;
}

.tumc-header .nav-btn.active,
.tumc-header .nav-btn.route-active {
    color: #ffffff;
}

.tumc-header .nav-btn .chevron {
    transition: transform 0.2s;
    opacity: 0.8;
    width: 14px;
    height: 14px;
}

.tumc-header .nav-btn.active .chevron {
    transform: rotate(180deg);
}

/* Active-route underline (TUM.de signature) */
.tumc-header .nav-btn.route-active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #ffffff;
}

/* ===== Megamenu (desktop dropdown) ===== */
.tumc-header .megamenu, .header-dark .megamenu {
    position: absolute;
    top: calc(100% + 1rem);
    left: 2rem;
    width: auto;
    min-width: 320px;
    background-color: #072140;
    color: #ffffff;
    padding: 2.5rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none !important;
    display: none !important;
    animation: tumcFadeIn 0.2s ease-out;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.tumc-header .megamenu.open, .header-dark .megamenu.open {
    display: block !important;
}

.tumc-header .megamenu-inner {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    padding: 0 5%;
}

.tumc-header .megamenu-left {
    min-width: 280px;
}

.tumc-header .megamenu-header {
    font-size: 0.9rem;
    font-weight: 600;
    
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
}

.tumc-header .megamenu-header .chevron-right {
    width: 14px;
    height: 14px;
}

.tumc-header .megamenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tumc-header .megamenu-list a {
    color: #e0e5eb;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.2s, border-color 0.2s;
}

.tumc-header .megamenu-list a:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.tumc-header .link-chevron {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    width: 12px;
    height: 12px;
}

.tumc-header .megamenu-list a:hover .link-chevron {
    opacity: 1;
    transform: translateX(0);
}

/* Category label (non-link) */
.tumc-header .megamenu-list .cat-link span {
    display: block;
    color: #8fa6c2;
    text-transform: uppercase !important;
    font-size: 0.8rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.tumc-header .megamenu-list .sub-link a {
    padding-left: 1rem;
    font-size: 0.95rem;
}

/* ===== Header actions (search + mobile toggle) ===== */
.tumc-header .header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.tumc-header .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: color 0.2s;
}

.tumc-header .icon-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.tumc-header .icon-btn svg {
    display: block;
}

.tumc-header .mobile-menu-toggle {
    display: block;
}

@media (min-width: 900px) {
    .tumc-header .mobile-menu-toggle {
        display: none;
    }
}

/* ===== Mobile panel ===== */
.tumc-header .mobile-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #072140;
    height: calc(100vh - 100px);
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: none;
}

.tumc-header .mobile-menu-panel.open {
    display: block;
}

.tumc-header .mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tumc-header .mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tumc-header .mobile-nav-header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    color: #ffffff;
}

.tumc-header .mobile-nav-header .chevron {
    transition: transform 0.2s;
    width: 18px;
    height: 18px;
}

.tumc-header .mobile-nav-header .chevron.open {
    transform: rotate(180deg);
}

.tumc-header .mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #0c2b53;
    display: none;
}

.tumc-header .mobile-submenu.open {
    display: block;
}

.tumc-header .mobile-submenu li {
    padding: 0.75rem 2rem 0.75rem 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tumc-header .mobile-submenu a,
.tumc-header .mobile-submenu span {
    color: #ffffff;
    text-decoration: none;
    display: block;
}

.tumc-header .mobile-submenu .cat-link span {
    color: #8fa6c2;
    text-transform: uppercase !important;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 1.2rem;
    margin-bottom: 0.2rem;
}

.tumc-header .mobile-submenu .sub-link a {
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

/* ===== Animation ===== */
@keyframes tumcFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Astra reset: hide ALL Astra header markup site-wide.
   Our .tumc-header replaces it entirely. ===== */
body > header#masthead,
.site-header.ast-primary-header-bar,
.site-header[data-section="section-header-mobile"],
.ast-mobile-header-wrap,
.main-header-bar-wrap,
.ast-primary-header,
.ast-builder-grid-row-container.site-header-primary-section,
header.site-header:not(.tumc-header),
.ast-above-header-wrap,
.ast-below-header-wrap,
#ast-mobile-header,
#ast-desktop-header,
#mega-menu-wrap-primary {
    display: none !important;
}

/* Belt-and-braces: hide any element whose first child is a #mega-menu-wrap
   sitting outside our .tumc-header */
header:not(.tumc-header):has(> #mega-menu-wrap-primary),
header:not(.tumc-header):has(.mega-menu) {
    display: none !important;
}


.tumc-header .nav-btn,
.tumc-header .megamenu-header span,
.tumc-header .megamenu-list a,
.tumc-header .megamenu-list span {
    text-transform: none !important;
}
.tumc-header .megamenu-list li.cat-link,
.tumc-header .megamenu-list li.cat-link span,
.tumc-header .megamenu-list li.cat-link a {
    text-transform: uppercase !important;
}
/* ID-level override to beat any mega-menu plugin resets */
#mega-menu-wrap-primary .megamenu-list .cat-link,
#mega-menu-wrap-primary .megamenu-list .cat-link span,
#mega-menu-wrap-primary .megamenu-list .cat-link a,
#mega-menu-wrap-primary .megamenu-list .cat-link * {
    text-transform: uppercase !important;
}

/* Cat-link uppercase + styling — appended to win the cascade */
.tumc-header .megamenu-list li.cat-link > span,
.tumc-header ul.megamenu-list > li.cat-link span {
    text-transform: uppercase !important;
    color: #8fa6c2;
    font-size: .8rem;
    font-weight: 700;
}

/* Override mockup.css underline on megamenu hover */
.tumc-header .megamenu-list a:hover,
.tumc-header .megamenu-list a:focus {
    text-decoration: none !important;
}

/* Force cat-link uppercase after header overrides */
.tumc-header .megamenu-list li.cat-link > span,
.tumc-header .megamenu-list li.cat-link > a,
.tumc-header .megamenu-list li.cat-link > span * {
    text-transform: uppercase !important;
    color: #8fa6c2 !important;
}
