header {
    width: 100%;
    padding: 30px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #041335;
    text-decoration: none;
    z-index: 1010;
}

.logo img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex: 0 0 auto;
    box-shadow: 0 4px 12px rgba(4, 19, 53, 0.12);
}

.logo span {
    white-space: nowrap;
}

nav ul {
    display: flex;
    gap: 40px;
    list-style: none;
}

nav a {
    text-decoration: none;
    color: #041335;
    font-size: 16px;
    transition: color 0.2s;
}

nav a:hover {
    color: #1b2954;
}

nav a.active {
    text-decoration: underline;
    font-weight: 600;
}

/* Hamburger Toggle Button styles */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.hamburger-bar {
    width: 100%;
    height: 2.5px;
    background-color: #041335;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left center;
}

/* Open states for hamburger bars */
.menu-toggle.open .hamburger-bar:nth-child(1) {
    transform: rotate(45deg) translate(2px, 0px);
}

.menu-toggle.open .hamburger-bar:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.menu-toggle.open .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(2px, 0px);
}

/* Prevent body scrolling when mobile menu is active */
body.nav-active {
    overflow: hidden !important;
    height: 100vh;
}

/* Dropdown arrow styling */
.dd-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.dropdown-open .dd-arrow {
    transform: rotate(180deg);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    header {
        padding: 20px 5%;
        position: relative;
        z-index: 1000;
    }

    .menu-toggle {
        display: flex;
    }

    /* Transform nav into a sliding mobile drawer */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: -10px 0 30px rgba(4, 19, 53, 0.08);
        padding: 90px 30px 40px;
        z-index: 1005;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }

    nav.open {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 24px;
        align-items: flex-start;
        justify-content: flex-start;
        width: 100%;
    }

    nav a {
        font-size: 18px;
        font-weight: 500;
        display: block;
        width: 100%;
    }

    /* Accordion behavior for the products dropdown on mobile */
    .dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        box-shadow: none;
        border: none;
        border-left: 2px solid rgba(4, 19, 53, 0.08);
        padding: 0 0 0 16px;
        margin-top: 8px;
        display: none;
        border-radius: 0;
        background: transparent;
    }

    .dropdown-menu.open {
        display: block;
        animation: none; /* remove desktop anim */
    }

    .dropdown-menu a {
        font-size: 15px;
        padding: 6px 0;
        color: #5a6475;
    }
    
    .dropdown-menu a.dd-active {
        color: #041335;
        background: transparent;
        font-weight: 600;
    }
}
