/* Custom Mega Menu Header Styles */

:root {
    --header-height: 80px;
    --mega-menu-bg: #ffffff;
    --nav-text-color: #161823;
    --nav-hover-color: #FE2C55;
    /* TikTok Red-ish Pink */
}

.custom-mega-menu-header {
    background: #fff;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
    /* Subtle shadow like TikTok */
    position: relative;
    z-index: 999;
    padding-top: 0;
}

/* Above Header */
.site-above-header-wrap {
    background-color: #12141D;
    /* Standard dark background often used */
    padding: 0;
    width: 100%;
}

.site-above-header-wrap .ast-container {
    padding-left: 20px;
    padding-right: 20px;
}

.header-main-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    /* Added for absolute positioning of nav */
    height: var(--header-height);
}

.site-branding img,
.site-branding svg {
    max-height: 40px;
    /* Adjust logo size */
    width: auto;
}

.site-branding .site-title {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
}

/* Desktop Navigation */
.main-navigation.desktop-only {
    display: flex;
    justify-content: center;
    /* Default for non-grid layouts or fallbacks */
}

.mega-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 40px;
    pointer-events: auto;
    /* Re-enable clicks for menu items */
}


.mega-menu-list>li {
    padding: 0;
    margin: 0;
    /* Reset margins */
}

.menu-link-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--nav-text-color);
    text-decoration: none;
    padding: 28px 0;
    /* Tall padding for hover area */
    display: block;
    position: relative;
    transition: color 0.2s;
}

.menu-link-header:hover {
    color: var(--nav-hover-color);
}

/* Ensure dropdown positions relative to full-width header - REVISED */
/* .header-main-layout, 
.custom-mega-menu-header .ast-container,
.main-navigation,
.mega-menu-list {
    position: static !important;
} */

/* Full Width Dropdown */
.full-width-dropdown {
    position: absolute;
    top: 100%;

    /* Robust Centering Strategy */
    width: 100vw;
    max-width: 100vw;
    left: 50%;
    margin-left: -50vw;
    /* Moves it back by half screen width to center it */
    right: auto;

    background: var(--mega-menu-bg);
    border-top: 1px solid #f1f1f1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    padding: 60px 0;
    min-height: 50vh;
    z-index: 1000;
}

/* Hover Logic */
.menu-item-has-children:hover .full-width-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Add an active state for the link when dropdown is open */
.menu-item-has-children:hover .menu-link-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--nav-hover-color);
}


/* Dropdown Content */
.mega-menu-content-wrapper {
    display: flex;
    justify-content: center;
    gap: 60px;
    /* Space between columns */
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: left;
}

.mega-menu-column {
    flex: 0 1 auto;
    min-width: 160px;
}

.mega-menu-heading {
    font-size: 14px;
    font-weight: 700;
    color: #161823;
    /* TikTok dark text */
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mega-sub-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-sub-list li {
    margin-bottom: 10px;
}

.mega-sub-list li a {
    text-decoration: none;
    color: #555;
    /* Slightly lighter for links */
    font-size: 15px;
    font-weight: 500;
    display: block;
    transition: color 0.2s;
}

.mega-sub-list li a:hover {
    color: var(--nav-hover-color);
    text-decoration: underline;
}

/* Right Side Header Controls */
.site-header-primary-section-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ast-header-account-link {
    font-weight: 600;
    color: #161823;
    text-decoration: none;
    font-size: 15px;
}

.ast-header-account-link:hover {
    color: var(--nav-hover-color);
}

/* Button Refinement */
.ast-custom-button {
    background-color: #004595;
    /* Match reference blue */
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.3s;
}

.ast-custom-button:hover {
    background-color: #003370;
    color: #fff;
}

/* Secondary Button (Logout) - Outline Style or Ghost Style if requested, 
   but user asked for "like Get Started" which usually implies similar shape/size.
   We will make it look like a secondary action (maybe transparent with border? 
   OR just same blue if they want identical). 
   Let's do transparent with dark text/border or similar to visual hierarchy. 
   Actually, "like Getstarted button" might mean Identical. 
   But two identical primary buttons is bad UX. 
   I'll make it "Ghost" style but same shape. */

.ast-custom-button.button-outline {
    background-color: transparent;
    color: #161823;
    /* border: 1px solid #E1E1E1; Optional border */
    /* If they want it exactly "like" it, maybe just same shape. */
    padding: 8px 16px;
    /* Slightly smaller or same */
}

.ast-custom-button.button-outline:hover {
    background-color: #f1f1f1;
    color: #000;
}

.ast-custom-button-link:hover {
    text-decoration: none;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
}

#mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -2px;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 30px;
    height: 3px;
    background-color: #000;
    border-radius: 4px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before {
    top: -10px;
}

.hamburger-inner::after {
    bottom: -10px;
}

/* Mobile Menu Container */
.mobile-menu-container {
    position: fixed;
    top: 0;
    right: -300px;
    /* Hidden off-screen */
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 10001;
    /* Above almost everything */
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-container.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.mobile-menu-title {
    font-size: 18px;
    font-weight: 700;
}

#mobile-menu-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    margin-bottom: 20px;
}

.mobile-menu-head {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.mobile-sub-menu {
    list-style: none;
    padding-left: 15px;
    margin: 0;
    border-left: 2px solid #eee;
}

.mobile-sub-menu li {
    margin-bottom: 8px;
}

.mobile-sub-menu a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    display: block;
    padding: 5px 0;
}


/* Responsive */
@media (max-width: 992px) {
    .main-navigation.desktop-only {
        display: none;
    }

    .site-header-primary-section-right.desktop-only {
        display: none;
    }

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

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


/* CSS Grid Layout for Desktop (min-width: 992px) */
@media (min-width: 992px) {
    .header-main-layout {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        justify-content: unset;
        /* Reset flex justify */
    }

    .site-branding {
        justify-self: start;
    }

    .main-navigation.desktop-only {
        justify-self: center;
        position: static;
        /* Reset absolute positioning */
        width: auto;
        height: auto;
        pointer-events: auto;
        /* Reset pointer events */
        margin: 0;
    }

    .site-header-primary-section-right {
        justify-self: end;
    }

    /* Ensure dropdowns position correctly relative to the header container */
    .mega-menu-list,
    .mega-menu-list>li {
        position: static !important;
        /* Force static to allow dropdown to position relative to container */
    }
}