.totalk9-fuzzy-search-wrapper {
    position: relative;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.totalk9-fuzzy-search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.totalk9-fuzzy-search-input {
    width: 100%;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    max-width: 100%;
    line-height: 30px;
    display: block;
    height: 100%;
    position: relative;
    z-index: 2;
    outline: 0;
    background: 0 0;
    -webkit-appearance: none;
}

.totalk9-fuzzy-search-field:not(:has(.totalk9-fuzzy-search-btn)) .totalk9-fuzzy-search-input {
    border-right: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 40px 12px 16px;
}

.totalk9-fuzzy-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.totalk9-fuzzy-search-input::placeholder {
    color: #999;
}

button.totalk9-fuzzy-search-btn {
    border-radius: 0px 30px 30px 0px !important;
    padding: 0 !important;
    line-height: 10px;
    width: 42px;
    height: 40px;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    background: #ededed !important;
    border: 1px solid #d8d8d8;
    margin: 0 0 0 -1px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transition: background-color 100ms ease-in-out;
    -moz-transition: background-color 100ms ease-in-out;
    -o-transition: background-color 100ms ease-in-out;
    transition: background-color 100ms ease-in-out;
}

button.totalk9-fuzzy-search-btn svg {
    display: inline-block;
    fill:#555555;
    height: 25px;
    line-height: 24px;
    position: relative;
    width: 42px;
    color: #555;
}

.totalk9-fuzzy-search-input:focus {
    border-color: #a70be9 !important;
    outline: none;
}

button.totalk9-fuzzy-search-btn:hover {
    background: #dcdcdc;
}

.totalk9-fuzzy-search-field:has(.totalk9-fuzzy-search-btn) .totalk9-fuzzy-search-spinner {
    right: 55px;
}

.totalk9-fuzzy-search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.totalk9-fuzzy-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: totalk9-fuzzy-spin 0.6s linear infinite;
}

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

.totalk9-fuzzy-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    z-index: 2;
}

.totalk9-fuzzy-search-clear:hover {
    color: #333;
}

.totalk9-fuzzy-search-clear svg {
    fill: currentColor;
}

.totalk9-fuzzy-search-field:has(.totalk9-fuzzy-search-btn) .totalk9-fuzzy-search-clear, 
.totalk9-fuzzy-search-field:has(.totalk9-fuzzy-search-btn) .totalk9-fuzzy-search-clear:hover {
    right: 55px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: #555555;
}

.totalk9-fuzzy-search-header {
    padding: 12px 14px 8px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.totalk9-fuzzy-search-header strong {
    color: #333;
}

.totalk9-fuzzy-search-footer {
    padding: 10px 14px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.totalk9-fuzzy-view-all {
    display: inline-block;
    color: #2271b1;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
}

.totalk9-fuzzy-view-all:hover {
    background-color: transparent !important;
    color: #135e96 !important;
}

.totalk9-fuzzy-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 450px;
    overflow-y: auto;
    z-index: 99999;
}

.totalk9-fuzzy-search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.totalk9-fuzzy-search-result-item:last-child {
    border-bottom: none;
}

.totalk9-fuzzy-search-result-item:hover {
    background-color: #f7f7f7;
}

.totalk9-fuzzy-result-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.totalk9-fuzzy-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.totalk9-fuzzy-result-details {
    flex: 1;
    min-width: 0;
}

.totalk9-fuzzy-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.totalk9-fuzzy-search-result-item:hover .totalk9-fuzzy-result-title {
    color: #2271b1;
}

.totalk9-fuzzy-result-price {
    font-size: 13px;
    font-weight: 500;
    color: #777;
    margin-top: 2px;
}

.totalk9-fuzzy-result-price del {
    color: #aaa;
    margin-right: 4px;
}

.totalk9-fuzzy-result-price ins {
    text-decoration: none;
    color: #d63638;
}

.totalk9-fuzzy-result-sku {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

.totalk9-fuzzy-result-stock {
    font-size: 11px;
    margin-top: 2px;
}

.totalk9-fuzzy-in-stock {
    color: #00a32a;
}

.totalk9-fuzzy-out-of-stock {
    color: #d63638;
}

.totalk9-fuzzy-search-no-results,
.totalk9-fuzzy-search-error {
    padding: 20px 14px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.totalk9-fuzzy-search-error {
    color: #d63638;
}

.totalk9-fuzzy-suggestions {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.totalk9-fuzzy-suggestions-label {
    font-size: 13px;
    color: #888;
    margin-right: 6px;
}

.totalk9-fuzzy-suggestion-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    padding: 2px 8px;
    margin: 2px 2px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
    cursor: pointer;
}

.totalk9-fuzzy-suggestion-link:hover {
    background-color: #e8f0fe;
    color: #135e96;
    text-decoration: none;
}

.totalk9-fuzzy-page-suggestions {
    background: #fff9e6;
    border: 1px solid #f0e5b0;
    border-radius: 6px;
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 15px;
    color: #555;
}

.totalk9-fuzzy-page-suggestions-label {
    font-weight: 600;
    color: #333;
    margin-right: 6px;
}

.totalk9-fuzzy-page-suggestion-link {
    display: inline-block;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.15s, color 0.15s;
}

.totalk9-fuzzy-page-suggestion-link:hover {
    background-color: #e8f0fe;
    color: #135e96;
    text-decoration: none;
}

@media (max-width: 600px) {
    .totalk9-fuzzy-search-results {
        max-height: 350px;
    }

    .totalk9-fuzzy-search-result-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .totalk9-fuzzy-result-image {
        width: 40px;
        height: 40px;
    }

    .totalk9-fuzzy-result-title {
        font-size: 13px;
    }

    .totalk9-fuzzy-result-price {
        font-size: 12px;
    }
}
