.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #41964C;
    z-index: 1000;
}

.nav-logo {
    position: absolute; /* Take logo out of flow */
    top: 0;
    right: 2rem; /* Adjust as needed */
    height: 80px; /* Control container height */
    pointer-events: auto;
    z-index: 10;
}

.nav-logo img {
    display: block;
    height: 120px; /* Make image taller than menu bar */
    width: auto;
    margin-top: 8px; /* Move logo up slightly */
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.3em;
}

.nav-title {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
}

.nav-toggle {
    display: none;
    font-size: 1.5em;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    padding: 0.5em;
    line-height: 1;
}

.nav-toggle:hover {
    color: #a5d68a;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    list-style: none;
    margin: 0;
    padding: 0 1em 0.5em 1em;
    justify-content: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 0.75em 1em;
    text-decoration: none;
    color: #FFFFFF;
    transition: background-color 0.2s;
}

.nav-menu > li > a:hover {
    color: #a5d68a;
}

.hamburger, .hamburger:before, .hamburger:after {
    display: block;
    background: #fff;
    height: 4px;
    width: 30px;
    border-radius: 2px;
    position: relative;
    transition: all 0.3s;
}

.hamburger:before,
.hamburger:after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger:before {
    top: -9px;
}

.hamburger:after {
    top: 9px;
}

.submenu {
    display: none;
    position: absolute;
    background: #41964C;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    left: 0;
    top: 100%;
    min-width: 220px;
    z-index: 1001;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    padding-left: 0;
}

.submenu-placeholder {
    display: none;
}

.submenu li a {
    display: block;
    padding: 0.75em 1em;
    text-decoration: none;
    color: #FFFFFF;
    border-bottom: 1px solid #a5d68a;
    transition: background-color 0.2s;
}

.submenu li:last-child a {
    border-bottom: none;
}

.submenu li a:hover {
    color: #a5d68a;
}

.submenu li {
    margin: 0;
    list-style-type: none;
    white-space: nowrap;
    text-align: left;
}

/* Add top margin to body to account for fixed nav */
body {
    /*margin-top: 80px;*/
}

/* Desktop hover behavior */
@media (min-width: 1257px) {
    .has-submenu:hover .submenu {
        display: block;
    }
}

/* Mobile styles */
@media (max-width: 1257px) {
    body {
        margin-top: 24px;
    }

    .nav-header {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 1em;
    }

    .nav-logo {
        position: static; /* On mobile, logo in the flow */
        height: auto;
        flex: 1;
        text-align: center;
        margin-top: 4px;
        margin-bottom: 4px;
        margin-left: 4px;
    }

    .nav-logo a {
        pointer-events: auto;
    }

    .nav-logo img {
        height: 72px;
        margin-top: 0;
    }

    .nav-toggle {
        display: block;
        color: #FFFFFF;
        z-index: 1001;
        position: relative;
        pointer-events: auto;
        padding: 0.75em;
        flex-shrink: 0;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        overflow-x: hidden;
        background: #41964C;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        padding: 0;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu > li > a {
        padding: 1em;
        border-bottom: 1px solid #a5d68a;
    }

    .has-submenu .submenu {
        position: static;
        box-shadow: none;
        background: #41964C;
        max-height: 300px;
        overflow-y: auto;
        position: relative;
    }
    
    /* Scroll indicator for more content - only show when scrollable */
    .has-submenu .submenu.is-scrollable::after {
        content: '⌄';
        position: sticky;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 50px;
        /*background: linear-gradient(to bottom, rgba(65, 150, 76, 0), #41964C 30%);*/
        background: #41964C;
        pointer-events: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        color: #a5d68a;
        font-weight: bold;
        animation: bounce 2s infinite;
        margin-top: -50px;
        flex-shrink: 0;
    }
    
    @keyframes bounce {
        0%, 100% {
            transform: translateY(5px);
        }
        50% {
            transform: translateY(10px);
        }
    }

    .submenu-placeholder {
        display: block;
    }

    .submenu {
        display: none;
        flex-direction: column;
    }

    .has-submenu.open .submenu {
        display: flex;
    }

    .submenu li a {
        padding: 0.75em 2em;
        background: #41964C;
        border-bottom: 1px solid #a5d68a;
    }

    .submenu li a:hover {
        color: #a5d68a;
    }
}