:root {
    /* Colors from global.css */
    --color-a: #556B2F;
    --color-b: #D4E38A;
    --color-c: #FFFFFF;
    --color-d: #8FA31E;
    --navbar-height: 80px; /* Define navbar height for positioning */
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar (from css/navbar.css and css/navbar-styles.css) */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.9);
    padding: 1.2rem 5%;
    transition: all 0.3s ease;
    animation: fadeInDown 0.8s ease;
}

nav.scrolled {
    background: rgba(10, 10, 10, 1);
    padding: 0.8rem 5%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.1);
}

.nav-name {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-a) 0%, var(--color-d) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-c);
    font-weight: 500;
    font-size: 1.1rem;
    position: relative;
    transition: color 0.3s;
    letter-spacing: 0.5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-a), var(--color-d));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--color-b);
}

.nav-links a.active {
    color: var(--color-b); /* Or any distinct color */
    font-weight: 700;
}

.nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: transparent;
    border: none;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-c);
}

@media (max-width: 768px) {
    /* Navbar Responsive Styles (from css/responsive.css and css/navbar-styles.css) */
    .nav-links {
        position: fixed;
        top: var(--navbar-height); /* Positioned below the main navbar */
        left: 0;
        width: 100%;
        max-height: 0; /* Initially hidden */
        background: rgba(10, 10, 10, 0.95); /* Dark overlay */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1001;
        overflow: hidden; /* Hide overflow content */

        opacity: 0; /* Still use for fading */
        visibility: hidden; /* Still use for screen readers */
        /* Default transition for when it becomes inactive (closing) */
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0s 0.3s; /* visibility hides after 0.3s */
    }

    .nav-links.active {
        top: var(--navbar-height); /* Remains positioned below the main navbar */
        max-height: calc(50vh - var(--navbar-height)); /* Expands to 50vh minus navbar height */
        opacity: 1; /* Becomes fully visible */
        visibility: visible; /* Becomes visible to screen readers/interaction */
        /* No delay when opening */
        transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0s 0s;
    }

    .nav-links li {
        margin: 0.3rem 0; /* Reduced gap between links */
    }

    .nav-links li:first-child {
        margin-top: 1.2rem; /* Added padding above Home */
    }

    .nav-links li:last-child {
        margin-bottom: 2.1rem; /* Added padding below Contact Us */
    }

    .nav-links a {
        font-size: 1rem; /* Adjusted font size for mobile */
    }

    .hamburger {
        display: block; /* Show hamburger on mobile */
        z-index: 1002; /* Ensure it's above the nav-links overlay */
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}