.wfh-live-search {
    position: relative;
    width: var(--wfh-s-width, 300px);
}

button.wfh-search-btn {
    padding: 10px 10px !important;
    margin-right: 5px !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wfh-search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
}
.wfh-live-search.is-active .wfh-search-overlay {
    display: block;
}

.wfh-search-container {
    position: relative;
    z-index: 101;
}

.wfh-search-form {
    display: flex;
    align-items: center;
    height: var(--wfh-s-height, 40px);
    border-style: var(--wfh-s-b-type);
    border-width: var(--wfh-s-b-width);
    border-color: var(--wfh-s-b-color);
    border-radius: var(--wfh-s-b-rad);
    /* ТУТ ДОДАЛИ ФОН ІНПУТА */
    background: var(--wfh-s-input-bg, #ffffff) !important;
    overflow: hidden;
}

/* ІНПУТ (ПОЛЕ ВВОДУ) */
.wfh-search-input {
    flex: 1;
    height: 100%;
    border: none !important;
    background: transparent !important;
    padding: var(--wfh-s-pad, 0 15px) !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--wfh-s-t-fam);
    font-weight: var(--wfh-s-t-w);
    font-size: var(--wfh-s-t-s);
    text-transform: var(--wfh-s-t-trans);
    color: var(--wfh-s-t-c);
}
.wfh-search-input::placeholder {
    font-family: var(--wfh-s-pl-fam);
    font-weight: var(--wfh-s-pl-w);
    font-size: var(--wfh-s-pl-s);
    color: var(--wfh-s-pl-c);
}

/* КНОПКА (ІКОНКА) */
.wfh-search-btn {
    width: var(--wfh-s-height, 40px); 
    height: var(--wfh-s-height, 40px);
    flex-shrink: 0;
    border: none !important;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ТУТ ДОДАЛИ !important ЩОБ ПЕРЕБИТИ ТЕМИ */
    background-color: var(--wfh-s-i-bg) !important;
    border-radius: var(--wfh-s-i-bg-rad) !important;
    transition: background-color 0.3s ease;
}
.wfh-search-btn:hover {
    /* ТУТ ТАКОЖ !important */
    background-color: var(--wfh-s-i-bg-h) !important;
}

/* ЛОГІКА ІКОНОК (КОЛІР ТА МАСКА) */
.wfh-search-icon-img {
    width: var(--wfh-s-i-size, 20px);
    height: auto;
}

.wfh-search-icon-svg-default {
    width: var(--wfh-s-i-size, 20px);
    height: var(--wfh-s-i-size, 20px);
    fill: var(--wfh-s-i-c) !important;
    transition: fill 0.3s ease;
}
.wfh-search-btn:hover .wfh-search-icon-svg-default {
    fill: var(--wfh-s-i-c-h) !important;
}

.wfh-search-icon-svg {
    display: inline-block;
    width: var(--wfh-s-i-size, 20px);
    height: var(--wfh-s-i-size, 20px);
    background-color: var(--wfh-s-i-c);
    -webkit-mask-image: var(--wfh-ic-url)!important;
    mask-image: var(--wfh-ic-url)!important;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    transition: background-color 0.3s ease;
}
body .wfh-search-btn:hover .wfh-search-icon-svg {
    background-color: var(--wfh-s-i-c-h) !important;
}

/* ХРЕСТИК ОЧИЩЕННЯ ТА ЛОАДЕР */
.wfh-search-spinner {
    width: 16px; height: 16px; margin: 0 10px;
    border: 2px solid #ccc; border-top-color: #333;
    border-radius: 50%; animation: wfh-spin 0.8s linear infinite;
}
.wfh-search-clear {
    cursor: pointer; font-size: 18px; color: #999;
    padding: 0 10px; font-weight: bold;
}
.wfh-search-clear:hover { color: #d63638; }
.wfh-hidden { display: none !important; }

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

/* РЕЗУЛЬТАТИ ТА ІСТОРІЯ */
.wfh-search-results-dropdown {
    position: absolute; top: 100%; left: 0; width: 100%;
    border-style: var(--wfh-s-b-type);
    border-width: var(--wfh-s-b-width);
    border-color: var(--wfh-s-b-color);
    border-radius: var(--wfh-s-b-rad);
    /* ТУТ ДОДАЛИ ФОН ІНПУТА */
    background: var(--wfh-s-input-bg, #ffffff) !important;
    overflow: hidden;
    margin-top: 2px; z-index: 102;
}

.wfh-search-results-inner {
    max-height: 400px; 
    overflow-y: auto;
    border-radius: 5px !important;
    padding: 5px !important;
    margin-right: 5px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
}
/* Стилі скролбара для Chrome, Safari, Edge */
.wfh-search-results-inner::-webkit-scrollbar {
    width: 6px; /* Товщина скролбара */
}
.wfh-search-results-inner::-webkit-scrollbar-track {
    background: transparent; /* Фон доріжки */
    margin: 4px 0; /* Відступи зверху і знизу, щоб скрол не прилипав до країв */
}
.wfh-search-results-inner::-webkit-scrollbar-thumb {
    background-color: #c1c1c1; /* Колір самого повзунка */
    border-radius: 10px; /* ТЕ САМЕ ЗАКРУГЛЕННЯ */
}
.wfh-search-results-inner::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8; /* Колір при наведенні */
}

.wfh-search-result-item {
    display: flex; align-items: center; padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5; text-decoration: none; color: #333;
    transition: background 0.2s;
}
.wfh-search-result-item:last-child { border-bottom: none; }
.wfh-search-result-item:hover { background: #f9f9f9; }
.wfh-search-result-img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; margin-right: 15px; flex-shrink: 0; background: #eee; }
.wfh-search-result-info { flex: 1; }
.wfh-search-result-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; line-height: 1.3; }
.wfh-search-result-price { font-size: 13px; color: #0073aa; font-weight: 600; }
.wfh-search-history-title { padding: 10px 15px; font-size: 12px; text-transform: uppercase; color: #999; font-weight: 600; border-radius: 4px; border-bottom: 1px solid #f5f5f5; }


/* =========================================================
   СТИЛІ ДЛЯ СТОРІНКИ РЕЗУЛЬТАТІВ ШОРТКОДУ [wfh_search_results]
========================================================= */

.wfh-search-results-shortcode {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px;
}

.wfh-res-main-title {
    font-size: 24px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

/* Окремий елемент загальні стилі (базовий flex) */
.wfh-res-item {
    background: var(--res-card-bg, #ffffff);
    border: 1px solid var(--res-card-border, #eeeeee); /* ОНОВЛЕНО */
    border-radius: var(--res-card-rad, 8px);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.wfh-res-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.wfh-res-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wfh-res-title {
    display: block;
    margin-bottom: 12px;
    text-decoration: none;
    font-family: var(--res-t-fam);
    font-weight: var(--res-t-w);
    font-size: var(--res-t-s);
    color: var(--res-t-c);
    line-height: 1.3;
}
.wfh-res-title:hover { opacity: 0.7; }

.wfh-res-excerpt {
    font-family: var(--res-e-fam);
    font-weight: var(--res-e-w);
    font-size: var(--res-e-s);
    color: var(--res-e-c);
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: var(--res-lines-d, 3);
}

.wfh-res-readmore {
    display: inline-block;
    font-family: var(--res-rm-fam, inherit);
    font-size: var(--res-rm-s, 13px);
    font-weight: var(--res-rm-w, 600);
    color: var(--res-rm-c, var(--res-t-c));
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.3s ease;
}
.wfh-res-readmore:hover {
    opacity: 0.7;
}

/* Ціна та кнопка WooCommerce */
.wfh-res-price {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-bottom: 15px;
}
.wfh-res-price del { font-size: 14px; color: #999; font-weight: 400; margin-right: 5px; }
.wfh-res-price ins { text-decoration: none; }
.wfh-res-add-to-cart .button {
    background: var(--res-t-c);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
    display: inline-block;
}
.wfh-res-add-to-cart .button:hover { opacity: 0.9; }

/* Пагінація */
.wfh-res-pagination { margin-top: 40px; text-align: center; }
.wfh-res-pagination .page-numbers {
    display: inline-block; padding: 8px 15px; margin: 0 4px;
    background: #f5f5f5; color: #333; text-decoration: none;
    border-radius: 4px; font-weight: 600;
}
.wfh-res-pagination .page-numbers.current,
.wfh-res-pagination .page-numbers:hover {
    background: var(--res-t-c); color: #fff;
}

/* --- АДАПТИВНІСТЬ ДЛЯ СІТКИ ТА РЯДКІВ --- */
@media screen and (max-width: 1366px) {
    .wfh-res-excerpt { -webkit-line-clamp: var(--res-lines-l, 3); }
}

@media screen and (max-width: 1024px) {
    .wfh-res-excerpt { -webkit-line-clamp: var(--res-lines-t, 2); }
}

@media screen and (max-width: 767px) {
    .wfh-res-excerpt { -webkit-line-clamp: var(--res-lines-m, 2); }
}