/**
 * MTH Hotel Search - header search dropdown
 *
 * The dropdown sits inside form.mth-nav__search. The theme styles every
 * <button> in that form as the search icon, so entries are links only.
 * Theme overrides need the .v2 prefix, this file prints after frontend.css.
 */

.mth-suggest {
    --mth-suggest-accent: #478ea8;
    --mth-suggest-accent-dark: #0b4d60;
    --mth-suggest-text: #353535;
    --mth-suggest-muted: #7e7e7e;
    --mth-suggest-hover: #eef5f8;

    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10;
    box-sizing: border-box;
    width: 96%;
    min-width: 320px;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    color: var(--mth-suggest-text);
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
}

.mth-suggest[hidden] {
    display: none !important;
}

.mth-suggest.is-loading .mth-suggest__group {
    opacity: 0.6;
}

.mth-suggest__group + .mth-suggest__group {
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 4px;
}

.mth-suggest__heading {
    padding: 8px 18px 4px;
    color: var(--mth-suggest-muted);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mth-suggest__option,
.mth-suggest__option:hover,
.mth-suggest__option:focus,
.mth-suggest__option:visited {
    color: var(--mth-suggest-text);
    text-decoration: none;
}

.mth-suggest__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    cursor: pointer;
}

.mth-suggest__option:hover,
.mth-suggest__option.is-active {
    background: var(--mth-suggest-hover);
}

/* Example queries as chips, styled like on the search page (theme: square, grey) */
.mth-suggest__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 18px 10px;
}

.mth-suggest__chip {
    display: inline-block;
    padding: 6px 12px;
    background: #f7fafc;
    border-radius: 0;
    font-family: "Geist Regular", sans-serif;
    font-size: 15px;
    line-height: 1.4;
}

.mth-suggest__chip:hover,
.mth-suggest__chip.is-active {
    background: var(--mth-suggest-accent);
    color: #fff;
}

.mth-suggest__thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}

.mth-suggest__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.mth-suggest__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mth-suggest__title {
    font-family: "Geist Medium", sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mth-suggest__title mark {
    background: none;
    color: var(--mth-suggest-accent-dark);
    font-weight: 700;
}

.mth-suggest__meta {
    color: var(--mth-suggest-muted);
    font-size: 14px;
}

.mth-suggest__message {
    padding: 10px 18px;
    color: var(--mth-suggest-muted);
    font-size: 14px;
}

.mth-suggest__all {
    margin-top: 4px;
    border-top: 1px solid #eee;
    padding-top: 12px;
    padding-bottom: 12px;
    color: var(--mth-suggest-accent-dark);
    font-family: "Geist Medium", sans-serif;
}

.mth-suggest__all,
.mth-suggest__all:hover,
.mth-suggest__all:visited {
    color: var(--mth-suggest-accent-dark);
}

/* Screen reader only */
.mth-suggest__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/*
 * Below 1024px the search sits in the burger overlay, which scrolls itself
 * (overflow: auto). An absolute dropdown would be clipped there, so it
 * becomes part of the flow and pushes the menu down.
 */
@media (max-width: 1023px) {
    .mth-suggest-host {
        flex-wrap: wrap;
    }

    .mth-suggest {
        position: static;
        flex: 0 0 96%;
        min-width: 0;
        max-height: none;
        margin-top: 8px;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
    }

    /* Narrow screens: two lines instead of a cut-off hotel name */
    .mth-suggest__title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        white-space: normal;
    }
}
