:root {
    --khofb-ink: #102a43;
    --khofb-muted: #6b7f93;
    --khofb-blue: #1769e0;
    --khofb-blue-dark: #0b3f91;
    --khofb-blue-soft: #eef5ff;
    --khofb-border: #d8e3ee;
    --khofb-surface: #ffffff;
    --khofb-page: #f5f8fc;
    --khofb-green: #0d9b68;
    --khofb-orange: #e08a00;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    color: var(--khofb-ink);
    background: var(--khofb-page);
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

.container {
    width: min(100% - 28px, 1240px);
}

.ctn-v10-footer {
    position: relative;
}

.khofb-auth-page {
    padding: 34px 0 52px !important;
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
}

.khofb-auth-page .user-form-card {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 30px 34px 26px;
    border: 1px solid var(--khofb-border);
    border-radius: 16px;
    background: var(--khofb-surface);
    box-shadow: 0 18px 44px rgba(16, 42, 67, .08);
}

.khofb-auth-page .user-form-card::before {
    display: none !important;
}

.khofb-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.khofb-auth-brand a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--khofb-blue-soft);
}

.khofb-auth-brand img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.khofb-auth-brand span {
    color: var(--khofb-blue-dark);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .04em;
}

.khofb-auth-page .user-form-title {
    margin-bottom: 24px;
    text-align: center;
}

.khofb-auth-page .user-form-title h1 {
    margin: 0 0 6px;
    color: var(--khofb-ink);
    font-size: 25px;
    font-weight: 850;
}

.khofb-auth-page .user-form-title p {
    margin: 0;
    color: var(--khofb-muted);
    font-size: 13px;
}

.khofb-auth-page .form-group {
    margin-bottom: 14px;
}

.khofb-auth-input {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 13px;
    border: 1px solid var(--khofb-border);
    border-radius: 10px;
    background: #fbfdff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.khofb-auth-input:focus-within {
    border-color: var(--khofb-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .11);
}

.khofb-auth-input > i {
    width: 20px;
    margin-right: 9px;
    color: #7b91a6;
    text-align: center;
}

.khofb-auth-input .form-control {
    min-width: 0;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.khofb-auth-input .form-control:focus {
    box-shadow: none;
}

.khofb-password-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    color: #7890a6;
    background: transparent;
    cursor: pointer;
}

.khofb-password-toggle:hover,
.khofb-password-toggle:focus-visible {
    color: var(--khofb-blue);
    background: var(--khofb-blue-soft);
    outline: 0;
}

.khofb-auth-page .form-button {
    margin-top: 20px;
}

.khofb-auth-page .form-button button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--khofb-blue);
    font-weight: 800;
    transition: background .18s ease, transform .18s ease;
}

.khofb-auth-page .form-button button:hover {
    background: var(--khofb-blue-dark);
    transform: translateY(-1px);
}

.khofb-auth-page .form-button button:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

.khofb-auth-page .form-button p {
    margin: 14px 0 0;
    text-align: center;
    color: var(--khofb-muted);
    font-size: 13px;
}

.khofb-auth-page .form-button a,
.khofb-auth-page .user-form-remind a {
    color: var(--khofb-blue);
    font-weight: 700;
}

.khofb-auth-page + .user-form-remind {
    margin-top: 14px;
    text-align: center;
}

.khofb-auth-page + .user-form-remind p {
    margin: 0;
    color: var(--khofb-muted);
    font-size: 13px;
}

.custom-button-list {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 0 0 18px !important;
    padding: 10px !important;
    overflow: visible !important;
    border: 1px solid var(--khofb-border) !important;
    border-radius: 12px !important;
    background: var(--khofb-surface) !important;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .05) !important;
}

.custom-button-list li,
.custom-button-list .ctn-cat-short,
.custom-button-list .ctn-cat-medium,
.custom-button-list .ctn-cat-long,
.custom-button-list .ctn-cat-all {
    min-width: 0 !important;
    width: auto !important;
    grid-column: span 1 !important;
    list-style: none !important;
}

.btn-category-home {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 52px !important;
    padding: 7px 10px !important;
    overflow: hidden !important;
    border: 1px solid var(--khofb-border) !important;
    border-radius: 9px !important;
    color: var(--khofb-ink) !important;
    background: #fff !important;
    box-shadow: none !important;
    text-align: left !important;
    white-space: normal !important;
}

.btn-category-home:hover,
.btn-category-home.active {
    border-color: var(--khofb-blue) !important;
    color: var(--khofb-blue-dark) !important;
    background: var(--khofb-blue-soft) !important;
    box-shadow: 0 0 0 2px rgba(23, 105, 224, .08) !important;
    transform: none !important;
}

.btn-category-home .category-chip-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 8px !important;
    color: var(--khofb-blue) !important;
    background: var(--khofb-blue-soft) !important;
    font-size: 14px !important;
}

.btn-category-home .category-chip-label,
.btn-category-home > span:not(.category-chip-icon) {
    display: -webkit-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
    color: inherit;
    line-height: 1.25 !important;
    text-overflow: ellipsis !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    margin: 16px 0 11px !important;
}

.home-heading h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0 !important;
    color: var(--khofb-ink) !important;
    font-size: 17px !important;
    font-weight: 850 !important;
}

.ctn-category-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: var(--khofb-blue);
    background: var(--khofb-blue-soft);
}

.ctn-category-badge-icon .khofb-category-icon {
    width: 100%;
    height: 100%;
    flex-basis: auto;
    border-radius: inherit;
}

.khofb-custom-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.btn-category-home .khofb-custom-logo {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 14px !important;
}

.product-grid > div,
.product-grid .feature-card {
    min-width: 0;
}

.feature-card {
    height: 100% !important;
    overflow: hidden !important;
    border: 1px solid var(--khofb-border) !important;
    border-radius: 10px !important;
    background: var(--khofb-surface) !important;
    box-shadow: 0 8px 20px rgba(16, 42, 67, .045) !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

.feature-card:hover {
    border-color: #b8cce1 !important;
    box-shadow: 0 14px 28px rgba(16, 42, 67, .10) !important;
    transform: translateY(-2px);
}

.feature-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px !important;
}

.ctn-v9-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 126px !important;
    margin: 0 0 10px !important;
    overflow: hidden;
    border-radius: 8px;
    background: #f6f9fd;
}

.ctn-v9-product-image img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.khofb-product-placeholder {
    flex-direction: column;
    gap: 7px;
    color: var(--khofb-blue);
}

.khofb-product-placeholder i {
    font-size: 27px;
}

.khofb-product-placeholder span {
    color: var(--khofb-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.feature-name {
    min-height: 42px !important;
    margin: 0 0 7px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

.feature-name a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--khofb-ink) !important;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.feature-content > .row:last-child {
    margin-top: auto;
}

.label-text {
    display: inline-block;
    margin: 0 6px 4px 0 !important;
    color: var(--khofb-muted) !important;
    font-size: 10px !important;
}

.label-text.feat {
    color: var(--khofb-green) !important;
}

.feature-price {
    margin: 7px 0 !important;
}

.feature-price span {
    color: #d55319 !important;
    font-size: 17px !important;
    font-weight: 900 !important;
}

.feature-price del {
    margin-right: 5px;
    color: #9aa9b7;
    font-size: 11px;
}

.feature-desc {
    min-height: 31px;
    margin-bottom: 10px !important;
    overflow: hidden;
    color: var(--khofb-muted) !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.btn-buy,
.btn-more {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100% !important;
    min-height: 36px !important;
    padding: 0 9px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.btn-buy {
    border: 1px solid var(--khofb-blue) !important;
    color: #fff !important;
    background: var(--khofb-blue) !important;
}

.btn-buy:hover {
    border-color: var(--khofb-blue-dark) !important;
    background: var(--khofb-blue-dark) !important;
}

.btn-more {
    border: 1px solid var(--khofb-border) !important;
    color: var(--khofb-ink) !important;
    background: #f7fafd !important;
}

.btn-more:hover {
    border-color: #b9cde1 !important;
    color: var(--khofb-blue-dark) !important;
    background: var(--khofb-blue-soft) !important;
}

.khofb-detail-category,
.khofb-modal-category {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 12px;
    padding: 6px 9px;
    border-radius: 7px;
    color: var(--khofb-blue-dark);
    background: var(--khofb-blue-soft);
    font-size: 12px;
    font-weight: 750;
}

.product-view {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.modal-dialog.modal-lg {
    width: min(860px, calc(100vw - 28px));
    max-width: none;
}

.modal-content {
    border: 1px solid var(--khofb-border);
    border-radius: 12px;
    overflow: hidden;
}

.ctn-recharge-wrap,
.ctn-recharge-card,
.account-card,
.kpay-card,
.kpay-history {
    border-color: var(--khofb-border) !important;
}

.ctn-recharge-card,
.ctn-recharge-note-card {
    box-shadow: 0 10px 28px rgba(16, 42, 67, .06) !important;
}

.ctn-money-input input,
.kpay-input {
    min-height: 48px;
    font-size: 16px;
}

.ctn-quick-money button,
.ctn-bank-option {
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.ctn-quick-money button:hover,
.ctn-bank-option:hover,
.ctn-bank-option.active {
    border-color: var(--khofb-blue) !important;
    color: var(--khofb-blue-dark);
    background: var(--khofb-blue-soft);
}

.ctn-generate-btn:disabled,
.kpay-btn:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.ctn-install-bar {
    right: 88px;
    bottom: 14px;
    z-index: 1080;
    max-width: min(440px, calc(100vw - 112px));
    margin: 0;
    border: 1px solid var(--khofb-border);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(16, 42, 67, .16);
}

.ctn-install-copy {
    min-width: 0;
}

.ctn-install-copy strong,
.ctn-install-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctn-install-later {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 7px;
    color: #6d7f91;
    background: transparent !important;
}

.ctn-install-later:hover {
    color: #b52d2d;
    background: #fff1f1 !important;
}

.ctn-v9-bottom-nav {
    display: none;
}

.ctn-mobile-nav {
    display: none !important;
}

@media (max-width: 1199px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .custom-button-list {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    body {
        padding-bottom: 72px !important;
    }

    .container {
        width: min(100% - 20px, 1240px);
    }

    .khofb-auth-page {
        min-height: auto;
        padding: 18px 0 30px !important;
    }

    .khofb-auth-page .user-form-card {
        padding: 24px 16px 20px;
        border-radius: 12px;
    }

    .khofb-auth-page .user-form-title h1 {
        font-size: 22px;
    }

    .custom-button-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
        padding: 8px !important;
    }

    .btn-category-home {
        min-height: 50px !important;
        padding: 7px 8px !important;
        font-size: 10px !important;
    }

    .btn-category-home .category-chip-icon {
        flex-basis: 24px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }

    .home-heading h3 {
        font-size: 15px !important;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .feature-content {
        padding: 9px !important;
    }

    .ctn-v9-product-image {
        height: 88px !important;
        margin-bottom: 8px !important;
    }

    .feature-name {
        min-height: 38px !important;
        font-size: 11px !important;
    }

    .feature-price span {
        font-size: 14px !important;
    }

    .feature-desc {
        display: none;
    }

    .feature-content > .row:last-child {
        --bs-gutter-x: 5px;
    }

    .btn-buy,
    .btn-more {
        min-height: 32px !important;
        padding: 0 5px !important;
        font-size: 9px !important;
    }

    .ctn-v9-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: 66px;
        border-top: 1px solid var(--khofb-border);
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 -7px 22px rgba(16, 42, 67, .10);
        z-index: 1070;
    }

    .ctn-v9-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        color: #7890a6;
        font-size: 9px;
        font-weight: 700;
        text-decoration: none;
    }

    .ctn-v9-bottom-nav a i {
        font-size: 17px;
    }

    .ctn-v9-bottom-nav a span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ctn-v9-bottom-nav a.active,
    .ctn-v9-bottom-nav a:hover {
        color: var(--khofb-blue);
    }

    .ctn-install-bar {
        right: 80px !important;
        bottom: 132px !important;
        left: 10px !important;
        max-width: calc(100vw - 90px) !important;
    }

    .ctn-install-copy strong {
        font-size: 11px;
    }

    .ctn-install-copy span {
        font-size: 10px;
    }

    .modal-dialog.modal-lg {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

    .product-view {
        max-height: calc(100vh - 20px);
    }

    .kpay-page {
        padding-bottom: 82px !important;
    }

    .kpay-head-top {
        align-items: flex-start;
    }

    .kpay-head h2 {
        font-size: 18px;
    }

    .kpay-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .kpay-tab {
        min-width: 0;
        padding: 9px 5px !important;
        overflow: hidden;
        font-size: 11px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .btn-buy,
    .btn-more {
        font-size: 8px !important;
    }

    .feature-price span {
        font-size: 13px !important;
    }
}

/* Marketplace category and product workspace */
.khofb-marketplace-layout {
    display: grid;
    grid-template-columns: minmax(250px, 276px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.khofb-category-sidebar {
    position: sticky;
    top: 88px;
    min-width: 0;
    max-height: calc(100vh - 108px);
    overflow: auto;
    padding: 16px;
    border: 1px solid #dfe7ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(22, 48, 78, .06);
}

.khofb-category-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.khofb-category-sidebar-head h3 {
    margin: 3px 0 0;
    color: #19324d;
    font-size: 18px;
    font-weight: 800;
}

.khofb-eyebrow {
    color: #7c91a8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
}

.khofb-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    color: #1769aa;
    background: #eaf4ff;
    font-size: 12px;
    font-weight: 800;
}

.khofb-category-search,
.khofb-product-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    height: 40px;
    padding: 0 11px;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    background: #f8fbfe;
    color: #7d91a5;
}

.khofb-category-search input,
.khofb-product-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #1f3852;
    background: transparent;
    font-size: 12px;
}

.khofb-category-sidebar .custom-button-list {
    display: flex !important;
    flex-direction: column;
    gap: 6px !important;
    margin: 14px 0 0;
    padding: 0 !important;
}

.khofb-category-sidebar .custom-button-list > li {
    display: block;
    min-width: 0;
}

.khofb-category-sidebar .btn-category-home {
    justify-content: flex-start;
    min-height: 43px !important;
    padding: 7px 9px !important;
    border-radius: 9px !important;
    text-align: left;
}

.khofb-category-sidebar .btn-category-home .category-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.khofb-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 8px;
}

.khofb-category-icon-image {
    object-fit: cover;
    background: #f3f7fb;
}

.category-chip-icon .khofb-category-icon {
    flex-basis: auto;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.product-head-box4 .khofb-category-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
}

.megamenu-title .khofb-category-icon,
.megamenu-list .khofb-category-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
}

.khofb-product-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 14px;
}

.khofb-product-search {
    flex: 1 1 260px;
}

.khofb-product-sort {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    color: #758aa0;
    font-size: 11px;
    font-weight: 700;
}

.khofb-product-sort select {
    height: 40px;
    min-width: 145px;
    padding: 0 10px;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    color: #1f3852;
    background: #fff;
    font-size: 12px;
}

.khofb-product-count {
    flex: 0 0 auto;
    color: #7d91a5;
    font-size: 11px;
    white-space: nowrap;
}

.khofb-category-sidebar .khofb-is-collapsed > li:nth-child(n+16):not(.ctn-cat-all) {
    display: none !important;
}

.khofb-products-panel {
    min-width: 0;
}

.khofb-products-panel .btn-buy,
.khofb-products-panel .btn-more {
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 991px) {
    .khofb-marketplace-layout {
        grid-template-columns: 1fr;
    }

    .khofb-category-sidebar {
        position: relative;
        top: auto;
        max-height: none;
    }

    .khofb-category-sidebar .custom-button-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .khofb-category-sidebar .custom-button-list > li {
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .khofb-marketplace-layout {
        gap: 12px;
    }

    .khofb-category-sidebar {
        padding: 12px;
        border-radius: 10px;
    }

    .khofb-category-sidebar .custom-button-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .khofb-category-sidebar .btn-category-home {
        min-height: 46px !important;
        padding: 6px 7px !important;
        font-size: 10px !important;
    }

    .khofb-category-sidebar .category-chip-icon {
        flex-basis: 24px;
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .khofb-product-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .khofb-product-search {
        flex-basis: 100%;
    }

    .khofb-product-sort {
        flex: 1 1 auto;
        justify-content: space-between;
    }

    .khofb-product-sort select {
        flex: 1 1 auto;
        min-width: 0;
    }

    .khofb-product-count {
        margin-left: auto;
    }

    .khofb-products-panel .product-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .khofb-products-panel .feature-card {
        min-width: 0;
    }

    .khofb-products-panel .btn-buy,
    .khofb-products-panel .btn-more {
        width: 100%;
        padding-right: 7px !important;
        padding-left: 7px !important;
        font-size: 10px !important;
    }
}

/* Final storefront refinements */
.khofb-category-sidebar {
    max-height: none;
    overflow: visible;
}

.khofb-category-sidebar .custom-button-list {
    display: flex !important;
    grid-template-columns: none !important;
    max-height: none;
    overflow: visible !important;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.khofb-category-sidebar .custom-button-list > li {
    display: block !important;
}

.khofb-category-sidebar .khofb-is-collapsed > li:nth-child(n+16):not(.ctn-cat-all) {
    display: block !important;
}

.home-heading h3,
#products-container .home-heading h3 {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--khofb-ink) !important;
    background: transparent !important;
    box-shadow: none !important;
}

#products-container > .col-lg-12 {
    margin-bottom: 30px !important;
}

.khofb-account-panel {
    padding: 18px !important;
    border: 1px solid #d8e5f1 !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 10px 28px rgba(16, 42, 67, .07) !important;
}

.khofb-account-panel-head {
    margin-bottom: 16px;
}

.khofb-account-panel-head h3 {
    margin: 4px 0 4px;
    color: var(--khofb-ink);
    font-size: 20px;
    font-weight: 850;
}

.khofb-account-panel-head p {
    margin: 0;
    color: var(--khofb-muted);
    font-size: 12px;
    line-height: 1.45;
}

.khofb-account-actions {
    display: grid;
    gap: 9px;
}

.khofb-account-action,
.khofb-account-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid #d9e5ef;
    border-radius: 10px;
    color: var(--khofb-ink);
    background: #fff;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.khofb-account-action:hover,
.khofb-account-primary:hover {
    border-color: #8eb7da;
    color: var(--khofb-blue-dark);
    background: #f5faff;
    transform: translateY(-1px);
}

.khofb-account-action.primary {
    border-color: var(--khofb-blue);
    color: #fff;
    background: var(--khofb-blue);
}

.khofb-account-action.primary:hover {
    color: #fff;
    background: var(--khofb-blue-dark);
}

.khofb-account-action > span:nth-child(2) {
    display: grid;
    min-width: 0;
    flex: 1;
}

.khofb-account-action strong {
    font-size: 12px;
    line-height: 1.2;
}

.khofb-account-action small {
    margin-top: 3px;
    color: #7b91a6;
    font-size: 10px;
}

.khofb-account-action.primary small {
    color: rgba(255, 255, 255, .76);
}

.khofb-account-action > i,
.khofb-account-primary > i:last-child {
    margin-left: auto;
    font-size: 11px;
}

.khofb-account-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--khofb-blue);
    background: var(--khofb-blue-soft);
}

.khofb-account-action.primary .khofb-account-action-icon {
    color: var(--khofb-blue);
    background: #fff;
}

.khofb-account-primary {
    justify-content: flex-start;
    margin-top: 14px;
    min-height: 42px;
    color: var(--khofb-blue-dark);
    font-size: 12px;
    font-weight: 800;
}

.khofb-account-primary > i:first-child {
    color: var(--khofb-blue);
}

.khofb-header-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.khofb-header-brand img {
    display: block !important;
    width: auto !important;
    max-width: 190px !important;
    height: auto !important;
    max-height: 48px !important;
    object-fit: contain;
}

.khofb-header-brand-fallback {
    align-items: center;
    gap: 7px;
    color: #fff;
}

.khofb-header-brand-fallback:not([hidden]) {
    display: inline-flex;
}

.khofb-header-brand-fallback b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: #0b315f;
    background: #fff;
    font-size: 12px;
}

.khofb-header-brand-fallback strong {
    color: inherit;
    font-size: 17px;
    font-weight: 900;
}

.khofb-header-brand-fallback strong span {
    color: #73c3ff;
}

.header-logo {
    display: flex !important;
    align-items: center;
    min-width: 185px;
    max-width: 220px;
}

.header-widget-group .khofb-header-login {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-width: 104px;
    min-height: 42px;
    padding: 6px 10px !important;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 10px;
    color: #fff !important;
    background: rgba(255, 255, 255, .08);
}

.khofb-header-login-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: #0b315f;
    background: #fff;
}

.khofb-header-login-text {
    display: inline-block !important;
    overflow: visible !important;
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.khofb-product-list-grid,
.khofb-search-product-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
}

.khofb-product-list-grid > div > .feature-card,
.khofb-search-product-list > div > .feature-card {
    height: auto !important;
}

.khofb-product-list-grid > div > .feature-card .feature-content {
    display: grid !important;
    grid-template-columns: 104px minmax(0, 1fr) 178px;
    grid-template-areas:
        "image name price"
        "image meta actions"
        "image desc actions";
    column-gap: 18px;
    row-gap: 5px;
    align-items: center;
    padding: 14px 18px !important;
}

.khofb-product-list-grid .ctn-v9-product-image {
    grid-area: image;
    width: 104px;
    height: 104px !important;
    margin: 0 !important;
    border: 1px solid #e1eaf3;
    border-radius: 10px;
    background: #f5f9fd;
}

.khofb-product-list-grid .feature-name {
    grid-area: name;
    min-height: 0 !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.35 !important;
}

.khofb-product-list-grid .feature-name a {
    display: block;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    -webkit-line-clamp: unset;
}

.khofb-product-list-grid .feature-content > .row:first-of-type {
    grid-area: meta;
    margin: 0 !important;
}

.khofb-product-list-grid .feature-price {
    grid-area: price;
    margin: 0 !important;
    text-align: right;
}

.khofb-product-list-grid .feature-price span {
    font-size: 19px !important;
}

.khofb-product-list-grid .feature-desc {
    grid-area: desc;
    min-height: 0;
    margin: 0 !important;
    -webkit-line-clamp: 2;
}

.khofb-product-list-grid .feature-content > .row:last-child {
    display: flex;
    flex-direction: column;
    grid-area: actions;
    gap: 7px;
    width: 100%;
    margin: 0 !important;
}

.khofb-product-list-grid .feature-content > .row:last-child > .col {
    width: 100%;
    max-width: none;
    padding: 0;
}

.khofb-product-list-grid .btn-buy,
.khofb-product-list-grid .btn-more {
    min-height: 38px !important;
}

@media (max-width: 767px) {
    .header-logo {
        min-width: 0;
        max-width: 145px;
    }

    .header-logo .khofb-header-brand img,
    .header-media-group .khofb-header-brand img {
        max-width: 130px !important;
        max-height: 36px !important;
    }

    .header-widget-group .khofb-header-login {
        min-width: 0;
        padding: 5px !important;
        border: 0;
        background: transparent;
    }

    .khofb-header-login-text {
        display: none !important;
    }

    .khofb-product-list-grid > div > .feature-card .feature-content {
        grid-template-columns: 76px minmax(0, 1fr);
        grid-template-areas:
            "image name"
            "image meta"
            "desc desc"
            "price actions";
        column-gap: 12px;
        row-gap: 7px;
        padding: 12px !important;
    }

    .khofb-product-list-grid .ctn-v9-product-image {
        width: 76px;
        height: 84px !important;
    }

    .khofb-product-list-grid .feature-name {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .khofb-category-sidebar .custom-button-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    .khofb-product-list-grid .feature-price {
        text-align: left;
    }

    .khofb-product-list-grid .feature-price span {
        font-size: 16px !important;
    }

    .khofb-product-list-grid .feature-content > .row:last-child {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .khofb-product-list-grid .btn-buy,
    .khofb-product-list-grid .btn-more {
        min-height: 34px !important;
        padding: 0 5px !important;
        font-size: 9px !important;
    }
}

/* KHOFB 2026-09-28: compact professional category rail */
@media (min-width: 992px) {
    .khofb-marketplace-layout{
        align-items:start;
    }
    .khofb-category-sidebar{
        position:sticky !important;
        top:112px !important;
        display:flex !important;
        flex-direction:column !important;
        height:min(740px, calc(100vh - 135px)) !important;
        max-height:min(740px, calc(100vh - 135px)) !important;
        overflow:hidden !important;
        padding:16px !important;
        border:1px solid #dfe7ef !important;
        border-radius:18px !important;
        background:#fff !important;
        box-shadow:0 12px 34px rgba(16,42,67,.08) !important;
    }
    .khofb-category-sidebar .custom-button-list{
        display:flex !important;
        flex-direction:column !important;
        flex:1 1 auto !important;
        min-height:0 !important;
        max-height:none !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        overscroll-behavior:contain;
        scrollbar-width:thin;
        scrollbar-color:#c8d5e2 transparent;
        padding:4px 5px 8px 0 !important;
        margin:12px -5px 0 0 !important;
    }
    .khofb-category-sidebar .custom-button-list::-webkit-scrollbar{width:5px}
    .khofb-category-sidebar .custom-button-list::-webkit-scrollbar-thumb{background:#c8d5e2;border-radius:20px}
    .khofb-category-sidebar .btn-category-home{
        width:100% !important;
        min-height:48px !important;
        padding:8px 10px !important;
        border:1px solid transparent !important;
        border-radius:12px !important;
        background:#fff !important;
        color:#42566b !important;
        font-size:12px !important;
        font-weight:750 !important;
        transition:.16s ease !important;
    }
    .khofb-category-sidebar .btn-category-home:hover,
    .khofb-category-sidebar .btn-category-home.active{
        transform:none !important;
        border-color:#ffd9bd !important;
        background:#fff3ea !important;
        color:#f15a24 !important;
        box-shadow:inset 3px 0 0 #ff6b21 !important;
    }
}

@media (max-width: 991px) {
    /* Trên mobile/tablet chỉ hiển thị logo nằm giữa cụm menu, tránh logo bị lặp 2 lần. */
    .header-content > .header-logo{display:none !important}
    .header-media-group{display:flex !important}
    .header-media-group > a{display:flex !important;align-items:center;justify-content:center !important;min-width:0}
    .header-media-group .khofb-header-brand img{display:block;max-width:150px !important;max-height:40px !important;object-fit:contain}

    .khofb-category-sidebar{
        max-height:430px !important;
        overflow:hidden !important;
        display:flex !important;
        flex-direction:column !important;
    }
    .khofb-category-sidebar .custom-button-list{
        flex:1 1 auto !important;
        min-height:0 !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        -webkit-overflow-scrolling:touch;
    }
}

.khofb-product-category-image .khofb-product-category-logo,
.khofb-product-category-logo{
    width:72px !important;
    height:72px !important;
    max-width:72px !important;
    max-height:72px !important;
    object-fit:contain !important;
    border-radius:14px !important;
    background:#fff !important;
}

/* =========================================================
   KHOFB HOTFIX 2026-09-28 B
   - Desktop category: exactly 1 vertical column, internal scroll
   - Mobile category: 2 columns, show all categories, page scroll
   - Mobile product modal: allow full vertical scroll to checkout button
   ========================================================= */

/* DESKTOP: left category rail like marketplace reference */
@media (min-width: 992px) {
    .khofb-category-sidebar {
        position: sticky !important;
        top: 112px !important;
        display: flex !important;
        flex-direction: column !important;
        height: min(740px, calc(100vh - 135px)) !important;
        max-height: min(740px, calc(100vh - 135px)) !important;
        overflow: hidden !important;
    }

    .khofb-category-sidebar .custom-button-list,
    #home-categories-container.custom-button-list {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        gap: 5px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        width: 100% !important;
        max-height: none !important;
        margin: 12px 0 0 !important;
        padding: 2px 5px 8px 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        scrollbar-width: thin;
        scrollbar-color: #c8d5e2 transparent;
    }

    .khofb-category-sidebar .custom-button-list > li,
    #home-categories-container.custom-button-list > li,
    #home-categories-container .ctn-cat-short,
    #home-categories-container .ctn-cat-medium,
    #home-categories-container .ctn-cat-long,
    #home-categories-container .ctn-cat-all {
        display: block !important;
        flex: 0 0 auto !important;
        float: none !important;
        clear: both !important;
        grid-column: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .khofb-category-sidebar .btn-category-home,
    #home-categories-container .btn-category-home {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 46px !important;
        height: auto !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 9px !important;
        padding: 7px 9px !important;
        text-align: left !important;
    }

    .khofb-category-sidebar .category-chip-label,
    #home-categories-container .category-chip-label {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-line-clamp: unset !important;
    }
}

/* MOBILE/TABLET: 2-column category grid, NO inner scrollbar */
@media (max-width: 991px) {
    .khofb-category-sidebar {
        position: relative !important;
        top: auto !important;
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 12px !important;
    }

    .khofb-category-sidebar .custom-button-list,
    #home-categories-container.custom-button-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        gap: 7px !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        margin: 12px 0 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .khofb-category-sidebar .custom-button-list > li,
    #home-categories-container.custom-button-list > li,
    #home-categories-container .ctn-cat-short,
    #home-categories-container .ctn-cat-medium,
    #home-categories-container .ctn-cat-long,
    #home-categories-container .ctn-cat-all {
        display: block !important;
        grid-column: span 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    #home-categories-container .btn-category-home {
        width: 100% !important;
        min-height: 48px !important;
        height: auto !important;
        padding: 7px 8px !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    #home-categories-container .category-chip-label {
        display: block !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-line-clamp: unset !important;
    }
}

/* MOBILE PRODUCT MODAL: scroll the entire modal until checkout is reachable */
@media (max-width: 767px) {
    #openModal.modal {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 8px 0 96px !important;
    }

    #openModal .modal-dialog,
    #openModal .modal-dialog.modal-lg {
        display: block !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 auto 96px !important;
        transform: none !important;
    }

    #openModal .modal-content {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #openModal #modalContent,
    #openModal .product-view {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    #openModal .product-view {
        padding-bottom: 28px !important;
    }

    /* fixed navigation/floating Telegram must not cover the checkout controls */
    body.modal-open .ctn-v9-bottom-nav,
    body.modal-open .ctn-floating-telegram,
    body.modal-open .telegram-float,
    body.modal-open .telegram-floating {
        display: none !important;
    }

    #openModal .view-add-group {
        position: relative !important;
        z-index: 2 !important;
        margin-bottom: 16px !important;
    }

    #openModal .view-add-group .btn-buy {
        min-height: 48px !important;
        font-size: 13px !important;
    }
}
