/* ============================================================================
   _game-select.css — modern GPU / CPU / RAM select controls (console-scoped)
   ============================================================================
   A dedicated, premium restyle of the hardware dropdowns on the FPS-calculator
   game page. EVERY rule is scoped under `.fps-field`, so the shared, legacy
   `_dropdowns.css` (reused by the game-selector modal and other pages) is never
   touched — the same `.dropdown-*` markup simply looks modern *inside a field*.

   Loaded AFTER `_dropdowns.css` and `_game-calc.css`; the `.fps-field` prefix
   raises specificity above the unscoped shared rules and ties resolve in this
   file's favour by load order. Tokens only (theme-vars + the `--fps-*` scale
   from `_game-hero.css`); depth comes from color-mix()/rgba-over-token so both
   light and dark themes stay correct. Alpine bindings are untouched — this is
   presentation only.

   Sections:
     1. Secondary field links ("Bekijk" / "Alle GPU's →")
     2. Trigger (the closed select button)
     3. Trigger internals (text / price / chevron)
     4. Floating menu (detached popover)
     5. Search field
     6. Options list (scrollbar, group eyebrows, rows, price, empty state)
   ============================================================================ */

/* ============================================================================
   1. SECONDARY FIELD LINKS — calm, muted, clearly secondary
   ----------------------------------------------------------------------------
   One quiet text-link per field instead of two loud pills: a persistent
   "Alle GPU's →" catalogue link plus a conditional "Bekijk" action that only
   appears when a part is selected. Both read as subdued meta, lifting to the
   accent on hover/focus.
   ========================================================================== */

.fps-field__links {
    gap: clamp(0.5rem, 1.2vw, 0.875rem);
}

.fps-field__link {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--fps-fs-xs);
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.fps-field__link:hover,
.fps-field__link:focus-visible {
    color: var(--accent);
}

.fps-field__link:focus-visible {
    outline: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The catalogue "more" link carries a nudging chevron that slides on hover. */
.fps-field__link-arrow {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.fps-field__link--all:hover .fps-field__link-arrow,
.fps-field__link--all:focus-visible .fps-field__link-arrow {
    transform: translateX(2px);
}

/* "Bekijk" is the quietest affordance — a hairline separates it from the
   catalogue link so the two stay visually distinct without borders. */
.fps-field__link--view {
    position: relative;
    padding-right: clamp(0.5rem, 1.2vw, 0.875rem);
}

.fps-field__link--view::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 0.8em;
    background: var(--border);
}

/* ============================================================================
   2. TRIGGER — the closed select button
   ----------------------------------------------------------------------------
   Clean 1px hairline, comfortable height, no shadow at rest. Hover lifts the
   border toward the accent with a whisper of accent tint; open + focus draw a
   full accent ring. The RAM field uses `.ram-dropdown-wrapper` and the GPU/CPU
   fields use `.hardware-dropdown` — both live inside `.fps-field`, so a single
   scoped rule styles all three.
   ========================================================================== */

.fps-field .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--fps-control-h);
    padding: 0.5rem clamp(0.75rem, 1.5vw, 0.9375rem);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fps-fs-base);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    touch-action: manipulation;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.fps-field .dropdown-trigger:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: color-mix(in srgb, var(--accent) 5%, var(--bg-secondary));
    box-shadow: none;
}

/* Keyboard focus + open share one clear accent ring; the button stays fully
   rounded (the menu detaches below it — no stuck-drawer flattening). */
.fps-field .dropdown-trigger:focus,
.fps-field .dropdown-trigger:focus-visible,
.fps-field .dropdown-trigger.is-open {
    outline: none;
    border-color: var(--accent);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.fps-field .dropdown-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.fps-field .dropdown-trigger:disabled:hover {
    border-color: var(--border);
    background: var(--bg-secondary);
}

/* ============================================================================
   3. TRIGGER INTERNALS — selected name, price badge, chevron
   ========================================================================== */

.fps-field .dropdown-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Refined price chip — muted accent tint, pushed to the right edge. */
.fps-field .dropdown-price {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0 auto;
    padding: 0.125rem 0.4375rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: var(--fps-fs-xs);
    font-weight: 700;
    line-height: 1.4;
}

/* Chevron: quiet at rest, rotates + accents when the menu is open. */
.fps-field .dropdown-arrow {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin-left: 0;
    color: var(--text-muted);
    transition: transform 0.18s ease, color 0.15s ease;
}

.fps-field .dropdown-trigger:hover .dropdown-arrow {
    color: var(--text-secondary);
}

.fps-field .dropdown-trigger.is-open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--accent);
}

/* ============================================================================
   4. FLOATING MENU — detached, fully-rounded popover
   ----------------------------------------------------------------------------
   A modern popover that floats a hair below the trigger with a soft shadow and
   a solid surface, rather than a drawer welded to the button. High z-index so
   it clears neighbouring fields and the results column.
   ========================================================================== */

.fps-field .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    max-height: 320px;
    overflow: hidden;
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.fps-field .dropdown-menu--compact {
    max-height: 280px;
}

/* Raise the whole field while its menu is open so the popover is never clipped
   by a later field's stacking context. */
.fps-field .hardware-dropdown:has(.is-open),
.fps-field .ram-dropdown-wrapper:has(.is-open) {
    z-index: 9999;
}

/* ============================================================================
   5. SEARCH FIELD — tidy input pinned to the top of the menu
   ========================================================================== */

.fps-field .dropdown-search {
    padding: clamp(0.5rem, 1.2vw, 0.6875rem);
    background: var(--bg-modal);
    border-bottom: 1px solid var(--border);
}

.fps-field .dropdown-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--fps-fs-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fps-field .dropdown-search input::placeholder {
    color: var(--text-muted);
}

.fps-field .dropdown-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ============================================================================
   6. OPTIONS LIST — scrollbar, group eyebrows, rows, price, empty state
   ========================================================================== */

.fps-field .dropdown-options {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.fps-field .dropdown-options::-webkit-scrollbar {
    width: 8px;
}

.fps-field .dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.fps-field .dropdown-options::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border: 2px solid var(--bg-modal);
    border-radius: 999px;
}

.fps-field .dropdown-options::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Vendor group headers become small uppercase eyebrows on a subtle shelf. */
.fps-field .dropdown-group-label {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.4375rem clamp(0.75rem, 1.5vw, 1rem);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--fps-fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Comfortable, tappable rows with a clean hover wash. */
.fps-field .dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5625rem clamp(0.75rem, 1.5vw, 1rem);
    background-color: transparent;
    border: none;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    color: var(--text-secondary);
    font-size: var(--fps-fs-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.fps-field .dropdown-option:last-child {
    border-bottom: none;
}

.fps-field .dropdown-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Selected row — accent tint + accent text + a tidy leading accent bar. */
.fps-field .dropdown-option.is-selected {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-weight: 700;
}

.fps-field .dropdown-option.is-selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 999px 999px 0;
}

.fps-field .dropdown-option {
    position: relative;
}

/* Prices ride the right edge, muted; the selected row keeps its accent. */
.fps-field .option-price {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: var(--fps-fs-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fps-field .dropdown-option.is-selected .option-price {
    color: color-mix(in srgb, var(--accent) 80%, var(--text-secondary));
}

/* Empty state — calm, centred. */
.fps-field .dropdown-empty {
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fps-fs-sm);
}

/* Respect reduced-motion: kill the micro-interactions, keep the styling. */
@media (prefers-reduced-motion: reduce) {
    .fps-field .dropdown-trigger,
    .fps-field .dropdown-arrow,
    .fps-field .dropdown-option,
    .fps-field .fps-field__link-arrow {
        transition: none;
    }
}
