/*! KokoriKoi – Boutique UX · Crimson Factory */
.kkb,.kkb-portal{--kkb-primary:#333399;--kkb-accent:#e8344e;--kkb-line:#e4e6f2;--kkb-soft:#f4f5fb}
.kkb{--kkb-cols:3;
	display:grid;grid-template-columns:270px minmax(0,1fr);gap:36px;align-items:start;width:100%;box-sizing:border-box}
.kkb *,.kkb *::before,.kkb *::after,.kkb-portal *,.kkb-portal *::before,.kkb-portal *::after{box-sizing:border-box}
.kkb .screen-reader-text,.kkb-portal .screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- Barre latérale ---------- */
.kkb-side{position:sticky;top:110px;max-height:calc(100vh - 130px);overflow:auto;background:#fff;border:1px solid var(--kkb-line);border-radius:18px;padding:6px 20px 20px}
.kkb-side-head,.kkb-toggle,.kkb-overlay,.kkb-close{display:none}
.kkb-facet{border-bottom:1px solid var(--kkb-line);padding:14px 0}
.kkb-facet:last-of-type{border-bottom:0}
.kkb-facet summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;font-weight:700;color:var(--kkb-primary);font-size:15px;letter-spacing:.2px}
.kkb-facet summary::-webkit-details-marker{display:none}
.kkb-facet summary::after{content:"";width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .2s;margin-right:4px}
.kkb-facet[open] summary::after{transform:rotate(-135deg)}
.kkb-facet-body{padding-top:12px}

.kkb-check,.kkb-switch{display:flex;align-items:center;gap:10px;padding:6px 0;cursor:pointer;font-size:14px;line-height:1.3}
.kkb-check input,.kkb-switch input{position:absolute;opacity:0;pointer-events:none}
.kkb-box{flex:none;width:18px;height:18px;border:2px solid #b9bdd8;border-radius:5px;display:grid;place-items:center;transition:.15s;background:#fff}
.kkb-check input:checked+.kkb-box{background:var(--kkb-primary);border-color:var(--kkb-primary)}
.kkb-check input:checked+.kkb-box::after{content:"";width:9px;height:5px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.kkb-check input:focus-visible+.kkb-box,.kkb-switch input:focus-visible+.kkb-track{outline:2px solid var(--kkb-accent);outline-offset:2px}
.kkb-lbl{flex:1}
.kkb-n{font-size:12px;color:#7b7fa0;background:var(--kkb-soft);border-radius:20px;padding:1px 8px}
.kkb-morebtn{background:none;border:0;color:var(--kkb-accent);font-weight:600;cursor:pointer;padding:6px 0;font-size:13px}
.kkb-switch{margin-top:8px;padding-top:12px;border-top:1px dashed var(--kkb-line)}
.kkb-track{flex:none;width:38px;height:22px;border-radius:22px;background:#c9cce2;position:relative;transition:.2s}
.kkb-track::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.kkb-switch input:checked+.kkb-track{background:var(--kkb-primary)}
.kkb-switch input:checked+.kkb-track::after{transform:translateX(16px)}

/* Curseur double */
.kkb-range{padding:4px 6px 0}
.kkb-range-track{position:relative;height:26px}
.kkb-range-track::before{content:"";position:absolute;left:0;right:0;top:11px;height:4px;border-radius:4px;background:var(--kkb-line)}
.kkb-range-fill{position:absolute;top:11px;height:4px;border-radius:4px;background:var(--kkb-primary)}
.kkb-range-track input[type=range]{position:absolute;left:0;top:0;width:100%;height:26px;margin:0;background:none;pointer-events:none;-webkit-appearance:none;appearance:none}
.kkb-range-track input[type=range]::-webkit-slider-runnable-track{background:none;height:26px}
.kkb-range-track input[type=range]::-moz-range-track{background:none}
.kkb-range-track input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;pointer-events:auto;width:20px;height:20px;margin-top:3px;border-radius:50%;background:#fff;border:3px solid var(--kkb-primary);box-shadow:0 1px 4px rgba(0,0,0,.25);cursor:grab}
.kkb-range-track input[type=range]::-moz-range-thumb{pointer-events:auto;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--kkb-primary);box-shadow:0 1px 4px rgba(0,0,0,.25);cursor:grab}
.kkb-range-track input[type=range]:focus-visible::-webkit-slider-thumb{outline:2px solid var(--kkb-accent);outline-offset:2px}
.kkb-range-vals{display:flex;justify-content:space-between;margin-top:8px;font-size:13px;font-weight:600;color:var(--kkb-primary)}

.kkb-side-foot{display:flex;flex-direction:column;gap:10px;padding-top:16px}
.kkb-apply{display:none;background:var(--kkb-primary);color:#fff;border:0;border-radius:12px;padding:13px;font-weight:700;font-size:15px;cursor:pointer}
.kkb-reset{text-align:center;font-size:13px;color:var(--kkb-accent);font-weight:600;text-decoration:underline}

/* ---------- Résultats ---------- */
.kkb-results{transition:opacity .2s}
.kkb-results.is-loading{opacity:.45;pointer-events:none}
.kkb-top{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px;flex-wrap:wrap}
.kkb-count{margin:0;color:#7b7fa0;font-size:14px}
.kkb-sort select{border:1px solid var(--kkb-line);border-radius:12px;padding:10px 38px 10px 14px;font-size:14px;background-color:#fff;color:var(--kkb-primary);font-weight:600;min-width:200px;cursor:pointer}
.kkb-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}
.kkb-chip{display:inline-flex;gap:6px;align-items:center;background:var(--kkb-soft);color:var(--kkb-primary);border:1px solid var(--kkb-line);border-radius:30px;padding:5px 12px;font-size:13px;font-weight:600;text-decoration:none;transition:.15s}
.kkb-chip:hover{border-color:var(--kkb-accent);color:var(--kkb-accent)}
.kkb-chip-reset{background:none;text-decoration:underline;border-color:transparent}

/* Grille : s'appuie sur la boucle WooCommerce / Divi pour garder badges et hooks */
.kkb ul.products{display:grid!important;grid-template-columns:repeat(var(--kkb-cols),minmax(0,1fr))!important;gap:26px;margin:0!important;padding:0!important;list-style:none}
.kkb ul.products::before,.kkb ul.products::after{display:none!important}
.kkb ul.products li.product{position:relative;float:none!important;width:auto!important;margin:0!important;padding:0 0 16px!important;background:#fff;border:1px solid var(--kkb-line);border-radius:18px;overflow:hidden;transition:transform .2s,box-shadow .2s}
.kkb ul.products li.product:hover{transform:translateY(-4px);box-shadow:0 14px 30px -12px rgba(51,51,153,.35)}
.kkb ul.products li.product a img{width:100%!important;height:auto;aspect-ratio:4/3;object-fit:cover;display:block;margin:0 0 12px!important;border-radius:0}
.kkb ul.products li.product .woocommerce-loop-product__title,.kkb ul.products li.product h2{padding:0 16px;margin:0 0 4px;color:var(--kkb-primary);font-size:17px}
.kkb ul.products li.product .price{display:block;padding:0 16px;color:#222;font-weight:600}
.kkb ul.products li.product .button{margin:12px 16px 0}

.kkb-empty{text-align:center;padding:60px 20px;background:var(--kkb-soft);border-radius:18px}

.kkb-pagination{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;margin-top:34px}
.kkb-pagination .page{min-width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--kkb-line);border-radius:12px;text-decoration:none;color:var(--kkb-primary);font-weight:600;background:#fff;transition:.15s}
.kkb-pagination .page:hover{border-color:var(--kkb-primary)}
.kkb-pagination .page.is-current{background:var(--kkb-primary);border-color:var(--kkb-primary);color:#fff}
.kkb-pagination .gap{display:grid;place-items:center;padding:0 4px;color:#7b7fa0}

/* ---------- Tablette ---------- */
@media (max-width:1100px){
	.kkb{grid-template-columns:240px minmax(0,1fr);gap:24px}
	.kkb ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* ---------- Mobile / tablette (breakpoint Divi : 980px) : filtres en tiroir ---------- */
@media (max-width:980px){
	.kkb{display:block;max-width:100%}
	.kkb-main{min-width:0}
	.kkb-toggle{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;background:var(--kkb-primary);color:#fff;border:0;border-radius:14px;padding:14px 20px;font-weight:700;cursor:pointer;margin:0 0 14px;font-size:16px}
	.kkb-toggle-n{background:var(--kkb-accent);border-radius:20px;min-width:22px;height:22px;display:inline-grid;place-items:center;font-size:12px;padding:0 6px}
	.kkb-toggle-n[hidden]{display:none}
	.kkb-overlay{display:block;position:fixed;inset:0;background:rgba(15,15,50,.55);z-index:2147482999}
	.kkb-overlay[hidden]{display:none}
	.kkb-side{position:fixed;top:0;left:0;bottom:0;width:min(90vw,380px);max-height:none;height:100dvh;border-radius:0 20px 20px 0;z-index:2147483000;transform:translateX(-105%);visibility:hidden;transition:transform .28s ease,visibility 0s .28s;padding:0 20px;border:0;box-shadow:0 0 40px rgba(0,0,0,.25);overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
	.kkb-open .kkb-side{transform:none;visibility:visible;transition:transform .28s ease}
	.kkb-form{display:flex;flex-direction:column;min-height:100%}
	.kkb-side-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:#fff;padding:18px 0 10px;z-index:2;font-size:19px;color:var(--kkb-primary)}
	.kkb-close{display:block;background:none;border:0;font-size:34px;line-height:1;cursor:pointer;color:var(--kkb-primary);padding:0 4px}
	.kkb-check,.kkb-switch{padding:10px 0;font-size:16px}
	.kkb-box{width:22px;height:22px}
	.kkb-range-track input[type=range]::-webkit-slider-thumb{width:26px;height:26px;margin-top:0}
	.kkb-range-track input[type=range]::-moz-range-thumb{width:20px;height:20px}
	.kkb-range-vals{font-size:15px}
	.kkb-apply{display:block}
	.kkb-side-foot{position:sticky;bottom:0;margin-top:auto;background:#fff;padding:14px 0 calc(14px + env(safe-area-inset-bottom))}
	.kkb-top{flex-direction:column;align-items:stretch;gap:10px}
	.kkb-count{order:2;font-size:13px}
	.kkb-sort,.kkb-sort select{width:100%}
	.kkb-sort select{font-size:16px;padding:12px 38px 12px 14px}
	.kkb-chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;margin-right:-4px;-webkit-overflow-scrolling:touch}
	.kkb-chip{white-space:nowrap;flex:none}
}
@media (max-width:980px){
	.kkb ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px}
	.kkb ul.products li.product{padding-bottom:12px!important;border-radius:14px}
	.kkb ul.products li.product .woocommerce-loop-product__title,.kkb ul.products li.product h2{font-size:15px;padding:0 10px;line-height:1.25}
	.kkb ul.products li.product .price{padding:0 10px;font-size:14px}
	.kkb ul.products li.product .button{display:none}
	.kkb-pagination{gap:5px}
	.kkb-pagination .page{min-width:42px;height:42px}
}
/* Téléphone : 1 colonne */
@media (max-width:640px){
	.kkb .kkb-main ul.products,.kkb ul.products.products{grid-template-columns:minmax(0,1fr)!important;gap:18px}
	.kkb ul.products li.product{padding-bottom:16px!important;border-radius:18px}
	.kkb ul.products li.product .woocommerce-loop-product__title,.kkb ul.products li.product h2{font-size:19px;padding:0 16px;margin-bottom:6px}
	.kkb ul.products li.product .price{padding:0 16px;font-size:16px}
}
.kkb ul.products li.product .woocommerce-loop-product__title,.kkb ul.products li.product h2{word-break:normal;overflow-wrap:normal;hyphens:none}
html.kkb-lock,html.kkb-lock body{overflow:hidden}

@media (prefers-reduced-motion:reduce){.kkb *{transition:none!important}}
