/**
 * Voertuig live search — suggestion panel under the vehicle search field.
 *
 * Colours come from the site palette (--hcl-*), with fallbacks so the panel also looks
 * right on a site without those variables. Override any --wm-ls-* variable to restyle.
 */

.wm-live-search-anchor {
    position: relative;
}

.wm-live-search {
    --wm-ls-text: var(--hcl-secondary-9, #002e5d);
    --wm-ls-muted: var(--hcl-neutral-11, #646461);
    --wm-ls-line: var(--hcl-neutral-4, #e8e8e4);
    --wm-ls-hover: var(--hcl-secondary-2, #f5faff);
    --wm-ls-mark: var(--hcl-primary-4, #ffe3b0);
    --wm-ls-link: var(--hcl-brand-9, #e30613);
    --wm-ls-thumb: 96px;

    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: max(100%, 440px);
    max-width: calc(100vw - 32px);
    overflow: hidden;
    border: 1px solid var(--wm-ls-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 46, 93, 0.18);
    color: var(--wm-ls-text);
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.wm-live-search[hidden],
.wm-live-search__list[hidden] {
    display: none;
}

.wm-live-search__list {
    /* Leave room for the header above and the "all results" link below. */
    max-height: min(560px, max(200px, calc(100vh - 260px)));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.wm-live-search a.wm-live-search__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--wm-ls-line);
    color: var(--wm-ls-text);
    text-decoration: none;
}

.wm-live-search a.wm-live-search__item:hover,
.wm-live-search a.wm-live-search__item:focus-visible,
.wm-live-search a.wm-live-search__item.is-active {
    background: var(--wm-ls-hover);
    color: var(--wm-ls-text);
    outline: none;
}

.wm-live-search__media {
    flex: 0 0 var(--wm-ls-thumb);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: var(--wm-ls-line);
}

.wm-live-search__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wm-live-search__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wm-live-search__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-family: var(--bde-heading-font-family, inherit);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.wm-live-search__title mark {
    padding: 0;
    border-radius: 2px;
    background: var(--wm-ls-mark);
    color: inherit;
}

.wm-live-search__facts {
    color: var(--wm-ls-muted);
    font-size: 13px;
}

.wm-live-search__price {
    font-size: 15px;
    font-weight: 800;
}

.wm-live-search__vat {
    color: var(--wm-ls-muted);
    font-size: 12px;
    font-weight: 400;
}

.wm-live-search__status {
    padding: 12px 14px;
}

.wm-live-search__status--empty,
.wm-live-search__status--loading {
    color: var(--wm-ls-muted);
}

.wm-live-search a.wm-live-search__all {
    color: var(--wm-ls-link);
    font-weight: 700;
    text-decoration: none;
}

.wm-live-search a.wm-live-search__all::after {
    content: " \203A";
}

.wm-live-search a.wm-live-search__all:hover,
.wm-live-search a.wm-live-search__all:focus-visible {
    color: var(--wm-ls-link);
    text-decoration: underline;
}

@media (max-width: 767px) {
    /* The field sits at the left edge here: grow to the right, up to the screen edge. */
    .wm-live-search {
        --wm-ls-thumb: 80px;
        right: auto;
        left: 0;
        width: max(100%, min(440px, calc(100vw - 2 * var(--wm-ls-edge, 12px))));
        max-width: none;
    }

    .wm-live-search__list {
        max-height: max(200px, calc(100vh - 300px));
    }
}
