/* =============================================
   NS Search — v2 Client-Side
   Outdoor & Offroad | Rijskamp
   ============================================= */

.ns-search {
    position: relative;
    width: 100%;
    z-index: 9999;
}

/* ── Input ── */
.ns-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ns-search-icon {
    position: absolute;
    left: 16px;
    color: #1A6338;
    pointer-events: none;
    transition: all .25s;
    z-index: 1;
    opacity: .6;
}
.ns-search--open .ns-search-icon { opacity: 1; transform: scale(1.1); }

.ns-search-input {
    width: 100%;
    height: 48px;
    padding: 0 44px 0 46px;
    border: 2px solid #dde5dd;
    border-radius: 12px;
    font-size: 15px;
    color: #222;
    background: #fff;
    outline: none;
    transition: all .3s cubic-bezier(.22,.61,.36,1);
    -webkit-appearance: none;
}
.ns-search-input::placeholder { color: #aaa; font-weight: 400; }
.ns-search-input::-webkit-search-cancel-button,
.ns-search-input::-webkit-search-decoration,
.ns-search-input::-webkit-search-results-button,
.ns-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}
.ns-search-input:hover { border-color: #b0c8b0; }
.ns-search-input:focus,
.ns-search--open .ns-search-input {
    border-color: #1A6338;
    box-shadow: 0 0 0 4px rgba(26,99,56,.1), 0 4px 16px rgba(26,99,56,.08);
}

.ns-search-clear {
    position: absolute;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ee;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #888;
    transition: all .2s;
    padding: 0;
    z-index: 1;
}
.ns-search-clear:hover { background: #1A6338; color: #fff; transform: scale(1.1); }

/* ── Dropdown (fixed to escape overflow:hidden) ── */
.ns-search-dropdown {
    position: fixed;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: ns-search-drop .15s cubic-bezier(.22,.61,.36,1);
    z-index: 999999;
}
@keyframes ns-search-drop {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ns-search-dropdown::-webkit-scrollbar { width: 4px; }
.ns-search-dropdown::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ── Sections ── */
.ns-search-section { padding: 8px 0; }
.ns-search-section + .ns-search-section { border-top: 1px solid #f0f0f0; }
.ns-search-section-title {
    padding: 10px 20px 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #1A6338;
    opacity: .5;
}

/* ── Category results ── */
.ns-search-cat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    text-decoration: none;
    color: #444;
    cursor: pointer;
    transition: all .15s;
}
.ns-search-cat:hover, .ns-search-cat.ns-highlight {
    background: linear-gradient(90deg, #f0f7f0, transparent);
    color: #1A6338;
}
.ns-search-cat svg { flex-shrink: 0; opacity: .35; }
.ns-search-cat:hover svg { opacity: .7; }
.ns-search-cat span:first-of-type { flex: 1; font-size: 13px; font-weight: 600; }
.ns-search-cat-count {
    font-size: 10px; font-weight: 700; color: #999;
    background: #f0f0f0; padding: 3px 10px; border-radius: 20px; transition: all .15s;
}
.ns-search-cat:hover .ns-search-cat-count { background: #1A6338; color: #fff; }

/* ── Product results ── */
.ns-search-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    transition: all .15s;
    position: relative;
}
.ns-search-product:hover, .ns-search-product.ns-highlight { background: linear-gradient(90deg, #f5f9f5, transparent); }

.ns-search-product-img {
    width: 56px; height: 56px; min-width: 56px;
    border-radius: 10px; overflow: hidden; background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: transform .2s;
}
.ns-search-product:hover .ns-search-product-img { transform: scale(1.05); }
.ns-search-product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ns-search-product-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ns-search-brand { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: #1A6338; opacity: .55; }
.ns-search-product-name {
    font-size: 13px; font-weight: 600; color: #222;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; transition: color .15s;
}
.ns-search-product:hover .ns-search-product-name { color: #1A6338; }
.ns-search-price { font-size: 13px; font-weight: 700; color: #333; }
.ns-search-price del { color: #bbb; font-weight: 400; font-size: 11px; margin-right: 4px; }
.ns-search-price ins { text-decoration: none; color: #c00; font-weight: 800; }

.ns-search-sale {
    position: absolute; top: 12px; right: 20px;
    font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff; padding: 3px 10px; border-radius: 20px;
    box-shadow: 0 2px 6px rgba(220,38,38,.25);
}

/* ── Alle resultaten ── */
.ns-search-all {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 16px 20px; text-align: center;
    font-size: 13px; font-weight: 700; color: #1A6338;
    text-decoration: none; border-top: 1px solid #f0f0f0; transition: all .15s; letter-spacing: .3px;
}
.ns-search-all:hover { background: #f0f7f0; color: #14502d; }

/* ── Empty ── */
.ns-search-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 36px 20px; text-align: center;
}
.ns-search-empty svg { opacity: .4; }
.ns-search-empty p { margin: 0; font-size: 13px; color: #999; font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .ns-search-dropdown { max-height: 60vh; border-radius: 12px; }
    .ns-search-input { height: 42px; font-size: 16px; border-radius: 10px; }
    .ns-search-product { gap: 12px; padding: 10px 16px; }
    .ns-search-product-img { width: 48px; height: 48px; min-width: 48px; }
}
