.kj-table-wrap {
    direction: rtl;
    text-align: right;
    margin: 16px 0;
    font-family: inherit;
}

.kj-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.kj-search {
    flex: 1 1 220px;
    max-width: 340px;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    height: 42px;
    box-sizing: border-box;
}

.kj-filters select {
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    min-width: 140px;
    height: 42px;
    font-family: inherit;
}

.kj-reset-filters {
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    height: 42px;
}

.kj-count {
    margin: 10px 0;
    color: #555;
    font-size: 13px;
}

.kj-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
}

.kj-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.kj-table th {
    background: var(--kj-accent, var(--e-global-color-accent, var(--e-global-color-primary, #0073aa)));
    color: #fff;
    padding: 5px;
    text-align: right;
    font-weight: 700;
}

.kj-table td {
    padding: 4px;
    border-bottom: 1px solid #eee;
    text-align: right;
    vertical-align: middle;
}

.kj-table tr:last-child td {
    border-bottom: none;
}

.kj-product-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.kj-product-link:hover {
    text-decoration: underline;
}

.kj-qty-input {
width: 54px;
padding: 2px;
text-align: center;
border: 1px solid #c1c1c1;
border-radius: 8px;
}
.kj-qty-cell-wrap {
display: inline-flex;
align-items: center;
gap: 4px;
}
.kj-qty-step {
display: none;
width: 32px;
height: 30px;
padding: 0;
border: 0px solid #cfcfcf;
background: #d9d9d9;
border-radius: 6px;
font-size: 10px;
line-height: 1;
cursor: pointer;
align-items: center;
justify-content: center;
color: var(--kj-accent, var(--e-global-color-accent, var(--e-global-color-primary, #0073aa)));
}
.kj-qty-step:active {
transform: scale(0.95);
}
.kj-qty-stack {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.kj-qty-price {
display: none;
font-weight: 600;
font-size: 14px;
color: #919191;
white-space: nowrap;
}

.kj-add-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 5px;
    background: var(--kj-accent, var(--e-global-color-accent, var(--e-global-color-primary, #0073aa)));
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.kj-add-btn:active {
    transform: scale(0.97);
}

.kj-muted {
    color: #888;
    font-size: 12px;
}

.kj-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.kj-page-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
}

.kj-page-btn.active {
    background: var(--kj-accent, var(--e-global-color-accent, var(--e-global-color-primary, #0073aa)));
    color: #fff;
    border-color: transparent;
}

.kj-page-dots {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
}

.kj-loading .kj-table-scroll {
    opacity: 0.55;
    pointer-events: none;
}

.kj-notice {
    padding: 12px;
    border: 1px solid #f0c36d;
    background: #fff9e8;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .kj-filters {
        gap: 4px;
    }

    .kj-search {
        max-width: 100%;
        flex: 1 1 100%;
        height: 40px;
    }

    .kj-filters select {
        flex: 1 1 45%;
        min-width: 0;
        height: 40px;
    }

    .kj-reset-filters {
        flex: 1 1 100%;
        height: 40px;
    }

    .kj-table {
        min-width: auto;
    }

    .kj-table th,
    .kj-table td {
        padding: 5px 5px;
        font-size: 13px;
    }

 .kj-qty-input {
     width: 56px;
 }
 .kj-qty-step {
     display: inline-flex;
 }
 .kj-table-wrap[data-qty-mode="order"] th.kj-th-price,
 .kj-table-wrap[data-qty-mode="order"] td.kj-price-cell {
     display: none;
 }
 .kj-table-wrap[data-qty-mode="order"] .kj-qty-price {
     display: block;
 }

    .kj-add-btn {
        width: 36px;
        height: 36px;
    }
}
/* --- دکمه‌های کم/زیاد: پس‌زمینه خاکستری کمرنگ، فلش‌ها خاکستری پررنگ --- */
.kj-table-wrap .kj-qty-step,
.kj-table-wrap button.kj-qty-step {
background: #ececec !important;
border: 1px solid #d0d0d0 !important;
color: #a5a5a5 !important;
box-shadow: none !important;
text-shadow: none !important;
}
.kj-table-wrap .kj-qty-step:active {
background: #dedede !important;
}
/* --- شورت‌کد ابزار جستجو --- */
.kj-search-tools-wrap {
max-width: 600px;
margin: 20px auto;
padding: 16px;
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.kj-search-tools-row {
display: flex;
gap: 8px;
align-items: center;
}
.kj-search-input-wrap {
flex: 1;
position: relative;
}
.kj-search-tools-input {
width: 100%;
padding: 12px 16px;
border: 1px solid #c1c1c1;
border-radius: 10px;
font-size: 15px;
font-family: inherit;
}
.kj-search-tools-input:focus {
outline: none;
border-color: var(--kj-accent, #0073aa);
}
.kj-search-tools-results {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: #fff;
border: 1px solid #e5e7eb;
border-radius: 10px;
margin-top: 4px;
max-height: 300px;
overflow-y: auto;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
z-index: 1000;
display: none;
}
.kj-search-tools-results.kj-active {
display: block;
}
.kj-search-result-item {
padding: 12px 16px;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
display: flex;
align-items: center;
gap: 12px;
}
.kj-search-result-item:hover {
background: #f9fafb;
}
.kj-search-result-item:last-child {
border-bottom: none;
}
.kj-search-result-item img {
width: 50px;
height: 50px;
object-fit: cover;
border-radius: 6px;
}
.kj-search-result-item .name {
flex: 1;
font-size: 14px;
font-weight: 600;
}
.kj-search-result-item .price {
font-size: 13px;
color: #666;
white-space: nowrap;
}
.kj-search-tools-btn {
width: 48px;
height: 48px;
border: 1px solid #c1c1c1;
background: #f9fafb;
border-radius: 10px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: #555;
transition: all 0.2s;
}
.kj-search-tools-btn:hover {
background: #ececec;
color: #333;
}
.kj-float-btn-inline {
display: block;
width: 100%;
margin-top: 12px;
padding: 14px;
background: var(--kj-accent, #0073aa);
color: #fff;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 700;
cursor: pointer;
font-family: inherit;
transition: all 0.2s;
}
.kj-float-btn-inline:hover {
opacity: 0.9;
transform: translateY(-1px);
}
.kj-float-btn-count {
display: inline-block;
background: #fff;
color: var(--kj-accent, #0073aa);
padding: 2px 8px;
border-radius: 12px;
font-size: 13px;
font-weight: 800;
margin-right: 6px;
}
.kj-search-tools-hint {
margin: 10px 0 0;
font-size: 13px;
color: #666;
text-align: center;
}