/* ══════════════════════════════════════════════════
   TAKI Category Menu v2.2
   L1 list dọc (children của 1 parent)
   Hover item có con → L2 flyout sang phải
   is-current L2 → L2-mode: L2 thay vị trí L1, L1 ẩn
══════════════════════════════════════════════════ */

.taki-cat-menu *, .taki-cat-menu *::before, .taki-cat-menu *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

/* Wrapper */
.taki-cat-menu {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    width: 100%;
}

/* ══ Cột L1 ══ */
.tcm-l1-col {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
}

/* ── L1 item ── */
.tcm-l1-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
    font-size: 14px;
    transition: background .13s, color .13s;
    white-space: nowrap;
    position: relative;
    border: 1px solid #E9E9E9;
    border-radius: 4px;
    margin-bottom: 4px;
}

.tcm-l1-item:last-child { margin-bottom: 0; }

.tcm-l1-item:hover,
.tcm-l1-item.is-active {
    background: #1d4ed8;
    color: #ffffff !important;
    text-decoration: none;
}

/* is-current: trang đang xem = item này (hoặc parent của trang đang xem) */
/* Chỉ highlight màu, KHÔNG kéo theo mở L2 */
.tcm-l1-item.is-current {
    background: #1d4ed8;
    color: #ffffff !important;
    border-color: #1d4ed8;
}

/* Icon */
.tcm-icon {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; flex-shrink: 0;
}
.tcm-icon img {
    width: 24px; height: 24px; object-fit: contain; display: block;
    transition: filter .13s;
}
.tcm-l1-item:hover .tcm-icon img,
.tcm-l1-item.is-active .tcm-icon img,
.tcm-l1-item.is-current .tcm-icon img {
    filter: brightness(0) invert(1);
}
.tcm-icon-placeholder {
    display: block; width: 24px; height: 24px;
    background: #e2e8f0; border-radius: 5px;
    transition: background .13s;
}
.tcm-l1-item:hover .tcm-icon-placeholder,
.tcm-l1-item.is-active .tcm-icon-placeholder,
.tcm-l1-item.is-current .tcm-icon-placeholder {
    background: rgba(255, 255, 255, .3);
}

/* Label + Arrow */
.tcm-label { flex: 1; }

.tcm-arrow {
    display: flex; align-items: center; flex-shrink: 0;
    opacity: .35; color: inherit; transition: opacity .13s;
}
.tcm-l1-item:hover .tcm-arrow,
.tcm-l1-item.is-active .tcm-arrow,
.tcm-l1-item.is-current .tcm-arrow { opacity: 1; }

/* ══ Cột L2 flyout (chế độ hover bình thường) ══ */
.tcm-l2-col {
    position: absolute;
    top: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .10);
    z-index: 200;
    overflow: hidden;
}

.tcm-l2-col[hidden] { display: none; }

/* L2 groups */
.tcm-l2-group { display: none; flex-direction: column; }
.tcm-l2-group.is-active { display: flex; }

/* L2 items – flyout style (chế độ hover) */
.tcm-l2-item {
    display: block;
    padding: 11px 16px;
    text-decoration: none;
    font-size: 13.5px;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    transition: background .10s, color .10s;
    white-space: nowrap;
}
.tcm-l2-group .tcm-l2-item:last-child { border-bottom: none; }
.tcm-l2-item:hover { background: #eff6ff; color: #1d4ed8; text-decoration: none; }

/* L2 item đang là trang hiện tại (trong flyout) */
.tcm-l2-item.is-current {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════
   L2-MODE: đang ở trang L2
   → L1 col ẩn, L2 group chiếm vị trí L1
══════════════════════════════════════════════════ */

/* Ẩn L1 col */
.taki-cat-menu.tcm-l2-mode .tcm-l1-col {
    display: none;
}

/* L2 col reset về cột bình thường (không còn là flyout) */
.taki-cat-menu.tcm-l2-mode .tcm-l2-col {
    position: relative;
    left: 0 !important;
    top: 0;
    width: 100%;
    min-width: unset;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    z-index: auto;
}

/* L2 group hiển thị theo cột dọc, gap giống L1 */
.taki-cat-menu.tcm-l2-mode .tcm-l2-group.is-active {
    display: flex;
    flex-direction: column;
}

/* L2 items trong L2-mode → giống card L1 */
.taki-cat-menu.tcm-l2-mode .tcm-l2-item {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    border: 1px solid #E9E9E9;
    border-bottom: 1px solid #E9E9E9;
    border-radius: 4px;
    margin-bottom: 4px;
    background: #ffffff;
    white-space: nowrap;
    transition: background .13s, color .13s, border-color .13s;
}
.taki-cat-menu.tcm-l2-mode .tcm-l2-group .tcm-l2-item:last-child {
    border-bottom: 1px solid #E9E9E9;
    margin-bottom: 0;
}
.taki-cat-menu.tcm-l2-mode .tcm-l2-item:hover {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    text-decoration: none;
}
.taki-cat-menu.tcm-l2-mode .tcm-l2-item.is-current {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    font-weight: 500;
}

/* ══ Responsive mobile ══ */
@media (max-width: 480px) {
    .taki-cat-menu { display: flex; flex-direction: column; }
    .tcm-l1-col { width: 100%; }
    .tcm-l2-col {
        position: static;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e2e8f0;
        margin-top: -1px;
    }
    .tcm-l2-col[hidden] { display: none; }

    /* L2-mode mobile */
    .taki-cat-menu.tcm-l2-mode .tcm-l2-col {
        border-top: none;
        margin-top: 0;
    }
}
