/*
  The cross-store product search entry, styled once for all four places it appears: the portal
  home and the PC, GAME and BOOK storefront layouts.

  Every colour here is a literal rather than a var() reference, and that is deliberate. The four
  pages load four different stylesheets: only site.css defines --color-*, and only pc-store.css
  defines --pc-*. A component that borrowed either set would render unstyled on three pages out of
  four, and would do it silently — which is the failure mode this project has already paid for
  once. The values are the ones the three storefronts and the portal hero already share: the deep
  cosmic blue ground, the ice-blue hairline, cyan for focus, and the brand gold reserved for the
  one control that submits.
*/

.xl-global-search {
    width: min(100%, 640px);
    margin: 0;
}

.xl-global-search__label {
    display: block;
    margin-bottom: 6px;
    color: rgba(243, 251, 255, .88);
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.xl-global-search__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.xl-global-search__scope,
.xl-global-search__input,
.xl-global-search__submit {
    /* 44px is the touch target this has to clear on a phone, so it is the floor and not the
       computed result of padding and line-height on whichever font the device substitutes. */
    min-height: 44px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
}

.xl-global-search__scope,
.xl-global-search__input {
    border: 1px solid rgba(127, 215, 255, .32);
    color: #f3fbff;
    background: rgba(8, 19, 35, .82);
    padding: 10px 12px;
}

.xl-global-search__scope {
    flex: 0 0 auto;
    min-width: 124px;
    /* The native arrow is invisible against the dark ground on Windows, so the control is given
       its own and the reserved space to draw it in. */
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgba(121, 219, 255, .9) 50%),
                      linear-gradient(135deg, rgba(121, 219, 255, .9) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 12px) calc(50% + 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.xl-global-search__scope option {
    /* Windows renders the popup with the page's colours, so the options need their own. */
    color: #f3fbff;
    background: #0a1a30;
}

.xl-global-search__input {
    /* min-width:0 is what stops a flex item with an intrinsic minimum from pushing the row wider
       than its container at 375px. Without it the row overflows rather than wrapping. */
    flex: 1 1 200px;
    min-width: 0;
}

.xl-global-search__input::placeholder {
    color: rgba(169, 190, 208, .9);
}

.xl-global-search__submit {
    flex: 0 0 auto;
    border: 1px solid rgba(215, 173, 88, .78);
    color: #10203a;
    background: #d7ad58;
    padding: 10px 22px;
    font-weight: 800;
    cursor: pointer;
}

.xl-global-search__submit:hover {
    border-color: #e7c684;
    background: #e7c684;
}

.xl-global-search__scope:focus-visible,
.xl-global-search__input:focus-visible,
.xl-global-search__submit:focus-visible {
    outline: 2px solid #79dbff;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    /* At phone widths the scope takes its own line so the query keeps a usable width; the two
       controls that finish the search stay together on the second. */
    .xl-global-search__scope {
        flex: 1 1 100%;
    }

    .xl-global-search__input {
        flex: 1 1 auto;
    }
}

/* ---- placement --------------------------------------------------------- */

.portal-hero-search {
    width: min(100%, 1360px);
    max-width: 720px;
    margin: 26px auto 0;
    justify-self: center;
}

.pc-topbar-search,
.game-topbar-search,
.book-topbar-search {
    width: min(100%, 1360px);
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 28px) 14px;
}
