.main-header {
    background-color: #000000;
    color: #EBC58E;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo-main {
    font-size: 24px;
    font-weight: 900;
    color: #EBC58E;
}

.header-logo-sub {
    font-size: 10px;
    letter-spacing: 2px;
    color: #EBC58E;
    opacity: 0.7;
    margin-top: -3px;
}

.header-nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
    position: static;
}

.header-nav ul {
    list-style: none;
    margin: 0;
    display: flex;
    gap: 30px;
}

.header-nav ul li {
    display: flex;
    align-items: center; /* Căn giữa theo chiều dọc */
    height: 100%;
}

.has-mega-menu {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.chevron-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid #EBC58E; /* Độ dày nét mũi tên */
    border-bottom: 2px solid #EBC58E; 
    transform: rotate(45deg); /* Xoay để tạo thành mũi tên chỉ xuống */
    transition: transform 0.3s ease; /* Hiệu ứng xoay mượt */
    margin-top: -4px; /* Tinh chỉnh nhỏ để mũi tên nằm chính giữa dòng */
}

.chevron-arrow.rotate {
    transform: rotate(225deg); /* 45 + 180 = 225 (Xoay ngược lên) */
    margin-top: 2px; /* Chỉnh lại vị trí chút khi xoay để không bị lệch */
}

.header-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    transition: color 0.3s;
    height: 100%;
}

.header-nav a:hover,
.header-nav a.active {
    color: #EBC58E;
}

.dropdown-arrow {
    margin-left: 5px;
    color: #EBC58E;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.action-icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.action-icon-wrapper img {
    width: 30px;
    height: 30px;
}

.action-icon {
    color: #000000;
    font-size: 18px;
}

.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 3px;
    margin-right: 10px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: #EBC58E;
    transition: 0.3s;
    border-radius: 2px;
}

.header-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* Nền đen trùng header */
    z-index: 1100; /* Cao hơn mọi thứ trong header */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Hiệu ứng ẩn/hiện */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
}

/* Khi có class 'active' (được JS thêm vào) */
.header-search-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-inner {
    width: 100%;
    max-width: 800px; /* Giới hạn độ rộng trên PC */
    display: flex;
    align-items: center;
    padding: 0 40px;
    gap: 15px;
}

.search-form {
    flex-grow: 1;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #EBC58E; /* Gạch chân màu vàng kim */
    padding-bottom: 5px;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    outline: none;
    padding: 5px 10px;
}

.search-input::placeholder {
    color: #666;
    font-size: 16px;
}

.search-submit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 5px;
}

.search-submit-btn img {
    width: 24px;
    height: 24px;
}

.search-close-btn {
    background: none;
    border: none;
    color: #EBC58E;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.3s;
}

.search-close-btn:hover {
    transform: rotate(90deg);
    color: #fff;
}

/* --- Cart Dropdown --- */
.cart-dropdown {
    position: absolute;
    top: 100%; /* Xuất hiện ngay dưới header */
    right: 20px; /* Căn phải, nhích vào trong một chút */
    width: 400px; /* Độ rộng của cart */
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1200; /* Cao hơn header và search overlay */

    /* Ẩn mặc định */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
}

.cart-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff0000;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    border: 2px solid #000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        width: 100%;
        height: 8vh;
        padding-left: 20px;
        padding-right: 20px;
    }

    .header-logo img{
        width: 80px;
        height: auto;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #000000;
        padding: 10px 20px;
        z-index: 1000;
        border-top: 1px solid #EBC58E;
    }

    .nav-toggle:checked ~ .header-nav {
        display: block;
    }

    .header-nav ul {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .header-nav a {
        font-size: 16px;
    }

    .header-actions {
        order: 3;
        gap: 10px;
        margin-left: auto;
    }

    .header-actions .action-icon-wrapper:nth-child(3) {
        display: none;
    }

    .action-icon-wrapper img {
        width: 25px;
        height: 25px;
    }

    .header-search-overlay {
        padding: 0; /* Full màn hình header */
    }

    .search-inner {
        padding: 0 15px; /* Padding nhỏ hơn cho mobile */
        gap: 10px;
    }

    .search-input {
        font-size: 16px; /* Font nhỏ vừa phải */
    }

    .welcome-text{
        display: none;
    }

    /* Language Switcher Mobile */
    .language-switcher {
        display: none !important; /* Hide on mobile, moved to taskbar */
    }
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(235, 197, 142, 0.2);
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 16px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    position: relative;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background-color: rgba(235, 197, 142, 0.1);
    border-color: rgba(235, 197, 142, 0.3);
    color: #EBC58E;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(235, 197, 142, 0.2);
}

.lang-btn.active {
    background-color: #EBC58E;
    color: #000000;
    font-weight: 600;
    border-color: #EBC58E;
    box-shadow: 0 2px 12px rgba(235, 197, 142, 0.4);
    transform: translateY(0);
}

.lang-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(235, 197, 142, 0.6);
}

.lang-divider {
    color: rgba(235, 197, 142, 0.6);
    font-size: 14px;
    font-weight: bold;
    user-select: none;
    margin: 0 2px;
}

.lang-text {
    position: relative;
    z-index: 1;
}

/* User Greeting Styles */
.user-greeting {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 14px;
}

.welcome-text {
    color: #EBC58E;
    font-weight: 500;
}

.logout-btn {
    background: none;
    border: none;
    color: #EBC58E;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.3s;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    color: #FFFFFF;
    background-color: rgba(235, 197, 142, 0.1);
}
