

/* --- Header Styles (Cần thiết cho cấu trúc header chung) --- */
.t-header-container {
    width: 100%;
    /* Chiều rộng đầy đủ */
    position: relative;
    /* Cho phép định vị các phần tử con tuyệt đối */
    z-index: auto;
    /* Đảm bảo header nằm trên một số nội dung khác (có thể cần điều chỉnh) */
}

.t-header-top {
    background-color: var(--t-light-color);
    /* Màu nền cho thanh header trên cùng */
    padding: 10px 20px;
    /* Khoảng đệm bên trong */
    box-shadow: var(--box-shadow);
    /* Đổ bóng */
}

.t-header-wrapper {
    display: flex;
    /* Sắp xếp các mục con theo hàng ngang */
    justify-content: space-between;
    /* Đẩy logo sang trái, actions sang phải */
    align-items: center;
    /* Căn giữa các mục con theo chiều dọc */
    max-width: var(--t-container-max);
    /* Giới hạn chiều rộng tối đa */
    margin: 0 auto;
    /* Căn giữa wrapper */
}

/* Logo styles (Cần thiết) */
.t-header-logo-container {
    display: flex;
    align-items: center;
}

.t-header-logo {
    display: flex;
    align-items: center;
}

.t-header-logo-img {
    width: 55px;
    height: auto;
    margin-right: 10px;
}

.t-header-logo-text {
    display: flex;
    flex-direction: column;
}

.t-header-logo-title {
    font-size: 2.7em;
    font-weight: 700;
    color: var(--t-primary-color);
    line-height: 1.2;
}

.t-header-logo-subtitle {
    font-size: 12px;
    color: var(--t-secondary-color);
}

/* Header actions (Search, Account, Cart - Cần thiết) */
.t-header-actions {
    display: flex;
    align-items: center;
}

.t-header-search {
    position: relative;
    margin-right: 15px;
}

/* Style cho search form được tạo bởi get_search_form() (Cần thiết) */
.t-header-search .search-form {
    display: flex;
}

/* Để input và button nằm cùng hàng */
.t-header-search .search-field {
    /* class mặc định của WP input */
    padding: 8px 15px;
    border: 1px solid var(--t-grey-dark);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    /* Bo góc trái */
    width: 200px;
    /* Điều chỉnh chiều rộng nếu cần */
    font-size: 14px;
    border-right: none;
    /* Để nút submit liền mạch với input */
}

.t-header-search .search-submit {
    /* class mặc định của WP button */
    padding: 0 12px;
    background-color: var(--t-primary-color);
    border: 1px solid var(--t-primary-color);
    /* Thêm border để đồng bộ chiều cao với input */
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    /* Bo góc phải */
    color: var(--t-light-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.t-header-search .search-submit:hover {
    background-color: var(--t-primary-dark);
    border-color: var(--t-primary-dark);
}

/* Account và Cart icons (Cần thiết) */
.t-header-account {
    margin-right: 15px;
    font-size: 20px;
    color: var(--t-secondary-color);
}

.t-header-cart {
    position: relative;
    font-size: 20px;
    color: var(--t-secondary-color);
}

.t-header-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--t-primary-color);
    color: var(--t-light-color);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* --- Desktop Navigation Bar (Cần thiết) --- */
.t-header-nav {
    background-color: var(--t-primary-color);
    /* Màu nền cho thanh menu chính */
    padding: 0 20px;
    /* Khoảng đệm */
}

.t-header-menu {
    /* ul chính của desktop menu */
    display: flex;
    /* Sắp xếp các mục menu theo hàng ngang */
    max-width: var(--t-container-max);
    /* Giới hạn chiều rộng */
    margin: 0 auto;
    /* Căn giữa */
    padding-left: 0;
    list-style: none;
    justify-content: center
}

/* Các mục li cấp một của desktop menu (Home, Products, Language, ...) (Cần thiết) */
.t-header-menu>li.menu-item {
    position: relative;
    /* Cho phép định vị submenu tuyệt đối so với li này */
}

/* Link a cấp một của desktop menu (Cần thiết) */
.t-header-menu>li.menu-item>a {
    display: block;
    /* Để padding có tác dụng đúng */
    padding: 10px 20px;
    /* Khoảng đệm cho mỗi mục menu */
    color: var(--t-light-color);
    /* Màu chữ */
    font-weight: 500;
    /* Độ đậm chữ */
    text-decoration: none;
    /* Bỏ gạch chân */
    transition: var(--transition);
    /* Hiệu ứng chuyển đổi */
}

/* Hover cho link và li cha có con (Cần thiết) */
.t-header-menu>li.menu-item>a:hover,
.t-header-menu>li.menu-item-has-children:hover>a {
    background-color: var(--t-primary-dark);
    /* Màu nền khi hover */
    color: var(--t-light-color);
}

/* Icon dropdown cho các mục có con trên desktop (Products, Language) (Cần thiết) */
.t-header-menu>li.menu-item-has-children>a {
    display: flex;
    /* Để icon và text nằm cùng hàng */
    align-items: center;
    /* Căn giữa theo chiều dọc */
}

.t-header-menu>li.menu-item-has-children>a::after {
    /* Dùng pseudo-element ::after để thêm icon */
    content: "\F282";
    /* Mã Unicode của Bootstrap Icon Chevron Down */
    font-family: 'bootstrap-icons';
    /* Font chứa icon */
    font-size: 12px;
    /* Kích thước icon */
    margin-left: 8px;
    /* Khoảng cách với chữ */
    font-weight: normal;
    /* Đảm bảo icon không bị ảnh hưởng bởi font-weight của link */
}

/* Icon globe cho Language switcher trên desktop (Cần thiết nếu bạn dùng icon globe) */
.t-header-menu>li.menu-item-language>a>i.bi-globe {
    /* Class .menu-item-language được thêm từ functions.php */
    margin-right: 5px;
    /* Khoảng cách với chữ "English" */
    font-size: 1em;
}


/* --- DESKTOP SUBMENU STYLES (ĐỒNG BỘ CHO PRODUCTS VÀ LANGUAGE - Cần thiết) --- */
.t-header-menu .sub-menu {
    /* Class này chung cho cả WP submenu và language dropdown (do functions.php đã thêm class sub-menu) */
    position: absolute;
    /* Định vị tuyệt đối so với li.menu-item cha */
    top: 100%;
    /* Nằm ngay dưới mục cha */
    left: 0;
    /* Căn trái với mục cha */
    width: 230px;
    /* Chiều rộng của dropdown */
    background-color: var(--t-light-color);
    /* Màu nền dropdown */
    box-shadow: var(--box-shadow);
    /* Đổ bóng */
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    /* Bo góc dưới */
    opacity: 0;
    /* Mặc định ẩn */
    visibility: hidden;
    /* Mặc định ẩn hoàn toàn, không tương tác được */
    transform: translateY(10px);
    /* Hiệu ứng trượt nhẹ từ trên xuống khi xuất hiện */
    transition: opacity 0.25s ease, visibility 0s linear 0.25s, transform 0.25s ease;
    /* Hiệu ứng xuất hiện/ẩn */
    z-index: 1000;
    /* Đảm bảo nằm trên các nội dung khác */
    border: 1px solid var(--t-grey-dark);
    /* Border nhẹ cho dropdown */
    border-top: 2px solid var(--t-primary-color);
    /* Border top màu chính, tạo điểm nhấn */
    padding: 5px 0;
    /* Khoảng đệm trên dưới cho toàn bộ ul.sub-menu */
    margin: 0;
    list-style: none;
}

/* Hiển thị submenu khi hover vào mục cha (Cần thiết) */
.t-header-menu>li.menu-item-has-children:hover>.sub-menu {
    opacity: 1;
    /* Hiện ra */
    visibility: visible;
    /* Cho phép nhìn thấy và tương tác */
    transform: translateY(0);
    /* Về vị trí ban đầu */
    transition-delay: 0s;
    /* Reset delay khi hiển thị */
}

/* Link <a> con bên trong TẤT CẢ submenu desktop (Cần thiết cho style đồng bộ) */
.t-header-menu .sub-menu li.menu-item>a {
    /* Class menu-item đã được thêm vào cả li ngôn ngữ */
    display: block;
    /* Để padding có tác dụng và chiếm hết chiều rộng li */
    padding: 10px 20px;
    /* ĐỒNG BỘ PADDING (ảnh hưởng "text height" của mục) */
    color: var(--t-text-color);
    /* ĐỒNG BỘ MÀU CHỮ */
    font-size: 0.95em;
    /* Đồng bộ kích thước chữ nếu cần */
    font-weight: normal;
    /* Reset font-weight */
    text-decoration: none;
    /* Bỏ gạch chân */
    /* border-bottom: 1px solid var(--t-grey-color); */
    /* Nếu muốn có border giữa các mục con, bỏ comment dòng này */
    transition: background-color 0.2s ease, color 0.2s ease;
    /* Hiệu ứng khi hover */
    white-space: nowrap;
    /* Ngăn chữ xuống dòng nếu tên mục quá dài */
    line-height: 1.5;
    /* Chiều cao dòng, giúp căn chỉnh text tốt hơn */
}

/* Bỏ đường kẻ cho mục con cuối cùng trong mỗi submenu (nếu bạn dùng border-bottom ở trên) */
/* .t-header-menu .sub-menu li.menu-item:last-child > a {
    border-bottom: none;
} */

/* HOVER cho link <a> con bên trong TẤT CẢ submenu desktop (Cần thiết) */
.t-header-menu .sub-menu li.menu-item>a:hover {
    background-color: var(--t-primary-color);
    /* ĐỒNG BỘ MÀU NỀN HOVER */
    color: var(--t-light-color);
    /* ĐỒNG BỘ MÀU CHỮ HOVER */
}

/* Style riêng cho ngôn ngữ hiện tại trong dropdown (Tùy chọn, nhưng nên có để người dùng biết) */
.t-header-menu .sub-menu li.menu-item a.current-language-item {
    /* Class current-language-item được thêm từ functions.php */
    font-weight: bold;
    background-color: var(--t-grey-color);
    color: var(--t-primary-dark);
}

.t-header-menu .sub-menu li.menu-item a.current-language-item:hover {
    background-color: var(--t-primary-dark);
    color: var(--t-light-color);
}


/* --- Mobile Menu Styles (Cần thiết) --- */
.t-header-mobile-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--t-secondary-color);
    cursor: pointer;
    padding: 5px;
}

.t-header-mobile-menu {
    /* Khung chính của mobile menu */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--t-light-color);
    z-index: 1000;
    overflow-y: auto;
    /* Cho phép cuộn nếu nội dung dài */
    /* Các thuộc tính cho hiệu ứng trượt (Cần thiết) */
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
}

.t-header-mobile-menu.active {
    /* Khi menu được mở bởi JS */
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.t-header-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--t-grey-color);
}

.t-header-mobile-close {
    font-size: 24px;
    background: none;
    border: none;
    color: var(--t-text-color);
    cursor: pointer;
    padding: 5px;
}

.t-header-mobile-menu-items {
    padding: 20px;
}

/* Padding cho toàn bộ nội dung bên trong mobile menu */

/* Search form trong mobile menu (Cần thiết) */
.t-header-mobile-menu-items .t-header-search {
    display: block !important;
    margin-bottom: 20px;
}

.t-header-mobile-menu-items .t-header-search .search-form {
    display: flex;
}

.t-header-mobile-menu-items .t-header-search .search-field {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--t-grey-dark);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 1rem;
    border-right: none;
}

.t-header-mobile-menu-items .t-header-search .search-submit {
    padding: 0 15px;
    background-color: var(--t-primary-color);
    border: 1px solid var(--t-primary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    color: var(--t-light-color);
    cursor: pointer;
}


/* --- MOBILE MENU ITEMS & SUBMENUS (ĐỒNG BỘ - Cần thiết) --- */
.t-header-mobile-menu-items .t-mobile-menu-ul {
    /* ul chính của mobile menu */
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.t-header-mobile-menu-items .t-mobile-menu-ul>li.menu-item {
    /* Các li cấp 1 */
    position: relative;
    /* Cho icon toggle */
}

/* Link cha có submenu VÀ link thường không có submenu trên mobile (Cần thiết cho style đồng bộ) */
.t-header-mobile-menu-items .t-mobile-menu-ul>li.menu-item-has-children>a,
.t-header-mobile-menu-items .t-mobile-menu-ul>li:not(.menu-item-has-children)>a {
    display: flex;
    /* Để icon (nếu có) và text căn chỉnh */
    justify-content: space-between;
    /* Đẩy icon sang phải nếu là mục có con */
    align-items: center;
    /* Căn giữa theo chiều dọc */
    padding: 14px 0;
    color: var(--t-text-color);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--t-grey-color);
    /* Đường kẻ giữa các mục cấp 1 */
}

/* Bỏ border cho mục cấp 1 cuối cùng (bao gồm cả language switcher nếu nó là li cuối) */
.t-header-mobile-menu-items .t-mobile-menu-ul>li:last-child>a {
    border-bottom: none;
}

/* Hover cho tất cả link cấp 1 (Cần thiết) */
.t-header-mobile-menu-items .t-mobile-menu-ul>li>a:hover {
    color: var(--t-primary-color);
}

/* Icon toggle cho mobile menu (Cần thiết, JS sẽ thêm span này) */
.t-header-mobile-menu-items .menu-item-has-children>a .submenu-toggle-icon {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.8em;
    color: var(--t-secondary-color);
}

/* Submenu ul trên mobile (Cần thiết) */
.t-header-mobile-menu-items .sub-menu {
    /* Áp dụng cho cả Products và Language */
    list-style: none;
    padding-left: 20px;
    /* Thụt lề */
    margin: 0;
    background-color: #f8f8f8;
    /* Nền khác biệt cho submenu */
    border-top: 1px solid var(--t-grey-color);
    /* Kẻ trên submenu */
    /* display: none; JS sẽ xử lý việc ẩn/hiện */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, visibility 0s linear 0.3s;
}

.t-header-mobile-menu-items .sub-menu.active
{
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
}

/* Link con trong submenu mobile (Cần thiết) */
.t-header-mobile-menu-items .sub-menu li>a {
    /* Áp dụng cho tất cả <a> trong <li> của submenu */
    display: block;
    padding: 10px 0;
    font-size: 0.9em;
    font-weight: 400;
    color: var(--t-text-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--t-grey-color);
    /* Kẻ giữa các mục con */
}

.t-header-mobile-menu-items .sub-menu li:last-child>a {
    border-bottom: none;
}

/* Bỏ kẻ cho mục con cuối */
.t-header-mobile-menu-items .sub-menu li>a:hover {
    color: var(--t-primary-color);
}

/* Ngôn ngữ active trong mobile dropdown (Tùy chọn) */
.t-header-mobile-menu-items .t-mobile-language-switcher .sub-menu a.active {
    /* .t-mobile-language-switcher là class của li ngôn ngữ */
    font-weight: bold;
    color: var(--t-primary-color);
}


/* --- Responsive Styles (Giữ lại các media query bạn đã có, có thể cần tinh chỉnh) --- */
@media screen and (max-width: 1024px) {
    .t-header-search .search-field {
        width: 150px;
    }

    /* Cho desktop search trên tablet */
    .t-header-menu>li.menu-item>a {
        padding: 15px 15px;
    }

    /* Cho desktop menu trên tablet */
}

@media screen and (max-width: 768px) {
    .t-header-nav {
        display: none;
    }
    .t-header-search {
        margin-right: 0;
    }
    /* Ẩn menu desktop */
    .t-header-mobile-toggle {
        display: block;
        margin-right: 15px;
    }

    /* Hiện nút mở mobile menu */
    .t-header-logo-title {
        font-size: 2.2em;
    }

    .t-header-logo-subtitle {
        font-size: 10px;
    }

    .t-header-actions .t-header-search {
        display: none;
    }

    /* Search trên top bar ẩn ở mobile */
    /* .t-header-search { margin-right: 0; } /* Style này có thể không cần nếu search trong mobile menu đã có style riêng */
    .t-header-actions .t-header-account,
    .t-header-actions .t-header-cart {
        margin-right: 10px;
    }

    .t-header-actions .t-header-cart {
        margin-right: 0;
    }
}

@media screen and (max-width: 480px) {
    .t-header-top{
        padding: 10px 0px;
    }
    .t-header-wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }
    .t-header-search {
        margin-right: 0;
    }

    .t-header-logo-img {
        width: 30px;
        margin-right: 8px;
    }

    .t-header-logo-title {
        font-size: 18px;
    }

    .t-header-logo-subtitle {
        display: none;
    }
}
.t-mobile-language-switcher
{
    font-weight: bold;
}

.t-mobile-language-switcher .lang-option-item a
{
    
}

.t-mobile-language-switcher .lang-option-item a.active {
    font-weight: bold;
    color: var(--t-primary-color);
}

.t-header-mobile-menu-items .menu-item-has-children>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}