/* ============================================
   LIVE SEARCH AUTOCOMPLETE DROPDOWN
   ============================================ */

.ph-search {
    position: relative;
}

.ls-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 250;
    background: #fff;
    border: 1px solid var(--color-border, #E5E7EB);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    max-height: 70vh;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
}
.ls-dropdown.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.ls-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.ls-section:last-child { border-bottom: none; }

.ls-section-title {
    margin: 0 0 8px;
    padding: 0 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9CA3AF;
}

.ls-list { list-style: none; margin: 0; padding: 0; }

.ls-item {
    display: block;
    padding: 10px 20px;
    color: var(--color-heading, #0F172A);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.1s ease, color 0.1s ease;
}
.ls-item:hover,
.ls-item.is-focused {
    background: var(--color-bg-soft, #F2F0FE);
    color: var(--color-accent, #0067FF);
}

/* Product row layout */
.ls-product {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: center;
}
.ls-product-img {
    width: 44px;
    height: 44px;
    background: var(--color-bg-muted, #F8FAFC);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}
.ls-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.ls-product-info { min-width: 0; }
.ls-product-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-heading, #0F172A);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ls-product-meta {
    display: block;
    font-size: 11px;
    color: #6B7280;
    margin-top: 2px;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.02em;
}

/* Term row (categories / manufacturers) */
.ls-term {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ls-term-count {
    background: var(--color-bg-muted, #F8FAFC);
    color: #6B7280;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
}

/* Footer "view all" */
.ls-footer {
    padding: 12px 20px;
    background: var(--color-bg-muted, #F8FAFC);
    text-align: center;
}
.ls-view-all {
    color: var(--color-accent, #0067FF);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.ls-view-all:hover { text-decoration: underline; }

/* Loading + empty states */
.ls-state {
    padding: 28px 20px;
    text-align: center;
    color: #6B7280;
    font-size: 13px;
}
.ls-state .ls-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-top-color: var(--color-accent, #0067FF);
    border-radius: 50%;
    animation: ls-spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: -3px;
}
@keyframes ls-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Highlight matched text */
.ls-mark {
    background: rgba(0, 103, 255, 0.15);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* Mobile */
@media (max-width: 640px) {
    .ls-dropdown {
        left: -8px;
        right: -8px;
        max-height: 60vh;
        border-radius: 10px;
    }
}
