/* ================= Header ================== */

.header {
    margin-top: 24px;
    min-height: 76px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    /* display: flex; */
    z-index: 10;
}

.header_main {
    display: flex;
    background: linear-gradient(179deg, #29242b, #29242b 78%, #2c252f);
    border-radius: 50px;
    border: 1px solid rgba(211, 201, 246, 0.1);
    padding: 11px 12px;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease;
}

.header__logo-group {
    flex-shrink: 0;
}

.header__logo {
    height: 52px;
    z-index: 1001;
}

.header__nav {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.header__nav-list {
    list-style: none;
    display: flex;
    gap: 40px;
    padding: 0;
    margin: 0;
    align-items: center;
}

.header__nav-item {
    position: relative;
}

.header__nav-item .nav-link {
    color: rgba(212, 195, 230, 1);
    font-size: 16px;
    padding: 10px 16px;
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: color 0.3s;
}

.header__nav-item .nav-link:hover,
.header__nav-item .nav-link.active {
    color: #ffffff;
}

.header__nav-item .nav-link::after {
    content: "";
    position: absolute;
    width: 132px;
    height: 34px;
    left: 50%;
    bottom: -40px;
    transform: translateX(-50%);
    background: radial-gradient( 50% 50% at 50% 50%, rgba(146, 135, 167, 0.5) 20%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
    clip-path: inset(-62px 0px 25px 0px);
}

.header__nav-item .nav-link:hover::after,
.header__nav-item .nav-link.active::after {
    opacity: 1;
}


/* Submenu */

.has-submenu {
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    position: absolute;
    background: #1e1a22;
    top: 100%;
    left: 0;
    padding: 10px 0;
    border-radius: 8px;
    min-width: 180px;
    z-index: 999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.submenu li {
    padding: 8px 20px;
}

.submenu li a {
    color: #d4c3e6;
    text-decoration: none;
    display: block;
    transition: color 0.3s;
    font-size: 15px;
}

.submenu li a:hover {
    color: #ffffff;
}

.has-submenu>.nav-link::before {
    content: "▼";
    font-size: 12px;
    right: -5px;
    transition: transform 0.3s ease;
    color: #fffdfd;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.has-submenu:hover>.nav-link::before {
    transform: translateY(-50%) rotate(90deg);
}


/* ========== TOGGLE BUTTON ========== */

.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
    z-index: 1001;
}

.mobile-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6.5px, 5.5px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6.6px, -6.5px);
}

.header--sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 76px;
    margin-top: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
    padding: 12px 24px;
}

.header--hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease-out;
}

.header-placeholder {
    height: 0;
    transition: height 0.3s ease;
}

.header--sticky+.header-placeholder {
    height: 76px;
}


/* Tablet và Mobile */

@media (max-width: 991px) {
    .header_main {
        padding: 0;
        border: none;
        background: none;
    }
    .header {
        margin-top: 0px;
        border: 1px solid rgba(211, 201, 246, 0.1);
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 32px;
        border-bottom-right-radius: 32px;
        padding-top: 0px;
        padding: 5px 10px;
        border-top: 1px solid rgba(211, 201, 246, 0);
        border-bottom: 1px solid rgba(211, 201, 246, 0.1);
        border-left: 1px solid rgba(211, 201, 246, 0.1);
        border-right: 1px solid rgba(211, 201, 246, 0.1);
        background: linear-gradient(179deg, #29242b, #29242b 78%, #2c252f);
    }
    .header__nav {
        position: fixed;
        inset: 0;
        background: #29242b;
        padding: 100px 24px 40px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
        z-index: 9999;
    }
    .header__nav.active {
        transform: translateX(0);
    }
    .header__logo {
        position: relative;
        z-index: 10001;
    }
    .mobile-toggle {
        display: flex;
        margin-left: 12px;
        z-index: 10002;
    }
    .header__nav-item .nav-link::after {
        display: none;
    }
    .header__nav-list {
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    .header__nav-item {
        width: 100%;
    }
    .header__nav-item .nav-link {
        display: block;
        width: 100%;
        color: #d4c3e6;
        padding: 12px 0;
        font-size: 18px;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .header__contact-button {
        display: none;
    }
    .has-submenu .submenu {
        display: none;
        position: static;
        background: none;
        box-shadow: none;
        flex-direction: column;
        margin-top: 8px;
    }
    .has-submenu.active .submenu {
        display: flex;
    }
    .submenu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .submenu li {
        padding: 6px 0;
    }
    .submenu li a {
        color: #ccc;
        font-size: 16px;
        padding-left: 12px;
        display: block;
        text-decoration: none;
    }
    .submenu li a:hover {
        color: #fff;
    }
    .has-submenu.active>.nav-link::before {
        transform: translateY(-50%) rotate(90deg);
    }
    .submenu-arrow {
        font-size: 12px;
        color: #d4c3e6;
    }
    .header--sticky+.header-placeholder {
        height: 76px;
    }
}

@media (max-width: 767px) {
    .header--sticky+.header-placeholder {
        height: 64px;
    }
    .has-submenu.active>.nav-link::before {
        transform: translateY(-50%) rotate(180deg);
    }
}

@media (min-width: 992px) {
    .has-submenu:hover .submenu {
        display: block;
    }
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}