/* ==========================================================================
   CATEGORY & SHOP ARCHIVE LAYOUT (MATCHING REFERENCE DESIGN)
   ========================================================================== */

.ks-category-archive-page {
    background-color: #FFFFFF;
    padding-top: 18px;
    padding-bottom: 60px;
    font-family: var(--ks-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: #1E293B;
}

.ks-cat-container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 1. Breadcrumbs */
.ks-cat-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.84rem;
    color: #64748B;
    margin-bottom: 20px;
    line-height: 1.4;
}
.ks-cat-bc-link {
    color: #64748B;
    text-decoration: none;
    transition: color 0.15s ease;
}
.ks-cat-bc-link:hover {
    color: #F36B21;
}
.ks-cat-bc-sep {
    color: #94A3B8;
    font-size: 0.95rem;
    font-weight: 600;
}
.ks-cat-bc-current {
    color: #102B46;
    font-weight: 600;
}

/* 2. Hero Section (Customizable Category Banner - Disabled) */
.ks-cat-hero-banner {
    display: none !important;
}

/* 3. Sub-heading & Sorting Bar */
.ks-cat-subbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
}

.ks-cat-subbar-headline {
    flex: 1 1 auto;
}

.ks-cat-headline-text {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #102B46 !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em;
}

.ks-cat-subbar-sort {
    flex: 0 0 auto;
}

.ks-cat-sort-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ks-cat-sort-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
}

.ks-cat-sort-wrapper form.woocommerce-ordering {
    margin: 0 !important;
    float: none !important;
}

.ks-cat-sort-wrapper select.orderby {
    background: #FFFFFF url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23475569" stroke-width="2.5"><polyline points="6 9 12 15 18 9"/></svg>') no-repeat right 12px center !important;
    background-size: 12px !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 6px !important;
    padding: 7px 34px 7px 12px !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    color: #1E293B !important;
    outline: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ks-cat-sort-wrapper select.orderby:hover,
.ks-cat-sort-wrapper select.orderby:focus {
    border-color: #102B46 !important;
    box-shadow: 0 0 0 2px rgba(16, 43, 70, 0.08) !important;
}

/* 4. Two-Column Body Layout */
.ks-cat-body-layout {
    display: grid !important;
    grid-template-columns: 240px 1fr !important;
    gap: 28px !important;
    align-items: start !important;
    width: 100% !important;
}

/* --------------------------------------------------------------------------
   LEFT COLUMN: SIDEBAR FILTERS
   -------------------------------------------------------------------------- */
.ks-cat-sidebar-card {
    background: #FFFFFF;
    border: 1px solid #E5EAF0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(16, 43, 70, 0.03);
    overflow: hidden;
}

.ks-filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    background: #F8FAFC;
    border-bottom: 1px solid #E5EAF0;
}

.ks-filter-main-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #102B46 !important;
    margin: 0 !important;
    letter-spacing: 0.2px;
}

.ks-filter-reset-btn {
    background: none;
    border: none;
    color: #F36B21;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.ks-filter-reset-btn:hover {
    background: #FFF7ED;
}

/* Filter Groups (Accordion) */
.ks-filter-group {
    border-bottom: 1px solid #E5EAF0;
}
.ks-filter-group:last-of-type {
    border-bottom: none;
}

.ks-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.ks-filter-header:hover {
    background: #F8FAFC;
}

.ks-filter-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #102B46;
}

.ks-filter-arrow {
    font-size: 0.75rem;
    color: #64748B;
    transition: transform 0.2s ease;
    display: inline-block;
}
.ks-filter-group.is-open .ks-filter-arrow {
    transform: rotate(180deg);
}

.ks-filter-body {
    padding: 6px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ks-filter-checkbox-row,
.ks-filter-radio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.86rem;
    color: #334155;
    transition: color 0.15s ease;
}
.ks-filter-checkbox-row:hover,
.ks-filter-radio-row:hover {
    color: #F36B21;
}

.ks-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ks-filter-input {
    cursor: pointer;
    accent-color: #F36B21;
    width: 15px;
    height: 15px;
    margin: 0;
}

.ks-filter-name {
    font-weight: 500;
}

.ks-filter-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748B;
    background: #F1F5F9;
    padding: 2px 7px;
    border-radius: 10px;
}

.ks-filter-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: #334155;
    font-size: 0.86rem;
    padding: 3px 0;
    transition: color 0.15s;
}
.ks-filter-cat-link:hover,
.ks-filter-cat-link.is-active {
    color: #F36B21;
    font-weight: 600;
}

/* Institutional Wholesale Callout in Sidebar */
.ks-filter-wholesale-box {
    background: linear-gradient(135deg, #102B46 0%, #0F3B66 100%);
    color: #FFFFFF;
    padding: 16px;
    margin: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(16, 43, 70, 0.12);
}
.ks-fwb-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    margin-bottom: 6px;
}
.ks-filter-wholesale-box p {
    font-size: 0.8rem;
    color: #E2E8F0;
    line-height: 1.4;
    margin: 0 0 10px 0;
}
.ks-fwb-btn {
    width: 100%;
    background: #F36B21;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.ks-fwb-btn:hover {
    background: #d95713;
}

/* --------------------------------------------------------------------------
   RIGHT COLUMN: 4-COLUMN PRODUCT GRID
   -------------------------------------------------------------------------- */
.ks-cat-products-col {
    width: 100%;
}

.ks-cat-products-col ul.products,
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.ks-cat-products-col ul.products::before,
.ks-cat-products-col ul.products::after {
    display: none !important;
}

/* Product Card Format (Matches Reference Exactly) */
.ks-cat-products-col li.product.ks-product-card,
.woocommerce ul.products li.product.ks-product-card {
    background: #FFFFFF !important;
    border: 1px solid #E5EAF0 !important;
    border-radius: 10px !important;
    padding: 9px 10px 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    box-shadow: 0 1px 3px rgba(16, 43, 70, 0.04) !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important;
}
.ks-cat-products-col li.product.ks-product-card:hover,
.woocommerce ul.products li.product.ks-product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 16px rgba(16, 43, 70, 0.08) !important;
    border-color: #CBD5E1 !important;
}

/* Card Image Box */
.ks-pc-image-wrap {
    width: 100%;
    height: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    margin-bottom: 6px;
    overflow: hidden;
}
.ks-pc-image-wrap a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.ks-pc-img {
    max-width: 100%;
    max-height: 115px;
    object-fit: contain;
    transition: transform 0.25s ease;
}
.ks-product-card:hover .ks-pc-img {
    transform: scale(1.03);
}

/* Rating Badge Pill */
.ks-pc-rating-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #FEF9C3;
    border: 1px solid #FEF08A;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.70rem;
    font-weight: 700;
    color: #102B46;
    margin-bottom: 6px;
    line-height: 1.1;
}
.ks-pc-rating-star {
    color: #16A34A;
    font-size: 0.72rem;
}
.ks-pc-review-count {
    color: #64748B;
    font-weight: 600;
    font-size: 0.65rem;
}

/* Card Title */
.ks-pc-title {
    font-size: 0.80rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    line-height: 1.35 !important;
    margin: 0 0 6px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
}
.ks-pc-title a {
    color: #1E293B !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}
.ks-pc-title a:hover {
    color: #F36B21 !important;
}

/* Price Row */
.ks-pc-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 7px;
    flex-wrap: wrap;
}
.ks-pc-price,
.ks-pc-price .amount {
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    color: #102B46 !important;
}
.ks-pc-mrp,
.ks-pc-mrp del,
.ks-pc-mrp .amount {
    font-size: 0.70rem !important;
    color: #94A3B8 !important;
    font-weight: 500 !important;
    text-decoration: line-through !important;
}

/* Add To Cart Button (Solid Orange) */
.ks-pc-action-wrap {
    width: 100%;
    margin-bottom: 6px;
}
.ks-pc-add-to-cart-btn {
    width: 100% !important;
    background: #F36B21 !important;
    border: 1px solid #F36B21 !important;
    color: #FFFFFF !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    padding: 7px 10px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    text-align: center !important;
    display: block !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    transition: all 0.18s ease !important;
    box-shadow: 0 2px 8px rgba(243, 107, 33, 0.2) !important;
    line-height: 1.2 !important;
}
.ks-pc-add-to-cart-btn:hover {
    background: #d95713 !important;
    border-color: #d95713 !important;
    box-shadow: 0 5px 14px rgba(243, 107, 33, 0.32) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
}

/* Delivery Estimate Row */
.ks-pc-delivery-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    color: #4B5563;
    border-top: none;
    padding-top: 0;
    margin-top: 6px;
}
.ks-pc-truck-icon {
    width: 13px;
    height: 13px;
    color: #4B5563;
    flex-shrink: 0;
}
.ks-pc-delivery-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No Products Found message */
.ks-cat-no-match-alert {
    grid-column: 1 / -1;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #475569;
}
.ks-cat-no-match-alert h4 {
    margin: 0 0 8px 0;
    color: #102B46;
}

/* --------------------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
    .ks-cat-products-col ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 991px) {
    .ks-cat-body-layout {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    .ks-cat-sidebar-col {
        order: 1;
    }
    .ks-cat-products-col {
        order: 2;
    }
    .ks-cat-products-col ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .ks-cat-hero-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 20px 22px !important;
        gap: 16px !important;
    }
    .ks-cat-hero-title {
        font-size: 1.75rem !important;
    }
    .ks-cat-hero-subtitle {
        font-size: 0.95rem !important;
    }
    .ks-cat-hero-image-wrap {
        width: 100% !important;
        justify-content: center !important;
    }
    .ks-cat-hero-img {
        max-height: 120px !important;
    }
    .ks-cat-subbar-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .ks-cat-sort-wrapper {
        width: 100% !important;
        justify-content: space-between !important;
    }
    .ks-cat-sort-wrapper select.orderby {
        flex: 1 !important;
    }
    .ks-cat-products-col ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    .ks-pc-image-wrap {
        height: 145px !important;
    }
    .ks-pc-title {
        font-size: 0.78rem !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }
    .ks-pc-price,
    .ks-pc-price .amount {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .ks-cat-container {
        padding: 0 12px !important;
    }
    .ks-cat-hero-banner {
        padding: 16px 16px !important;
        border-radius: 8px !important;
    }
    .ks-cat-hero-title {
        font-size: 1.45rem !important;
    }
    .ks-cat-headline-text {
        font-size: 1rem !important;
    }
    .ks-cat-products-col ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .ks-cat-products-col li.product.ks-product-card,
    .woocommerce ul.products li.product.ks-product-card {
        padding: 10px 10px 8px !important;
    }
    .ks-pc-image-wrap {
        height: 125px !important;
    }
    .ks-pc-add-to-cart-btn {
        padding: 7px 8px !important;
        font-size: 0.78rem !important;
    }
}
