/*
 * Shared search-suggestion rows for the header bar and the homepage bar.
 *
 * Owns everything INSIDE the dropdown panel. Each surface keeps ownership of
 * the panel box itself (position, width, radius, shadow, pill-corner
 * squaring), because those genuinely differ between the two bars.
 *
 * Namespaced .mus-suggest__* so nothing collides with the existing
 * .dropdown-item or .header-search-controls__count-item rules.
 */

.mus-suggest__list {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    /*
     * A full dropdown is now up to nine rows (~470px). Cap it here rather than
     * on either panel so both bars inherit the same ceiling, and so the
     * status message above the list stays pinned while the rows scroll. The
     * header panel keeps its own tighter mobile max-height; whichever is
     * smaller wins, and overscroll-behavior stops the page scrolling behind.
     */
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mus-suggest__row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 10px;
    color: #222222;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.mus-suggest__row--divider {
    margin-top: 4px;
    border-top: 1px solid #e2e2e2;
    border-radius: 0 0 10px 10px;
    padding-top: 10px;
}

.mus-suggest__row:hover,
.mus-suggest__row.is-active {
    background: #ebebeb;
}

/*
 * One 36px gutter for both row types - an icon is centred in it and a
 * thumbnail fills it - so the left edge stays aligned no matter how the
 * refinement and listing rows interleave.
 */
.mus-suggest__gutter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 8px;
    background: #ececec;
    color: #003660;
    font-size: 14px;
}

.mus-suggest__row--refinement .mus-suggest__gutter,
.mus-suggest__row--surface .mus-suggest__gutter,
.mus-suggest__row--all .mus-suggest__gutter {
    background: transparent;
}

.mus-suggest__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    display: block;
}

.mus-suggest__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 auto;
    min-width: 0;
}

/*
 * Inverted weights: the label is bold and the MATCHED span is normal, so what
 * the user typed recedes and the predicted remainder stands out. This is the
 * opposite of the usual highlight-the-match convention, and it is deliberate -
 * it is what makes a completion row read as a completion.
 */
.mus-suggest__label {
    overflow: hidden;
    color: #222222;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Nothing matched, so there is no "remainder" to emphasise. */
.mus-suggest__label--unmatched {
    font-weight: 500;
}

/* Chrome rows opt out of the inverted weighting entirely (see renderer). The
   two-class specificity keeps them clear of --unmatched's 500. */
.mus-suggest__row--all .mus-suggest__label,
.mus-suggest__row--surface .mus-suggest__label,
.mus-suggest__row--refinement .mus-suggest__label {
    font-weight: 600;
}

.mus-suggest__label mark {
    background: transparent;
    color: inherit;
    font-weight: 400;
}

.mus-suggest__meta {
    overflow: hidden;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mus-suggest__trail {
    flex: 0 0 auto;
    max-width: 40%;
    overflow: hidden;
    color: #222222;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mus-suggest__trail--count {
    color: #6b7280;
    font-weight: 600;
}

/*
 * Narrow header (<=1150px leaves ~264px for the text stack): the secondary
 * meta line is the first thing to go, never the thumbnail or the price -
 * price is what people scan.
 */
@media (max-width: 1150px) {
    .mus-suggest__row--listing .mus-suggest__meta {
        display: none;
    }
}

/*
 * Phone: the price moves onto its own line so the title gets full width.
 */
@media (max-width: 760px) {
    .mus-suggest__row--listing .mus-suggest__meta {
        display: block;
    }

    .mus-suggest__row {
        min-height: 48px;
    }

    .mus-suggest__trail {
        align-self: flex-start;
        max-width: 32%;
    }
}
