/* Header search dropdown (Views/Search/AutoComplete.cshtml, js autocomplete.js) and the search
   results page extras ("Looking for:" chips, the no-results panel in Products/Index.cshtml).
   Linked in the head of _Layout.cshtml and _Layout_AE.cshtml. Logical properties only, so one
   file serves LTR and RTL. Dark like the header. */

.g2s-box,
.g2s-sheet,
.g2s-page,
.g2s-field,
.g2s-more {
    --g2s-bg: #14171c;
    --g2s-field-line: rgba(255, 255, 255, .14);
    --g2s-ring: rgba(188, 215, 103, .28);
    --g2s-surface: #1a1d22;
    --g2s-hover: #23272e;
    --g2s-line: rgba(255, 255, 255, .08);
    --g2s-text: #edeff5;
    --g2s-muted: rgba(237, 239, 245, .62);
    --g2s-faint: rgba(237, 239, 245, .38);
    --g2s-accent: var(--brand-color-light, #bcd767);
    --g2s-accent-bg: rgba(149, 171, 82, .16);
    --g2s-focus: rgba(188, 215, 103, .7);
    --g2s-radius: 14px;
}

/* ===== The box. Beats the theme's white .x-autocomplete-container (padding-top 40px). ===== */

.search-box .x-autocomplete-container.g2s-box,
.g2s-sheet .x-autocomplete-container.g2s-box {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    width: 560px;
    min-width: 100%;
    max-width: calc(100vw - 32px);
    max-height: min(72vh, 640px);
    margin: 0;
    padding: 6px !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--g2s-bg);
    border: 1px solid var(--g2s-line);
    border-radius: var(--g2s-radius);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
    color: var(--g2s-text);
    text-align: start;
    z-index: 1200;
    scrollbar-width: thin;
    scrollbar-color: rgba(237, 239, 245, .22) transparent;
}

.g2s-box::-webkit-scrollbar { width: 6px; }
.g2s-box::-webkit-scrollbar-track { background: transparent; }
.g2s-box::-webkit-scrollbar-thumb { background: rgba(237, 239, 245, .22); border-radius: 6px; }

.g2s-box.d-none { display: none !important; }

.g2s-box.is-open { animation: g2s-in .14s ease-out; }

@keyframes g2s-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .g2s-box.is-open { animation: none; }
}

.g2s,
.g2s * { box-sizing: border-box; }

/* ===== Groups ===== */

.g2s-group + .g2s-group {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--g2s-line);
}

.g2s-group[hidden] { display: none; }

.g2s-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    padding: 4px 10px 2px;
}

.g2s-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--g2s-muted);
}

.g2s-clear {
    border: 0;
    background: none;
    padding: 2px 4px;
    font-size: 12px;
    color: var(--g2s-accent);
    cursor: pointer;
    border-radius: 6px;
}

.g2s-clear:hover { text-decoration: underline; }

.g2s-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.g2s-row {
    position: relative;
    display: flex;
    align-items: stretch;
    margin: 0;
    padding: 0;
    border: 0;
}

/* ===== Rows ===== */

.g2s-option {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--g2s-text) !important;
    text-decoration: none !important;
    text-transform: none;
    font-size: 14px;
    line-height: 1.35;
    outline: none;
}

.g2s-option:hover,
.g2s-option.is-active {
    background-color: var(--g2s-hover);
    color: var(--g2s-text) !important;
}

.g2s-option.is-active,
.g2s-option:focus-visible {
    box-shadow: inset 0 0 0 2px var(--g2s-focus);
}

.g2s-icon {
    flex: 0 0 auto;
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--g2s-faint);
}

.g2s-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g2s mark {
    padding: 0;
    background: none;
    color: var(--g2s-accent);
    font-weight: 700;
}

.g2s-remove {
    flex: 0 0 auto;
    width: 40px;
    border: 0;
    background: none;
    color: var(--g2s-faint);
    border-radius: 10px;
    cursor: pointer;
}

.g2s-remove:hover,
.g2s-remove:focus-visible {
    color: var(--g2s-text);
    background-color: var(--g2s-hover);
    outline: none;
}

/* Platforms on the empty box: two per row from tablets up. */
@media (min-width: 576px) {
    .g2s-list--platforms {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Chips ===== */

.g2s-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .07);
    color: var(--g2s-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.g2s-chip--page { background-color: var(--g2s-accent-bg); color: var(--g2s-accent); }
.g2s-chip--preorder { background-color: rgba(141, 188, 244, .14); color: #a9cdf7; }
.g2s-chip--used { background-color: rgba(242, 184, 99, .14); color: #f4c47e; }
.g2s-chip--out { background-color: rgba(243, 144, 135, .13); color: #f5a59d; }

/* ===== Product rows ===== */

.g2s-product { align-items: center; }

.g2s-product__art {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: #12161f;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.g2s-product__art img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}

.g2s-product__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.g2s-product__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.34;
    max-height: 2.68em;
    font-size: 13.5px;
}

.g2s-product__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.g2s-product__meta:empty { display: none; }

.g2s-product__price {
    flex: 0 0 auto;
    font-size: 14px;
    color: var(--g2s-text);
    white-space: nowrap;
    text-align: end;
}

.g2s-free {
    font-size: 12px;
    font-weight: 600;
    color: var(--g2s-accent);
}

/* ===== Help rows ===== */

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

.g2s-help__title,
.g2s-help__question {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g2s-help__question {
    font-size: 12px;
    color: var(--g2s-muted);
}

/* ===== See all / empty ===== */

.g2s-all { color: var(--g2s-accent) !important; font-weight: 600; }
.g2s-all .g2s-icon { color: var(--g2s-accent); }
.g2s-all__arrow { flex: 0 0 auto; font-size: 14px; }
[dir="rtl"] .g2s-all__arrow,
[dir="rtl"] .g2s-sheet__close .fa { transform: scaleX(-1); }

.g2s-empty {
    margin: 0;
    padding: 12px 10px;
    font-size: 13px;
    color: var(--g2s-muted);
}

/* ===== Phones: full-screen sheet (autocomplete.js moves the form into it) ===== */

/* The page behind does not scroll: overflow hidden on <html> only (never on body or position: fixed - that breaks
   the sticky header), the scrollbar's space kept, so the header and the page never move. */
html.g2s-locked { overflow: hidden !important; scrollbar-gutter: stable; }

.g2s-sheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    background-color: var(--g2s-bg);
    color: var(--g2s-text);
    overscroll-behavior: contain;
    transform-origin: 50% var(--g2s-origin-y, 0px);
    transition: opacity .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}

/* Opening grows the sheet out of the search field; closing plays it backwards (autocomplete.js openSheet). */
.g2s-sheet.is-entering,
.g2s-sheet.is-leaving {
    opacity: 0;
    transform: translateY(var(--g2s-from-y, 0px)) scale(.96);
}

.g2s-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .2s ease;
}

.g2s-sheet-backdrop.is-shown { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .g2s-sheet, .g2s-sheet-backdrop { transition: none; }
}

.g2s-sheet .g2s-sheet__form {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 10px 12px 0;
}

.g2s-sheet__close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background-color: var(--g2s-surface);
    color: var(--g2s-text);
    font-size: 18px;
    cursor: pointer;
}

.g2s-sheet__close:focus-visible { outline: 2px solid var(--g2s-focus); outline-offset: 2px; }

.g2s-sheet .g2s-sheet__form .g2s-field__box {
    flex: 1 1 0;
    min-width: 0;
}

/* 16px: iOS does not zoom the page on focus. */
.g2s-sheet .g2s-sheet__form input.x-autocomplete { font-size: 16px; }

.g2s-sheet .x-autocomplete-container.g2s-box {
    position: relative;
    /* In the flow of the sheet: none of the desktop panel's offsets. */
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    flex: 0 0 100%;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: calc(100vh - 64px - env(safe-area-inset-top));
    max-height: calc(100dvh - 64px - env(safe-area-inset-top));
    margin: 0 -12px;
    padding: 4px 6px calc(24px + env(safe-area-inset-bottom)) !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
}

.g2s-sheet .g2s-option { min-height: 48px; }

/* ===== Results page: "Looking for:" chips and the no-results panel ===== */

.g2s-looking {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* The page heading's theme rules title-case its children ("Looking For:"). */
.g2s-looking__label,
.g2s-pill {
    text-transform: none !important;
}

.g2s-looking__label {
    font-size: 13px;
    color: var(--g2s-muted, rgba(237, 239, 245, .62));
}

.g2s-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .1);
    background-color: rgba(255, 255, 255, .05);
    color: #edeff5 !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
}

.g2s-pill:hover,
.g2s-pill:focus-visible {
    border-color: rgba(188, 215, 103, .55);
    background-color: rgba(149, 171, 82, .14);
    outline: none;
}

.g2s-pill .fa { color: var(--brand-color-light, #bcd767); }

.g2s-page {
    color: var(--g2s-text);
}

.g2s-page__title {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.3;
    text-transform: none !important;
}

.g2s-page__text {
    margin: 0 0 14px;
    color: var(--g2s-muted);
}

.g2s-page__dym {
    margin: 0 0 14px;
    font-size: 15px;
}

.g2s-page__dym a {
    color: var(--g2s-accent);
    font-weight: 700;
}

.g2s-page__section + .g2s-page__section { margin-top: 16px; }

.g2s-page__label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--g2s-muted);
}

.g2s-page__ask {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background-color: rgba(37, 211, 102, .08);
    border: 1px solid rgba(37, 211, 102, .2);
    font-size: 14px;
}

.g2s-page__ask .fa { font-size: 20px; color: #4fd683; }

.g2s-page__ask a {
    color: #6fe09b;
    font-weight: 700;
    direction: ltr;
    unicode-bidi: isolate;
}

/* ===== The header search field (both layouts): dark, 46px, icon at the start, × at the end ===== */

form.g2s-field { position: relative; }

.g2s-field__box { position: relative; }

/* Beats the theme's light .search-box input (#dfdfdf, 45px, radius 13px / 6px !important). */
form.g2s-field input.x-autocomplete {
    width: 100%;
    height: 46px;
    margin: 0;
    padding-block: 0;
    padding-inline: 44px 40px;
    border: 1px solid var(--g2s-field-line) !important;
    border-radius: 12px !important;
    background-color: var(--g2s-bg) !important;
    color: var(--g2s-text) !important;
    font-size: 15px;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

form.g2s-field input.x-autocomplete::placeholder {
    color: var(--g2s-muted);
    opacity: 1;
}

form.g2s-field input.x-autocomplete:focus {
    border-color: var(--g2s-accent) !important;
    background-color: var(--g2s-bg) !important;
    box-shadow: 0 0 0 3px var(--g2s-ring);
    outline: none;
}

form.g2s-field .g2s-field__submit {
    position: absolute;
    top: 0;
    bottom: 0;
    left: auto;
    right: auto;
    inset-inline-start: 2px;
    z-index: 202;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: none;
    color: var(--g2s-muted);
    line-height: 1;
}

form.g2s-field .g2s-field__submit .fa { font-size: 16px; }
form.g2s-field .g2s-field__submit:hover,
form.g2s-field .g2s-field__submit:focus-visible { color: var(--g2s-accent); outline: none; }

form.g2s-field .g2s-field__clear {
    position: absolute;
    top: 50%;
    inset-inline-end: 6px;
    z-index: 202;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--g2s-muted);
    cursor: pointer;
}

form.g2s-field .g2s-field__clear[hidden] { display: none; }

form.g2s-field .g2s-field__clear:hover,
form.g2s-field .g2s-field__clear:focus-visible {
    color: var(--g2s-text);
    background-color: var(--g2s-hover);
    outline: none;
}

/* Phones (_Layout's header, "mb-2 pb-2"): 12px between the search field and the header's bottom hairline - the
   layout's .pb-2 gave 8. */
@media (max-width: 991px) {
    header.header.pb-2 { padding-bottom: 12px !important; }
}

/* ===== Waiting for a request: a 2px line at the top, rows dimmed after 250 ms ===== */

.g2s-box.is-loading::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 12px;
    z-index: 3;
    height: 2px;
    border-radius: 2px;
    background-image: linear-gradient(90deg, transparent, var(--g2s-accent), transparent);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    animation: g2s-progress .9s linear infinite;
}

@keyframes g2s-progress {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
}

.g2s-box .g2s { transition: opacity .15s ease; }
.g2s-box.is-stale .g2s { opacity: .6; }

/* New rows fade in (the panel height is animated by autocomplete.js). */
.g2s--enter { animation: g2s-rows-in 120ms ease-out; }

@keyframes g2s-rows-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* ===== The dim layer over the page below the header while the panel is open (not on the phone sheet) ===== */

.g2s-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 990;
    background-color: rgba(31, 38, 58, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease-out;
}

.g2s-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 767px) {
    .g2s-backdrop { display: none; }
}

/* ===== ↖ fill-in button at the end of text rows (mirrored in RTL) ===== */

.g2s-fill {
    flex: 0 0 auto;
    width: 40px;
    border: 0;
    background: none;
    color: var(--g2s-faint);
    border-radius: 10px;
    cursor: pointer;
}

.g2s-fill .fa {
    display: inline-block;
    transform: rotate(-45deg);
}

[dir="rtl"] .g2s-fill .fa { transform: rotate(45deg); }

.g2s-fill:hover,
.g2s-fill:focus-visible {
    color: var(--g2s-text);
    background-color: var(--g2s-hover);
    outline: none;
}

/* ===== Results page: the "More results" divider inside the product grid ===== */

.products--grid .g2s-more {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 calc(100% - 16px);
    width: calc(100% - 16px);
    grid-column: 1 / -1;
    margin: 16px 8px 8px;
    padding: 0;
    list-style: none;
    color: var(--g2s-muted);
    font-size: 13px;
}

.products--grid .g2s-more::before,
.products--grid .g2s-more::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background-color: var(--g2s-line);
}

.g2s-more__label {
    text-transform: none !important;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .g2s--enter,
    .g2s-box.is-loading::before { animation: none; }
    .g2s-box.is-loading::before { background-image: none; background-color: var(--g2s-accent); opacity: .5; }
    .g2s-backdrop,
    .g2s-box .g2s,
    form.g2s-field input.x-autocomplete { transition: none; }
}
