/* ============================================================
   Header desktop kiểu mới: hàng 1 (logo + tìm kiếm + tối/sáng + đăng
   nhập), hàng 2 (thanh menu cam) - chỉ áp dụng khi màn hình >= 992px,
   dưới mức đó vẫn dùng giao diện mobile (hamburger + off-canvas) như cũ.
   ============================================================ */

/* Wrapper chiều rộng DÙNG CHUNG cho hàng logo + thanh menu cam + mọi widget
   trang chủ (Truyện Hay, Danh Sách Truyện Tranh Mới, Danh Sách Thể Loại...)
   - co gọn về đúng 1200px, canh giữa. Cả 3 khối PHẢI dùng chung đúng 1 giá
   trị max-width này (xem thêm rule cho hàng logo bên dưới) để luôn thẳng
   mép nhau tuyệt đối. */
.tqq-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Icon menu hamburger (mobile) vốn màu trắng - cho nền header đã đổi trắng,
   đổi lại thành xám cho nhìn thấy được. */
.menu_icon__open > span {
    background-color: #666 !important;
}

/* Ẩn ô tìm kiếm dạng overlay cũ (đã có ô tìm kiếm luôn hiện mới thay thế) */
.c-header__top > ul.search-main-menu {
    display: none !important;
}

/* Hàng 1 (logo/tìm kiếm/đăng nhập): nền trắng, bỏ màu đỏ-cam demo mặc định
   của theme (chỉ đổi đúng hàng này, không đụng --primary-color dùng chung
   toàn site cho nút/badge/hover chỗ khác). */
.site-header .c-header__top .main-navigation.style-1 {
    background: #fff !important;
    border-bottom: 1px solid #eee;
}

/* Hàng logo đang dùng ".container" gốc của Bootstrap (căn giữa theo
   breakpoint) trong khi thanh menu cam + widget bên dưới dùng ".tqq-container"
   (full-width + padding cố định) -> lệch mép trái/phải giữa 2 hàng. Ép hàng
   logo dùng ĐÚNG cùng 1 kiểu padding/full-width như ".tqq-container" để logo
   và menu/nội dung bên dưới luôn thẳng hàng tuyệt đối. */
.site-header .c-header__top .main-navigation.style-1 > .container {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .main-navigation.style-1 .main-navigation_wrap {
        display: flex;
        align-items: center;
        gap: 24px;
    }
    .main-navigation.style-1 .wrap_branding {
        flex-shrink: 0;
    }

    /* Ẩn menu chính ở hàng 1 (đã chuyển xuống thanh cam riêng) */
    .main-navigation.style-1 .main-menu,
    .main-navigation.style-1 .search-navigation.search-sidebar {
        display: none !important;
    }

    .tqq-header-search {
        flex: 1;
        max-width: 480px;
    }
    .tqq-header-search form {
        display: flex;
        align-items: center;
        border: 1.5px solid #e2e5ea;
        border-radius: 22px;
        overflow: hidden;
        background: #fff;
    }
    .tqq-header-search input[type="text"] {
        flex: 1;
        border: none;
        outline: none;
        padding: 9px 16px;
        font-size: 14px;
    }
    .tqq-header-search button {
        background: transparent;
        border: none;
        color: #e88a00;
        padding: 0 16px;
        cursor: pointer;
        font-size: 16px;
    }

    .tqq-darklight-slot {
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
    }
    /* Nút Sáng/Tối gốc của theme là "position: fixed" (nổi góc màn hình) -
       khi chuyển vào header phải ép về vị trí tĩnh để nằm đúng trong hàng. */
    .tqq-darklight-slot #darklight_toggle {
        position: static !important;
        bottom: auto !important;
        left: auto !important;
    }

    .tqq-header-auth {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        margin-left: auto;
    }
    .tqq-btn-auth {
        padding: 8px 18px;
        border-radius: 4px;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none !important;
        white-space: nowrap;
    }
    .tqq-btn-register {
        background: #fff;
        color: #e88a00;
        border: 1.5px solid #e88a00;
    }
    .tqq-btn-register:hover {
        background: #fff5e9;
    }
    .tqq-btn-login {
        background: #e88a00;
        color: #fff !important;
        border: 1.5px solid #e88a00;
    }
    .tqq-btn-login:hover {
        opacity: .9;
    }

    .tqq-header-user {
        position: relative;
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
        color: #333;
    }
    .tqq-header-user img {
        border-radius: 50%;
        width: 32px;
        height: 32px;
    }
    .tqq-header-user-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        border: 1px solid #e2e5ea;
        border-radius: 6px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
        min-width: 150px;
        padding: 6px 0;
        z-index: 50;
    }
    .tqq-header-user:hover .tqq-header-user-menu {
        display: block;
    }
    .tqq-header-user-menu a {
        display: block;
        padding: 8px 14px;
        color: #444;
        font-weight: 500;
        text-decoration: none !important;
    }
    .tqq-header-user-menu a:hover {
        background: #f7f8fa;
        color: #e88a00;
    }

    /* Thanh menu chính - nền cam */
    .tqq-main-navbar-wrap {
        background: #e88a00;
    }
    /* Dùng nguyên class .container gốc của theme (Bootstrap) - không tự đặt
       max-width riêng - để khớp đúng chiều rộng với các khối nội dung khác
       (widget Truyện Hay, danh sách truyện...) bên dưới, tránh lệch mép. */
    .tqq-main-navbar {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
    }
    .tqq-main-navbar > li {
        display: block;
        float: none;
    }
    .tqq-main-navbar > li > a {
        display: block;
        padding: 12px 16px;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none !important;
        white-space: nowrap;
    }
    .tqq-main-navbar > li > a:hover,
    .tqq-main-navbar > li.current-menu-item > a,
    .tqq-main-navbar > li.current_page_item > a {
        background: rgba(0, 0, 0, .12);
        color: #fff8ec !important;
    }
    .tqq-main-navbar li.menu-item-has-children {
        position: relative;
    }
    .tqq-main-navbar li.menu-item-has-children > a::after {
        content: "\25BE";
        margin-left: 5px;
        font-size: 11px;
    }
    .tqq-main-navbar .sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        border-radius: 0 0 6px 6px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
        min-width: 200px;
        max-height: 360px;
        overflow-y: auto;
        list-style: none;
        margin: 0;
        padding: 6px 0;
        z-index: 40;
    }
    .tqq-main-navbar li.menu-item-has-children:hover > .sub-menu {
        display: block;
    }
    .tqq-main-navbar .sub-menu a {
        display: block;
        padding: 8px 16px;
        color: #444;
        font-size: 13px;
        text-decoration: none !important;
        white-space: nowrap;
    }
    .tqq-main-navbar .sub-menu a:hover {
        background: #fff5e9;
        color: #e88a00;
    }
}

@media (max-width: 991px) {
    .tqq-header-search,
    .tqq-darklight-slot,
    .tqq-header-auth,
    .tqq-main-navbar-wrap {
        display: none !important;
    }
}
