.nss-search-wrap, .nss-theme-panel-host {
    position: relative !important;
}

.nss-search-box { position: relative; }
.nss-search-input {
    width: 100% !important;
    padding: 13px 42px 13px 16px !important;
    font-size: 15px !important;
    border: 1px solid #dcdfe4 !important;
    border-radius: 999px !important;
}
.nss-search-input:focus {
    outline: none !important;
    border-color: var(--nss-accent, #1d4ed8) !important;
    box-shadow: 0 0 0 3px rgba(29,78,216,0.12) !important;
}

.nss-spinner { display: none; }

/* Results / home panel */
.nss-panel {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100000 !important;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eceef1;
    box-shadow: 0 16px 40px rgba(16,24,40,0.18), 0 2px 6px rgba(16,24,40,0.06);
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    padding: 20px;
}
.nss-panel.nss-open { display: block !important; }

/* The theme's own native search box (#search-box, inside #search-outer) is
   fully replaced by our full-screen overlay below. Without Doofinder's own
   CSS, that native box's reveal animation renders as an empty, zero-height
   bar when its ancestor gets the theme's "material-open" class -- visible
   as a blank strip that flashes in on icon click and then appears to
   vanish beneath the next section. Hide it outright so it can never show
   that broken artifact; the search icon click is now intercepted directly
   in search.js to open our overlay instead. */
#search-box { display: none !important; }

/* Full-screen overlay takeover (matches the live Doofinder search's own
   behaviour: clicking the site's search icon takes over the screen with a
   large input, category/price sidebar, and a results grid -- rather than a
   small dropdown under the icon). */
body.nss-overlay-lock { overflow: hidden !important; }
.nss-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: rgba(16, 24, 40, 0.55);
}
.nss-overlay.nss-open { display: block !important; }

.nss-overlay-sheet {
    background: #fff;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.3);
}
.nss-overlay-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px 48px 16px;
    max-width: 1372px;
    margin: 0 auto;
}
.nss-overlay-searchbox {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #101828;
    padding-bottom: 12px;
    color: #101828;
}
.nss-overlay-search-icon { flex-shrink: 0; color: #667085; }
.nss-overlay-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 26px !important;
    padding: 6px 0 !important;
    color: #101828;
}
.nss-overlay-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: none;
    background: #f1f3f9;
    color: #344054;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nss-overlay-close:hover { background: #e4e7ec; }
.nss-overlay-body {
    padding: 8px 48px 48px;
    max-width: 1372px;
    margin: 0 auto;
}

@media (max-width: 782px) {
    .nss-overlay-header { padding: 20px 20px 12px; }
    .nss-overlay-input { font-size: 20px !important; }
    .nss-overlay-body { padding: 8px 20px 32px; }
}

/* Hint line shown the instant the box opens, before latest/popular/
   recommended has loaded over AJAX -- matches Doofinder's own brief
   "Hit enter to search or ESC to close" flash on open. */
.nss-hint {
    color: #888;
    font-size: 13px;
    margin: 0;
    padding-top: 4px;
}

/* Latest searches row -- pill chips styled to match Doofinder's own
   (transparent background, 1px gray border, fully rounded). */
.nss-latest-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eef0f3;
}
.nss-latest-label { font-size: 13px; color: #667085; font-weight: 600; margin-right: 4px; }
.nss-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #333;
    padding: 6px 12px;
    border: 1px solid #737678;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
}
.nss-chip-x {
    background: none;
    border: none;
    color: #98a2b3;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}
.nss-chip-x:hover { color: #333; }
.nss-delete-all {
    background: none;
    border: none;
    color: var(--nss-accent, #1d4ed8);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
}

/* Home: popular + recommended */
.nss-home-cols { display: flex; gap: 32px; flex-wrap: wrap; }
.nss-popular-col { min-width: 160px; }
.nss-popular-col h4, .nss-recommended-col h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #667085;
    margin: 0 0 10px;
}
.nss-popular-list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 4px; }
.nss-popular-item {
    background: none;
    border: none;
    text-align: left;
    padding: 4px 0;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}
.nss-popular-item:hover { color: var(--nss-accent, #1d4ed8); }
.nss-muted { color: #98a2b3; font-size: 13px; }

.nss-recommended-col { flex: 1; min-width: 260px; }
.nss-recommended-wrap { display: flex; align-items: center; gap: 8px; }
.nss-recommended-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex: 1;
    min-width: 0;
    scroll-behavior: smooth;
}
.nss-rec-nav {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #e4e7ec;
    background: #fff;
    color: #344054;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nss-rec-nav:hover { border-color: var(--nss-accent, #1d4ed8); color: var(--nss-accent, #1d4ed8); }

/* Cards */
.nss-card {
    display: block;
    text-decoration: none !important;
    color: inherit !important;
    border: 1px solid #cbcccd;
    border-radius: 4px;
    padding: 24px;
    transition: border-color .12s ease;
    background: #fff;
}
.nss-card:hover { border-color: var(--nss-accent, #1d4ed8); }
.nss-card-sm { flex: 0 0 150px; }
.nss-card-img { aspect-ratio: 1 / 1; background: #f7f8fa; border-radius: 8px; overflow: hidden; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.nss-card-img img { width: 100%; height: 100%; object-fit: cover; }
/* COA results use the site logo as a branded placeholder (client request,
   replacing the generic gray "PDF" box) instead of a real product photo --
   needs contain/padding so the wide logo doesn't get cropped or stretched
   the way a square product photo would under object-fit: cover above. */
.nss-card-img img.nss-card-coa-placeholder { width: 60%; height: 60%; object-fit: contain; background: #fff; }
.nss-card-noimg { color: #98a2b3; font-size: 12px; font-weight: 700; }
.nss-card-title { font-size: 13.5px; font-weight: 600; color: #101828; margin-bottom: 4px; line-height: 1.3; }
.nss-card-price { font-size: 13px; color: #333; }
.nss-card-link { font-size: 12.5px; color: var(--nss-accent, #1d4ed8); font-weight: 600; }

/* Results layout: filters + grid */
.nss-results-layout { display: flex; gap: 24px; align-items: flex-start; }
.nss-filters {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid #eef0f3;
    padding-right: 24px;
}
.nss-filters h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #667085;
    font-weight: 700;
    margin: 0 0 12px;
}
.nss-cat-list { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 10px; }
.nss-cat-list label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; color: #344054; }
.nss-cat-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--nss-accent, #1d4ed8);
    cursor: pointer;
    margin: 0;
}
.nss-cat-count { color: #98a2b3; font-size: 12px; }

.nss-price-heading { margin-top: 24px !important; }
.nss-filters-reset {
    display: block;
    margin: 0 0 16px;
    background: none;
    border: none;
    padding: 0;
    color: var(--nss-accent, #1d4ed8);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.nss-filters-reset:hover { opacity: .8; }
.nss-price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 14px;
}

/* Dual-handle price slider, built from two overlapping range inputs --
   visually matches Doofinder's own price slider on mit45.com. */
.nss-price-slider { position: relative; height: 20px; margin: 0 2px; }
.nss-slider-base {
    position: absolute;
    top: 9px;
    left: 0;
    right: 0;
    height: 2px;
    background: #dcdfe4;
    border-radius: 999px;
}
.nss-slider-connect {
    position: absolute;
    top: 0;
    height: 2px;
    background: var(--nss-accent, #1d4ed8);
    border-radius: 999px;
}
.nss-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}
.nss-range::-webkit-slider-runnable-track { background: transparent; height: 20px; }
.nss-range::-moz-range-track { background: transparent; height: 20px; }
.nss-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid var(--nss-accent, #1d4ed8);
    box-shadow: 0 1px 3px rgba(16,24,40,0.2);
    cursor: pointer;
    margin-top: 2px;
}
.nss-range::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid var(--nss-accent, #1d4ed8);
    box-shadow: 0 1px 3px rgba(16,24,40,0.2);
    cursor: pointer;
}

.nss-results-main { flex: 1; min-width: 0; }
.nss-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f3;
    font-size: 13.5px;
    color: #444;
    font-weight: 600;
}
.nss-sort-select {
    border: 1px solid #dcdfe4;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    color: #344054;
    cursor: pointer;
}
.nss-sort-select:focus { outline: none; border-color: var(--nss-accent, #1d4ed8); }
.nss-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}
.nss-no-results { color: #667085; font-size: 14px; padding: 30px 0; text-align: center; }

/* Invisible marker at the end of the results grid -- an IntersectionObserver
   watches this to load the next batch of results as it scrolls into view,
   matching the live Doofinder search's infinite-scroll behavior instead of
   hard-stopping at a fixed page size. */
.nss-load-sentinel { width: 100%; height: 1px; }

/* Visible feedback while the next batch of results is being fetched, so
   scrolling to the bottom doesn't feel like it silently stopped. */
.nss-loading-more {
    display: none;
    text-align: center;
    padding: 18px 0 4px;
    color: #667085;
    font-size: 13px;
}
.nss-loading-more.is-visible { display: block; }

@media (max-width: 782px) {
    .nss-results-layout { flex-direction: column; }
    .nss-filters {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eef0f3;
        padding-right: 0;
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    .nss-results-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
}

/* Floating fallback */
.nss-floating-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99998;
    background: var(--nss-accent, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    cursor: pointer;
}
.nss-floating-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(16,24,40,0.55);
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 20px 20px;
}
.nss-floating-modal.is-open { display: flex; }
.nss-floating-modal-inner {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 32px 24px 24px;
    width: 100%;
    max-width: 800px;
    max-height: 75vh;
    overflow: auto;
    box-shadow: 0 20px 50px rgba(16,24,40,0.25);
}
.nss-floating-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #667085;
}
/* Header Search */
.nss-overlay-sheet {
    padding: 0px 20px 50px;
}
.nss-overlay .nss-overlay-header {
    max-width: 1344px;
    padding: 32px 0px 12px 0px;
    background-color: #fff;
}
.nss-overlay .nss-overlay-input {
    border-color: #ffffff !important;
    color: #888888;
    font-size: 18px !important;
    padding: 0px !important;
    box-shadow: unset !important;
}
.nss-overlay .nss-overlay-searchbox {
    border-bottom: 1px solid #1069f9;
}
.nss-overlay .nss-overlay-search-icon {
    position: relative;
    top: -2px;
}
.nss-overlay .nss-overlay-close {
    font-size: 0px;
    background-color: transparent;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 329.26933 329'%3E%3Cpath d='m194.800781 164.769531 128.210938-128.214843c8.34375-8.339844 8.34375-21.824219 0-30.164063-8.339844-8.339844-21.824219-8.339844-30.164063 0l-128.214844 128.214844-128.210937-128.214844c-8.34375-8.339844-21.824219-8.339844-30.164063 0-8.34375 8.339844-8.34375 21.824219 0 30.164063l128.210938 128.214843-128.210938 128.214844c-8.34375 8.339844-8.34375 21.824219 0 30.164063 4.15625 4.160156 9.621094 6.25 15.082032 6.25 5.460937 0 10.921875-2.089844 15.082031-6.25l128.210937-128.214844 128.214844 128.214844c4.160156 4.160156 9.621094 6.25 15.082032 6.25 5.460937 0 10.921874-2.089844 15.082031-6.25 8.34375-8.339844 8.34375-21.824219 0-30.164063zm0 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    width: 40px;
    height: 40px;
}
.nss-overlay .nss-overlay-close:hover {
    opacity: 1;
}
.nss-overlay .nss-overlay-body {
    padding: 0px;
    max-width: 1344px;
    margin: 0 auto;
    background-color: #fff;
}
.nss-overlay .nss-latest-label {
    font-size: 14px;
    color: #737678;
}
.nss-overlay .nss-chip {
    color: #737678;
    padding: 6px 12px 5px 12px;
    border: 1px solid #737678;
    font-size: 14px;
    line-height: 1.2;
    gap: 24px;
}
.nss-overlay .nss-chip-x {
    font-size: 0px;
    background-color: transparent;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 329.26933 329'%3E%3Cpath d='m194.800781 164.769531 128.210938-128.214843c8.34375-8.339844 8.34375-21.824219 0-30.164063-8.339844-8.339844-21.824219-8.339844-30.164063 0l-128.214844 128.214844-128.210937-128.214844c-8.34375-8.339844-21.824219-8.339844-30.164063 0-8.34375 8.339844-8.34375 21.824219 0 30.164063l128.210938 128.214843-128.210938 128.214844c-8.34375 8.339844-8.34375 21.824219 0 30.164063 4.15625 4.160156 9.621094 6.25 15.082032 6.25 5.460937 0 10.921875-2.089844 15.082031-6.25l128.210937-128.214844 128.214844 128.214844c4.160156 4.160156 9.621094 6.25 15.082032 6.25 5.460937 0 10.921874-2.089844 15.082031-6.25 8.34375-8.339844 8.34375-21.824219 0-30.164063zm0 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right;
    background-size: 10px;
    width: 20px;
    height: 20px;
}
.nss-overlay .nss-delete-all {
    margin-left: 0;
    color: #1069f9;
    font-weight: normal;
    font-size: 14px;
}
.nss-overlay .nss-latest-row {
    padding: 0;
    margin: 0 0 0px 0;
    border: 0px;
}
.nss-overlay .nss-home-cols {
    margin: 24px 0 0px 0;
}
.nss-overlay .nss-popular-col h4,
.nss-overlay .nss-recommended-col h4 {
    font-size: 18px;
    font-weight: 500;
    text-transform: initial;
    color: #323334;
}
.nss-overlay .nss-recommended-col h4 {
    padding-left: 38px;
}
.nss-overlay ul {
    
}
.nss-overlay ul li {
    list-style: none !important;
}
.nss-overlay .nss-popular-item {
    color: #323334;
}
.nss-overlay .nss-rec-nav {
    font-size: 0px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: right;
    background-size: 40px;
    width: 40px;
    height: 40px;
    border: 0px;
    padding: 0px;
}
.nss-overlay .nss-rec-nav.nss-rec-prev {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24px' height='24px'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M14.71 6.71c-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L10.83 12l3.88-3.88c.39-.39.38-1.03 0-1.41z' fill='%231069f9'/%3E%3C/svg%3E");
}
.nss-overlay .nss-rec-nav.nss-rec-next {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24px' height='24px'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M9.29 6.71c-.39.39-.39 1.02 0 1.41L13.17 12l-3.88 3.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01z' fill='%231069f9'/%3E%3C/svg%3E");
}
.nss-overlay .nss-card-sm {
    flex: 0 0 228px;
}
.nss-overlay .nss-recommended-row::-webkit-scrollbar {
    display: none;
}
.nss-overlay .nss-card-img img {
    aspect-ratio: 1 / 1;
    background: transparent;
}
.nss-overlay .nss-card-img {
    background: transparent !important;
    margin-bottom: 12px;
}
.nss-overlay .nss-card-title {
    color: #323334;
    font-size: 14px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nss-overlay .nss-card-price {
    min-height: 41px;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    color: #323334;
    font-size: 14px;
    font-weight: bold;
}
.nss-overlay .nss-results-main {
    max-height: none;
    overflow-y: visible;
    padding-bottom: 50px;
}
.nss-overlay .nss-sort-select {
    width: auto;
    border: 0px;
    font-size: 14px;
    color: #323334;
    box-shadow: unset !important;
}
.nss-overlay .nss-results-header {
    margin: 0 0 24px;
    padding: 0;
    border: 0;
}
.nss-overlay .nss-filters h4 {
    font-size: 18px;
    font-weight: 500;
    text-transform: initial;
    color: #323334;
}
.nss-overlay .nss-cat-list li label {
    color: #323334;
    font-size: 14px;
    font-weight: 500;
    padding-right: 20px;
    position: relative;
    align-items: flex-start;
}
.nss-overlay .nss-cat-list li label input {
    top: 5px;
    position: relative;
}
.nss-overlay .nss-cat-list li label .nss-cat-count {
    font-weight: bold;
    display: block;
    color: #323334;
    font-size: 14px;
    position: absolute;
    right: 0;
    top: 1;
}
.nss-overlay .nss-results-grid {
    
}
.nss-overlay .nss-results-grid .nss-card {
    position: relative;
    padding-bottom: 64px;
}
.nss-overlay .nss-results-grid .nss-card .nss-card-link {
    position: absolute;
    bottom: 24px;
    left: 24px;
}
.nss-overlay .nss-results-grid .nss-card .nss-card-title {
    display: block;
    -webkit-box-orient: unset;
    -webkit-line-clamp: unset;
    overflow: unset;
    text-overflow: unset;
}
.nss-overlay .nss-results-grid .nss-card .nss-card-price {
    min-height: unset;
    position: absolute;
    bottom: 24px;
    left: 24px;
}
.nss-overlay .nss-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f8fa !important;
}
.nss-overlay .nss-results-layout {
    margin: 24px 0 0 0;
}

@media(max-width: 782px) {
    .nss-overlay .nss-results-main {
        width: 100%;
    }
    .nss-overlay .nss-overlay-input {
        font-size: 14px;
    }
    .nss-overlay .nss-results-grid .nss-card {
        padding: 16px;
    }
    .nss-overlay .nss-results-grid .nss-card .nss-card-price,
    .nss-overlay .nss-results-grid .nss-card .nss-card-link {
        left: 16px;
        bottom: 16px;
    }
    .nss-overlay .nss-results-grid .nss-card {
        padding-bottom: 48px;
    }
}