/* ==========================================================================
   WESTORX Live Search dropdown
   ========================================================================== */

/* Wrapper around the search form inside header-search */
.header-search {
    position: relative;
}

/* Dropdown panel — anchored under the search bar */
.wstx-livesearch {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-gray-2);
    border-top: none;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 9995;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-2) transparent;
}
.wstx-livesearch.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.wstx-livesearch::-webkit-scrollbar { width: 6px; }
.wstx-livesearch::-webkit-scrollbar-thumb { background: var(--color-gray-2); border-radius: 3px; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.wstx-ls-section {
    padding: 18px 0;
    border-bottom: 1px solid var(--color-gray-1);
}
.wstx-ls-section:last-child {
    border-bottom: none;
}
.wstx-ls-heading {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-gray-3);
    padding: 0 24px;
    margin: 0 0 12px 0;
}

/* ── Loading / empty / hint states ──────────────────────────────────────── */
.wstx-ls-state {
    padding: 32px 24px;
    text-align: center;
    color: var(--color-gray-3);
    font-size: 0.85rem;
}
.wstx-ls-state-title {
    color: var(--color-black);
    font-family: var(--font-secondary);
    font-size: 1.05rem;
    margin: 0 0 4px 0;
    font-weight: 600;
}
.wstx-ls-state-sub {
    margin: 0;
    font-size: 0.82rem;
    color: var(--color-gray-3);
}
.wstx-ls-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-gray-2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: wstx-spin .7s linear infinite;
    margin-bottom: 10px;
}

/* ── Category chips ─────────────────────────────────────────────────────── */
.wstx-ls-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 24px;
}
.wstx-ls-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-gray-1);
    color: var(--color-black);
    border: 1px solid var(--color-gray-2);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: background .25s ease, border-color .25s ease;
}
.wstx-ls-cat:hover {
    background: var(--color-black);
    border-color: var(--color-black);
    color: var(--color-white);
}
.wstx-ls-cat-count {
    font-size: 0.65rem;
    color: var(--color-gray-3);
    font-weight: 500;
}
.wstx-ls-cat:hover .wstx-ls-cat-count {
    color: rgba(255, 255, 255, 0.7);
}

/* ── Product items ──────────────────────────────────────────────────────── */
.wstx-ls-products {
    display: flex;
    flex-direction: column;
}
.wstx-ls-product {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px 24px;
    text-decoration: none;
    color: inherit;
    transition: background .2s ease;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
}
.wstx-ls-product:hover,
.wstx-ls-product.is-active {
    background: var(--color-gray-1);
}
.wstx-ls-product-image {
    width: 56px;
    height: 56px;
    object-fit: cover;
    background: var(--color-gray-1);
    display: block;
}
.wstx-ls-product-body {
    min-width: 0;
}
.wstx-ls-product-cat {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-gray-3);
    margin: 0 0 3px 0;
}
.wstx-ls-product-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-black);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wstx-ls-product-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-black);
    white-space: nowrap;
    flex-shrink: 0;
}
.wstx-ls-product-price del {
    color: var(--color-gray-3);
    font-weight: 400;
    margin-right: 4px;
    font-size: 0.78rem;
}
.wstx-ls-product-price ins {
    text-decoration: none;
    color: var(--color-accent);
}

/* ── View all results button ────────────────────────────────────────────── */
.wstx-ls-viewall {
    display: block;
    text-align: center;
    padding: 14px 20px;
    background: var(--color-black);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .25s ease;
}
.wstx-ls-viewall:hover {
    background: var(--color-accent);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .wstx-livesearch {
        max-height: 60vh;
    }
    .wstx-ls-heading {
        padding: 0 16px;
    }
    .wstx-ls-cats {
        padding: 0 16px;
    }
    .wstx-ls-product {
        padding: 10px 16px;
        grid-template-columns: 48px 1fr auto;
        gap: 12px;
    }
    .wstx-ls-product-image {
        width: 48px;
        height: 48px;
    }
    .wstx-ls-product-title {
        font-size: 0.82rem;
    }
}
