.hk-ajax-categories {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    direction: rtl;
}

.hk-ajax-categories * {
    box-sizing: border-box;
}

.hk-categories-sidebar {
    flex: 0 0 260px;
    width: 260px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.hk-categories-title {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
}

.hk-category-all {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    text-align: right;
    cursor: pointer;
}

.hk-categories-list,
.hk-subcategory-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hk-subcategory-list {
    margin: 5px 18px 8px 0;
    padding-right: 10px;
    border-right: 1px solid #e5e7eb;
}

.hk-subcategory-list[hidden] {
    display: none;
}

.hk-category-item {
    margin: 3px 0;
}

.hk-category-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.hk-category-link {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    gap: 8px;
    padding: 7px 6px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}

.hk-category-link:hover,
.hk-category-all:hover,
.hk-category-selected {
    background: #f1f5f9;
}

.hk-category-selected {
    font-weight: 700;
}

.hk-category-image {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 5px;
    object-fit: cover;
}

.hk-category-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.hk-category-count {
    flex: 0 0 auto;
    color: #64748b;
    font-size: 12px;
}

.hk-category-toggle {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    background: #fff;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.hk-products-main {
    flex: 1 1 auto;
    min-width: 0;
}

.hk-products-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

.hk-products-stock-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    cursor: pointer;
}

.hk-products-stock-only {
    margin: 0;
    cursor: pointer;
}

.hk-products-sort-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hk-products-sort-label {
    font-weight: 600;
}

.hk-products-sort {
    width: 100%;
    max-width: 260px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #222;
}

.hk-ajax-categories-products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.hk-product-item {
    position: relative;
    min-width: 0;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
}

.hk-product-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hk-product-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.hk-product-title {
    margin: 12px 0 8px;
    font-size: 15px;
    line-height: 1.7;
}

.hk-product-price {
    margin-top: 8px;
}

.hk-product-item.cat-na-mojood {
    opacity: 0.78;
}

.hk-product-item.cat-na-mojood::before {
    content: "تمام شد";
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 13px;
    border-radius: 5px;
    background: #c00000;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

.hk-products-status {
    margin: 16px 0 0;
    text-align: center;
}

.hk-products-sentinel {
    width: 100%;
    height: 1px;
}

.hk-products-more {
    display: block;
    margin: 22px auto 0;
    padding: 8px 16px;
    cursor: pointer;
}

.hk-products-more[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .hk-categories-sidebar {
        flex-basis: 220px;
        width: 220px;
    }

    .hk-ajax-categories-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .hk-ajax-categories {
        flex-direction: column;
    }

    .hk-categories-sidebar,
    .hk-products-main {
        width: 100%;
    }

    .hk-categories-sidebar {
        flex-basis: auto;
    }
}

@media (max-width: 480px) {
    .hk-ajax-categories-products {
        grid-template-columns: 1fr;
    }
}

.hk-ajax-categories-products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.hk-product-item {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hk-product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgb(0 0 0 / 8%);
}

.hk-product-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.hk-product-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    object-fit: cover;
}

.hk-product-title {
    margin: 12px 0 8px;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.7;
}

.hk-product-price {
    margin-top: auto;
    padding-top: 8px;
    color: #222;
    font-size: 14px;
    font-weight: 700;
}

.hk-product-item.cat-na-mojood {
    opacity: 0.78;
}

.hk-product-item.cat-na-mojood::before {
    content: "تمام شد";
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 6px;
    background: #c00000;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

@media (max-width: 900px) {
    .hk-ajax-categories-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .hk-ajax-categories-products {
        grid-template-columns: 1fr;
    }
}

