/* Impreza WooCommerce Live Search */
:root {
    --iwls-accent: #b08d57;
    --iwls-bg: #fff;
    --iwls-text: #2b2b2b;
    --iwls-muted: #8a8a8a;
    --iwls-border: rgba(0, 0, 0, 0.1);
    --iwls-hover: rgba(0, 0, 0, 0.045);
}

/* Встроенный Live Search Impreza прячем, чтобы не было двух списков */
.w-search.iwls-bound .w-search-results,
.w-search.iwls-bound .w-search-form-results {
    display: none !important;
}

.iwls-dropdown {
    position: absolute;
    z-index: 1000000;
    box-sizing: border-box;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--iwls-bg);
    color: var(--iwls-text);
    border: 1px solid var(--iwls-border);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
}
.iwls-dropdown[hidden] { display: none; }
.iwls-dropdown.iwls-busy { opacity: .6; }

.iwls-title {
    padding: 10px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--iwls-muted);
}

.iwls-item,
.iwls-all {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    box-shadow: none;
}
.iwls-item:hover,
.iwls-item.is-active,
.iwls-all:hover,
.iwls-all.is-active {
    background: var(--iwls-hover);
    color: inherit;
}

.iwls-thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f3f3;
}
.iwls-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iwls-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.iwls-name {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 500;
}
.iwls-meta { font-size: 12px; color: var(--iwls-muted); }

.iwls-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.iwls-price { font-weight: 600; white-space: nowrap; }
.iwls-price del { opacity: .55; font-weight: 400; margin-right: 4px; }
.iwls-price ins { text-decoration: none; }
.iwls-stock { font-size: 12px; color: #c0392b; }
.iwls-count { font-size: 12px; color: var(--iwls-muted); }

.iwls-cat .iwls-name { font-weight: 500; }

.iwls-all {
    justify-content: center;
    padding: 12px 14px;
    border-top: 1px solid var(--iwls-border);
    color: var(--iwls-accent);
    font-weight: 600;
}

.iwls-status,
.iwls-note {
    padding: 14px;
    color: var(--iwls-muted);
}
.iwls-note { padding: 10px 14px 0; font-size: 12px; }

.iwls-dropdown mark {
    background: color-mix(in srgb, var(--iwls-accent) 25%, transparent);
    color: inherit;
    padding: 0;
    border-radius: 2px;
}

/* Шорткод [iwls_search] */
.iwls-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;
}
.iwls-form input[type="search"] {
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    padding: 0 44px 0 14px;
    height: 44px;
    border: 1px solid var(--iwls-border);
    border-radius: 8px;
    background: var(--iwls-bg);
    color: var(--iwls-text);
    box-sizing: border-box;
}
.iwls-form input[type="search"]:focus {
    outline: 0;
    border-color: var(--iwls-accent);
}
.iwls-form button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 639px) {
    .iwls-thumb { flex-basis: 40px; width: 40px; height: 40px; }
    .iwls-side { max-width: 38%; }
}

/* Первая строка: «Результат поиска по запросу …» + крестик */
.iwls-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-size: 15px;
}
.iwls-head-text b { font-weight: 700; }
.iwls-head-sub { color: var(--iwls-muted); font-size: 12px; margin-left: 4px; }
.iwls-close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 2px solid currentColor !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--iwls-muted) !important;
    font-size: 20px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
}
.iwls-close:hover { color: var(--iwls-text) !important; }

/* Кнопка «Искать» внутри поля поиска */
.iwls-submit {
    position: absolute !important;
    z-index: 3;
    transform: translateY(-50%);
    left: 0;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 0 !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--iwls-accent) !important;
    color: #fff !important;
    font: 600 14px/1 inherit !important;
    font-family: inherit !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none !important;
    animation: iwls-pop .14s ease-out;
    transition: filter .15s ease, box-shadow .15s ease;
}
.iwls-submit[hidden] { display: none !important; }
.iwls-submit:hover,
.iwls-submit:focus-visible {
    filter: brightness(1.07);
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}
.iwls-submit:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.iwls-submit:active { transform: translateY(-50%) scale(.97); }
@keyframes iwls-pop {
    from { opacity: 0; transform: translateY(-50%) scale(.92); }
    to   { opacity: 1; transform: translateY(-50%) scale(1); }
}
@media (max-width: 479px) {
    .iwls-submit { height: 32px !important; padding: 0 14px !important; font-size: 13px !important; }
}
