/* =========================================================
   MOBILE — chỉ chạy trên điện thoại (<= 767px)
   File này nạp CUỐI, ghi đè header.css...
========================================================= */

/* Mặc định (máy tính): ẩn các phần chỉ dành cho mobile */
.inh-mobile-actions,
.inh-bn {
    display: none;
}

/* Máy tính: giữ nguyên giao diện cũ */
.inh-account-who {
    display: contents;
}

.inh-orders-stats,
.inh-orders-search {
    display: none;
}

.inh-account-name,
.inh-lbl-short,
.inh-badge-mobile {
    display: none;
}

@media (max-width: 767px) {

    html {
        scroll-behavior: smooth;
    }

    /* chừa chỗ cho thanh menu dưới cùng */
    body {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    /* -----------------------------------------------------
       1. ẨN THANH KHUYẾN MÃI TRÊN CÙNG
       (muốn giữ lại thì xoá nguyên khối này)
    ----------------------------------------------------- */
    .inh-top-promo {
        display: none !important;
    }

    /* -----------------------------------------------------
       2. THANH ĐEN (utility): thu về 0px, KHÔNG display:none
          vì popup đăng nhập/báo giá nằm bên trong nó
    ----------------------------------------------------- */
    .inh-utility,
    .inh-utility .inh-container {
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .inh-utility-left,
    .inh-utility-right>a,
    .inh-utility-right>.inh-account,
    .inh-utility-right>.inh-cart {
        display: none !important;
    }

    /* -----------------------------------------------------
       3. HEADER CHÍNH: nền xanh, logo + icon tài khoản, ô tìm kiếm
    ----------------------------------------------------- */
    .inh-main-header {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 14px 0 16px !important;
        background: #08265B !important;
    }

    .inh-main-header .inh-container {
        height: auto !important;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px !important;
    }

    .inh-logo {
        order: 1;
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0;
    }

    .inh-logo img {
        width: auto;
        max-height: 38px;
        /* Nếu logo của bạn màu tối, bỏ dấu comment dòng dưới để đổi thành logo trắng:
        filter: brightness(0) invert(1); */
    }

    .inh-logo-text {
        font-size: 24px;
    }

    .inh-mobile-actions {
        order: 2;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    .inh-m-account {
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.16);
        color: #ffffff;
        cursor: pointer;
    }

    .inh-search {
        order: 3;
        flex: 0 0 100% !important;
        width: 100%;
    }

    .inh-search form {
        height: 48px;
        padding: 0 12px 0 6px;
        border: 0;
        box-shadow: none;
    }

    /* 16px để iPhone không tự phóng to khi bấm vào ô tìm kiếm */
    .inh-search input[type="search"] {
        font-size: 16px;
    }

    .inh-trust {
        display: none !important;
    }

    /* thanh menu ngang (Thiết kế cùng penci...) ẩn trên mobile */
    .inh-primary-nav {
        display: none !important;
    }

    /* -----------------------------------------------------
       4. THANH MENU 5 TAB Ở ĐÁY MÀN HÌNH
    ----------------------------------------------------- */
    .inh-bn {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 10020;
        /* cao hơn chatbot (10010), thấp hơn popup (99999) */

        height: 64px;
        padding: 0 6px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        background: #ffffff;
        border-radius: 999px;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
    }

    .inh-bn-item {
        flex: 1;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;

        color: #444444;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }

    .inh-bn-icon {
        position: relative;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        transition: background 0.2s ease, width 0.2s ease;
    }

    .inh-bn-item.is-active .inh-bn-icon {
        width: 62px;
        background: #EDF3FA;
        color: #08265B;
    }

    /* số lượng trên giỏ hàng (class inh-cart-count được WooCommerce cập nhật tự động) */
    .inh-bn .inh-bn-icon .inh-cart-count {
        top: -2px !important;
        right: -2px !important;
    }

    /* -----------------------------------------------------
       5. CÁC NÚT NỔI: đẩy lên trên thanh menu
    ----------------------------------------------------- */
    .inh-cb {
        right: 14px !important;
        bottom: 160px !important;
    }

    #generate-back-to-top,
    .inh-faq-top {
        right: 16px !important;
        bottom: 96px !important;
    }

    .inh-fb {
        left: 12px !important;
        bottom: 96px !important;
    }

    /* =====================================================
       TRANG TÀI KHOẢN (/thanhvien/): giao diện kiểu app
    ===================================================== */
    .inh-account-page {
        padding: 0 0 24px;
        background: #f1f4f2;
    }

       .inh-account-wrapper {
        padding: 0;
        gap: 16px;
        align-items: stretch;
    }

    /* Khối xanh phía trên: nền xanh kéo xuống tới giữa thẻ menu */
    .inh-account-sidebar {
        position: relative;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "card logout"
            "stats stats"
            "menu menu";
        gap: 14px 12px;
        padding: 16px 16px 0;
    }

    .inh-account-sidebar::before {
        content: "";
        position: absolute;
        inset: 0 0 70px 0;
        /* 70px = phần thẻ menu nằm đè lên nền xanh, chỉnh nếu cần */
        background: #08265B;
    }

    .inh-account-sidebar>* {
        position: relative;
    }

    /* Avatar + "Tài khoản" + MEMBER */
    .inh-account-card {
        grid-area: card;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .inh-account-avatar {
        width: 52px;
        height: 52px;
        margin: 0;
        border-radius: 50%;
    }

    .inh-account-avatar-img {
        border-radius: 50%;
    }

    .inh-account-who {
        display: block;
    }

    .inh-account-name {
        display: block;
        margin-bottom: 6px;
        color: #fff;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
    }

    .inh-account-badge {
        display: inline-block;
        padding: 2px 12px;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, .7);
        color: #fff;
        font-size: 11px;
    }

    /* Đăng xuất: lên góc phải trên, icon trên chữ dưới */
    .inh-account-logout {
        grid-area: logout;
        align-self: center;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
    }

    .inh-account-logout-btn {
        min-height: 0;
        padding: 0;
        flex-direction: column;
        gap: 4px;
        background: transparent;
        border: 0;
        color: #fff;
        font-size: 12px;
        font-weight: 500;
    }

    .inh-account-logout-icon {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }

    .inh-account-logout-icon svg {
        width: 22px;
        height: 22px;
    }

    /* 2 ô thống kê trong suốt trên nền xanh */
    .inh-account-stats {
        grid-area: stats;
        margin: 0;
        gap: 12px;
        border: 0;
        overflow: visible;
    }

    .inh-account-stat {
        padding: 12px 14px;
        text-align: left;
        background: rgba(255, 255, 255, .18);
        border-radius: 10px;
    }

    .inh-account-stat+.inh-account-stat {
        border-left: 0;
    }

    .inh-account-stat-icon {
        display: none;
    }

    .inh-account-stat-value {
        color: #fff;
    }

    .inh-account-stat-label {
        color: rgba(255, 255, 255, .85);
    }

    /* Menu: lưới icon 4 cột trong thẻ trắng nổi */
    .inh-account-menu {
        grid-area: menu;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px 4px;
        margin: 0;
        padding: 14px 8px;
        border: 0;
        border-radius: 14px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
        overflow: visible;
    }

    .inh-account-menu-item {
        position: relative;
        flex-direction: column;
        gap: 6px;
        padding: 0;
        border: 0;
        background: transparent;
        font-size: 12px;
        line-height: 1.25;
        text-align: center;
    }

    .inh-account-menu-item:hover {
        background: transparent;
    }

    .inh-account-menu-icon {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        border-radius: 12px;
        background: #f1f3f2;
        color: #555;
    }

    .inh-account-menu-icon svg {
        width: 20px;
        height: 20px;
    }

    .inh-account-menu-item.active {
        background: transparent;
        color: #08265B;
        font-weight: 600;
    }

    .inh-account-menu-item.active .inh-account-menu-icon {
        background: #08265B;
        color: #fff;
    }

    /* Tên ngắn + huy hiệu số ở góc icon */
    .inh-lbl-full,
    .inh-badge-desktop {
        display: none;
    }

    .inh-lbl-short,
    .inh-badge-mobile {
        display: inline;
    }

    .inh-account-menu-item .inh-pending-badge {
        position: absolute;
        top: -4px;
        left: calc(50% + 6px);
        margin: 0;
    }

    /* Phần nội dung bên dưới: có lề hai bên */
    .inh-account-content {
        width: auto;
        margin: 0 16px;
        padding: 18px 14px;
    }

    /* Trang đơn hàng: bỏ khung trắng lớn, các thẻ trắng nằm trên nền xám */
        .inh-orders-content {
        background: transparent;
        border: 0;
        padding: 0;
        margin: 0 16px;
        width: auto;
        min-width: 0;
        max-width: 100%;
    }

    .inh-orders-title {
        font-size: 24px;
        color: #08265B;
    }

    /* 3 ô thống kê */
    .inh-orders-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 0 0 20px;
    }

    .inh-os-card {
        padding: 12px 14px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    }

    .inh-os-label {
        font-size: 11px;
        font-weight: 500;
        letter-spacing: .03em;
        text-transform: uppercase;
        color: #5a6560;
    }

    .inh-os-value {
        margin-top: 6px;
        font-size: 20px;
        font-weight: 700;
        color: #1a1a1a;
    }

    .inh-os-card--due .inh-os-value {
        color: #c2620a;
    }

    /* Thẻ trạng thái: chữ thường, gạch chân thẻ đang chọn, vuốt ngang */
    .inh-orders-tabs {
        flex-wrap: nowrap;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -16px;
        padding: 0 16px;
    }

    .inh-orders-tabs::-webkit-scrollbar {
        display: none;
    }

    .inh-orders-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 12px;
        border-radius: 0;
        border-bottom: 2px solid transparent;
        background: transparent;
        color: #444;
        font-size: 14px;
        font-weight: 500;
    }

    .inh-orders-tab:hover {
        background: transparent;
        color: #444;
    }

    .inh-orders-tab.active,
    .inh-orders-tab.active:hover {
        background: transparent;
        border-bottom-color: #08265B;
        color: #08265B;
        font-weight: 700;
    }

    /* Ô tìm kiếm */
    .inh-orders-search {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 16px 0 0;
        padding: 0 14px;
        background: #fff;
        border: 1px solid #e1e6e3;
        border-radius: 12px;
    }

    .inh-orders-search svg {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        fill: none;
        stroke: #6b7570;
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    .inh-orders-search-input {
        flex: 1;
        min-width: 0;
        height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        outline: 0;
        background: transparent;
        box-shadow: none;
        font-size: 15px;
        -webkit-appearance: none;
        appearance: none;
    }
}

/* Thông báo "đơn hàng chờ thanh toán": nổi lên trên thanh menu dưới */
.inh-pending-notice {
    left: 12px !important;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: calc(100vw - 24px) !important;
}

/* =========================================================
   PANEL DANH MỤC SẢN PHẨM (mobile)
========================================================= */

.inh-cs {
    display: none;
}

@media (max-width: 767px) {

    .inh-cs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        /* JS sẽ đặt lại top = đáy header */
        z-index: 9980;
        /* thấp hơn thanh menu dưới (9990) */

        display: none;
        flex-direction: column;
        background: #ffffff;
        border-radius: 22px 22px 0 0;
        overflow: hidden;
    }

    .inh-cs.is-open {
        display: flex;
    }

    body.inh-cat-open {
        overflow: hidden;
    }

    /* ẩn các nút nổi khi panel đang mở */
    body.inh-cat-open .inh-cb,
    body.inh-cat-open #generate-back-to-top,
    body.inh-cat-open .inh-faq-top,
    body.inh-cat-open .inh-fb {
        display: none !important;
    }

    /* icon Danh mục sáng lên, tab khác tắt */
    body.inh-cat-open .inh-bn-item.is-active .inh-bn-icon {
        width: 48px;
        background: transparent;
        color: inherit;
    }

    body.inh-cat-open .inh-bn-cat .inh-bn-icon {
        width: 62px;
        background: #EDF3FA;
        color: #08265B;
    }

    /* ---------- Tiêu đề ---------- */
    .inh-cs-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid #eef0ef;
    }

    .inh-cs-title {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #222222;
    }

    .inh-cs-title span {
        color: #08265B;
    }

    .inh-cs-close {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        color: #333333;
        background: #F0F4F9;
        border: 0;
        border-radius: 50%;
        cursor: pointer;
    }

    /* ---------- Thân: 2 cột ---------- */
    .inh-cs-body {
        flex: 1;
        display: flex;
        min-height: 0;
    }

    .inh-cs-tabs {
        flex: 0 0 104px;
        margin: 0;
        padding: 0 0 110px;
        list-style: none;
        overflow-y: auto;
        background: #F4F7FB;
    }

    .inh-cs-tabs li {
        margin: 0;
    }

    .inh-cs-tab {
        position: relative;
        display: block;
        width: 100%;
        padding: 18px 8px;
        font-family: inherit;
        font-size: 14px;
        line-height: 1.3;
        text-align: center;
        color: #333333;
        background: transparent;
        border: 0;
        cursor: pointer;
    }

    .inh-cs-tab.is-active {
        font-weight: 600;
        color: #08265B;
        background: #ffffff;
    }

    .inh-cs-tab.is-active::before {
        content: "";
        position: absolute;
        left: 0;
        top: 12px;
        bottom: 12px;
        width: 3px;
        background: #08265B;
        border-radius: 0 3px 3px 0;
    }

    .inh-cs-panes {
        flex: 1;
        min-width: 0;
        padding: 16px 14px 110px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .inh-cs-pane {
        display: none;
    }

    .inh-cs-pane.is-active {
        display: block;
    }

    /* ---------- Thẻ nổi bật ---------- */
    .inh-cs-feature {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px;
        color: #222222;
        text-decoration: none;
        background: #F4F7FB;
        border-radius: 14px;
    }

    .inh-cs-feature img {
        flex: 0 0 64px;
        width: 64px;
        height: 64px;
        object-fit: cover;
        background: #e6e9e8;
        border-radius: 10px;
    }

    .inh-cs-feature strong {
        display: block;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.3;
    }

    .inh-cs-feature small {
        display: block;
        margin-top: 2px;
        font-size: 13px;
        color: #465672;
    }

    /* ---------- Nhóm cấp 2 + chip cấp 3 ---------- */
    .inh-cs-group {
        margin-top: 20px;
    }

    .inh-cs-group-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 10px;
    }

    .inh-cs-group-title {
        font-size: 15px;
        font-weight: 700;
        line-height: 1.3;
        color: #222222;
    }

    .inh-cs-more {
        flex: none;
        font-size: 13px;
        color: #08265B;
        text-decoration: none;
    }

    .inh-cs-chips {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .inh-cs-chip {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 8px 12px;
        font-size: 13.5px;
        line-height: 1.3;
        color: #333333;
        text-decoration: none;
        background: #F4F7FB;
        border-radius: 12px;
    }

    .inh-cs-chip:active {
        background: #EDF3FA;
    }
}

@media (max-width: 767px) {

    .inh-cs-pane .inh-cs-group:first-child {
        margin-top: 0;
    }
}