/* One look for the site's card / item pickers: the trade offer picker's (.gto-picker in
   garam_trade_offer.css). Applies to every dialog built on the Auctions picker markup that has the
   class "picker-look":
     #marketSellModal (Marketplace), #auctionPickerModal (Auctions),
     #invPickModal (Inventory), #shopPickModal (Shop).
   Load it after garam_auctions.css and garam_market_sell.css.

   Every selector starts with `body :is(#_, .picker-look)`: :is() takes the specificity of its
   strongest argument, so these rules weigh as much as an id (no element has the id "_") and win
   over the older picker rules without !important. */

body :is(#_, .picker-look) {
    --market-accent: var(--garam-theme-ui-accent, var(--garam-theme-accent, #087cce));
    --market-ink: #142438; --market-muted: #617489; --market-panel: #fff; --market-border: #d9e6f0; --market-raised: #f3f7fa;
    padding: 16px; background: rgba(9, 24, 40, .55);
}
html[data-garam-mode="dark"] body :is(#_, .picker-look) {
    --market-accent: var(--garam-theme-ui-accent, #b4b6c0);
    --market-ink: var(--garam-dark-text, #f3f4f7); --market-muted: var(--garam-dark-muted, #a5a8b2);
    --market-panel: var(--garam-dark-panel, #23242a); --market-border: var(--garam-dark-border, #45464d);
    --market-raised: var(--garam-dark-raised, #34353c);
}
body :is(#_, .picker-look) .auction-picker-dialog {
    --picker-pad: clamp(16px, 2.6vw, 26px);
    display: flex; flex-direction: column;
    width: min(920px, 100%); max-height: min(92vh, 880px); padding: var(--picker-pad);
    border-radius: 22px; border: 1px solid var(--market-border); background: var(--market-panel); color: var(--market-ink);
    box-shadow: 0 24px 70px rgba(9, 24, 40, .35);
}
/* A dialog with a footer bar lets the bar reach its bottom edge. */
body :is(#_, .picker-look) .auction-picker-dialog:has(> .market-sell-footer) { padding-bottom: 0; }
body :is(#_, .picker-look) .auction-picker-dialog [hidden] { display: none !important; }

/* Header: just the title on the left and the close button on the right. */
body :is(#_, .picker-look) .auction-picker-kicker,
body :is(#_, .picker-look) .auction-picker-description { display: none; }
body :is(#_, .picker-look) .auction-picker-header { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; align-items: center; flex: 0 0 auto; }
body :is(#_, .picker-look) .auction-picker-header h2 { grid-column: 1; grid-row: 1; text-align: left;
    font-size: clamp(19px, 2.3vw, 25px); letter-spacing: -.03em; color: var(--market-ink); }
body :is(#_, .picker-look) .auction-picker-close { grid-column: 2; grid-row: 1; width: 36px; min-width: 36px; height: 36px;
    border: 0; border-radius: 10px; background: var(--market-raised); color: var(--market-ink); }
body :is(#_, .picker-look) .auction-picker-close:focus-visible { outline: 2px solid var(--market-accent); outline-offset: 2px; }

/* Filters */
body :is(#_, .picker-look) .auction-picker-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 10px; flex: 0 0 auto; }
body :is(#_, .picker-look) .marketplace-filters label { gap: 6px; font-size: 12px; font-weight: 600; color: var(--market-ink); }
body :is(#_, .picker-look) .marketplace-filters input, body :is(#_, .picker-look) .marketplace-filters select {
    height: auto; min-height: 40px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--market-border);
    background: var(--market-raised); color: var(--market-ink); font-size: 13px; }
body :is(#_, .picker-look) .marketplace-filters input:focus-visible, body :is(#_, .picker-look) .marketplace-filters select:focus-visible {
    outline: 2px solid var(--market-accent); outline-offset: 1px; }
/* Placeholders: plain gray (the browser's own placeholder gray), not a theme-tinted color. */
body :is(#_, .picker-look) .marketplace-filters input::placeholder { color: #757575; opacity: 1; }
body :is(#_, .picker-look) .auction-picker-status { min-height: 1em; margin: 0; flex: 0 0 auto;
    font-size: 12px; font-weight: 400; line-height: 1.5; color: var(--market-muted); }
/* Marketplace: steps 2 and 3 start a little below the title (step 1 has its filters' margin there). */
body :is(#_, .picker-look) #marketSellPriceStep, body :is(#_, .picker-look) #marketSellDoneStep { margin-top: 16px; }

/* Tiles: picture, name and one line under it. */
body :is(#_, .picker-look) .auction-picker-grid { gap: 10px; margin-top: 10px; }
body :is(#_, .picker-look) .auction-pick-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 6px;
    border-radius: 13px; border: 1px solid var(--market-border); background: var(--market-panel); box-shadow: none;
    transition: border-color .15s, transform .15s, box-shadow .15s; }
body :is(#_, .picker-look) .auction-pick-card:hover:not(:disabled) { border-color: var(--market-accent); transform: translateY(-2px); box-shadow: none; }
body :is(#_, .picker-look) .auction-pick-card[aria-pressed="true"] { border-color: var(--market-accent); box-shadow: 0 0 0 2px var(--market-accent); }
body :is(#_, .picker-look) .auction-pick-card:disabled { opacity: .4; transform: none; }
body :is(#_, .picker-look) .auction-pick-card:focus-visible { outline: 2px solid var(--market-accent); outline-offset: 2px; }
body :is(#_, .picker-look) .auction-pick-card .marketplace-card-photo { border-radius: 9px; background: var(--market-raised); }
body :is(#_, .picker-look) .auction-pick-card .marketplace-card-photo img { border-radius: 0; }
/* The copy number, over the picture's top left corner. */
body :is(#_, .picker-look) .auction-pick-copy { position: absolute; top: 5px; left: 5px; max-width: calc(100% - 10px); padding: 2px 6px; border-radius: 7px;
    background: rgba(20, 36, 56, .82); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3;
    font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
body :is(#_, .picker-look) .auction-pick-card .marketplace-card-info { padding: 6px 1px 0; }
body :is(#_, .picker-look) .auction-pick-card .marketplace-card-name { font-size: 12px; font-weight: 600; }
body :is(#_, .picker-look) .auction-pick-card .marketplace-card-sub { margin-top: 1px; font-size: 12px; color: var(--market-muted); }
body :is(#_, .picker-look) .market-sell-check { right: 5px; top: 5px; width: 22px; height: 22px; font-size: 12px; }
/* Small notes that some pickers keep on a tile ("On sale", "In a cardholder: it will be moved"). */
body :is(#_, .picker-look) .auction-pick-badge { right: 5px; bottom: 5px; top: auto; max-width: calc(100% - 10px); min-height: 0; padding: 3px 6px; border-radius: 7px; font-size: 12px; }
body :is(#_, .picker-look) .inv-pick-flag { margin-top: 2px; font-size: 12px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body :is(#_, .picker-look) .auction-picker-empty { padding: 34px 12px; border-radius: 14px; font-size: 13px; }
body :is(#_, .picker-look) .auction-picker-empty strong { font-size: 15px; margin-bottom: 4px; }

/* Pages */
body :is(#_, .picker-look) .auction-picker-pagination { gap: 14px; margin-top: 14px; flex: 0 0 auto; }
body :is(#_, .picker-look) .marketplace-pagination button { min-height: 0; min-width: 0; padding: 7px 15px; border-radius: 12px;
    border: 1px solid var(--market-border); background: var(--market-panel); color: var(--market-ink); font-size: 13px; font-weight: 600; }
body :is(#_, .picker-look) .marketplace-pagination button:hover:not(:disabled) { background: var(--market-raised); }
body :is(#_, .picker-look) :is(.market-sell-page, #auctionPickPage) { min-width: 0; font-size: 13px; font-weight: 600; color: var(--market-ink);
    font-variant-numeric: tabular-nums; }

/* Footer bar and its buttons (Marketplace, Inventory, Shop) */
body :is(#_, .picker-look) .market-sell-footer { flex: 0 0 auto; margin: 16px calc(-1 * var(--picker-pad)) 0;
    padding: 14px var(--picker-pad) max(16px, env(safe-area-inset-bottom)); border-radius: 0 0 22px 22px;
    background: var(--market-panel); border-top: 1px solid var(--market-border); }
body :is(#_, .picker-look) .market-sell-secondary { min-height: 0; padding: 11px 20px; border-radius: 12px; border: 1px solid var(--market-border);
    background: var(--market-panel); color: var(--market-ink); font-size: 13px; font-weight: 600; }
body :is(#_, .picker-look) .market-sell-secondary:hover:not(:disabled) { background: var(--market-raised); }
body :is(#_, .picker-look) .market-sell-footer .auction-primary-button { min-height: 0; padding: 11px 20px; border: 0; border-radius: 12px;
    background: var(--market-accent); color: #fff; box-shadow: none; font-size: 13px; font-weight: 600; }
body :is(#_, .picker-look) .market-sell-footer .auction-primary-button:hover:not(:disabled) { filter: brightness(.94); }

/* Desktop: one page of results is 24 = 8 columns x 3 rows. The tiles keep the shape of a card
   (they are never stretched) and the grid always keeps the height of three rows of them, so the
   dialog has the same height however many results there are (as in garam_trade_offer.css).
   100cqw is the width of the dialog's content; --pick-text is the height of a tile without its
   picture (padding, border, name and the line under it). */
@media (min-width: 781px) {
    body :is(#_, .picker-look) .auction-picker-dialog { container-type: inline-size; max-height: min(96vh, 880px); overflow-y: auto; overscroll-behavior: contain; }
    body :is(#_, .picker-look) .auction-picker-dialog > * { flex-shrink: 0; }
    /* The filters fit on one row. */
    body :is(#_, .picker-look) .auction-picker-filters { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: 14px 0 8px; }
    body :is(#_, .picker-look) .auction-picker-grid { --pick-text: 52px; margin-top: 8px; align-items: start; align-content: start;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        min-height: calc(3 * (((100cqw - 70px) / 8 - 14px) * 279 / 188 + var(--pick-text)) + 20px); }
    body :is(#_, .picker-look) .auction-picker-grid:has(.auction-picker-empty) { align-items: stretch; align-content: stretch; }
    body :is(#_, .picker-look) .auction-picker-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; }
    body :is(#_, .picker-look) .market-sell-footer { position: static; margin-top: 12px; padding-top: 12px; padding-bottom: 14px; }
}
@media (max-width: 780px) {
    body :is(#_, .picker-look) .auction-picker-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Phones and tablets: rounder pictures. */
    body :is(#_, .picker-look) .auction-pick-card .marketplace-card-photo { border-radius: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    body :is(#_, .picker-look) .auction-pick-card { transition: none; }
}
