/* =============================================================================
   MeiliSearch Live-Search Dropdown
   Styles the instant-search result panel that appears below .header-search-form.
   ============================================================================= */

/* Give the inner wrapper a positioning context for the absolute dropdown. */
.site-header__search-inner {
    position: relative;
}

/* =============================================================================
   Dropdown container
   ============================================================================= */

.lf-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 20px;  /* matches .site-header__search-inner padding */
    right: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.13);
    z-index: 9999;
    overflow: hidden;
    animation: lf-dropdown-in 0.15s ease;
}

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

/* =============================================================================
   Result list
   ============================================================================= */

.lf-search-results {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.lf-search-result__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.lf-search-result__link:hover,
.lf-search-result.is-active .lf-search-result__link {
    background: #f8f8f8;
}

/* Product thumbnail */
.lf-search-result__img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.lf-search-result__img--placeholder {
    background: #f0f0f0;
    display: block;
}

/* Text column */
.lf-search-result__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lf-search-result__title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark, #111);
    line-height: 1.3;
}

/* Highlighted match characters */
.lf-search-result__title mark {
    background: transparent;
    color: var(--primary-color, #ff6b35);
    font-weight: 700;
    text-decoration: none;
}

.lf-search-result__brand {
    font-size: 0.78rem;
    color: var(--text-light, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price */
.lf-search-result__price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark, #111);
    white-space: nowrap;
    flex-shrink: 0;
}

.lf-search-result__price ins {
    text-decoration: none;
}

/* =============================================================================
   Taxonomy suggestion items (category / tag / goal)
   ============================================================================= */

.lf-search-result--taxonomy .lf-search-result__link {
    gap: 10px;
}

.lf-search-result__tax-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 70px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    background: var(--primary-color, #ff6b35);
    color: #fff;
    white-space: nowrap;
}

.lf-search-result--taxonomy + .lf-search-result:not(.lf-search-result--taxonomy) {
    border-top: 1px solid #f0f0f0;
}

/* =============================================================================
   Loading state
   ============================================================================= */

.lf-search-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    color: var(--text-light, #6b7280);
    font-size: 0.875rem;
}

.lf-search-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary-color, #ff6b35);
    border-radius: 50%;
    animation: lf-spin 0.55s linear infinite;
    flex-shrink: 0;
}

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

/* =============================================================================
   Empty / no-results state
   ============================================================================= */

.lf-search-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-light, #6b7280);
    font-size: 0.875rem;
}

/* =============================================================================
   "View all results" footer
   ============================================================================= */

.lf-search-footer {
    border-top: 1px solid #f0f0f0;
    padding: 10px 16px;
}

.lf-search-footer__link {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-dark, #111);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.lf-search-footer__link:hover {
    color: var(--primary-color, #ff6b35);
}

.lf-search-footer__link strong {
    font-weight: 700;
}
