/* =========================================
   STICKY HEADER & OVERLAY (ADD-ON)
   ========================================= */

/* --- Sticky Header Bar --- */
.sticky-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Use an extremely high Z-Index to beat everything */
    z-index: 2147483647;
    background-color: #000000 !important;
    /* Force solid black */
    padding: 10px 0;

    /* FADE-IN LOGIC */
    transform: none;
    opacity: 0;
    pointer-events: none;
    /* KEY: Allows clicks to pass */

    transition: opacity 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* WP Admin Bar Compatibility */
body.admin-bar .sticky-header-bar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .sticky-header-bar {
        top: 46px;
    }
}

.sticky-header-bar.is-visible {
    opacity: 1;
    pointer-events: auto;
    /* Re-enable clicks */
}

.sticky-header-bar .container {
    padding: 0 20px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 40px;
}

/* --- Hamburger Toggle --- */
.hamburger-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    padding: 0;
    outline: none;
}

.hamburger-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff !important;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* --- Fullscreen Overlay --- */
.fullscreen-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.98);
    z-index: 2147483647;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.fullscreen-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.overlay-inner {
    text-align: center;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

.close-menu {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff !important;
    font-size: 3rem;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
    z-index: 10;
}

@media screen and (min-width: 768px) {
    .close-menu {
        position: fixed;
        top: 30px;
        right: 40px;
    }
}

/* --- NAV LAYOUT --- */

/* --- MOBILE FIRST (DEFAULT = VERTICAL) --- */
.overlay-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 40px;
    width: 100%;
}

.overlay-menu-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.overlay-nav a {
    color: #ffffff !important;
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 1.5rem;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    display: block;
    width: auto;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* --- DESKTOP REDESIGN (STRICT 3/4 GRID) --- */
@media screen and (min-width: 768px) {

    .overlay-nav {
        /* CHANGED FROM FLEX TO GRID */
        display: grid;
        grid-template-columns: auto auto auto;
        /* Single column stack */
        gap: 30px;
        /* Space between row 1 and row 2 */
        align-items: center;
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Reset Group Style */
    .overlay-menu-group {
        display: grid;
        width: 100%;
        gap: 20px;
        /* Space between buttons horizontal */
    }

    /* ROW 1: Strictly 3 Columns */
    .overlay-menu-group:first-child {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ROW 2: Strictly 4 Columns */
    .overlay-menu-group:last-child {
        grid-template-columns: repeat(4, 1fr);
    }

    .overlay-nav a {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        /* Fill the grid cell */
        height: 100%;
        min-height: 80px;
        /* Force consistent height */

        font-size: 1.4rem;
        padding: 10px;

        /* Grid Block Style */
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        background-color: rgba(255, 255, 255, 0.05);
    }

    .overlay-nav a:hover {
        background-color: #ffffff;
        color: #000000 !important;
        border-color: #ffffff;
        transform: scale(1.03);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        z-index: 1;
    }
}


/* --- MOBILE SPECIFIC --- */
@media screen and (max-width: 768px) {
    .sticky-header-bar {
        padding: 8px 0;
    }

    .sticky-header-bar .container {
        padding: 0 15px;
    }

    .close-menu {
        position: fixed;
        top: 15px;
        right: 15px;
        font-size: 2.5rem;
    }

    .overlay-inner {
        max-width: 90%;
    }

    .overlay-nav {
        margin-top: 60px;
    }

    .overlay-menu-group {
        gap: 1rem;
    }

    .overlay-nav a {
        font-size: 1.25rem;
        padding: 0.5rem;
        border: none;
        /* Text only on mobile */
        display: block;
        background: none;
    }
}

@media screen and (max-width: 480px) {
    .overlay-nav a {
        font-size: 1.1rem;
    }
}