/* NovaCommerce Fuzzy Search — Hyva autocomplete */
.nwc-fuzzy-host {
    position: relative !important;
}

.nwc-fuzzy-panel {
    position: absolute;
    z-index: 10020;
    top: calc(100% + 10px);
    left: 50%;
    width: min(1040px, calc(100vw - 40px));
    max-height: min(680px, calc(100vh - 185px));
    overflow: auto;
    transform: translateX(-50%);
    border: 1px solid #dce5e0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(19, 48, 37, .2), 0 5px 16px rgba(19, 48, 37, .08);
    color: #202a24;
    overscroll-behavior: contain;
}

.nwc-fuzzy-panel[hidden] {
    display: none !important;
}

.nwc-fuzzy-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #edf1ef;
}

.nwc-fuzzy-heading strong {
    color: #173f32;
    font-size: 17px;
    font-weight: 600;
}

.nwc-fuzzy-heading span {
    color: #748079;
    font-size: 12px;
    font-weight: 600;
}

.nwc-fuzzy-correction {
    padding: 10px 20px;
    border-bottom: 1px solid #e3ebe7;
    background: #f4f8f6;
    color: #56655e;
    font-size: 13px;
}

.nwc-fuzzy-correction strong {
    color: #315f53;
    font-weight: 600;
}

.nwc-fuzzy-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    background: #f7f9f8;
}

.nwc-fuzzy-result {
    display: grid;
    min-width: 0;
    min-height: 122px;
    grid-template-columns: 94px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid #e3e9e6;
    border-radius: 11px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.nwc-fuzzy-result:hover,
.nwc-fuzzy-result:focus,
.nwc-fuzzy-result.is-active {
    border-color: #79a493;
    box-shadow: 0 7px 18px rgba(31, 70, 55, .09);
    color: inherit;
    outline: none;
    transform: translateY(-1px);
}

.nwc-fuzzy-image {
    display: flex;
    width: 94px;
    height: 100px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

.nwc-fuzzy-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nwc-fuzzy-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.nwc-fuzzy-meta {
    overflow: hidden;
    color: #668076;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .055em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.nwc-fuzzy-name {
    display: -webkit-box;
    overflow: hidden;
    color: #202a24;
    font-size: 14px;
    font-weight: 720;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.nwc-fuzzy-name strong {
    color: #315f53;
    font-weight: 600;
}

.nwc-fuzzy-sku {
    color: #849089;
    font-size: 10px;
}

.nwc-fuzzy-side {
    display: flex;
    min-width: 86px;
    align-self: stretch;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.nwc-fuzzy-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.nwc-fuzzy-price strong {
    color: #173f32;
    font-size: 15px;
    font-weight: 600;
}

.nwc-fuzzy-price del {
    color: #8b948f;
    font-size: 11px;
}

.nwc-fuzzy-cta {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border-radius: 7px;
    background: #427c6d;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.nwc-fuzzy-see-all {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-top: 1px solid #dce6e1;
    background: #fff;
    color: #315f53;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.nwc-fuzzy-see-all:hover,
.nwc-fuzzy-see-all:focus,
.nwc-fuzzy-see-all.is-active {
    background: #eef5f1;
    color: #173f32;
    outline: none;
}

.nwc-fuzzy-message {
    padding: 24px 20px;
    color: #5b6861;
    font-size: 13px;
    line-height: 1.5;
}

.nwc-fuzzy-loading {
    position: relative;
    padding-left: 52px;
}

.nwc-fuzzy-loading::before {
    position: absolute;
    top: 50%;
    left: 22px;
    width: 17px;
    height: 17px;
    margin-top: -9px;
    border: 2px solid #bad1c7;
    border-top-color: #3b7f6b;
    border-radius: 50%;
    content: "";
    animation: nwc-fuzzy-spin 650ms linear infinite;
}

.nwc-fuzzy-discover {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1.7fr);
    gap: 28px;
    padding: 22px;
}

.nwc-fuzzy-discover h3 {
    margin: 0 0 13px;
    color: #173f32;
    font-size: 15px;
    font-weight: 600;
}

.nwc-fuzzy-discover__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nwc-fuzzy-chip {
    display: inline-flex;
    padding: 8px 11px;
    border: 1px solid #d9e5df;
    border-radius: 999px;
    background: #f5f8f6;
    color: #315f53;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.nwc-fuzzy-quick {
    display: flex;
    width: calc(50% - 4px);
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 11px;
    border-bottom: 1px solid #e6ece9;
    color: #2d3c35;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.nwc-fuzzy-chip:hover,
.nwc-fuzzy-quick:hover,
.nwc-fuzzy-chip.is-active,
.nwc-fuzzy-quick.is-active {
    color: #173f32;
    background: #edf5f1;
}

@keyframes nwc-fuzzy-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .nwc-fuzzy-panel {
        position: absolute;
        top: calc(100% + 6px);
        right: auto;
        left: 50%;
        width: calc(100vw - 4px);
        max-height: calc(100dvh - 158px);
        overflow-x: hidden;
        transform: translateX(-50%);
        border-radius: 10px;
    }

    .nwc-fuzzy-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
        padding: 13px 14px 11px;
    }

    .nwc-fuzzy-heading strong { font-size: 14px; }
    .nwc-fuzzy-correction { padding: 9px 14px; }

    .nwc-fuzzy-results {
        grid-template-columns: 1fr;
        gap: 7px;
        padding: 7px;
    }

    .nwc-fuzzy-result {
        min-height: 96px;
        grid-template-columns: 74px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 7px;
    }

    .nwc-fuzzy-image {
        width: 74px;
        height: 80px;
    }

    .nwc-fuzzy-name {
        font-size: 12px;
        -webkit-line-clamp: 3;
    }

    .nwc-fuzzy-side { min-width: 66px; }
    .nwc-fuzzy-price strong { font-size: 13px; }
    .nwc-fuzzy-price del { font-size: 9px; }
    .nwc-fuzzy-cta { display: none; }

    .nwc-fuzzy-discover {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 17px 14px;
    }

    .nwc-fuzzy-quick { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .nwc-fuzzy-result { transition: none; }
    .nwc-fuzzy-loading::before { animation-duration: 1.4s; }
}
