/* ============================================================
 * user_ui — Price List page styles.
 * ============================================================
 *
 * Section-local CSS for the Price List page. Layers on top of
 * the shared cascade (tokens / fonts / base / buttons /
 * decorations / theme) loaded by base.html. Every
 * selector is scoped under `.price-list-page` so nothing leaks.
 *
 * Ported from the owner-supplied Price_List.html mockup, with
 * the mockup's hardcoded colours replaced by design-system
 * tokens so light theme works for free: the mockup
 * baked `#fff` into the "We Buy / We Sell" headers and a white
 * search field — both are tokenised here (var(--text), etc.).
 *
 * Sections:
 *   1. .price-hero            — hero spacing; its title + lead are
 *                               the shared hero copy
 *                               (shared/page_hero.css)
 *   3. .search                — GET search form
 *   4. .mascot-frame          — hero mascot
 *   5. .price / .price-card   — the table card + head row
 *   6. .price-table           — buy/sell table
 *   7. .pager / .pager-meta   — pagination
 *   8. responsive             — @1100 / @860 / @760 breakpoints
 * ============================================================ */

.price-list-page {
    position: relative;
}

/* ====== HERO ============================================
 * The hero paints no background of its own — the shared hero
 * band (shared/decorations.css) and the site-wide background
 * chrome (css/background/background.css) show through. Its
 * title and lead are the shared hero copy (shared/page_hero.css,
 * `.page-hero*`); this sheet only spaces the hero for the search
 * bar and the price card below it. */
.price-list-page .price-hero {
    padding: 56px 0 90px;
}

/* ====== SEARCH ========================================== */
.price-list-page .search {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    z-index: 3;            /* above the mascot — mascot peeks BEHIND the bar */
}
.price-list-page .search input {
    width: 100%;
    height: 54px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 0 18px 0 48px;
    outline: none;
}
.price-list-page .search input::placeholder { color: var(--text-mute); }
.price-list-page .search input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 22%, transparent);
}
.price-list-page .search .icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    color: var(--text-mute);
    pointer-events: none;
}
.price-list-page .search .search-go {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    height: 40px; padding: 0 18px;
    border: 0; border-radius: var(--radius);
    background: var(--orange); color: #fff;
    font-family: var(--font-head); font-weight: 600;
    cursor: pointer;
}

/* ====== MASCOT ========================================== */
/* Hero mascot — shared spec, single definition in shared/decorations.css. */

/* ====== PRICE CARD ====================================== */
.price-list-page .price {
    position: relative;
    padding: 0 0 80px;
    z-index: 2;
}
.price-list-page .price .wrap { max-width: 1400px; }
.price-list-page .price-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: -40px;
}
/* Game tabs — links to each game's Price List; rendered only while more
 * than one game is switched on for customers. The active tab is marked by
 * its underline and weight, and by `aria-current="page"`. */
.price-list-page .price-games {
    display: flex;
    gap: 6px;
    padding: 16px 24px 0;
    border-bottom: 1px solid var(--line);
}
.price-list-page .price-game {
    padding: 8px 16px 10px;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    color: var(--text-dim);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
}
.price-list-page .price-game:hover { color: var(--text); }
.price-list-page .price-game.active {
    color: var(--text);
    font-weight: 700;
    border-bottom-color: var(--orange);
}
.price-list-page .price-game:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: 6px;
}
.price-list-page .price-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px 0;
    min-height: 22px;
}
.price-list-page .result-count {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}
.price-list-page .last-updated {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: .02em;
    white-space: nowrap;
}

/* ====== TABLE =========================================== */
/* The card clips its rounded corners (`overflow: hidden`), so the table
 * scrolls sideways inside this box once the card is narrower than the
 * table's natural width (phones); header and body cells share one table,
 * so they scroll together and stay aligned. */
.price-list-page .price-table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.price-list-page .price-table-scroll:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: -2px;
}
.price-list-page .price-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.price-list-page .price-table thead th {
    background: transparent;
    border-bottom: 1px solid var(--line);
    padding: 22px 24px 14px;
    text-align: left;
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--orange);
    font-size: 15px;
    letter-spacing: .02em;
}
/* "We Buy" / "We Sell" span their quantity + price pair (colspan="2") and
 * are centred over it; this selector outranks the left-aligned
 * `thead th` rule above at every width. */
.price-list-page .price-table thead .group {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    padding: 22px 24px 4px;
    border-bottom: 0;
    text-align: center;
}
.price-list-page .price-table thead tr.group-row th { padding-bottom: 0; border-bottom: 0; }
.price-list-page .price-table thead tr.cols-row th { padding-top: 6px; }
.price-list-page .price-table thead .col-name { color: var(--orange); }
.price-list-page .price-table thead .col-q,
.price-list-page .price-table thead .col-p { text-align: right; font-size: 15px; }
.price-list-page .col-divider { border-left: 1px solid var(--line); }

.price-list-page .price-table tbody td {
    padding: 14px 24px;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
.price-list-page .price-table tbody tr:last-child td { border-bottom: 0; }
.price-list-page .price-table tbody tr.group-end td {
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
}
.price-list-page .price-table tbody tr.group-end + tr td { padding-top: 22px; }

.price-list-page .cell-name {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
}
.price-list-page .thumb {
    width: 36px; height: 36px;
    border-radius: 6px;
    flex: 0 0 auto;
    object-fit: contain;
    background: var(--chip);
}
.price-list-page .thumb-placeholder {
    border: 1px dashed var(--line);
    background:
        repeating-linear-gradient(135deg,
            color-mix(in srgb, var(--text) 6%, transparent) 0 5px,
            transparent 5px 10px);
}
.price-list-page .cell-name .name {
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
}
/* A row whose owner has an item page renders the cell as one link
   (image + name): no link styling at rest, the name underlined on
   hover, and the focus ring on the whole cell. */
.price-list-page .cell-name[href] {
    color: inherit;
    text-decoration: none;
    border-radius: 6px;
}
.price-list-page .cell-name[href]:hover .name { text-decoration: underline; }
.price-list-page .cell-name[href]:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

.price-list-page .col-buy-q,
.price-list-page .col-buy-p,
.price-list-page .col-sell-q,
.price-list-page .col-sell-p {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    white-space: nowrap;
}
.price-list-page .col-buy-q { width: 18%; }
.price-list-page .col-buy-p { width: 18%; }
.price-list-page .col-sell-q { width: 18%; padding-left: 38px; }
.price-list-page .col-sell-p { width: 18%; }

.price-list-page .empty-row td {
    text-align: center;
    color: var(--text-dim);
    padding: 56px 24px;
    font-size: 15px;
}

/* ====== LIVE-REFRESH FLASH ============================== */
/* Auto-refresh: brief highlight on a cell whose
   value changed after a live snapshot refresh. PriceListPage adds
   `.price-flash` to changed <td>s; the keyframe fades it out.
   Token-based so it works in both themes. */
@keyframes price-cell-flash {
    0%   { background-color: color-mix(in srgb, var(--orange) 28%, transparent); }
    100% { background-color: transparent; }
}
.price-list-page .price-table td.price-flash {
    animation: price-cell-flash 1100ms ease-out;
}

/* ====== PAGINATION ====================================== */
.price-list-page .pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 48px 0 12px;
    font-family: var(--font-head);
    color: var(--text-dim);
}
.price-list-page .pager a,
.price-list-page .pager span {
    background: transparent;
    border: 0;
    color: var(--text-dim);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 22px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    line-height: 1;
    text-decoration: none;
}
.price-list-page .pager a:hover { color: var(--text); }
.price-list-page .pager .active {
    color: var(--text);
    border: 1px solid var(--text-dim);
    width: 42px; height: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
    cursor: default;
}
.price-list-page .pager .arrow { font-family: var(--font-mono); font-size: 18px; }
.price-list-page .pager .disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}
.price-list-page .pager-meta {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    padding-bottom: 10px;
}

/* ====== RESPONSIVE ====================================== */
@media (max-width: 1100px) {
    .price-list-page .price .wrap { max-width: 1100px; }
    .price-list-page .price-table thead .group { font-size: 22px; }
    .price-list-page .price-table thead th { padding: 20px 18px 12px; }
    .price-list-page .price-table tbody td { padding: 12px 18px; }
    .price-list-page .col-sell-q { padding-left: 24px; }
}

@media (max-width: 860px) {
    .price-list-page .price-hero { padding: 40px 0 50px; }
    .price-list-page .search { max-width: none; margin-top: 18px; }
    .price-list-page .price-card { margin-top: 0; }
    .price-list-page .price-table thead .group { font-size: 18px; }
    .price-list-page .price-table tbody td,
    .price-list-page .price-table thead th { padding: 10px 12px; font-size: 13px; }
    .price-list-page .cell-name { min-width: 160px; gap: 10px; }
    .price-list-page .thumb { width: 28px; height: 28px; }
    .price-list-page .col-sell-q { padding-left: 14px; }
}

@media (max-width: 760px) {
    .price-list-page .search input { height: 46px; font-size: 14px; }
    .price-list-page .pager a,
    .price-list-page .pager span { font-size: 18px; }
    .price-list-page .pager .active { width: 36px; height: 36px; }
    .price-list-page .price-card-head { flex-wrap: wrap; }
    /* Headings keep one line, so the table holds its natural width and
     * scrolls sideways in `.price-table-scroll` rather than squeezing the
     * column titles into stacked fragments. */
    .price-list-page .price-table thead th { white-space: nowrap; }
}


/* ---- Killstreak kit overlay ----
   Every killstreak kit and fabricator in TF2 is drawn with the SAME
   generic icon, so a page holding several is identical row to row. The
   target weapon is laid over that icon to tell them apart.

   Positioned absolutely inside whatever tile already holds the base
   image, which is why that tile gets `position: relative` here rather
   than in its own block — the overlay is the only reason it needs one.
   Kept slightly transparent and inset so the kit underneath still
   reads: the weapon answers "which one", the crate answers "what kind".
   `pointer-events: none` so it can never swallow a click meant for the
   card. */

.cell-name .thumb,
.cell-name .thumb-stack { position: relative; }
.thumb-stack { display: inline-block; }
.thumb-stack .thumb-base { width: 100%; height: 100%; object-fit: contain; }

.thumb-overlay {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  object-fit: contain;
  opacity: 0.8;
  pointer-events: none;
}
