/* KHF Phytofusion product directory — consolidated stylesheet
   Replace the old directory CSS rather than append it.
   Designed for existing khf-dir-* PHP markup and JS. */
:root{--khf-green:#07583f;--khf-dark:#153f32;--khf-sage:#e6ecd9;--khf-line:#e5e9e4;--khf-text:#30423a}
.khf-dir-container{width:min(1508px,calc(100% - 48px));margin-inline:auto}
/* Hero: image remains responsive; text overlays left, never baked into image */
.khf-dir-hero{position:relative;width:100%;overflow:hidden;margin-top:60px;background:#eae9df}
.khf-dir-hero-picture{display:block;width:100%;position:relative}
.khf-dir-hero-picture img,.khf-dir-hero-img{display:block;width:100%;height:clamp(200px,16vw,310px);object-fit:cover;object-position:center}
.khf-dir-hero:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(250,249,244,.93) 0%,rgba(250,249,244,.78) 34%,rgba(250,249,244,0) 68%);pointer-events:none;z-index:1}
.khf-dir-hero-content{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;padding:24px max(24px,calc((100% - 1508px)/2));color:var(--khf-dark);pointer-events:none}
.khf-dir-hero-content h1{font-family:Georgia,'Times New Roman',serif;font-size:clamp(30px,3.6vw,58px);font-weight:600;line-height:1.15;color:var(--khf-dark);margin:0 0 12px}
.khf-dir-breadcrumb{display:flex;gap:10px;align-items:center;justify-content:flex-start;flex-wrap:wrap;font-size:13px;color:var(--khf-dark);order:-1;margin-bottom:12px}
.khf-dir-breadcrumb a{color:var(--khf-dark);text-decoration:none;pointer-events:auto}.khf-dir-breadcrumb a:hover{text-decoration:underline}
/* Category tabs: distinct from header underline and search CTA */
.khf-dir-tabs-wrap{background:#fff;}
.khf-dir-tabs{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:10px 0}
.khf-dir-tab{display:flex;flex:0 0 auto;align-items:center;justify-content:center;min-height:40px;padding:10px 24px;border-radius:10px;color:#34463d!important;text-align:center;text-decoration:none!important;font-size:14px;font-weight:500;transition:background .2s,color .2s}
.khf-dir-tab:hover{background:#f1f4ed;color:var(--khf-green)!important}
.khf-dir-tab.is-active,.khf-dir-tab.is-active:hover{background:var(--khf-sage);color:var(--khf-dark)!important;font-weight:600}
/* Directory search and A–Z */
.khf-dir{padding:36px 0 72px;color:var(--khf-text)}
.khf-dir-search{display:grid;grid-template-columns:minmax(0,1fr) 160px;gap:14px;align-items:center;margin:0 0 25px;}
.khf-dir-search input{width:100%;height:48px;padding:0 20px!important;border:1px solid #e0e5e0!important;border-radius:30px!important;background:#fff!important;box-shadow:none!important;font-size:14px;color:var(--khf-text);outline-offset:2px}
.khf-dir-search input:focus{border-color:#87aa94!important}
.khf-dir-search button,.khf-dir-inquiry{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:46px;padding:12px 20px;border:0;border-radius:25px;background:var(--khf-green)!important;color:#fff!important;font-size:14px;font-weight:600;text-decoration:none!important;cursor:pointer;transition:background .2s}
.khf-dir-search button:hover,.khf-dir-inquiry:hover{background:#064731!important}
.khf-dir-alphabet{display:flex;align-items:center;justify-content:space-between;gap:5px;margin:0 0 20px;overflow-x:auto;padding:2px 0 7px;scrollbar-width:thin;border:0}
.khf-dir-alphabet a{display:flex;flex:0 0 35px;align-items:center;justify-content:center;min-height:35px;width:35px;padding:0 3px;border-radius:50%;color:#263e32!important;text-decoration:none!important;font-size:13px;transition:background .15s,border-color .15s}
.khf-dir-alphabet a:hover{background:#f1f4ed;border-color:#d9e5d8}
.khf-dir-alphabet a.is-active{background:#e6ecd9;color:var(--khf-green)!important;border-color:var(--khf-green);font-weight:600}
.khf-dir-alphabet a:first-child{flex-basis:55px;width:55px;border-radius:22px}
/* Product table */
.khf-dir-table-scroll{width:100%;overflow-x:auto;border-radius:10px;}
.khf-dir-table{width:100%;min-width:800px;border-collapse:collapse;table-layout:fixed;margin:0!important;border:0!important;font-size:14px}
.khf-dir-table th,.khf-dir-table td{box-sizing:border-box;text-align:left;vertical-align:middle;border:0!important}
.khf-dir-table thead th{background:#e9eee8;color:var(--khf-dark)!important;padding:15px 20px;font-size:14px;font-weight:700;line-height:1.4}
.khf-dir-table thead th:nth-child(1){width:25%}.khf-dir-table thead th:nth-child(2){width:25%}.khf-dir-table thead th:nth-child(3){width:30%}.khf-dir-table thead th:nth-child(4){width:20%}
.khf-dir-product-row{background:#fff;border-bottom:1px solid var(--khf-line)!important;cursor:pointer}
.khf-dir-product-row td{padding:15px 20px!important;color:var(--khf-text);line-height:1.5;overflow-wrap:anywhere}
.khf-dir-table .khf-dir-product-row:hover{background:#f5f8f4}
.khf-dir-table .khf-dir-product-row.is-expanded,.khf-dir-table .khf-dir-product-row[aria-expanded="true"]{background:#f1f5ef}
.khf-dir-table .khf-dir-product-row:focus-visible{outline:2px solid var(--khf-green);outline-offset:-2px}
.khf-dir-name{color:var(--khf-green);font-weight:600}.khf-dir-muted{color:#a2aca5}
.khf-dir-detail-row[hidden]{display:none!important}
.khf-dir-detail-cell{padding:0!important;border:0!important;background:#fff}
/* Expanded inline panel */
.khf-dir-detail{background:#fff;overflow:hidden;margin:0;}
.khf-dir-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:22px 26px 8px;background:#fff;color:var(--khf-dark);font-size:30px;font-weight:600}
.khf-dir-detail-heading>span{font-family:Georgia,'Times New Roman',serif;line-height:1.15;min-width:0;overflow-wrap:anywhere}
.khf-dir-detail-body{padding:12px 26px 24px}
.khf-dir-detail-main{display:flex;flex-direction:column;align-items:flex-start;gap:24px;min-width:0}
.khf-dir-spec-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:30px;row-gap:18px;width:100%;margin:0;padding:0}
.khf-dir-spec-grid>div{min-width:0}
.khf-dir-spec-grid dt{margin:0 0 5px;color:#7b8981;font-size:13px;font-weight:400;line-height:1.4}
.khf-dir-spec-grid dd{margin:0;color:#35473e;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.khf-dir-mobile-field,.khf-dir-mobile-extra-specs{display:none}
.khf-dir-detail-photo{display:flex;justify-content:flex-end;min-width:0;padding: 1rem; width: 100%; height: 100%;}
.khf-dir-detail-photo img{display:block;width:100%;max-width:240px;height:240px;object-fit:cover;border-radius:9px}
.khf-dir-inquiry{border-radius:8px;min-height:44px;padding:11px 20px}
.khf-dir-inquiry svg{width:20px;height:20px;flex:none}
.khf-dir-no-specs{color:#69776e;font-size:14px;line-height:1.6;margin:0}
.khf-dir-pagination{margin-top:28px}.khf-dir-pagination .woocommerce-pagination ul{border:0;display:flex;gap:6px}.khf-dir-pagination .woocommerce-pagination ul li{border:0}
.khf-dir-empty{padding:22px;border:1px solid var(--khf-line);background:#f7faf8}
.khf-dir-mobile-nav{display:none!important}.khf-dir-mobile-list[hidden]{display:none!important}
/* Tablet */
@media(max-width:991.98px){.khf-dir-hero{margin-top:70px}.khf-dir-detail-photo img{height:200px}.khf-dir-tab{padding-inline:16px}}
/* Mobile: preserve two-column product rows and 2-column details */
@media(max-width:767.98px){
 .khf-dir-container{width:calc(100% - 30px)}
 .khf-dir{padding:26px 0 50px}
 .khf-dir-hero{margin-top:70px}
 .khf-dir-hero-picture img,.khf-dir-hero-img{height:190px;object-position:65% center}
 .khf-dir-hero:before{background:linear-gradient(90deg,rgba(250,249,244,.93),rgba(250,249,244,.65) 65%,rgba(250,249,244,.1))}
 .khf-dir-hero-content{padding:15px 20px;align-items:flex-start;text-align:left}
 .khf-dir-hero-content h1{font-size:clamp(24px,6vw,34px);margin-bottom:8px;width: 100%;}
 .khf-dir-breadcrumb{display: none;}
 .khf-dir-tabs-wrap{display:none!important}
 .khf-dir-mobile-nav{display:block!important;width:100%;background:#fff}
 .khf-dir-mobile-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:48px;padding:0 18px;border:0;border-radius:0;background:var(--khf-green);color:#fff;cursor:pointer}
 .khf-dir-mobile-title{flex:1;text-align:center;font-size:14px;font-weight:600;color:#fff}
 .khf-dir-mobile-arrow{display:flex;align-items:center;justify-content:center;width:22px;font-size:28px;line-height:1;color:#fff}
 .khf-dir-mobile-grid{display:grid;grid-template-columns:repeat(2,7px);grid-template-rows:repeat(2,7px);gap:2px;width:22px;justify-content:center}
 .khf-dir-mobile-grid span{background:#fff;border-radius:1px}
 .khf-dir-mobile-list{background:#fff;box-shadow:0 4px 12px rgba(0,0,0,.08)}
 .khf-dir-mobile-link{display:flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;color:#42564a!important;text-decoration:none!important;font-size:14px}
 .khf-dir-mobile-link:hover,.khf-dir-mobile-link.is-active{background:#edf3e8;color:var(--khf-green)!important}
 .khf-dir-search{grid-template-columns:minmax(0,1fr) 100px;gap:9px;margin-bottom:14px}
 .khf-dir-search input{height:44px;padding:0 13px!important;font-size:12px}
 .khf-dir-search button{min-height:44px;height:44px;padding:0 8px;font-size:12px;white-space:nowrap}
 .khf-dir-alphabet{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px 4px;overflow:visible;margin-bottom:20px;padding:0}
 .khf-dir-alphabet a,.khf-dir-alphabet a:first-child{width:100%;min-width:0;min-height:35px;flex:initial;font-size:12px;border-radius:20px}
 .khf-dir-table-scroll{overflow-x:hidden!important}
 .khf-dir-table{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important}
 .khf-dir-table thead,.khf-dir-table tbody{display:block!important;width:100%!important}
 .khf-dir-table thead tr,.khf-dir-table .khf-dir-product-row{display:grid!important;grid-template-columns:minmax(0,58%) minmax(0,42%);width:100%!important}
 .khf-dir-table thead th{display:block!important;width:auto!important;min-width:0!important;padding:13px 12px!important;font-size:12px!important}
 .khf-dir-table thead th:nth-child(n+3){display:none!important}
 .khf-dir-table .khf-dir-product-row td{display:block!important;width:auto!important;min-width:0!important;padding:14px 12px!important;font-size:13px!important;white-space:normal!important;overflow-wrap:anywhere!important}
 .khf-dir-table .khf-dir-product-row td:nth-child(n+3){display:none!important}
 .khf-dir-table .khf-dir-detail-row:not([hidden]){display:block!important;width:100%!important}
 .khf-dir-table .khf-dir-detail-cell{display:block!important;width:100%!important;max-width:100%!important;padding:0!important}
 .khf-dir-detail{width:100%;}
 .khf-dir-detail-heading{padding:17px 15px 6px;font-size:25px}
 .khf-dir-detail-body{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:18px;padding:12px 15px 20px}
 .khf-dir-detail-main{width:100%;align-items:stretch;gap:20px}
 .khf-dir-spec-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;column-gap:13px;row-gap:17px;width:100%;}
 .khf-dir-spec-grid dt{font-size:12px}.khf-dir-spec-grid dd{font-size:13px;}
 .khf-dir-spec-grid>.khf-dir-mobile-field{display:block!important}
 .khf-dir-detail-photo{width:100%;justify-content:flex-start}
 .khf-dir-detail-photo img{width:100%;max-width:100%;height:190px;}
 .khf-dir-inquiry{width:100%;max-width:100%;white-space:normal;text-align:center}
}

/* Safety: directory section must remain visible inside custom full-width template */
.khf-dir.khf-dir-container{display:block;visibility:visible;opacity:1;height:auto;min-height:0;overflow:visible;width: 100%;padding-left: 7%;padding-right: 7%;background: #f9f9f9;}

/* ===== 2026-10: Requested UI refinements (no feature changes) ===== */
/* Breadcrumb uses >; separation remains visible and light. */
.khf-dir-crumb-separator{color:#71877b;font-size:14px;font-weight:400;line-height:1}
/* Three category tabs only; subtle vertical separators between neighbors. */
.khf-dir-tabs{gap:0}
.khf-dir-tab{position:relative;margin:0 8px}
.khf-dir-tab+.khf-dir-tab::before{content:"";position:absolute;left:-9px;top:50%;transform:translateY(-50%);width:1px;height:18px;background:#d8ded9;pointer-events:none}
/* A–Z: white circles by default, dark green for the selected filter. */
.khf-dir-alphabet a{background:#fff;border-radius:50%;color:#304b3d!important}
.khf-dir-alphabet a:hover{background:#edf3e9;border-color:#aec5b4;color:#07583f!important}
.khf-dir-alphabet a.is-active,.khf-dir-alphabet a.is-active:hover{background:#07583f!important;border-color:#07583f!important;color:#fff!important;box-shadow:none;font-weight:600}
.khf-dir-alphabet a:first-child{border-radius:22px}
/* Chevron on the last cell of each clickable product row; rotates when expanded. */
.khf-dir-product-row td:last-child{position:relative;padding-right:54px!important}
.khf-dir-product-row td:last-child::after{content:"";position:absolute;right:23px;top:50%;width:9px;height:9px;border-right:1.8px solid #0d6549;border-bottom:1.8px solid #0d6549;transform:translateY(-65%) rotate(45deg);transition:transform .2s ease;pointer-events:none}
.khf-dir-product-row.is-expanded td:last-child::after,.khf-dir-product-row[aria-expanded="true"] td:last-child::after{transform:translateY(-25%) rotate(225deg)}
/* Detail heading is plain text, with no separate close-circle control. */
.khf-dir-detail-heading{justify-content:flex-start}
@media(max-width:767.98px){
  .khf-dir-product-row td:nth-child(2){position:relative;}
  .khf-dir-product-row td:nth-child(2)::after{content:"";position:absolute;right:12px;top:50%;width:8px;height:8px;border-right:1.8px solid #0d6549;border-bottom:1.8px solid #0d6549;transform:translateY(-65%) rotate(45deg);pointer-events:none}
  .khf-dir-product-row.is-expanded td:nth-child(2)::after,.khf-dir-product-row[aria-expanded="true"] td:nth-child(2)::after{transform:translateY(-25%) rotate(225deg)}
  .khf-dir-product-row td:last-child::after{display:none}
  .khf-dir-tab+.khf-dir-tab::before{display:none}
}

/* ===== October refinements: nav, search, A-Z, row chevrons ===== */
/* Breadcrumb separators point to the right */
.khf-dir-breadcrumb .khf-dir-crumb-separator{display:inline-block;transform:none!important;font-size:14px;line-height:1;color:#65776e}
/* Keep the existing three categories and add All Products */
.khf-dir-tabs{gap:0}
.khf-dir-tab{position:relative;margin:0 8px}
.khf-dir-tab+.khf-dir-tab::before{content:"";position:absolute;left:-9px;top:50%;transform:translateY(-50%);height:18px;width:1px;background:#d8ded9;pointer-events:none}
/* Search icon sits inside the input, not a separate button */
.khf-dir-search-field{position:relative;min-width:0;width:100%}
.khf-dir-search-field .khf-dir-search-icon{position:absolute;left:18px;top:50%;transform:translateY(-50%);z-index:1;color:#3a6054;pointer-events:none}
.khf-dir-search .khf-dir-search-field input{padding-left:50px!important}
/* A-Z circles: white unselected, deep green selected */
.khf-dir-alphabet a:not(.is-active){background:#fff!important;border-radius:50%;}
.khf-dir-alphabet a:not(.is-active):hover{background:#edf3e9!important;border-color:#aec5b4!important}
.khf-dir-alphabet a.is-active,.khf-dir-alphabet a.is-active:hover{background:#07583f!important;border-color:#07583f!important;color:#fff!important;border-radius:50%;box-shadow:none}
.khf-dir-alphabet a:first-child,.khf-dir-alphabet a:first-child.is-active{border-radius:22px}
/* A single circled chevron in the existing CAS cell */
.khf-dir-product-row .khf-dir-cas-cell{position:relative;padding-right:58px!important}
.khf-dir-product-row .khf-dir-cas-cell::after{content:none!important;display:none!important}
.khf-dir-row-arrow{position:absolute;right:17px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:1px solid #2c7059;border-radius:50%;background:#fff;color:#14543e;pointer-events:none;transition:transform .2s ease,background .2s ease}
.khf-dir-product-row[aria-expanded="true"] .khf-dir-row-arrow{transform:translateY(-50%) rotate(180deg)}
.khf-dir-product-row:hover .khf-dir-row-arrow{background:#eef5ef}
@media(max-width:767.98px){
  .khf-dir-search-field .khf-dir-search-icon{left:12px;width:16px;height:16px}
  .khf-dir-search .khf-dir-search-field input{padding-left:36px!important}
  .khf-dir-alphabet a:not(.is-active){border-radius:50%}
  /* Mobile displays only first two table columns; put arrow on the second */
  .khf-dir-product-row td:nth-child(2)::after{content:none!important;display:none!important}
  .khf-dir-product-row .khf-dir-cas-cell{display:none!important}
  .khf-dir-product-row td:nth-child(2){position:relative;}
  .khf-dir-product-row[aria-expanded="true"] td:nth-child(2)::before{transform:translateY(-25%) rotate(225deg)}
  .khf-dir-alphabet a{width: 40px;height: 40px;}
  .khf-dir-search span{display: none;}
}
