/* ===== HEADER BASE ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ===== NAV ===== */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 56px;
}

/* ===== LOGO (CENTER MOBILE STYLE) ===== */
.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo a {
    font-weight: 600;
    font-size: 18px;
    color: #111;
    letter-spacing: -0.2px;
}

/* ===== DESKTOP MENU ===== */
.desktop-menu {
    margin-left: auto;
}

.desktop-menu a {
    margin-left: 22px;
    font-size: 14px;
    color: #666;
    position: relative;
    transition: 0.25s;
}

.desktop-menu a:hover {
    color: #000;
}

/* underline animation */
.desktop-menu a::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: #111;
    transition: 0.3s;
}

.desktop-menu a:hover::after {
    width: 100%;
}

.desktop-menu a.active {
    color: #000;
    font-weight: 500;
}

/* ===== HAMBURGER (LEFT) ===== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: #111;
    transition: all 0.3s ease;
}

/* ANIMATE → X */
.hamburger.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

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

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

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: #fff;
    z-index: 1000;
    padding: 20px;
    transition: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 20px 0 60px rgba(0,0,0,0.15);
}

.mobile-menu.active {
    left: 0;
}

/* HEADER MOBILE */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-weight: 600;
}

/* CLOSE BUTTON */
.mobile-header button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* MENU LINK */
.mobile-menu a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    color: #222;
    border-bottom: 1px solid #eee;
    transition: 0.2s;
}

.mobile-menu a:hover {
    color: #2563eb;
    padding-left: 6px;
}

/* ===== OVERLAY ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .desktop-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* giữ logo center */
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== DESKTOP FIX ===== */
@media (min-width: 769px) {

    .logo {
        position: static;
        transform: none;
    }

    .nav {
        height: 64px;
    }
}