/* Njandi Product Filters — front-end (corporate) */
.njf-form {
    --njf-accent: #0369a1;
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 16px;
    box-shadow: 0 16px 40px -30px rgba(4,32,64,.6);
    padding: 18px 18px 16px;
    font-size: 14px;
    color: #1f2d3d;
}
.njf-title {
    font-weight: 800;
    font-size: 1.02rem;
    color: #0c2340;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 2px solid #eef3f8;
    letter-spacing: -.01em;
}
.njf-group { padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.njf-group:last-of-type { border-bottom: 0; }
.njf-group-head {
    font-weight: 800;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #33506e;
    margin-bottom: 8px;
}
.njf-options { display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow: auto; }
.njf-opt { display: flex; align-items: center; gap: 9px; cursor: pointer; margin: 0; line-height: 1.3; }
.njf-opt input { accent-color: var(--njf-accent); width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.njf-opt span { display: inline-flex; align-items: center; gap: 6px; }
.njf-opt em { font-style: normal; color: #94a3b8; font-size: .82em; }
.njf-opt:hover span { color: var(--njf-accent); }
.njf-rating span { color: #f59e0b; letter-spacing: 1px; }

.njf-price { display: flex; align-items: center; gap: 8px; }
.njf-price input {
    width: 100%; padding: 8px 10px; border: 1.5px solid #d3deea; border-radius: 9px;
    background: #f8fbfe; font-size: 14px;
}
.njf-price input:focus { border-color: var(--njf-accent); outline: none; box-shadow: 0 0 0 3px rgba(3,105,161,.12); }
.njf-price span { color: #94a3b8; font-weight: 700; }

.njf-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.njf-apply {
    flex: 1 1 auto;
    background: var(--njf-accent);
    background-image: linear-gradient(135deg, var(--njf-accent), #0c2340);
    color: #fff; border: 0; border-radius: 10px; font-weight: 800;
    padding: 10px 16px; cursor: pointer;
    box-shadow: 0 10px 22px -12px rgba(3,105,161,.85);
    transition: filter .15s ease;
}
.njf-apply:hover { filter: brightness(1.08); }
.njf-clear { color: #64748b; font-weight: 700; text-decoration: none; font-size: .88rem; }
.njf-clear:hover { color: var(--njf-accent); text-decoration: underline; }

/* AJAX loading state on the product grid */
.njf-loading ul.products { opacity: .35; transition: opacity .2s ease; pointer-events: none; }

/* ---------- v1.1: price slider, active chips, live counts ---------- */
.njf-slider { position: relative; height: 34px; margin: 8px 3px 12px; }
.njf-slider-track { position: absolute; top: 15px; left: 0; right: 0; height: 5px; background: #e2e8f0; border-radius: 4px; }
.njf-slider-fill { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: var(--njf-accent); border-radius: 4px; }
.njf-range { position: absolute; top: 8px; left: 0; width: 100%; height: 18px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.njf-range::-webkit-slider-runnable-track { background: transparent; border: 0; }
.njf-range::-moz-range-track { background: transparent; border: 0; }
.njf-range::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--njf-accent); box-shadow: 0 2px 6px rgba(4,32,64,.35); cursor: pointer; }
.njf-range::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--njf-accent); box-shadow: 0 2px 6px rgba(4,32,64,.35); cursor: pointer; }

.njf-active { display: none; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.njf-active.has { display: flex; }
.njf-chip { display: inline-flex; align-items: center; gap: 7px; background: #eef5fb; color: #0c2340; border: 1px solid #d6e4f0; border-radius: 20px; padding: 4px 5px 4px 12px; font-size: .8rem; font-weight: 700; cursor: pointer; line-height: 1.4; }
.njf-chip:hover { background: #e3eef8; }
.njf-chip i { font-style: normal; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--njf-accent); color: #fff; font-size: .95rem; line-height: 1; }

.njf-opt.njf-zero { opacity: .4; }
.njf-opt.njf-zero input { cursor: not-allowed; }
.njf-none { list-style: none; padding: 24px 0; text-align: center; color: #64748b; width: 100%; }

/* ---------- v2.0: Njandi POS product grid ---------- */
/* The layout responds to the COMPONENT's own width (container query), not the
   viewport — so it stays filter-left / products-right even inside a page column,
   and only stacks when the block itself is genuinely narrow. */
.njf-pos { container-type: inline-size; }
.njf-pos-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; }
.njf-pos-form { min-width: 0; }
.njf-pos-results { min-width: 0; }
@container (min-width: 720px) { .njf-pos-form { position: sticky; top: 20px; } }
@container (max-width: 640px) { .njf-pos-layout { grid-template-columns: 1fr; } }
/* Fallback for browsers without container queries: stack on small viewports. */
@supports not (container-type: inline-size) {
    .njf-pos-layout { grid-template-columns: 260px minmax(0, 1fr); }
    @media (max-width: 860px) { .njf-pos-layout { grid-template-columns: 1fr; } }
}
.njf-pos-search { width: 100%; padding: 10px 12px; border: 1.5px solid #d3deea; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.njf-pos-search:focus { border-color: var(--njf-accent); outline: none; box-shadow: 0 0 0 3px rgba(3,105,161,.12); }
.njf-pos-count { color: #64748b; font-weight: 700; }
.njf-pos-resulthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* results column becomes its own query container so the grid columns respond to
   the grid's width (not the viewport) — keeps 6-across when there's room */
.njf-pos-results { container-type: inline-size; }
.njf-pos-grid { display: grid; grid-template-columns: repeat(var(--njf-cols, 6), minmax(0, 1fr)); gap: 14px; }
@container (max-width: 1180px) { .njf-pos-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@container (max-width: 980px)  { .njf-pos-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@container (max-width: 760px)  { .njf-pos-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@container (max-width: 520px)  { .njf-pos-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@container (max-width: 320px)  { .njf-pos-grid { grid-template-columns: 1fr; } }
@supports not (container-type: inline-size) {
    .njf-pos-grid { grid-template-columns: repeat(var(--njf-cols, 6), minmax(0,1fr)); }
    @media (max-width: 1180px){ .njf-pos-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
    @media (max-width: 760px) { .njf-pos-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
    @media (max-width: 480px) { .njf-pos-grid { grid-template-columns: 1fr; } }
}

@keyframes njfCardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.njf-card { background: #fff; border: 1px solid #e6edf5; border-radius: 14px; overflow: hidden; box-shadow: 0 14px 34px -30px rgba(4,32,64,.6); display: flex; flex-direction: column;
    animation: njfCardIn .4s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 28ms);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; will-change: transform; }
.njf-card:hover { transform: translateY(-5px); box-shadow: 0 26px 46px -26px rgba(4,32,64,.55); border-color: color-mix(in srgb, var(--njf-accent) 45%, #e6edf5); }
.njf-card-img { aspect-ratio: 1 / 1; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.njf-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.njf-card:hover .njf-card-img img { transform: scale(1.07); }
@media (prefers-reduced-motion: reduce) {
    .njf-card { animation: none; }
    .njf-card:hover { transform: none; }
    .njf-card:hover .njf-card-img img { transform: none; }
}
.njf-noimg { font-size: 2.4rem; opacity: .5; }
.njf-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.njf-card-cat { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 800; }
.njf-card-name { font-weight: 700; color: #0c2340; line-height: 1.25; font-size: .92rem; }
.njf-card-sku { font-size: .72rem; color: #94a3b8; }
.njf-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; gap: 6px; }
.njf-card-price { font-weight: 800; color: var(--njf-accent); }

/* Get a Quote button */
.njf-quote-add { margin-top: 10px; width: 100%; border: 0; cursor: pointer; border-radius: 10px; padding: 9px 10px; font-weight: 800; font-size: .82rem; color: #fff;
    background: linear-gradient(135deg, var(--njf-accent), color-mix(in srgb, var(--njf-accent) 55%, #8b5cf6));
    box-shadow: 0 10px 20px -12px color-mix(in srgb, var(--njf-accent) 70%, #000); transition: transform .12s ease, box-shadow .18s ease, filter .18s ease; }
.njf-quote-add:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 26px -14px color-mix(in srgb, var(--njf-accent) 70%, #000); }
.njf-quote-add:active { transform: translateY(0); }
.njf-quote-add.added { background: #15803d; box-shadow: none; }

/* Cart Quote button (results header) */
.njf-quote-open { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; border: 1.5px solid color-mix(in srgb, var(--njf-accent) 40%, #e6edf5);
    background: #fff; color: var(--njf-accent); font-weight: 800; border-radius: 999px; padding: 8px 16px; transition: background .15s ease, transform .12s ease, box-shadow .15s ease; }
.njf-quote-open:hover { background: color-mix(in srgb, var(--njf-accent) 8%, #fff); transform: translateY(-1px); box-shadow: 0 12px 22px -14px color-mix(in srgb, var(--njf-accent) 60%, #000); }
.njf-quote-cart { font-size: 1.05em; }
.njf-quote-count { display: inline-grid; place-items: center; min-width: 1.4em; height: 1.4em; padding: 0 .3em; border-radius: 999px; background: var(--njf-accent); color: #fff; font-size: .78em; }

/* Quote slide-over panel */
.njf-quote-overlay { position: fixed; inset: 0; background: rgba(4,32,64,.42); z-index: 99998; animation: njfFade .2s ease both; }
@keyframes njfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes njfSlide { from { transform: translateX(100%); } to { transform: none; } }
.njf-quote-panel { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw); background: #fff; z-index: 99999; display: flex; flex-direction: column;
    box-shadow: -20px 0 60px -30px rgba(4,32,64,.6); animation: njfSlide .28s cubic-bezier(.2,.7,.2,1) both; }
.njf-quote-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.1rem; color: #0c2340;
    background: linear-gradient(135deg, color-mix(in srgb, var(--njf-accent) 12%, #fff), #fff); border-bottom: 1px solid #eef3f9; }
.njf-quote-close { border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #64748b; }
.njf-quote-list { flex: 1; overflow-y: auto; padding: 12px 16px; }
.njf-quote-emptymsg { color: #64748b; text-align: center; padding: 40px 12px; }
.njf-quote-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px dashed #e6edf5; }
.njf-quote-name { font-weight: 700; color: #0c2340; font-size: .9rem; }
.njf-quote-sku { font-size: .7rem; color: #94a3b8; }
.njf-quote-price { font-weight: 700; color: var(--njf-accent); font-size: .82rem; margin-top: 2px; }
.njf-quote-qty { display: inline-flex; align-items: center; gap: 8px; }
.njf-quote-qty button { width: 26px; height: 26px; border-radius: 8px; border: 1px solid #d3deea; background: #f8fbfe; cursor: pointer; font-weight: 800; color: #0c2340; }
.njf-quote-qty button:hover { border-color: var(--njf-accent); color: var(--njf-accent); }
.njf-q-n { min-width: 1.4em; text-align: center; font-weight: 800; }
.njf-q-rm { border: 0; background: transparent; color: #b91c1c; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.njf-quote-foot { border-top: 1px solid #eef3f9; padding: 16px 20px; display: grid; gap: 10px; }
.njf-quote-total { display: flex; align-items: center; justify-content: space-between; font-weight: 800; color: #0c2340; font-size: 1.05rem; }
.njf-quote-send { border: 0; cursor: pointer; border-radius: 12px; padding: 13px; font-weight: 800; color: #fff; font-size: .98rem;
    background: linear-gradient(135deg, var(--njf-accent), color-mix(in srgb, var(--njf-accent) 55%, #8b5cf6)); box-shadow: 0 14px 26px -14px color-mix(in srgb, var(--njf-accent) 70%, #000); transition: filter .15s ease, transform .12s ease; }
.njf-quote-send:hover { filter: brightness(1.05); transform: translateY(-1px); }
.njf-quote-empty { border: 1px solid #e6edf5; background: #fff; color: #64748b; border-radius: 12px; padding: 9px; font-weight: 700; cursor: pointer; }
.njf-quote-empty:hover { border-color: #b91c1c; color: #b91c1c; }
body.njf-quote-lock { overflow: hidden; }
.njf-card-stock { font-size: .64rem; font-weight: 800; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.njf-card-stock.in { background: #dcfce7; color: #15803d; }
.njf-card-stock.out { background: #fee2e2; color: #b91c1c; }
.njf-pos-empty, .njf-pos-loading { grid-column: 1 / -1; text-align: center; color: #64748b; padding: 30px 0; }

/* ---------- v2.4: Store mode, filter-left / products-right ---------- */
.njf-store{container-type:inline-size;}
.njf-store-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:22px;align-items:start;}
.njf-store-layout > .njf-form{min-width:0;}
.njf-store-results{min-width:0;}
@container (min-width:720px){ .njf-store-layout > .njf-form{position:sticky;top:20px;} }
@container (max-width:640px){ .njf-store-layout{grid-template-columns:1fr;} }
@supports not (container-type:inline-size){
    .njf-store-layout{grid-template-columns:260px minmax(0,1fr);}
    @media (max-width:860px){ .njf-store-layout{grid-template-columns:1fr;} }
}

/* ---------- v2.6: POS pagination ---------- */
.njf-pos-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.njf-page-btn { cursor: pointer; border: 1.5px solid color-mix(in srgb, var(--njf-accent) 35%, #e6edf5); background: #fff; color: var(--njf-accent);
    font-weight: 800; border-radius: 10px; padding: 11px 20px; min-height: 44px; font-size: .95rem; transition: background .15s ease, transform .12s ease, box-shadow .15s ease; }
.njf-page-btn:hover:not([disabled]) { background: color-mix(in srgb, var(--njf-accent) 8%, #fff); transform: translateY(-1px); box-shadow: 0 12px 22px -14px color-mix(in srgb, var(--njf-accent) 60%, #000); }
.njf-page-btn:active:not([disabled]) { transform: translateY(0); }
.njf-page-btn[disabled] { opacity: .45; cursor: default; }
.njf-page-info { font-weight: 800; color: #0c2340; min-width: 120px; text-align: center; }
@media (max-width: 520px) {
    .njf-pos-pager { gap: 10px; }
    .njf-page-btn { flex: 1; padding: 12px 10px; }
    .njf-page-info { order: -1; width: 100%; }
}
