/**
 * 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 (thiết kế lại theo mẫu)
   Tone màu chủ đạo: #BB6903
   ============================================= */

.mhbar {
    display: none;
}

@media (max-width: 767px) {

    /* Ẩn header & menu desktop trên mobile */
    .header-bottom.hidden-xs,
    .main-menu-box.hidden-xs {
        display: none !important;
    }

    .mhbar {
        display: block;
        position: relative;
        z-index: 1000;
        background: #BB6903;
        box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    }

    /* ---------- Hàng 1: thanh tiện ích trên cùng ---------- */
    .mhbar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 7px 10px;
        background: #a85e03;
    }

    .mhbar-top a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12.5px;
        font-weight: 600;
        line-height: 1;
        padding: 7px 14px;
        border-radius: 20px;
        text-decoration: none !important;
        white-space: nowrap;
    }

    .mhbar-top a i {
        font-size: 13px;
    }

    .mhbar-contact {
        background: #e53935;
        color: #fff !important;
    }

    .mhbar-contact:hover,
    .mhbar-contact:focus {
        background: #d32f2f;
        color: #fff !important;
    }

    .mhbar-support {
        background: rgba(255, 255, 255, .16);
        color: #fff !important;
        border: 1px solid rgba(255, 255, 255, .45);
    }

    .mhbar-support:hover,
    .mhbar-support:focus {
        background: rgba(255, 255, 255, .28);
        color: #fff !important;
    }

    /* ---------- Hàng 2: logo ---------- */
    .mhbar-logobar {
        text-align: center;
        padding: 10px;
        background: linear-gradient(180deg, #f4d06d 0%, #ecbb50 55%, #e0a83e 100%);
    }

    .mhbar-logo {
        display: inline-block;
        line-height: 0;
    }

    .mhbar-logo img {
        height: 54px;
        width: auto;
        max-width: 82%;
        display: inline-block;
    }

    /* ---------- Hàng 3: tìm kiếm + nút menu ---------- */
    .mhbar-searchbar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 9px 10px;
        background: #BB6903;
    }

    .mhbar-search-form {
        flex: 1;
        display: flex;
        align-items: stretch;
        height: 40px;
        background: #fff;
        border-radius: 22px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
        min-width: 0;
    }

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

    .mhbar-search-go {
        flex-shrink: 0;
        width: 52px;
        border: none;
        background: #e08a1e;
        color: #fff;
        font-size: 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mhbar-search-go:hover {
        background: #cf7a12;
    }

    .mhbar-menu-toggle {
        flex-shrink: 0;
        width: 44px;
        height: 40px;
        border: none;
        background: rgba(255, 255, 255, .15);
        color: #fff !important;
        font-size: 20px;
        border-radius: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
    }

    .mhbar-menu-toggle:hover {
        background: rgba(255, 255, 255, .28);
    }

    .mhbar-menu-toggle i {
        color: #fff !important;
    }

    /* ---------- Hàng 4: giỏ hàng / yêu thích ---------- */
    .mhbar-quick {
        display: flex;
        align-items: stretch;
        background: #fff;
        border-bottom: 1px solid #ececec;
    }

    .mhbar-quick-item {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 11px 6px;
        font-size: 13.5px;
        font-weight: 600;
        color: #333 !important;
        text-decoration: none !important;
        white-space: nowrap;
    }

    .mhbar-quick-item + .mhbar-quick-item {
        border-left: 1px solid #ececec;
    }

    .mhbar-quick-item i {
        color: #BB6903;
        font-size: 16px;
    }

    .mhbar-quick-item span {
        color: #e53935;
        font-weight: 700;
    }

    /* =========================================
       DRAWER MENU MOBILE (thiết kế lại theo mẫu)
       ========================================= */

    .mhbar .mobile-menu-wrap {
        width: 86%;
        max-width: 320px;
        background: #fff;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .mhbar .mmenu-head {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #BB6903;
        padding: 10px 14px;
    }

    .mhbar .mmenu-head .mmenu-logo {
        line-height: 0;
    }

    .mhbar .mmenu-head .mmenu-logo img {
        height: 36px;
        width: auto;
    }

    .mhbar .mmenu-close {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        border-radius: 50%;
    }

    .mhbar .mmenu-close:hover {
        background: rgba(255, 255, 255, .2);
    }

    .mhbar .mmenu-scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* chừa chỗ cho thanh chat cố định ở đáy (Gọi điện/Nhắn tin/Zalo/Facebook) */
        padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }

    /* Reset chung cho metismenu trong drawer */
    .mhbar .mobile-menu-wrap .metismenu,
    .mhbar .mobile-menu-wrap .metismenu .sidebar {
        border: none !important;
        background: #fff !important;
        width: 100%;
    }

    .mhbar .mobile-menu-wrap ul {
        list-style: none;
        margin: 0;
        padding: 0 !important;
    }

    .mhbar .mobile-menu-wrap li {
        position: relative;
    }

    /* Mặc định: MỌI mục là hàng nền trắng, THU GỌN mục con */
    .mhbar .mmenu-scroll a {
        display: block;
        position: relative;
        padding: 12px 16px;
        color: #333 !important;
        background: #fff;
        text-decoration: none !important;
        font-size: 14px;
        line-height: 1.35;
        font-weight: 400;
        text-transform: none;
        border-bottom: 1px solid #ededed;
    }

    /* Icon nhà cho mục Trang chủ */
    .mhbar .mmenu-scroll a.home:before {
        content: "\f015";
        font-family: FontAwesome;
        margin-right: 8px;
        color: #BB6903;
    }

    /* Mục cha (có menu con) khi ĐÓNG: nền trắng, đậm, chừa chỗ cho nút + */
    .mhbar .mmenu-scroll li.mdrawer-parent > a {
        padding-right: 50px;
        font-weight: 700;
    }

    /* Mục cha khi MỞ (.mopen): nền nâu #BB6903, chữ trắng in hoa, nút thành − */
    .mhbar .mmenu-scroll li.mdrawer-parent.mopen > a {
        background: #BB6903 !important;
        color: #fff !important;
        text-transform: uppercase;
        border-bottom: 1px solid #a85e03 !important;
    }

    /* THU GỌN submenu mặc định - CSS !important để thắng mọi xử lý của metisMenu */
    .mhbar .mmenu-scroll li.mdrawer-parent > ul {
        display: none !important;
    }

    .mhbar .mmenu-scroll li.mdrawer-parent.mopen > ul {
        display: block !important;
    }

    /* Mục con (mọi cấp lồng nhau): nền trắng, thụt lề */
    .mhbar .mmenu-scroll .mdrawer-parent ul a {
        background: #fff !important;
        color: #333 !important;
        font-weight: 400 !important;
        text-transform: none !important;
        font-size: 13.5px;
        padding-left: 26px !important;
    }

    .mhbar .mmenu-scroll .mdrawer-parent ul ul a {
        padding-left: 40px !important;
    }

    .mhbar .mmenu-scroll .mdrawer-parent ul ul ul a {
        padding-left: 54px !important;
    }

    /* Mục con mà cũng là cha thì chừa chỗ cho nút + và đậm hơn chút */
    .mhbar .mmenu-scroll .mdrawer-parent ul li.mdrawer-parent > a {
        padding-right: 50px !important;
        font-weight: 600 !important;
    }

    .mhbar .mmenu-scroll .mdrawer-parent ul a:hover,
    .mhbar .mmenu-scroll .mdrawer-parent ul a:focus {
        background: #f5f0e8 !important;
        color: #BB6903 !important;
    }

    /* Ẩn caret/arrow mặc định (ta tự thêm nút .mexpand) */
    .mhbar .mmenu-scroll a > .fa-angle-down,
    .mhbar .mmenu-scroll a > .fa-angle-right,
    .mhbar .mmenu-scroll .arrow.expand,
    .mhbar .mmenu-scroll .fa.arrow {
        display: none !important;
    }

    /* ===== Nút +/- : JS chèn BÊN TRONG thẻ <a> nên luôn thẳng hàng với dòng ===== */
    .mhbar .mmenu-scroll a > .mexpand {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 3;
        color: #BB6903;
        font-style: normal;
        font-weight: 700;
        -webkit-tap-highlight-color: transparent;
    }

    .mhbar .mmenu-scroll a > .mexpand:before {
        content: "+";
        font-size: 18px;
        line-height: 1;
    }

    .mhbar .mmenu-scroll a > .mexpand:active {
        background: rgba(0, 0, 0, .06);
    }

    /* Khi mục cha đang MỞ: nút thành − và màu trắng (trên nền nâu) */
    .mhbar .mmenu-scroll li.mopen > a > .mexpand {
        color: #fff;
    }

    .mhbar .mmenu-scroll li.mopen > a > .mexpand:before {
        content: "\2212"; /* − */
    }

}

/* =====================================================
   ĐỒNG BỘ CARD TRANG DANH MỤC / TÌM KIẾM (.product-grid)
   cho giống card trang chủ (.product-card)
   ===================================================== */

.viewgrid.row,
.shops-viewgrid {
    display: flex;
    flex-wrap: wrap;
}
.viewgrid.row > [class*="col-"],
.shops-viewgrid > [class*="col-"] {
    display: flex;
    margin-bottom: 16px;
}

.product-grid {
    position: relative;
    width: 100%;
    background: #fff;
    border: 1px solid #eee4d6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .06);
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0;
}

.product-grid .image {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    padding-top: 75%;
    margin: 0;
    overflow: hidden;
    line-height: 0;
}
.product-grid .image a {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
}
.product-grid .image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-grid .info_pro {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.product-grid h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 12px 12px 6px;
    min-height: 38px;
    /* Hủy giới hạn 2 dòng + chiều cao cố định 48px từ themes.css để hiện đủ tiêu đề */
    height: auto !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}
.product-grid h3 a {
    color: #2b2b2b;
    text-decoration: none;
}

.product-grid .price {
    margin: 0 12px 10px;
    font-size: 13.5px;
    color: #666;
    min-height: 20px;
}
.product-grid .price .money {
    color: #d8262c;
    font-weight: 700;
}
.product-grid .price .discounts_money {
    color: #b9a98f;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}
.product-grid .label.label-default {
    display: none;
}

/* Ẩn nút Đặt hàng/Yêu thích mặc định trên lưới để giống card trang chủ
   (vẫn mua/đặt được ở trang chi tiết) */
.product-grid > .clearfix {
    display: none;
}

/* Nút "Xem ngay" chính - full width nâu */
.product-grid .pg-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: auto 12px 12px;
    background: #5c3508;
    color: #fff !important;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: .25s;
}
.product-grid .pg-view:hover {
    background: #7a4a12;
}
.product-grid .pg-view .fa {
    font-size: 15px;
}

@media (max-width: 767px) {
    .viewgrid.row,
    .shops-viewgrid {
        margin-left: -5px;
        margin-right: -5px;
    }
    .viewgrid.row > [class*="col-"],
    .shops-viewgrid > [class*="col-"] {
        padding-left: 5px;
        padding-right: 5px;
        margin-bottom: 10px;
    }
    .product-grid h3 {
        font-size: 13px;
        margin: 10px 8px 6px;
        min-height: 34px;
    }
    .product-grid .price {
        font-size: 12.5px;
        margin: 0 8px 8px;
    }
    .product-grid .pg-view {
        font-size: 13px;
        padding: 9px 10px;
        margin: auto 8px 10px;
        border-radius: 9px;
    }
}

/* =====================================================
   MENU "DANH MỤC SẢN PHẨM" CỘT TRÁI (desktop)
   Gọn hơn + màu hover đẹp (thay vì xám nhạt bẩn)
   Chỉ áp dụng cho block cột trái (.block-box), không đụng menu mobile
   ===================================================== */

.block-box .metismenu .sidebar {
    border: none !important;
    background: #fff !important;
}

.block-box .metismenu .sidebar-nav ul a {
    padding: 5px 11px !important;
    font-size: 12.5px !important;
    line-height: 1.33 !important;
    transition: background-color .2s, color .2s;
}

/* --- Mục cấp 1 (nền sáng) --- */
.block-box .metismenu .sidebar-nav > ul > li > a {
    color: #4a2c07 !important;
    font-weight: 600;
    background: #faf6f0 !important;
    border-bottom: 1px solid #ece0cf !important;
    padding-right: 36px !important;
}

.block-box .metismenu .sidebar-nav > ul > li > a:hover,
.block-box .metismenu .sidebar-nav > ul > li > a:focus {
    background: #f2e3cd !important;
    color: #9a5502 !important;
}

/* --- Mục con (nền nâu) --- */
.block-box .metismenu .sidebar-nav ul ul a {
    background-color: #BB6903 !important;
    color: #fff !important;
    padding: 4px 11px !important;
    font-size: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .22) !important;
}

/* Hover: nâu đậm hơn + chữ trắng (thay cho rgba(0,0,0,.07) xám nhạt) */
.block-box .metismenu .sidebar-nav ul ul a:hover,
.block-box .metismenu .sidebar-nav ul ul a:focus,
.block-box .metismenu .sidebar-nav ul ul a:active {
    background-color: #9a5502 !important;
    color: #fff !important;
}

/* --- Nút +/- cho vừa hàng đã thu gọn --- */
.block-box .metismenu .arrow {
    width: 32px !important;
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #7a4a12 !important;
}

.block-box .metismenu .arrow:hover {
    background: rgba(0, 0, 0, .08) !important;
}

