.trade-page { min-height: 100vh; background: #ece9df; }
.trade-hero { min-height: 315px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 45px; padding: 44px max(7vw,24px) 72px; color: white; background: var(--ink); }
.trade-hero::after { content: "TRADE"; position: absolute; right: -20px; bottom: -36px; color: rgba(255,255,255,.025); font: 700 195px/.8 "Oswald"; }
.trade-hero > div { position: relative; z-index: 1; }
.trade-hero h1 { margin: 0; font: 600 clamp(48px,6vw,74px)/.9 "Oswald"; text-transform: uppercase; letter-spacing: -1.5px; }
.trade-hero h1 span { color: var(--yellow); }
.trade-hero > div:first-child > p:last-child { max-width: 510px; margin: 20px 0 0; color: #b8c3d1; font-size: 14px; line-height: 1.6; }
.trade-stats { display: flex; align-items: center; gap: 25px; padding: 24px 30px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.trade-stats div { min-width: 110px; text-align: center; }
.trade-stats strong { display: block; color: var(--yellow); font: 600 47px/.95 "Oswald"; }
.trade-stats span { color: #aeb9c8; font-size: 9px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.trade-stats i { width: 1px; height: 54px; background: rgba(255,255,255,.14); }

.trade-layout { position: relative; z-index: 2; max-width: 1440px; display: grid; grid-template-columns: minmax(0,1fr) 355px; gap: 20px; margin: -35px auto 0; padding: 0 max(3vw,20px) 70px; }
.trade-catalog, .trade-cart { background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.trade-catalog { min-width: 0; padding: 20px; }
.trade-tools { display: grid; grid-template-columns: minmax(260px,1fr) 165px auto; gap: 9px; }
.trade-search { min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #f4f3ed; border: 1px solid var(--line); }
.trade-search span { font-size: 23px; }
.trade-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.trade-group-filter { display: flex; }
.paste-toggle { padding: 0 16px; color: white; background: var(--ink); border: 0; cursor: pointer; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.paste-panel { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 18px; margin-top: 12px; padding: 18px; background: var(--yellow-soft); border: 1px solid #dec65c; }
.paste-panel[hidden] { display: none; }
.paste-panel h2 { margin: 0; font: 600 21px "Oswald"; text-transform: uppercase; }
.paste-panel p:last-of-type { margin: 4px 0 8px; color: var(--muted); font-size: 9px; }
.paste-panel select { height: 34px; background: white; border-color: #d3c78f; font-size: 9px; }
.paste-panel textarea { width: 100%; height: 112px; resize: vertical; padding: 10px; background: white; border: 1px solid #d3c78f; outline: none; font: 600 11px/1.5 "DM Sans"; }
.paste-actions { display: flex; flex-direction: column; gap: 7px; }
.paste-actions button { padding: 10px 12px; border: 1px solid var(--ink); cursor: pointer; font-size: 9px; font-weight: 700; }
.paste-actions button:first-child { color: white; background: var(--ink); }
.paste-actions button:last-child { background: transparent; }
.paste-matches { grid-column: 1 / -1; padding: 10px 12px; color: var(--ink); background: white; border-left: 4px solid #3b874d; font-size: 10px; line-height: 1.6; }
.paste-matches[hidden] { display: none; }
.paste-matches strong { color: #3b874d; }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; margin: 30px 4px 17px; }
.catalog-heading h2, .cart-heading h2 { margin: 0; font: 600 28px "Oswald"; text-transform: uppercase; }
.catalog-heading > p { color: var(--muted); font-size: 9px; }
.catalog-heading > p strong { color: var(--ink); }
.trade-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.trade-item { --team-color: var(--blue); position: relative; overflow: hidden; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 74px; padding: 10px; background: #f7f4e9; border: 1px solid #dcd7c8; border-top: 4px solid var(--team-color); }
.trade-item::after { content: attr(data-code); position: absolute; right: 55px; color: rgba(7,23,47,.035); font: 700 54px "Oswald"; pointer-events: none; }
.trade-sticker-number { z-index: 1; display: grid; place-items: center; width: 45px; height: 51px; background: white; border: 1px solid #c9c5b8; font: 600 20px "Oswald"; }
.trade-item-info { z-index: 1; min-width: 0; }
.trade-item-info strong { display: block; overflow: hidden; font: 600 14px "Oswald"; white-space: nowrap; text-overflow: ellipsis; }
.trade-item-info small { color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .5px; }
.trade-add { z-index: 1; min-width: 53px; padding: 8px 7px; color: white; background: var(--ink); border: 0; cursor: pointer; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.trade-add:hover { background: var(--team-color); }
.trade-add:disabled { color: #7d888a; background: #d8d9d4; cursor: default; }
.trade-empty { padding: 70px 20px; text-align: center; background: #f7f5ed; }
.trade-empty > span { font-size: 32px; }
.trade-empty h3 { margin: 9px 0 3px; font: 600 20px "Oswald"; text-transform: uppercase; }
.trade-empty p { margin: 0; color: var(--muted); font-size: 11px; }

.trade-cart { position: sticky; top: 15px; align-self: start; min-height: 620px; max-height: calc(100vh - 30px); display: flex; flex-direction: column; padding: 22px; }
.cart-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.cart-heading button { padding: 6px 8px; color: var(--red); background: transparent; border: 1px solid #e6b6b8; cursor: pointer; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.cart-heading button:disabled { opacity: .35; }
.trade-selection { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow: auto; margin-top: 13px; }
.selection-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; background: #f5f3eb; border-left: 3px solid var(--team-color); }
.selection-row strong { display: block; font: 600 14px "Oswald"; }
.selection-row small { display: block; color: var(--muted); font-size: 7px; }
.selection-quantity { display: flex; align-items: center; background: white; border: 1px solid var(--line); }
.selection-quantity button { width: 27px; height: 27px; padding: 0; background: transparent; border: 0; cursor: pointer; }
.selection-quantity b { min-width: 22px; text-align: center; font: 600 13px "Oswald"; }
.incoming-trade { margin-top: 14px; padding: 10px; background: #edf6ea; border: 1px solid #bad1b5; }
.incoming-trade > p { margin: 0 0 7px; color: #397846; font-size: 8px; font-weight: 700; letter-spacing: .7px; }
#incomingTradeList { display: flex; flex-wrap: wrap; gap: 5px; }
#incomingTradeList span { padding: 4px 6px; color: #285e33; background: white; border: 1px solid #bad1b5; font: 600 9px "Oswald"; }
.selection-empty { margin: auto; padding: 45px 10px; text-align: center; }
.selection-empty > span { display: grid; place-items: center; width: 52px; height: 52px; margin: auto; color: var(--ink); background: var(--yellow); border-radius: 50%; font-size: 24px; }
.selection-empty h3 { margin: 14px 0 4px; font: 600 18px "Oswald"; text-transform: uppercase; }
.selection-empty p { margin: 0; color: var(--muted); font-size: 10px; }
.trade-actions { margin-top: auto; padding-top: 18px; }
.trade-actions > button { width: 100%; cursor: pointer; }
.copy-trade { margin-bottom: 8px; padding: 10px; color: var(--ink); background: transparent; border: 1px solid var(--ink); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.complete-trade { display: flex; align-items: center; gap: 12px; padding: 13px 15px; color: var(--ink); background: var(--yellow); border: 0; text-align: left; }
.complete-trade > span:first-child { display: grid; place-items: center; width: 29px; height: 29px; color: white; background: var(--ink); border-radius: 50%; }
.complete-trade > span:last-child { display: flex; flex-direction: column; }
.complete-trade strong { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.complete-trade small { font-size: 8px; }
.trade-actions button:disabled { color: #8b8e8d; background: #dddcd6; border-color: #ccc; cursor: default; }
.trade-actions > p { margin: 9px 0 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.trade-actions code { color: var(--ink); font-size: 8px; }

@media (max-width: 1120px) {
  .trade-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .trade-layout { grid-template-columns: 1fr; }
  .trade-cart { position: static; min-height: 460px; max-height: none; }
  .paste-panel { grid-template-columns: 1fr 1fr; }
  .paste-actions { grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 700px) {
  .page-nav a { padding: 8px 7px; font-size: 8px; }
  .trade-hero { display: block; padding-bottom: 78px; }
  .trade-stats { margin-top: 27px; padding: 18px; }
  .trade-layout { padding: 0 12px 55px; }
  .trade-catalog, .trade-cart { padding: 14px; }
  .trade-tools { grid-template-columns: 1fr 1fr; }
  .trade-search { grid-column: 1 / -1; }
  .paste-panel { grid-template-columns: 1fr; }
  .paste-actions { grid-column: auto; }
  .trade-grid { grid-template-columns: 1fr; }
}
