/* ============================================================
 * WEF Premium — Live Search
 * Dark editorial live-search field + dropdown results panel.
 * Mirrors the suite palette (warm-dark, #8b2fd6 purple accent, Inter).
 * All colors below are FALLBACKS — Elementor controls override via
 * {{WRAPPER}} selectors.
 * ============================================================ */

.wefpp-search {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.wefpp-search *, .wefpp-search *::before, .wefpp-search *::after { box-sizing: border-box; }

/* ---- Field ----
   Built WITHOUT flex so themes that force `display:block/grid` on inputs or
   the container can't break the single-line layout. The field is a plain
   block; the input fills it; icon + clear button are absolutely positioned
   on the right. */
.wefpp-search__field {
    position: relative !important;
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    background-color: #0d0d0d;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.wefpp-search.is-focused .wefpp-search__field {
    border-color: #8b2fd6;
    box-shadow: 0 0 0 3px rgba(139, 47, 214, .12);
}

/* Input fills the whole field; right padding leaves room for icon + clear. */
.wefpp-search .wefpp-search__input,
.wefpp-search input.wefpp-search__input,
.wefpp-search input.wefpp-search__input[type="search"] {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 64px 10px 16px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    outline: none !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    font-size: 14px;
    line-height: 1.2;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.wefpp-search__input::placeholder { color: #9a9a9a !important; opacity: 1; }
.wefpp-search__input::-webkit-search-cancel-button,
.wefpp-search__input::-webkit-search-decoration { display: none; -webkit-appearance: none; }

/* Search icon — absolute, far right. */
.wefpp-search__icon {
    position: absolute !important;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff;
    opacity: .9;
    pointer-events: none;
}

/* Clear (×) button — absolute, sits just left of the icon, only when typing. */
.wefpp-search .wefpp-search__clear,
.wefpp-search button.wefpp-search__clear {
    position: absolute !important;
    top: 50%;
    right: 42px;
    transform: translateY(-50%);
    display: none;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 20px !important;
    height: 20px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .1) !important;
    color: #cfcac2 !important;
    cursor: pointer;
    box-shadow: none !important;
    line-height: 1 !important;
    transition: background .15s ease, color .15s ease;
}
.wefpp-search .wefpp-search__clear:hover { background: rgba(255, 255, 255, .2) !important; color: #fff !important; }
.wefpp-search .wefpp-search__clear.is-visible { display: -webkit-box !important; display: -ms-flexbox !important; display: flex !important; }
.wefpp-search__clear svg { width: 13px; height: 13px; }

/* ---- Panel ---- */
.wefpp-search__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #141414;
    border: 1px solid #2a2824;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    overflow: hidden;
    animation: wefppSearchIn .18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.wefpp-search__panel[hidden] { display: none !important; }

@keyframes wefppSearchIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wefpp-search__eyebrow {
    padding: 14px 18px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #5e5a54;
}

.wefpp-search__status {
    padding: 22px 18px;
    text-align: center;
    color: #8a857d;
    font-size: 14px;
}

/* ---- Result list ---- */
.wefpp-search__list { padding: 2px 0; }

.wefpp-search__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    text-decoration: none;
    color: inherit;
    border-top: 1px solid transparent;
    transition: background-color .15s ease;
}
.wefpp-search__item + .wefpp-search__item { border-top: 1px solid #242220; }

.wefpp-search__item:hover,
.wefpp-search__item.is-active {
    background-color: #1f1d1a;
}

.wefpp-search__thumb {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 4px;
    overflow: hidden;
    background: #221f1c;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wefpp-search__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.wefpp-search__item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wefpp-search__item-title {
    color: #f3f0ea;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    /* clamp to 3 lines like the reference */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wefpp-search__item-price {
    color: #8b2fd6;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.wefpp-search__item-price del { opacity: .55; font-weight: 400; margin-right: 6px; }
.wefpp-search__item-price ins { text-decoration: none; }

/* ---- Footer ---- */
.wefpp-search__footer {
    border-top: 1px solid #2a2824;
}
.wefpp-search__viewall {
    display: block;
    padding: 16px 18px;
    text-align: center;
    color: #8b2fd6;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}
.wefpp-search__viewall:hover {
    color: #a259e6;
    background-color: rgba(139, 47, 214, .06);
}
.wefpp-search__count { opacity: .7; font-weight: 400; }

/* ---- Scroll for long lists ---- */
.wefpp-search__results {
    max-height: 70vh;
    overflow-y: auto;
}
.wefpp-search__results::-webkit-scrollbar { width: 8px; }
.wefpp-search__results::-webkit-scrollbar-thumb {
    background: #2e2c28;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .wefpp-search__panel { animation: none; }
}
