/**
 * Kinetiflo Faceted Product Filters — McMaster-style
 * Two-column layout: left sidebar filters + right product grid/table.
 */

/* ── Header overrides for WooCommerce pages are in header.php ── */

/* ── My Account page spacing & layout ── */
/* Logged-in dashboard = two-column flex. Logged-out login page = full-width,
   theme's form-login.php handles the card styling. */
body.woocommerce-account .woocommerce {
    padding-top: 100px;
    padding-bottom: 40px;
    padding-left: 25px;
    padding-right: 25px;
}
.logged-in.woocommerce-account .woocommerce {
    max-width: 1100px !important;
    margin: 0 auto !important;
    display: flex !important;
    gap: 40px !important;
}
.logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation {
    float: none !important;
    width: 200px !important;
    left: 0 !important;
    position: relative !important;
    background-color: #f5f5f5 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
}
body.woocommerce-account .woocommerce-MyAccount-content {
    flex: 1 !important;
}
.logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation ul li {
    list-style: none !important;
    display: block !important;
    margin-left: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
}
.logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation ul li a {
    display: block !important;
    padding: 12px 16px !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}
.logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation ul li.is-active a,
.logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation ul li a:hover {
    background: #D94232 !important;
    color: #fff !important;
}
/* ── Logged-out login form is styled by the theme's form-login.php template
      (.basic-login card). No overrides needed here. ── */

/* ── Distributor signup CTA (logged-out only, above brand banner) ── */
.kcf-distributor-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin: 0 0 16px;
    background: #fff8ec;
    border: 1px solid #f4d99f;
    border-left: 4px solid #d97706;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: #6b4f1f;
}
.kcf-distributor-cta-icon {
    flex-shrink: 0;
    color: #d97706;
}
.kcf-distributor-cta-text {
    flex: 1;
}
.kcf-distributor-cta strong {
    color: #1a1a1a;
    margin-left: 4px;
}
.kcf-distributor-cta-link {
    color: #b85a14;
    font-weight: 600;
    text-decoration: none;
    margin-left: 6px;
    white-space: nowrap;
}
.kcf-distributor-cta-link:hover {
    color: #8a4310;
    text-decoration: underline;
}
@media (max-width: 600px) {
    .kcf-distributor-cta {
        align-items: flex-start;
    }
    .kcf-distributor-cta-link {
        display: inline-block;
        margin-top: 4px;
        margin-left: 0;
    }
}

/* ── Brand Banner (shown when Brand filter is active) ── */
.kcf-brand-banner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 28px;
    margin: 0 0 24px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #9ca3af;
    border-radius: 6px;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
}
.kcf-brand-banner[hidden] {
    display: none;
}
.kcf-brand-banner.is-continental {
    border-left-color: #2a7a2f;
    background: #f3f9f3;
}
.kcf-brand-banner.is-integrity {
    border-left-color: #1f4e79;
    background: #f5f8fc;
}
.kcf-brand-banner-logo {
    max-height: 140px;     /* 2.5× the prior 56px — Trisha 2026-05-13 */
    width: auto;
    flex-shrink: 0;
}
.kcf-brand-banner-tagline {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.4;
}
@media screen and (max-width: 640px) {
    .kcf-brand-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }
    .kcf-brand-banner-logo {
        max-height: 90px;     /* mobile equivalent of the 2.5× bump */
    }
}

/* ── Request Account link below login ── */
.kcf-request-account {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #555;
}
.kcf-request-account a {
    color: #D94232;
    font-weight: 600;
    text-decoration: none;
}
.kcf-request-account a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    body.woocommerce-account .woocommerce {
        padding-top: 100px;
    }
    .logged-in.woocommerce-account .woocommerce {
        flex-direction: column !important;
    }
    .logged-in.woocommerce-account nav.woocommerce-MyAccount-navigation {
        width: 100% !important;
    }
}

/* ── Reset & Base ── */
.kcf-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 140px;
    padding-bottom: 200px;
    padding-left: 20px;
    padding-right: 20px;
}

.kcf-wrap *, .kcf-wrap *::before, .kcf-wrap *::after {
    box-sizing: border-box;
}

/* ── Search Bar ── */
.kcf-search {
    position: relative;
    margin-bottom: 1rem;
}

.kcf-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.kcf-search-icon {
    position: absolute;
    left: 0.75rem;
    color: #999;
    pointer-events: none;
    flex-shrink: 0;
}

.kcf-search-input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 2.5rem;
    font-size: 0.95rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.15s;
}

.kcf-search-input:focus {
    border-color: #2e6f40;
    box-shadow: 0 0 0 3px rgba(46, 111, 64, 0.1);
}

.kcf-search-input::placeholder {
    color: #aaa;
}

.kcf-search-clear {
    position: absolute;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: #e0e0e0;
    color: #555;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.kcf-search-clear:hover {
    background: #ccc;
    color: #333;
}

/* ── Search Dropdown ── */
.kcf-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.kcf-search-group {
    border-bottom: 1px solid #f0f0f0;
}

.kcf-search-group:last-of-type {
    border-bottom: none;
}

.kcf-search-group-label {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
}

.kcf-search-item {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
}

.kcf-search-item:hover,
.kcf-search-item.kcf-search-highlighted {
    background: #f0f7f2;
}

.kcf-search-item-sku {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a1a;
    white-space: nowrap;
}

.kcf-search-item-name {
    font-size: 0.8rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kcf-search-item mark {
    background: #fef08a;
    color: inherit;
    padding: 0;
    border-radius: 1px;
}

.kcf-search-no-results {
    padding: 1rem 0.75rem;
    color: #999;
    font-size: 0.85rem;
    text-align: center;
}

.kcf-search-see-all {
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2e6f40;
    cursor: pointer;
    border-top: 1px solid #eee;
    text-align: center;
}

.kcf-search-see-all:hover,
.kcf-search-see-all.kcf-search-highlighted {
    background: #f0f7f2;
}

/* ── Search Banner (in-grid mode) ── */
.kcf-search-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    background: #f0f7f2;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #2e6f40;
}

.kcf-search-banner strong {
    font-weight: 700;
}

.kcf-search-banner-clear {
    background: none;
    border: none;
    color: #2e6f40;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    white-space: nowrap;
    margin-left: 1rem;
}

.kcf-search-banner-clear:hover {
    color: #2e6f40;
}

/* ── Two-Column Layout ── */
.kcf-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* ── Sidebar ── */
.kcf-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: -webkit-sticky;
    position: sticky;
    top: 138px;
    max-height: calc(100vh - 148px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Scrollbar styling */
.kcf-sidebar::-webkit-scrollbar {
    width: 6px;
}
.kcf-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.kcf-sidebar-inner {
    padding: 0;
}

/* Mobile toggle — hidden on desktop */
.kcf-sidebar-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    color: #333;
}

.kcf-filter-count-badge {
    display: none;
    background: #2e6f40;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

/* ── Sidebar Header ── */
.kcf-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.kcf-sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    color: #333;
}

.kcf-clear-all {
    font-size: 0.75rem;
    color: #2e6f40;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
    text-decoration: underline;
}
.kcf-clear-all:hover {
    color: #2e6f40;
}

/* ── Sidebar Loading ── */
.kcf-sidebar-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    color: #999;
    font-size: 0.85rem;
}

/* ── Model Nav (McMaster-style drill-down) ── */
.kcf-model-nav {
    border-bottom: 2px solid #ddd;
    overflow: hidden;
}

.kcf-model-nav-title {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #333;
}

.kcf-model-back {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: #f5f5f5;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2e6f40;
    text-align: left;
}
.kcf-model-back:hover {
    background: #eee;
    color: #2e6f40;
}
.kcf-model-back svg {
    flex-shrink: 0;
}

.kcf-model-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kcf-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: #2e6f40;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}
.kcf-model-item:last-child {
    border-bottom: none;
}
.kcf-model-item:hover {
    background: #f0f7f2;
}
.kcf-model-item.kcf-model-selected {
    background: #e8f5e9;
    color: #2e6f40;
    font-weight: 700;
}

.kcf-model-name {
    flex: 1;
    min-width: 0;
}

.kcf-model-arrow {
    flex-shrink: 0;
    color: #999;
}
.kcf-model-item:hover .kcf-model-arrow {
    color: #2e6f40;
}

/* Slide animations */
.kcf-model-nav.kcf-model-animate[data-dir="forward"] .kcf-model-list {
    animation: kcf-slide-in-right 0.2s ease-out;
}
.kcf-model-nav.kcf-model-animate[data-dir="back"] .kcf-model-list {
    animation: kcf-slide-in-left 0.2s ease-out;
}

@keyframes kcf-slide-in-right {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes kcf-slide-in-left {
    from { transform: translateX(-40px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* ── Facet Group ── */
.kcf-facet-group {
    border-bottom: 1px solid #eee;
}

.kcf-facet-group:last-child {
    border-bottom: none;
}

/* Facet Header */
.kcf-facet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kcf-facet-header:hover {
    background: #fafafa;
}

.kcf-facet-chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #999;
    transition: transform 0.15s ease;
}

.kcf-collapsed .kcf-facet-chevron {
    transform: rotate(-90deg);
}

/* Facet Body */
.kcf-facet-body {
    padding: 0 0.75rem 0.5rem;
}

.kcf-collapsed .kcf-facet-body {
    display: none;
}

/* Facet Search */
.kcf-facet-search-wrap {
    margin-bottom: 0.4rem;
}

.kcf-facet-search {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    outline: none;
}
.kcf-facet-search:focus {
    border-color: #2e6f40;
    box-shadow: 0 0 0 1px rgba(46, 111, 64, 0.2);
}
.kcf-facet-search::placeholder {
    color: #aaa;
}

/* Facet List */
.kcf-facet-list {
    list-style: none;
    margin: 0;
    padding: 0;
}


.kcf-facet-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.35rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #2e6f40;
    transition: background 0.1s;
}

.kcf-facet-option:hover {
    background: #f0f7f2;
}

.kcf-facet-option.kcf-selected {
    background: #e8f5e9;
    color: #2e6f40;
    font-weight: 700;
}

.kcf-facet-option.kcf-facet-hidden {
    display: none;
}

.kcf-facet-name {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}
.kcf-facet-desc {
    display: block;
    font-size: 0.75em;
    opacity: 0.6;
    font-weight: normal;
    line-height: 1.3;
    margin-top: 1px;
}

.kcf-facet-count {
    font-size: 0.75rem;
    color: #999;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.kcf-facet-remove {
    font-size: 1rem;
    color: #c62828;
    margin-left: 0.5rem;
    flex-shrink: 0;
    font-weight: 700;
    line-height: 1;
}

/* Show More */
.kcf-show-more {
    display: block;
    background: none;
    border: none;
    color: #2e6f40;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    margin-top: 0.2rem;
}
.kcf-show-more:hover {
    text-decoration: underline;
}

/* Scrollable expanded list */
.kcf-facet-list::-webkit-scrollbar {
    width: 5px;
}
.kcf-facet-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ── Content Area ── */
.kcf-content {
    flex: 1;
    min-width: 0;
}

/* Content Header */
.kcf-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.kcf-result-count {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

/* Header right (account + view toggle) */
.kcf-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.kcf-account-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 4px;
    white-space: nowrap;
}
.kcf-account-status.kcf-logged-in {
    color: #333;
    background: #f0f0f0;
}
.kcf-account-status.kcf-logged-in:hover {
    background: #e0e0e0;
}
.kcf-account-status.kcf-logged-out {
    color: #fff;
    background: #D94232;
}
.kcf-account-status.kcf-logged-out:hover {
    background: #c13528;
}

/* View Toggle */
.kcf-view-toggle {
    display: flex;
    gap: 0.25rem;
}

.kcf-view-btn {
    padding: 0.35rem 0.5rem;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    color: #999;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kcf-view-btn:hover {
    background: #f5f5f5;
    color: #666;
}
.kcf-view-btn.kcf-view-active {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* ── Loading ── */
/* Fixed to the VIEWPORT, not the grid — the grid can be thousands of px
   tall, which used to park the spinner far below the fold (Mike 7/8).
   pointer-events:none so the overlay never blocks sidebar clicks. */
.kcf-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9990;
    pointer-events: none;
}

.kcf-loading .kcf-spinner {
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18), 0 0 0 8px #fff;
}

/* Thin progress bar pinned to the top of the viewport (created by JS). */
.kcf-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: #2e6f40;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
}

/* Whole page signals work-in-progress. */
body.kcf-busy,
body.kcf-busy .kcf-facet-option {
    cursor: progress;
}

/* The option just clicked: its count becomes a mini spinner. */
.kcf-facet-busy .kcf-facet-count,
.kcf-facet-busy .kcf-facet-remove {
    display: none;
}

.kcf-facet-busy {
    position: relative;
}

.kcf-facet-busy::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    margin-top: -7px;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border: 2px solid #e0e0e0;
    border-top-color: #2e6f40;
    border-radius: 50%;
    animation: kcf-spin 0.6s linear infinite;
}

.kcf-content {
    position: relative;
}

.kcf-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #2e6f40;
    border-radius: 50%;
    animation: kcf-spin 0.6s linear infinite;
}

@keyframes kcf-spin {
    to { transform: rotate(360deg); }
}

.kcf-initial-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: #999;
}

/* ── Product Grid ── */
.kcf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.kcf-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
    background: #fff;
}

.kcf-product-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

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

.kcf-product-image {
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.kcf-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.kcf-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.8rem;
}

.kcf-product-info {
    padding: 0.75rem;
}

.kcf-product-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: #1a1a1a;
    line-height: 1.3;
}

.kcf-product-sku {
    font-size: 0.75rem;
    color: #888;
    display: block;
    margin-bottom: 0.25rem;
}

.kcf-product-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.kcf-stock-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    display: inline-block;
}

.kcf-in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.kcf-out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* ── Product Table ── */
.kcf-table-wrap {
    overflow-x: auto;
}

.kcf-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.kcf-product-table th {
    background: #f5f5f5;
    font-weight: 700;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #ddd;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
    white-space: nowrap;
}

.kcf-product-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.kcf-product-table tbody tr:hover {
    background: #f9f9f9;
}

.kcf-product-table a {
    color: #2e6f40;
    text-decoration: none;
    font-weight: 600;
}
.kcf-product-table a:hover {
    text-decoration: underline;
}

/* ── Pagination ── */
.kcf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.kcf-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kcf-page-btn:hover {
    background: #f0f0f0;
}

.kcf-page-btn.kcf-page-active {
    background: #2e6f40;
    border-color: #2e6f40;
    color: #fff;
    font-weight: 700;
}

.kcf-page-dots {
    padding: 0 0.25rem;
    color: #999;
}

.kcf-page-prev,
.kcf-page-next {
    font-weight: 600;
    padding: 0 0.75rem;
}

/* ── No Results / Error ── */
.kcf-no-results,
.kcf-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.kcf-error {
    color: #c62828;
}

/* ── Responsive ── */

/* Tablet */
@media (max-width: 900px) {
    .kcf-sidebar {
        width: 260px;
    }

    .kcf-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .kcf-layout {
        flex-direction: column;
    }

    .kcf-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
        border: none;
    }

    .kcf-sidebar-toggle {
        display: flex;
    }

    .kcf-sidebar-inner {
        display: none;
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-top: 0.5rem;
        max-height: 60vh;
        overflow-y: auto;
    }

    .kcf-sidebar-inner.kcf-sidebar-open {
        display: block;
    }

    .kcf-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .kcf-product-table {
        font-size: 0.75rem;
    }

    .kcf-product-table th,
    .kcf-product-table td {
        padding: 0.3rem 0.5rem;
    }

    /* Model nav mobile */
    .kcf-model-nav {
        border-bottom-width: 1px;
    }

    /* Search mobile */
    .kcf-search-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .kcf-search-dropdown {
        max-height: 50vh;
    }

    .kcf-search-item-name {
        display: none; /* Save space on mobile */
    }

    .kcf-search-banner {
        flex-direction: column;
        gap: 0.4rem;
        align-items: flex-start;
    }

    .kcf-search-banner-clear {
        margin-left: 0;
    }
}

/* ── Page-Level Overrides (Product Finder as home) ── */

/* Hide the large page title — the filter UI IS the content */
.page-template-default .wp-block-post-title,
.home .wp-block-post-title {
    display: none;
}

/* Reduce the huge theme spacing around the content area */
.home main {
    margin-top: 0.5rem !important;
}
.home main > .wp-block-group {
    padding-top: 0.5rem !important;
    padding-bottom: 1rem !important;
}

/* ── Site Logo ── */
.wp-block-site-logo.is-default-size img {
    width: 275px !important;
}

/* ── Utility Nav Styling ── */
/* Smaller, lighter nav links so they read as utility nav */
header .wp-block-navigation a {
    font-size: 0.78rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.7;
}
header .wp-block-navigation a:hover {
    opacity: 1;
}

/* ── Range Filters (Pressure, Flow) ── */
.kcf-range-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.kcf-range-field {
    flex: 1;
}

.kcf-range-field label {
    display: block;
    font-size: 0.72rem;
    color: #666;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kcf-range-input {
    width: 100%;
    padding: 0.35rem 0.4rem;
    font-size: 0.82rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    outline: none;
    -moz-appearance: textfield;
}

.kcf-range-input::-webkit-inner-spin-button,
.kcf-range-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kcf-range-input:focus {
    border-color: #2e6f40;
    box-shadow: 0 0 0 1px rgba(46, 111, 64, 0.2);
}

.kcf-range-unit {
    font-size: 0.72rem;
    color: #999;
    padding-bottom: 0.45rem;
    white-space: nowrap;
}

.kcf-range-apply {
    display: block;
    width: 100%;
    padding: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: #2e6f40;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}

.kcf-range-apply:hover {
    background: #245a33;
}

.kcf-range-clear {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0;
    font-size: 0.75rem;
    color: #2e6f40;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.kcf-range-clear:hover {
    color: #245a33;
}

.kcf-range-hint {
    font-size: 0.7rem;
    color: #999;
    margin-top: 0.3rem;
}

/* ── Product Resources Tab ── */
.kcf-resources h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #1a1a1a;
}

.kcf-resource-group {
    margin-bottom: 1.25rem;
}

.kcf-resource-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e5e5e5;
}

.kcf-resource-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kcf-resource-item {
    margin: 0;
    padding: 0;
}

.kcf-resource-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.5rem;
    color: #2e6f40;
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 4px;
    transition: background 0.15s;
}

.kcf-resource-item a:hover {
    background: #f0f7f2;
    color: #245a33;
}

.kcf-resource-icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.kcf-resource-item a:hover .kcf-resource-icon {
    opacity: 1;
}

/* ── Landing-page Resources include ([kcf_resources]) ── */
.kcf-resources-include {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin: 1.5rem 0;
}

.kcf-resources-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem 2.5rem;
}

/* ── Login Request Form ── */
.kcf-lr-wrap {
    max-width: 600px;
    margin: 0 auto;
    /* Clear the fixed header (top) and lift off the footer (bottom). The
       request-access page has no hero, so the content sits directly under
       the header without this. */
    padding: 140px 20px 80px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (max-width: 782px) {
    .kcf-lr-wrap { padding-top: 110px; }
}

/* ── Calculator form pages (GF) — top/bottom breathing room ──
   The web-team calculator pages (minimum-submergence, velocity-head,
   shaft-column-stretch) have a hero up top so top spacing was fine, but the
   last field / reCAPTCHA sat only ~50-80px above the dark footer, reading as
   cramped. Match the buffer the other form pages already have. */
.calculator_form {
    /* !important: Gravity Forms resets the form's padding to 0 via its
       higher-specificity #gform_wrapper_N inline styles, so a plain class
       rule never wins. */
    padding-top: 20px !important;
    padding-bottom: 72px !important;
}
@media (max-width: 782px) {
    .calculator_form { padding-bottom: 48px !important; }
}

.kcf-lr-intro h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.kcf-lr-intro p {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 0.5rem;
}

.kcf-lr-intro a {
    color: #2e6f40;
}

.kcf-lr-form {
    margin-top: 1.5rem;
}

.kcf-lr-row {
    margin-bottom: 1rem;
}

.kcf-lr-row-2col {
    display: flex;
    gap: 1rem;
}

.kcf-lr-row-2col .kcf-lr-field {
    flex: 1;
}

.kcf-lr-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.kcf-lr-field label .required {
    color: #c0392b;
}

.kcf-lr-field input,
.kcf-lr-field textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
}

.kcf-lr-field input:focus,
.kcf-lr-field textarea:focus {
    border-color: #2e6f40;
    box-shadow: 0 0 0 2px rgba(46, 111, 64, 0.15);
}

.kcf-lr-field textarea {
    resize: vertical;
}

.kcf-lr-submit {
    display: inline-block;
    padding: 0.65rem 2rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #2e6f40;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.kcf-lr-submit:hover {
    background: #245a33;
}

.kcf-lr-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kcf-lr-status {
    margin-top: 0.75rem;
    padding: 0.65rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 4px;
}

.kcf-lr-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.kcf-lr-success {
    text-align: center;
    padding: 2rem 1rem;
}

.kcf-lr-success-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: #2e6f40;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.kcf-lr-success h3 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.kcf-lr-success p {
    font-size: 0.9rem;
    color: #555;
}

.kcf-lr-success a {
    color: #2e6f40;
}

@media (max-width: 600px) {
    .kcf-lr-row-2col {
        flex-direction: column;
        gap: 0;
    }
}

/* ══════════════════════════════════════════
   Single Product Page — tighter layout
   ══════════════════════════════════════════ */

/* Constrain page width */
.single-product .wp-block-group.alignwide,
.single-product .entry-content {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Reduce top spacing */
.single-product main {
    margin-top: 0 !important;
}
.single-product main > .wp-block-group {
    padding-top: 0.5rem !important;
    padding-bottom: 1rem !important;
}

/* Image gallery — constrain height */
.single-product .wp-block-woocommerce-product-image-gallery {
    max-height: 400px;
    overflow: hidden;
}
.single-product .woocommerce-product-gallery img {
    max-height: 380px;
    object-fit: contain;
    width: 100%;
}
/* Hide the zoom icon */
.single-product .woocommerce-product-gallery__trigger {
    display: none;
}

/* Product title — way smaller */
.single-product .wp-block-post-title {
    font-size: 1.3rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.25rem !important;
    font-weight: 700 !important;
}

/* Price block */
.single-product .wp-block-woocommerce-product-price {
    font-size: 1.1rem !important;
    font-weight: 700;
    color: #2e6f40;
    margin-bottom: 0.25rem !important;
}

/* Login prompt (from tiered pricing) */
.single-product .ktp-login-prompt {
    font-size: 0.85rem;
    margin: 0.25rem 0 0.5rem;
}
.single-product .ktp-login-prompt a {
    color: #2e6f40;
    font-weight: 600;
}

/* Excerpt / short description */
.single-product .wp-block-post-excerpt {
    font-size: 0.82rem !important;
    color: #555;
    line-height: 1.5;
    margin: 0.25rem 0 0.5rem !important;
}

/* Product meta (SKU, categories) */
.single-product .wp-block-woocommerce-product-meta {
    font-size: 0.78rem;
    color: #666;
    margin-top: 0.5rem !important;
}
.single-product .wp-block-woocommerce-product-meta a {
    color: #2e6f40;
}

/* Tighten the two columns gap */
.single-product .wp-block-columns.alignwide {
    gap: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Add to cart button */
.single-product .single_add_to_cart_button,
.single-product .wp-block-button__link {
    background: #2e6f40 !important;
    border: none;
    color: #fff !important;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}
.single-product .single_add_to_cart_button:hover,
.single-product .wp-block-button__link:hover {
    background: #245733 !important;
}

/* Tabs (Additional Info, Resources) */
.single-product .wp-block-woocommerce-product-details {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Tab panel headings — "Additional information", etc. */
.single-product .woocommerce-Tabs-panel > h2,
.single-product .woocommerce-Tabs-panel > h3 {
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem !important;
}

/* Attributes table — tighter rows */
.single-product .woocommerce-product-attributes {
    font-size: 0.82rem;
}
.single-product .woocommerce-product-attributes th,
.single-product .woocommerce-product-attributes td {
    padding: 0.35rem 0.75rem !important;
}
.single-product .woocommerce-product-attributes th {
    font-weight: 600;
    color: #333;
    width: 30%;
}
.single-product .woocommerce-product-attributes td p {
    margin: 0;
}

/* Related products — compact */
.single-product .wp-block-woocommerce-product-collection {
    margin-top: 1rem !important;
    padding-top: 1rem;
    border-top: 1px solid #e8e8e8;
}
.single-product .wp-block-woocommerce-product-collection h2 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
}
.single-product .wp-block-woocommerce-product-collection .wc-block-product-image img {
    max-height: 140px;
    object-fit: contain;
}
.single-product .wp-block-woocommerce-product-collection .wp-block-post-title {
    font-size: 0.75rem !important;
    line-height: 1.3 !important;
}
.single-product .woocommerce-tabs ul.tabs {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 2px solid #e0e0e0;
}
.single-product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
}
.single-product .woocommerce-tabs ul.tabs li a {
    display: block;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.single-product .woocommerce-tabs ul.tabs li.active a {
    color: #2e6f40;
    border-bottom-color: #2e6f40;
}
.single-product .woocommerce-tabs ul.tabs li a:hover {
    color: #2e6f40;
}
.single-product .woocommerce-tabs .panel {
    padding: 1rem 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Attributes table inside tabs — compact */
.single-product .woocommerce-tabs .shop_attributes {
    width: 100%;
    border-collapse: collapse;
}
.single-product .woocommerce-tabs .shop_attributes th {
    font-weight: 600;
    text-align: left;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    width: 35%;
    color: #333;
}
.single-product .woocommerce-tabs .shop_attributes td {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
}
.single-product .woocommerce-tabs .shop_attributes tr:nth-child(even) {
    background: #f8f8f8;
}
.single-product .woocommerce-tabs .shop_attributes td p {
    margin: 0;
}

/* Related products — full width, smaller cards */
.single-product div.product .related.products {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8e8e8;
}
.single-product .related.products > h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.single-product .related.products ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.single-product .related.products ul.products li.product {
    text-align: center;
}
.single-product .related.products ul.products li.product img {
    max-height: 140px;
    object-fit: contain;
    width: 100%;
}
.single-product .related.products ul.products li.product h2,
.single-product .related.products ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.75rem;
    margin: 0.3rem 0;
    line-height: 1.3;
}

/* Breadcrumb — smaller */
.single-product .woocommerce-breadcrumb {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.5rem;
}
.single-product .woocommerce-breadcrumb a {
    color: #2e6f40;
}

/* Hide duplicate "Login for Pricing" text if present */
.single-product div.product > .price:empty {
    display: none;
}

/* Responsive — stack on mobile */
@media (max-width: 768px) {
    .single-product div.product {
        grid-template-columns: 1fr;
    }
    .single-product div.product div.woocommerce-product-gallery {
        max-height: 300px;
    }
    .single-product .related.products ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}
