/*
 * Live-search dropdown under the header search field, ported from the Figma
 * source's own LiveSearchWidget. The field itself is the page shell's (see
 * dehai-common's main.css) — only what drops out of it is the shop's.
 */

.search-suggest {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    width: 100%;
    z-index: 60;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.search-suggest__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.15s ease;
}

.search-suggest__item:last-of-type {
    border-bottom: none;
}

.search-suggest__item:hover {
    background: var(--paper);
}

.search-suggest__media {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    font-size: 20px;
    color: var(--muted);
}

.search-suggest__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The row must be allowed to shrink, or the title's ellipsis never appears. */
.search-suggest__body {
    flex: 1;
    min-width: 0;
}

.search-suggest__title,
.search-suggest__brand {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggest__title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink);
}

.search-suggest__brand {
    font-size: 0.6875rem;
    color: var(--muted);
}

.search-suggest__meta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1875rem;
    text-align: right;
}

.search-suggest__price {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--ink);
    white-space: nowrap;
}

.search-suggest__chip {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggest__all {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.875rem;
    background: var(--paper);
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.search-suggest__all:hover {
    background: var(--surface-2);
}

.search-suggest__all svg {
    width: 12px;
    height: 12px;
}

.search-suggest__empty {
    margin: 0;
    padding: 1.125rem 0.875rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
}

/* The desktop header's field is 280px wide, and at that width every product
   name is cut to a couple of words — so there the list grows leftwards past
   the field. In the mobile drawer (below this breakpoint, where the desktop
   field is hidden) it stays the field's own width: the drawer is 300px, and
   anything wider would hang out over the page behind it. */
@media (min-width: 1024px) {
    .search-suggest {
        min-width: 22rem;
    }
}
