/* ---- LGSG global header search: input, magnifier, suggestion panel. ----
   Loaded on every public page from web/layout/header.blade.php. The .search-box sizing
   (margin-left:auto etc.) still comes from the navbar's own style block; this file only
   adds what the suggestion dropdown needs. */

.gsearch {
    /* The panel is anchored to this box. */
    position: relative;
}

.gsearch__form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.gsearch__input {
    padding: 12px;
    border-radius: 8px;
    border: none;
    min-width: 220px;
    font-size: 15px;
    color: #001942;
}

.gsearch__input:focus {
    outline: 2px solid #b8892b;
    outline-offset: 1px;
}

.gsearch__btn {
    border: none;
    background: none;
    padding: 0;
    line-height: 0;
    cursor: pointer;
}

/* ---- Suggestion panel ---- */

.gsearch__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1200;
    width: 380px;
    /* Never let the panel push the page sideways on a narrow viewport. */
    max-width: min(380px, calc(100vw - 32px));
    max-height: min(70vh, 460px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dfe4ee;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 25, 66, .18);
    padding: 6px;
}

.gsearch__panel[hidden] {
    display: none;
}

.gsearch__opt {
    display: block;
    padding: 9px 10px;
    border-radius: 7px;
    text-decoration: none;
    color: #001942;
}

.gsearch__opt:hover,
.gsearch__opt.is-active {
    background: #eef1f7;
    text-decoration: none;
    color: #001942;
}

.gsearch__opt-title {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    /* Long Greek names wrap rather than clip. */
    overflow-wrap: anywhere;
}

.gsearch__opt-sec {
    display: block;
    margin-top: 2px;
    color: #6b7690;
    font-size: 11.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.gsearch__all {
    /* Pinned to the bottom of the panel: with a full 8 suggestions the list scrolls, and
       "See all results" must never be the thing that falls below the fold. */
    position: sticky;
    bottom: -6px;               /* cancels the panel's 6px padding so it sits flush */
    z-index: 1;
    display: block;
    margin: 4px -6px -6px;
    padding: 11px 16px;
    background: #fff;
    border-top: 1px solid #e4e8f0;
    border-radius: 0 0 9px 9px;
    color: #001942;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.gsearch__all:hover,
.gsearch__all.is-active {
    background: #eef1f7;
    color: #b8892b;
    text-decoration: none;
}

.gsearch__none {
    padding: 12px 10px;
    color: #6b7690;
    font-size: 14px;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .gsearch__input {
        min-width: 0;
        width: 150px;
        padding: 10px;
        font-size: 14px;
    }

    .gsearch__panel {
        /* Anchored to the viewport edges on a phone so a long title can never overflow. */
        position: fixed;
        top: 74px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: 62vh;
    }
}
