/* --- Core Header Layout --- */
.header {
    background-color: rgb(187, 202, 199);
    width: 100%;
    position: relative;
    z-index: 1000;
    padding-top: 20px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    height: 120px;
    display: flex;
    align-items: flex-end;
    position: relative;
}

/* --- Logo --- */
.logo-container {
    display: flex;
    align-items: flex-end;
}

.logo-container a {
    display: block;
}

.logo-container img {
    display: flex;
    align-items: flex-end;
    height: auto;
    width: auto;
    max-height: 120px;
    object-fit: contain;
}

/* --- Desktop Menu --- */
.nav-menu {
    display: flex;
    align-items: flex-end;
    margin-bottom: 14px;
}

.nav-links {
    display: flex;
    gap: 60px;
    align-items: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    color: #323232;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: color 0.25s ease;
    cursor: pointer;
}

.nav-link:hover,
.nav-item:hover>.nav-item {
    color: #ffffff;
}

.nav-item.active>.nav-link,
.nav-link.active {
    color: #727272;
}

.dropdown-item.active {
    color: #727272;
    padding-left: 32px;
}

/* --- Down Chevron Icon --- */
.nav-arrow {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    margin-bottom: 4px;
}

.nav-item:hover>.nav-link .nav-arrow {
    transform: rotate(225deg);
    margin-bottom: -1px;
}

/* --- Desktop Dropdowns --- */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgb(187, 202, 199);
    min-width: 260px;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    width: 100%;
    height: 5px;
    background: transparent;
}

.nav-item:hover>.dropdown-menu {
    opacity: 1;
    visibility: visible;
}


.lang-toggle {
    font-weight: 400;
    gap: 8px;
}

.dropdown-item {
    display: block;
    padding: 12px 24px;
    color: #323232;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    color: #ffffff;
}

/* Align Language Dropdown to the right */
.language-selector {
    margin-left: 10px;
}

.language-selector .dropdown-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    min-width: 80px;
}

.language-selector .dropdown-item {
    text-transform: uppercase;
    text-align: center;
}

/* --- Mobile Toggle (Burger Menu) --- */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1050;
}

.burger-bar {
    width: 100%;
    height: 2px;
    background-color: #323232;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- Mobile Menu Backdrop --- */
.header-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

/* --- Responsive Media Queries --- */
@media (max-width: 991px) {
    .header-inner {
        height: 70px;
        padding: 0 42px;
        align-items: center;
        justify-content: space-between;
    }

    .logo-container {
        width: auto;
        height: auto;
        display: flex;
        align-items: center;
    }

    .logo-container img {
        height: 45px;
        width: auto;
        position: static;
    }

    .burger-menu {
        display: flex;
    }

    /* Morph Burger menu into X */
    .header.nav-open .burger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .header.nav-open .burger-bar:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }

    .header.nav-open .burger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Navigation Drawer */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85%;
        height: 100vh;
        background-color: rgb(187, 202, 199);
        z-index: 1000;
        padding: 90px 24px 40px;
        flex-direction: column;
        align-items: flex-start;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .header.nav-open .nav-menu {
        transform: translateX(0);
    }

    .header.nav-open .header-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
        align-items: flex-start;
    }

    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(50, 50, 50, 0.1);
    }

    .nav-link {
        width: 100%;
        padding: 16px 0;
        font-size: 15px;
        justify-content: space-between;
    }

    /* Accordion Dropdowns on Mobile */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 10px 15px;
        max-height: 0;
        overflow: hidden;
        min-width: 100%;
        background-color: transparent;
        transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-item.open>.dropdown-menu {
        max-height: 600px;
    }

    .dropdown-item {
        padding: 10px 0;
        font-size: 14px;
        font-weight: 500;
    }

    .dropdown-item:hover {
        padding-left: 8px;
    }

    .nav-arrow {
        transition: transform 0.3s ease;
    }

    .nav-item.open>.nav-link .nav-arrow {
        transform: rotate(225deg);
    }

    .language-selector {
        margin-left: 0;
    }

    .language-selector .dropdown-menu {
        left: auto;
        right: auto;
        transform: none;
        min-width: 100%;
    }
}