/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    box-shadow: 1px 1px 25px -1px #ccc;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100px;
}

.logo img{
  height: 50px;
}



.nav {
    margin-left: 40px;
    display: flex;
    gap: 26px;
}

.nav a {
    font-size: 16px;
    color:#333;
    position: relative;
    padding: 4px 0;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

/* .nav a:hover::after,
.nav a.active::after { width: 100%; } */

.nav a:hover,
.nav a.active { color: #fff;background: var(--primary); padding: 4px 10px;transition: all 0.3s;}

.header-actions {
    display: flex;
    gap: 16px;
    color: #1a1a1a;
    align-items: center;
}

.header-actions a { font-size: 16px; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #1a1a1a;
    cursor: pointer;
}

.nav-item{position: relative;}
.nav-item > a i { font-size: 12px; }

.subnav {
    position: absolute;
    top: 40px;
    left: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid #eee;
    border-top: 2px solid var(--primary);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    padding: 8px 18px;
    margin: 0;
    list-style: disc inside;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-item:hover .subnav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.subnav li {
    padding: 6px 0;
}

.subnav li a {
    display: inline;
    font-size: 16px;
    color: #1a1a1a;
    white-space: nowrap;
    line-height: 1.5;
}

.subnav li:hover { color: var(--primary-dark); }

.subnav li a::after { display: none; }

.lang-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    background: #fff;
    padding: 6px 15px;
    border-radius: 20px;
    margin-left: auto;
    max-width: 105px;
}

.lang-switch i { font-size: 10px; margin-left:5px;}

/* Language dropdown */
.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 120px;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.1);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: var(--transition);
    z-index: 200;
    cursor: default;
}

.lang-switch.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 16px;
    color: #1a1a1a;
    white-space: nowrap;
}

.lang-menu a:hover { background: #f5f7f6; color: var(--primary); }
.lang-menu a.active { color: var(--primary); font-weight: 600; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: #1a1a1a;
    cursor: pointer;
}

@media (max-width: 992px) {
    .header { background: rgba(255,255,255,0.98); }
    .header-inner { height: 64px; justify-content: space-between; }
    .logo img { height: 40px; }

    /* Mobile drawer nav (real structure: .header > .container.header-inner > .nav) */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 10px 20px 20px;
        gap: 0;
        box-shadow: 0 12px 24px rgba(0,0,0,0.08);
        margin-left: 0;
        z-index: 999;
    }

    .nav.open { display: flex; }

    .nav a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 16px;
        line-height: 1.5;
    }

    /* Mobile: drop the desktop hover highlight (white text on green) and change the text colour instead */
    .nav a:hover,
    .nav a.active {
        color: var(--primary);
        background: transparent;
        padding: 12px 0;
    }

    .menu-toggle { display: block; color: #1a1a1a; }

    /* Submenu: statically expanded on mobile (there is no hover on touch) */
    .nav .subnav {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        min-width: 0;
        padding: 0 0 8px 22px;
        margin: 0;
        list-style: none;
    }
    .subnav li { padding: 0; }
    .subnav li a {
        line-height: 38px;
        font-size: 16px;
        color: #666;
        border-bottom: none;
        padding: 0;
    }
}

@media (max-width: 576px) {
    .logo img { height: 36px; }
}

/* Language selector - mobile layout (additive; does not touch the rules above).
   The language choice must stay reachable at all times, so the selector sits to the
   LEFT of the hamburger button in the header (hamburger stays the rightmost control).
   It is compacted so logo + selector + hamburger fit comfortably on a 390px viewport. */
@media (max-width: 992px) {
    .lang-switch {
        margin-left: auto;
        margin-right: 12px;
        padding: 5px 10px;
        font-size: 16px;
        gap: 5px;
    }
    .lang-switch i { font-size: 14px; margin-left: 2px; }
    .lang-menu { min-width: 150px; }
    .lang-menu a { padding: 8px 12px; font-size: 16px; }
    /* 四档字号约束：汉堡按钮与导航小图标归入 20 / 14 档 */
    .menu-toggle { font-size: 20px; }
    .nav-item > a i { font-size: 14px; }
}

/* Very narrow screens: clamp the label so a long name ("Bahasa Indonesia")
   can never push the header into a horizontal scroll. */
@media (max-width: 576px) {
    .lang-switch .lang-label {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

