/* ===================================================
   DANH MUC MENU – menu-danh-muc.css
   Selector dùng .dcm-wrap thay vì #id động
=================================================== */

/* VARIABLES & RESET */
.dcm-wrap {
    --loaimobile: #155dfc;
    --blue:    #1a4f9d;
    --blue-dk: #163e80;
    --blue-lt: #e8eef8;
    --red:     #d00000;
    --white:   #ffffff;
    --gray:    #f4f6fb;
    --line:    #e0e5ef;
    --text:    #1a2340;
    --muted:   #6b7590;
    --sw:      280px;
    --fw:      420px;
    --th:      52px;
    color: var(--text);
    position: relative;
}
.dcm-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.dcm-wrap ul { list-style: none; }
.dcm-wrap a { text-decoration: none; }

/* ===================================================
   TOPBAR
=================================================== */
.dcm-wrap .dcm-topbar {
    background: var(--blue);
    display: flex;
    align-items: center;
    height: var(--th);
    position: relative;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.dcm-wrap .dcm-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--blue-dk);
    border: none;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 0 20px;
    height: 100%;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
    user-select: none;
}
.dcm-wrap .dcm-toggle-btn:hover,
.dcm-wrap .dcm-toggle-btn.open { background: #0d2856; }

.dcm-wrap .dcm-hbg { display:flex; flex-direction:column; gap:4px; width:18px; flex-shrink:0; }
.dcm-wrap .dcm-hbg span { display:block; height:2px; background:var(--white); border-radius:2px; transition:all .25s; }
.dcm-wrap .dcm-toggle-btn.open .dcm-hbg span:nth-child(1) { transform:translateY(6px) rotate(45deg); }
.dcm-wrap .dcm-toggle-btn.open .dcm-hbg span:nth-child(2) { opacity:0; width:0; }
.dcm-wrap .dcm-toggle-btn.open .dcm-hbg span:nth-child(3) { transform:translateY(-6px) rotate(-45deg); }

.dcm-wrap .dcm-toggle-label { flex:1; text-align:left; }

.dcm-wrap .dcm-toggle-arr {
    flex-shrink: 0;
    transition: transform .3s ease;
    opacity: .85;
}
.dcm-wrap .dcm-toggle-btn.open .dcm-toggle-arr { transform: rotate(180deg); }
.dcm-wrap .dcm-topbar-nav { display: none !important; }

/* ===================================================
   MENU SHELL
=================================================== */
.dcm-wrap .dcm-menu-shell {
    display: none;
    position: absolute;
    top: var(--th);
    left: 0;
    z-index: 999;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
    max-height: 70vh;
    overflow: hidden;
}
.dcm-wrap .dcm-menu-shell.open { display: flex; }

/* Header mobile */
.dcm-wrap .dcm-shell-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--white);
    border-bottom: 2px solid var(--blue);
    position: sticky; top: 0; z-index: 2;
}
.dcm-wrap .dcm-shell-header span {
    color: var(--blue);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .5px;
}
.dcm-wrap .dcm-close-btn {
    background: none; border: none;
    color: var(--text); font-size: 20px;
    cursor: pointer; padding: 2px 6px; line-height: 1;
    transition: color .15s;
}
.dcm-wrap .dcm-close-btn:hover { color: var(--blue); }

/* ===================================================
   CỘT TRÁI – SIDEBAR
=================================================== */
.dcm-wrap .dcm-sidebar {
    width: var(--sw);
    min-width: var(--sw);
    height: 100%;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--white);
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
    scrollbar-color: #c5cde0 transparent;
}
.dcm-wrap .dcm-sidebar::-webkit-scrollbar { width: 5px; }
.dcm-wrap .dcm-sidebar::-webkit-scrollbar-track { background: transparent; }
.dcm-wrap .dcm-sidebar::-webkit-scrollbar-thumb { background: #c5cde0; border-radius: 10px; }
.dcm-wrap .dcm-sidebar::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* L1 */
.dcm-wrap .dcm-l1-item { border-bottom: 1px solid var(--line); }
.dcm-wrap .dcm-l1-item:last-child { border-bottom: none; }

.dcm-wrap .dcm-l1-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px 0 18px;
    cursor: pointer; user-select: none;
    transition: background .15s;
}
.dcm-wrap .dcm-l1-row:hover { background: var(--gray); }
.dcm-wrap .dcm-l1-item.open > .dcm-l1-row { background: var(--white); }

.dcm-wrap .dcm-l1-link {
    display: block; flex: 1; padding: 13px 0;
    color: var(--text); font-size: 16px; font-weight: 400;
    transition: color .15s;
}
.dcm-wrap .dcm-l1-link:hover { color: var(--blue); }
.dcm-wrap .dcm-l1-item.open > .dcm-l1-row .dcm-l1-link { color: var(--blue); font-weight: 700; }

.dcm-wrap .dcm-arr {
    flex-shrink: 0; color: var(--muted);
    transition: transform .25s ease;
    pointer-events: none; display: block;
}
.dcm-wrap .dcm-l1-item.open > .dcm-l1-row .dcm-arr { transform: rotate(180deg); color: var(--blue); }

.dcm-wrap .dcm-arr-btn {
    background: none; border: none; cursor: pointer;
    padding: 8px 4px; display: flex;
    align-items: center; justify-content: center;
    color: var(--muted); border-radius: 4px;
    transition: background .15s;
}
.dcm-wrap .dcm-arr-btn:hover { background: rgba(26,79,157,.08); }

/* L2 */
.dcm-wrap .dcm-l2-list {
    display: none;
    background: var(--white);
    border-top: 1px solid var(--line);
}
.dcm-wrap .dcm-l1-item.open > .dcm-l2-list { display: block; }

.dcm-wrap .dcm-l2-item { border-bottom: 1px solid var(--line); }
.dcm-wrap .dcm-l2-item:last-child { border-bottom: none; }

.dcm-wrap .dcm-l2-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px 0 30px;
    cursor: pointer; user-select: none;
    transition: background .15s;
}
.dcm-wrap .dcm-l2-row:hover { background: var(--gray); }

.dcm-wrap .dcm-l2-item.active > .dcm-l2-row { background: var(--white); }
.dcm-wrap .dcm-l2-item.active > .dcm-l2-row .dcm-l2-link { color: var(--red) !important; font-weight: 700; }
.dcm-wrap .dcm-l2-item.active > .dcm-l2-row .dcm-arr-sm { color: var(--blue) !important; transform: rotate(0); }

.dcm-wrap .dcm-l2-link {
    display: block; flex: 1; padding: 10px 0;
    color: var(--text); font-size: 16px; font-weight: 400;
    
}
.dcm-wrap .dcm-l2-link:hover { color: var(--blue); }
.dcm-wrap .dcm-l2-item.dcm-featured > .dcm-l2-row .dcm-l2-link { color: var(--red); font-weight: 700; }

.dcm-wrap .dcm-arr-sm {
    flex-shrink: 0; color: var(--muted);
    transition: transform .25s ease, color .15s;
    pointer-events: none; display: block;
}
.dcm-wrap .dcm-arr-sm-btn {
    background: none; border: none; cursor: pointer;
    padding: 8px 4px; 
    align-items: center; justify-content: center;
    color: var(--muted); border-radius: 4px;
    transition: background .15s;
}
.dcm-wrap .dcm-arr-sm-btn:hover { background: rgba(26,79,157,.08); }

/* ===================================================
   CỘT PHẢI – FLYOUT L3 (desktop)
=================================================== */
.dcm-wrap .dcm-flyout {
    display: none;
    width: var(--fw);
    height: 100%;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--white);
    padding: 20px 22px;
    border-left: 1px solid var(--line);
    animation: dcmFadeIn .18s ease;
    scrollbar-width: thin;
    scrollbar-color: #c5cde0 transparent;
}
.dcm-wrap .dcm-flyout::-webkit-scrollbar { width: 5px; }
.dcm-wrap .dcm-flyout::-webkit-scrollbar-track { background: transparent; }
.dcm-wrap .dcm-flyout::-webkit-scrollbar-thumb { background: #c5cde0; border-radius: 10px; }
.dcm-wrap .dcm-flyout::-webkit-scrollbar-thumb:hover { background: #a0aec0; }
.dcm-wrap .dcm-flyout.open { display: block; }

@keyframes dcmFadeIn { from { opacity:0; transform:translateX(6px); } to { opacity:1; transform:translateX(0); } }

.dcm-wrap .dcm-flyout-title {
    font-size: 18px; font-weight: 700; color: var(--blue);
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--line);
}
.dcm-wrap .dcm-flyout-grid { display: flex; flex-wrap: wrap; gap: 28px; }
.dcm-wrap .dcm-flyout-col { flex: 1; min-width: 140px; }

.dcm-wrap .dcm-flyout-group-label {
    font-size: 16px; font-weight: 700; color: var(--blue);
    letter-spacing: .5px; text-transform: uppercase;
    padding-bottom: 0;
    border-left: 3px solid var(--blue);
    padding-left: 8px;
        margin-bottom: 10px;
}
.dcm-wrap .dcm-flyout-col:nth-of-type(2) .dcm-flyout-group-label{
    border-color: var(--red);
}
.dcm-wrap .dcm-flyout-links { list-style: none; }
.dcm-wrap .dcm-flyout-links li { margin-bottom: 7px; }
.dcm-wrap .dcm-flyout-links a {
    color: var(--muted); font-size: 16px;
    transition: color .15s, padding-left .15s;
    display: block;
}
.dcm-wrap .dcm-flyout-links a:hover { color: var(--blue); padding-left: 4px; }
.dcm-l1-list a{
    transition: color .15s, padding-left .15s;
}
.dcm-l1-list a:hover{
    color: var(--blue); padding-left: 4px;
}
/* ===================================================
   L3 ACCORDION – ẩn trên desktop
=================================================== */
.dcm-wrap .dcm-l3-accordion { display: none; }

/* ===================================================
   MOBILE ≤ 768px
=================================================== */
@media (max-width: 768px) {
    .dcm-wrap .dcm-topbar { display: none !important; }

    .dcm-wrap .dcm-menu-shell {
        position: fixed;
        top: 49; left: -320px;
        width: 310px; height: 100%;
        max-height: 100%;
        overflow: hidden;
        flex-direction: column;
        border: none;
        border-top: none;
        box-shadow: 4px 0 24px rgba(0,0,0,.25);
        transition: left .3s cubic-bezier(.4,0,.2,1);
        display: flex !important;
    }
    .dcm-wrap .dcm-menu-shell.open { left: 0; }

    .dcm-wrap .dcm-shell-header { display: flex; flex-shrink: 0; }

    .dcm-wrap .dcm-sidebar {
        width: 100%; min-width: unset;
        max-height: unset; height: 100%;
        overflow-y: auto; overflow-x: hidden;
        border-right: none;
        scrollbar-width: thin;
        scrollbar-color: #c5cde0 transparent;
    }
    .dcm-wrap .dcm-sidebar::-webkit-scrollbar { width: 4px; }
    .dcm-wrap .dcm-sidebar::-webkit-scrollbar-thumb { background: #c5cde0; border-radius: 10px; }

    .dcm-wrap .dcm-flyout { display: none !important; }
    .dcm-wrap .dcm-arr-sm-btn { display: flex !important; }

    .dcm-wrap .dcm-l2-item.active > .dcm-l2-row { background: var(--white) !important; }
    .dcm-wrap .dcm-l2-item.active > .dcm-l2-row .dcm-l2-link { color: var(--red) !important; font-weight: 700; }
    .dcm-wrap .dcm-l2-item.active > .dcm-l2-row .dcm-arr-sm { color: var(--red) !important; transform: rotate(90deg); }
    .dcm-wrap .dcm-l2-item.active > .dcm-l2-row .dcm-arr-sm-btn { color: var(--red) !important; }

    .dcm-wrap .dcm-l3-accordion { display: none; padding: 10px 14px 12px 22px; background: var(--gray); border-top: 1px solid var(--line); }
    .dcm-wrap .dcm-l2-item.active > .dcm-l3-accordion { display: block; }

    .dcm-wrap .dcm-l3-grid { display: flex; flex-wrap: wrap; gap: 12px; }
    .dcm-wrap .dcm-l3-col { flex: 1; min-width: 100%; }
    .dcm-wrap .dcm-l3-col:nth-of-type(2) a{
        color: var(--loaimobile);
    }
    .dcm-wrap .dcm-l3-label {
        font-size: 13px; font-weight: 700; color: var(--muted);
        letter-spacing: .8px; text-transform: uppercase;
        margin-bottom: 6px; padding-bottom: 3px;
        border-bottom: none;
    }
    .dcm-wrap .dcm-l3-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .dcm-wrap .dcm-l3-list li { margin: 0; }
    .dcm-wrap .dcm-l3-list a {
        display: inline-block; background: var(--white);
        border: 1px solid var(--line); border-radius: 20px;
        padding: 4px 12px; font-size: 13px; color: var(--text);
        transition: all .15s;
    }
    .dcm-wrap .dcm-l3-list a:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }
}