/* Shared navigation: keep the logo row separate from the expanded mobile menu. */
.header {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.5rem 1.5rem;
    background: #000;
    color: #fff;
}

.header-left, .header-right, .header-socials, .header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.header-left { gap: 1.5rem; }
.header-left > a { flex-shrink: 0; }
.header .logo { display: block; width: auto; height: 54px; }
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 1px solid #4aa547;
    border-radius: 6px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.header .menu { display: flex; gap: 1rem; }
.menu-item { position: relative; }
.menu-link, .menu-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 0;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.menu-link:hover, .menu-label:hover { color: #a3d3a1; }
.menu-label::after { content: '\25BE'; color: #4aa547; font-size: 0.7rem; }
.menu-label[aria-expanded="true"]::after { transform: rotate(180deg); }
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    width: min(320px, 80vw);
    max-height: min(400px, 65dvh);
    overflow-y: auto;
    padding: 0.5rem 0;
    border: 1px solid #ffffff20;
    border-radius: 8px;
    background: #222;
    box-shadow: 0 12px 30px #0006;
}

.menu-item:hover .dropdown-content,
.menu-item.open .dropdown-content { display: block; }
.dropdown-content a {
    display: block;
    padding: 0.65rem 1rem;
    color: #fff;
    text-decoration: none;
    white-space: normal;
}
.dropdown-content a:hover, .dropdown-content a:focus-visible { background: #4aa54730; }
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.4rem 0.75rem;
    border: 0;
    border-radius: 5px;
    background: #4aa547;
    color: #fff;
    font-size: 0.88rem;
    white-space: nowrap;
    cursor: pointer;
}
.header .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 32px;
    color: #fff;
}
.social-icon svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.header .social-icon:hover { color: #4aa547; }
.header-socials > a:first-child { flex-shrink: 0; }
.search-form { display: flex; min-width: 0; }
.search-bar {
    width: 140px;
    min-width: 0;
    min-height: 40px;
    padding: 0.4rem 0.7rem;
    border-radius: 5px;
    background: #fff;
    color: #000;
}
.header :is(a, button, input):focus-visible { outline: 2px solid #a3d3a1; outline-offset: 3px; }

@media (max-width: 1440px) {
    .header { flex-wrap: wrap; gap: 0; padding: 0.65rem 1rem; }
    .header.is-menu-open { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
    .header-left { flex-wrap: wrap; justify-content: space-between; gap: 0; width: 100%; }
    .header .logo { height: 46px; }
    .menu-toggle { display: inline-flex; }
    .header .menu {
        display: none;
        flex: 0 0 100%;
        flex-direction: column;
        gap: 0;
        margin-top: 0.65rem;
        border-top: 1px solid #ffffff26;
    }
    .header .menu.is-open { display: flex; }
    .menu-item { width: 100%; border-bottom: 1px solid #ffffff1a; }
    .menu-link, .menu-label { width: 100%; min-height: 48px; justify-content: space-between; padding: 0.75rem 0; text-align: left; }
    .dropdown-content,
    .menu-item:hover .dropdown-content { display: none; }
    .menu-item.open .dropdown-content {
        display: block;
        position: static;
        width: 100%;
        max-height: 35dvh;
        margin-bottom: 0.5rem;
        padding: 0;
        border: 0;
        border-left: 2px solid #4aa547;
        border-radius: 0;
        box-shadow: none;
    }
    .dropdown-content a { min-height: 44px; }
    .header-right { display: none; width: 100%; padding: 0.75rem 0 0.25rem; }
    .is-menu-open .header-right { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .header-socials { gap: 0.4rem; }
    .header .social-icon { width: 36px; height: 44px; }
    .header-actions { justify-content: flex-end; }
    .header .primary-btn { min-height: 44px; }
    .search-form { grid-column: 1 / -1; }
    .search-bar { width: 100%; min-height: 44px; font-size: 16px; }
}

@media (max-width: 600px) {
    .header .logo { height: 42px; }
    .is-menu-open .header-right { grid-template-columns: minmax(0, 1fr); }
    .header-socials { justify-content: center; }
    .header-actions > * { flex: 1; }
}
