/**
 * NukeViet Content Management System
 * @version 4.x
 * @author VINADES.,JSC <contact@vinades.vn>
 * @copyright (C) 2009-2021 VINADES.,JSC. All rights reserved
 * @license GNU/GPL version 2 or any later version
 * @see https://github.com/nukeviet The NukeViet CMS GitHub project
 */

/* Các tùy chỉnh CSS của giao diện nên để vào đây */

/* =============================================
   DESKTOP HEADER - CART & LOGIN (Gọn gàng & Sang trọng)
   ============================================= */

/* Căn phải cho cột chứa cart & login */
.header-bottom .col-md-6 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 15px; /* Khoảng cách giữa giỏ hàng và đăng nhập */
    height: 100%;
    min-height: 50px;
}

/* --- Style Giỏ hàng Desktop --- */
.cart-desk {
    display: flex !important;
    align-items: center;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1); /* Nền mờ nhẹ */
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.cart-desk:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.cart-desk a {
    color: #fff !important;
    margin-right: 5px;
}

.cart-desk i {
    font-size: 18px;
    color: #fff !important;
}

/* Ẩn chữ "Giỏ hàng :" và "sản phẩm" cho gọn */
.cart-desk strong:first-of-type, 
.cart-desk {
    font-size: 0; /* Ẩn text node không mong muốn */
}

/* Hiện lại icon và số lượng */
.cart-desk a, 
.cart-desk strong.red {
    font-size: 14px;
}

.cart-desk strong.red {
    background: #ffeb3b; /* Màu vàng nổi bật cho số lượng */
    color: #000 !important;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 5px;
    font-weight: bold;
}

/* --- Style Đăng nhập Desktop --- */
.header-login.dropdown {
    display: inline-block !important;
}

.header-login button.dropdown-toggle {
    background: transparent !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none !important;
}

.header-login button.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #fff !important;
}

.header-login i {
    color: #fff !important;
    font-size: 16px;
}

/* Dropdown menu khi mở */
#nv-block-login.dropdown-menu {
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: none;
    padding: 10px;
    min-width: 180px;
}


/* =============================================
   MOBILE HEADER BAR
   ============================================= */

.mhbar {
    display: none;
}

@media (max-width: 767px) {

    /* Ẩn desktop header */
    .header-bottom.hidden-xs {
        display: none !important;
    }

    /* Thanh header mobile */
    .mhbar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #BB6903;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    }

    .mhbar-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 8px;
    }

    /* Bên trái */
    .mhbar-left {
        display: flex;
        align-items: center;
        gap: 4px;
        flex: 1;
        min-width: 0;
    }

    .mhbar-logo img {
        height: auto;
        width: 100%;
        display: block;
    }

    /* Bên phải */
    .mhbar-right {
        display: flex;
        align-items: center;
        gap: 0;
        flex-shrink: 0;
    }

    /* Icon button chung */
    .mhbar-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: none;
        background: none !important;
        color: #fff !important;
        font-size: 20px;
        cursor: pointer;
        border-radius: 8px;
        position: relative;
        text-decoration: none !important;
        transition: background .2s;
        -webkit-tap-highlight-color: transparent;
        padding: 0;
    }

    .mhbar-btn i,
    .mhbar-btn .fa {
        color: #fff !important;
    }

    .mhbar-btn:hover,
    .mhbar-btn:focus {
        background: rgba(0, 0, 0, .15) !important;
        color: #fff !important;
    }

    /* Badge giỏ hàng */
    .mhbar-badge {
        position: absolute;
        top: 5px;
        right: 4px;
        min-width: 16px;
        height: 16px;
        line-height: 16px;
        padding: 0 3px;
        background: #e53935;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        border-radius: 8px;
        text-align: center;
        pointer-events: none;
    }

    /* ===== SEARCH OVERLAY ===== */

    .mhbar-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 99999;
        background: #BB6903;
        padding: 9px 10px;
        display: flex;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
        transform: translateY(-110%);
        transition: transform .3s ease;
    }

    .mhbar-search-overlay.open {
        transform: translateY(0);
    }

    /* Form tìm kiếm trong overlay */
    .mhbar-search-form {
        flex: 1;
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, .95);
        border-radius: 25px;
        padding: 0 10px;
        height: 40px;
        gap: 6px;
    }

    .mhbar-search-icon {
        color: #BB6903;
        font-size: 15px;
        flex-shrink: 0;
    }

    .mhbar-search-form input[type="text"] {
        flex: 1;
        border: none !important;
        outline: none !important;
        background: transparent !important;
        font-size: 14px !important;
        color: #333 !important;
        padding: 0 !important;
        box-shadow: none !important;
        height: 38px;
        min-width: 0;
    }

    .mhbar-search-submit {
        border: none;
        background: #BB6903;
        color: #fff;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .2s;
    }

    .mhbar-search-submit:hover {
        background: #9a5502;
    }

    /* Nút đóng search */
    .mhbar-search-close {
        width: 38px;
        height: 38px;
        border: none;
        background: rgba(255, 255, 255, .2);
        color: #fff;
        font-size: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .2s;
    }

    .mhbar-search-close:hover {
        background: rgba(255, 255, 255, .35);
    }

    /* Overlay tối */
    .mhbar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 998;
    }

    .mhbar-overlay.open {
        display: block;
    }

}