/* KEHETO | Sidebar danh mục sản phẩm – CSS tách từ V1 */
.khcs,
.khcs * {
    box-sizing: border-box
}

.khcs {
    --khcs-green: #198949;
    --khcs-deep: #14665D;
    --khcs-line: #deebe3;
    --khcs-mint: #f4fbf6;
    max-width: 340px;
    width: 100%;
    background: var(--color-white);
    border: 1px solid #dce8df;
    border-radius: 15px;
    box-shadow: 0 10px 28px rgba(23, 73, 54, .045);
    overflow: hidden;
    color: #243a36;
}

.khcs-header {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #e1eae5;
    background: var(--color-white);
}

.khcs-header-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, #37c65b, #179b44);
    box-shadow: 0 5px 12px rgba(33, 158, 67, .16);
    color: var(--color-white);
}

.khcs-header-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round
}

.khcs-header-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 750 !important;
    color: #263b36 !important;
    letter-spacing: -.025em;
    text-transform: uppercase;
}

.khcs-scroll {
    padding: 9px 8px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #b7cec0 transparent;
    scrollbar-width: thin;
}

.khcs-scroll::-webkit-scrollbar {
    width: 5px;
}

.khcs-scroll::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #bfd4c8;
}

.khcs-menu,
.khcs-menu li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.khcs-root>.khcs-item+.khcs-item {
    margin-top: 2px !important;
}

.khcs-row {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 5px 5px 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.khcs-root>.khcs-item>.khcs-row {
    min-height: 45px;
}

.khcs-root>.khcs-item.khcs-current>.khcs-row,
.khcs-root>.khcs-item.khcs-expanded>.khcs-row {
    background: linear-gradient(100deg, #f0fbf4, #fafffc);
    border-color: #cde9d7;
    box-shadow: inset 3px 0 0 #2cbe59, 0 3px 8px rgba(32, 121, 64, .035);
}

.khcs-root>.khcs-item>.khcs-row:hover {
    background: #f5fbf7;
}

.khcs-dot {
    display: block;
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c8d7cf;
}

.khcs-current>.khcs-row>.khcs-dot,
.khcs-expanded>.khcs-row>.khcs-dot {
    background: #2cbf5a;
}

.khcs-name {
    display: block;
    min-width: 0;
    flex: 1;
    color: #3f5550 !important;
    text-decoration: none !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    font-weight: 650;
    word-break: normal;
    overflow-wrap: anywhere;
}

.khcs-root>.khcs-item>.khcs-row>.khcs-name {
    text-transform: uppercase;
}

.khcs-current>.khcs-row>.khcs-name,
.khcs-expanded>.khcs-row>.khcs-name {
    color: #16854b !important;
}

.khcs-name:hover {
    color: #14665D !important;
}

.khcs-chevron {
    flex: 0 0 25px !important;
    width: 25px !important;
    height: 29px !important;
    min-height: 29px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d8e6dd !important;
    border-radius: 8px !important;
    display: grid !important;
    place-items: center !important;
    background: var(--color-white) !important;
    color: #829a8d !important;
    box-shadow: none !important;
    line-height: 1 !important;
    transform: none !important;
}

.khcs-chevron svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}

button.khcs-toggle {
    cursor: pointer !important;
    -webkit-appearance: none !important;
    appearance: none !important
}

button.khcs-toggle:hover,
button.khcs-toggle:focus-visible {
    border-color: #9bd0ac !important;
    background: #f3fbf6 !important;
    color: #16854b !important;
    outline-offset: 2px
}

.khcs-expanded>.khcs-row>.khcs-toggle svg {
    transform: rotate(90deg)
}

.khcs-submenu {
    margin: 1px 0 6px 17px !important;
    padding: 2px 0 3px 14px !important;
    border-left: 1px solid #dbe9e0
}

.khcs-submenu .khcs-row {
    min-height: 35px;
    border-radius: 7px;
    padding-left: 7px
}

.khcs-submenu .khcs-name {
    font-size: 12px !important;
    text-transform: none !important;
    color: #64736d !important;
    font-weight: 450 !important
}

.khcs-submenu .khcs-chevron {
    border: 0 !important;
    width: 21px !important;
    height: 23px !important;
    min-height: 23px !important;
    color: #839b8b !important
}

.khcs-submenu .khcs-row:hover {
    background: #f6faf7
}

.khcs-submenu .khcs-current>.khcs-row {
    background: #edf8f0;
    border-color: #d7ebdd
}

.khcs-submenu .khcs-current>.khcs-row>.khcs-name {
    color: #11864b !important;
    font-weight: 650 !important
}

.khcs-submenu .khcs-submenu {
    margin-left: 10px !important
}

.khcs-panel[hidden] {
    display: none !important
}

.khcs-empty {
    padding: 16px;
    color: #65776c;
    font-size: 14px
}

@media(max-width:849px) {
    .khcs {
        max-width: none
    }

    .khcs-header-title {
        font-size: 13.5px !important
    }

    .khcs-name {
        font-size: 12.5px !important
    }
}

@media(prefers-reduced-motion:reduce) {
    .khcs * {
        transition: none !important
    }
}

/* KEHETO | Thay vùng page-title-inner bằng danh mục riêng trên mobile */
.khcs-mobile-category-source {
    display: none !important;
}

@media (max-width: 849px) {
    body.tax-product_cat .shop-page-title.category-page-title>.page-title-inner {
        display: none !important;
    }

    body.tax-product_cat .shop-page-title.category-page-title>.khcs-mobile-category-slot {
        display: block !important;
        width: 100%;
        max-width: 100%;
        padding: 12px 15px;
        margin: 0 auto;
    }

    body.tax-product_cat .shop-page-title.category-page-title .khcs-mobile-category-slot .khcs {
        max-width: none;
        width: 100%;
        margin: 0;
    }
}


/* KEHETO | Mobile: giới hạn chiều cao danh sách và cho phép cuộn dọc */
@media (max-width: 849px) {
    body.tax-product_cat .khcs-mobile-category-slot .khcs-scroll {
        max-height: 230px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
}