/* BFH Mattress Finder */
:root{--bfh-mf-accent:#14213d;--bfh-mf-hi:#c9a54c}
.bfh-mf-fab,.bfh-mf-panel{--mf-text:#1f2937;--mf-muted:#6b7280;--mf-line:#e5e7eb;--mf-soft:#f6f4f0;font-family:inherit;box-sizing:border-box}
.bfh-mf-panel *,.bfh-mf-panel *::before,.bfh-mf-panel *::after{box-sizing:border-box}
.bfh-mf-panel [hidden],.bfh-mf-overlay[hidden]{display:none!important}

/* Floating button */
.bfh-mf-fab{position:fixed;bottom:24px;z-index:99990;display:inline-flex;align-items:center;gap:10px;height:56px;padding:0 22px 0 18px;border:0;border-radius:999px;background:var(--bfh-mf-accent);color:#fff;font-size:16px;font-weight:600;line-height:1;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.22);transition:transform .2s,box-shadow .2s}
.bfh-mf-fab.bfh-mf-left{left:24px}
.bfh-mf-fab.bfh-mf-right{right:24px}
.bfh-mf-fab:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(0,0,0,.28)}
.bfh-mf-fab:focus-visible{outline:3px solid var(--bfh-mf-hi);outline-offset:3px}
.bfh-mf-fab svg{flex:none}
.bfh-mf-dot{display:none;position:absolute;top:8px;left:38px;width:10px;height:10px;border-radius:50%;background:var(--bfh-mf-hi);box-shadow:0 0 0 2px var(--bfh-mf-accent)}
.bfh-mf-fab.is-active .bfh-mf-dot{display:block}

/* Overlay + panel */
.bfh-mf-overlay{position:fixed;inset:0;z-index:99991;background:rgba(15,23,42,.45);opacity:0;transition:opacity .25s}
.bfh-mf-overlay.is-open{opacity:1}
.bfh-mf-panel{position:fixed;top:0;bottom:0;z-index:99992;width:420px;max-width:100%;background:#fff;color:var(--mf-text);box-shadow:0 0 40px rgba(0,0,0,.2);transition:transform .3s ease}
.bfh-mf-panel.bfh-mf-left{left:0;transform:translateX(-100%)}
.bfh-mf-panel.bfh-mf-right{right:0;transform:translateX(100%)}
.bfh-mf-panel.is-open{transform:none}
.bfh-mf-form{display:flex;flex-direction:column;height:100%;margin:0}

.bfh-mf-head{display:flex;align-items:flex-start;gap:16px;justify-content:space-between;padding:22px 24px 18px;border-bottom:1px solid var(--mf-line)}
.bfh-mf-head h2{margin:0;font-size:22px;font-weight:800;color:var(--bfh-mf-accent);line-height:1.2}
.bfh-mf-titles{flex:1;min-width:0}
.bfh-mf-intro{margin:8px 0 0;font-size:14px;line-height:1.5;color:var(--mf-muted)}
.bfh-mf-intro p{margin:0 0 6px}
.bfh-mf-intro p:last-child{margin:0}
.bfh-mf-intro a{color:var(--bfh-mf-accent);text-decoration:underline}
.bfh-mf-close{flex:none;display:grid;place-items:center;width:40px;height:40px;margin:-6px -8px 0 0;padding:0;border:0;border-radius:50%;background:transparent;color:var(--mf-text);cursor:pointer}
.bfh-mf-close:hover{background:var(--mf-soft)}

.bfh-mf-body{flex:1;overflow-y:auto;padding:8px 24px 24px;-webkit-overflow-scrolling:touch}
.bfh-mf-field{padding:20px 0;border-bottom:1px solid var(--mf-line)}
.bfh-mf-field:last-child{border-bottom:0}
.bfh-mf-field>label,.bfh-mf-label{display:block;margin:0 0 10px;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--bfh-mf-accent)}
.bfh-mf-hint{margin:10px 0 0;font-size:13px;color:var(--mf-muted)}

/* Quick-link buttons */
.bfh-mf-quick{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:18px 0 20px;border-bottom:1px solid var(--mf-line)}
.bfh-mf-quick.is-single{grid-template-columns:1fr}
.bfh-mf-quick:has(.bfh-mf-qbtn:last-child:nth-child(odd)) .bfh-mf-qbtn:last-child{grid-column:1/-1}
.bfh-mf-qbtn{display:flex;align-items:center;justify-content:center;min-height:52px;padding:8px 12px;border:1.5px solid var(--bfh-mf-accent);border-radius:10px;background:#fff;color:var(--bfh-mf-accent)!important;font-size:14px;font-weight:700;line-height:1.25;text-align:center;text-wrap:balance;text-decoration:none!important;transition:background .15s,color .15s}
.bfh-mf-qbtn:hover,.bfh-mf-qbtn:focus-visible{background:var(--bfh-mf-accent);color:#fff!important}
.bfh-mf-qbtn:focus-visible{outline:3px solid var(--bfh-mf-hi);outline-offset:2px}

/* Drop-downs */
.bfh-mf-select{position:relative}
.bfh-mf-select::after{content:"";position:absolute;right:18px;top:50%;width:9px;height:9px;margin-top:-7px;border-right:2px solid var(--bfh-mf-accent);border-bottom:2px solid var(--bfh-mf-accent);transform:rotate(45deg);pointer-events:none}
.bfh-mf-select select{display:block;width:100%;height:52px;margin:0;padding:0 46px 0 16px;border:1.5px solid var(--mf-line);border-radius:10px;background:#fff;color:var(--mf-text);font:inherit;font-size:16px;font-weight:600;line-height:1.2;-webkit-appearance:none;appearance:none;cursor:pointer;box-shadow:none;transition:border-color .15s}
.bfh-mf-select select:hover{border-color:var(--bfh-mf-accent)}
.bfh-mf-select select:focus{outline:3px solid color-mix(in srgb,var(--bfh-mf-hi) 45%,transparent);outline-offset:1px;border-color:var(--bfh-mf-accent)}
.bfh-mf-select select.has-value{border-color:var(--bfh-mf-accent);background:var(--mf-soft)}

/* Price slider */
.bfh-mf-readout{margin:0 0 14px;font-size:20px;font-weight:700;color:var(--mf-text)}
.bfh-mf-range{position:relative;height:28px}
.bfh-mf-track{position:absolute;left:0;right:0;top:50%;height:6px;margin-top:-3px;border-radius:3px;background:var(--mf-line)}
.bfh-mf-fill{position:absolute;top:0;bottom:0;border-radius:3px;background:var(--bfh-mf-accent);left:var(--lo,0%);right:calc(100% - var(--hi,100%))}
.bfh-mf-range input[type=range]{position:absolute;inset:0;width:100%;height:28px;margin:0;background:none;pointer-events:none;-webkit-appearance:none;appearance:none}
.bfh-mf-range input[type=range]::-webkit-slider-runnable-track{background:none;border:0}
.bfh-mf-range input[type=range]::-moz-range-track{background:none;border:0}
.bfh-mf-range input[type=range]::-webkit-slider-thumb{pointer-events:auto;-webkit-appearance:none;width:26px;height:26px;border-radius:50%;background:#fff;border:3px solid var(--bfh-mf-accent);box-shadow:0 2px 6px rgba(0,0,0,.2);cursor:grab}
.bfh-mf-range input[type=range]::-moz-range-thumb{pointer-events:auto;width:20px;height:20px;border-radius:50%;background:#fff;border:3px solid var(--bfh-mf-accent);box-shadow:0 2px 6px rgba(0,0,0,.2);cursor:grab}
.bfh-mf-range input[type=range]:focus-visible::-webkit-slider-thumb{outline:3px solid var(--bfh-mf-hi);outline-offset:2px}
.bfh-mf-range input[type=range]:focus-visible::-moz-range-thumb{outline:3px solid var(--bfh-mf-hi);outline-offset:2px}

/* Footer */
.bfh-mf-foot{display:flex;gap:12px;align-items:center;padding:16px 24px calc(16px + env(safe-area-inset-bottom));border-top:1px solid var(--mf-line);background:#fff}
.bfh-mf-clear{padding:12px 6px;border:0;background:none;color:var(--mf-text);font-size:15px;font-weight:600;text-decoration:underline;cursor:pointer}
.bfh-mf-submit{flex:1;min-height:52px;padding:0 20px;border:0;border-radius:10px;background:var(--bfh-mf-accent);color:#fff;font-size:16px;font-weight:700;cursor:pointer;transition:opacity .2s}
.bfh-mf-submit:hover{opacity:.9}
.bfh-mf-submit.is-empty{background:#9ca3af}

body.bfh-mf-lock{overflow:hidden}

/* Mobile: icon-only button, bottom sheet */
@media (max-width:600px){
  .bfh-mf-fab{bottom:20px;width:56px;padding:0;justify-content:center}
  .bfh-mf-fab.bfh-mf-left{left:16px}
  .bfh-mf-fab.bfh-mf-right{right:16px}
  .bfh-mf-fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .bfh-mf-dot{top:10px;left:34px}
  .bfh-mf-panel,.bfh-mf-panel.bfh-mf-left,.bfh-mf-panel.bfh-mf-right{top:auto;left:0;right:0;width:100%;max-height:90vh;border-radius:18px 18px 0 0;transform:translateY(100%)}
  .bfh-mf-panel.is-open{transform:none}
  .bfh-mf-form{max-height:90vh}
  .bfh-mf-head{padding:18px 20px 14px}
  .bfh-mf-body{padding:4px 20px 16px}
  .bfh-mf-foot{padding:14px 20px calc(14px + env(safe-area-inset-bottom))}
}

/* Side tab (edge) placement */
.bfh-mf-fab.bfh-mf-edge{top:var(--bfh-mf-edge-top,50%);bottom:auto;transform:translateY(-50%);height:56px;min-width:56px;padding:0 17px;gap:0;border-radius:0 10px 10px 0;background:var(--bfh-mf-hi);box-shadow:0 6px 18px rgba(0,0,0,.25);transition:padding .3s ease,box-shadow .2s}
.bfh-mf-fab.bfh-mf-edge.bfh-mf-left{left:0;right:auto}
.bfh-mf-fab.bfh-mf-edge.bfh-mf-right{right:0;left:auto;border-radius:10px 0 0 10px;flex-direction:row-reverse}
.bfh-mf-fab.bfh-mf-edge svg{width:24px;height:24px}
.bfh-mf-fab.bfh-mf-edge .bfh-mf-fab-label{display:inline-block;max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transition:max-width .35s ease,opacity .25s ease,margin .35s ease}
.bfh-mf-fab.bfh-mf-edge:hover,.bfh-mf-fab.bfh-mf-edge:focus-visible{transform:translateY(-50%);box-shadow:0 8px 24px rgba(0,0,0,.3)}
@media (hover:hover) and (min-width:601px){
  .bfh-mf-fab.bfh-mf-edge:hover .bfh-mf-fab-label,.bfh-mf-fab.bfh-mf-edge:focus-visible .bfh-mf-fab-label{max-width:260px;opacity:1;margin:0 4px 0 12px}
  .bfh-mf-fab.bfh-mf-edge.bfh-mf-right:hover .bfh-mf-fab-label,.bfh-mf-fab.bfh-mf-edge.bfh-mf-right:focus-visible .bfh-mf-fab-label{margin:0 12px 0 4px}
}
.bfh-mf-fab.bfh-mf-edge .bfh-mf-dot{top:8px;left:auto;right:8px;background:#fff;box-shadow:0 0 0 2px var(--bfh-mf-hi)}
@media (max-width:600px){
  .bfh-mf-fab.bfh-mf-edge{width:auto;min-width:48px;height:48px;padding:0 12px;bottom:auto}
  .bfh-mf-fab.bfh-mf-edge.bfh-mf-left{left:0}.bfh-mf-fab.bfh-mf-edge.bfh-mf-right{right:0}
  .bfh-mf-fab.bfh-mf-edge .bfh-mf-fab-label{position:static;width:auto;height:auto;clip:auto}
}
@media (prefers-reduced-motion:reduce){.bfh-mf-panel,.bfh-mf-overlay,.bfh-mf-fab,.bfh-mf-fab-label{transition:none!important}}

/* Price list under products (Mattress only / Bed set) */
.bfh-pl{max-width:270px;margin:10px auto 4px;font-size:13px;line-height:1.3;text-align:left}
.bfh-pl-head{margin:8px 0 4px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;text-align:center;color:#6b7280}
.bfh-pl-list{list-style:none!important;margin:0!important;padding:0!important}
.bfh-pl-list li{margin:0!important;padding:0!important;list-style:none!important}
.bfh-pl-list a{display:flex;justify-content:space-between;gap:10px;padding:4px 10px;border-radius:6px;color:inherit!important;text-decoration:none!important;transition:background .15s,color .15s}
.bfh-pl-list li:nth-child(odd) a{background:rgba(0,0,0,.04)}
.bfh-pl-list a:hover,.bfh-pl-list li.is-hit a{background:var(--bfh-mf-accent);color:#fff!important}
.bfh-pl-list b{font-weight:700;white-space:nowrap}
.bfh-pl-list b .woocommerce-Price-amount{color:inherit}
