/* =============================================================================
   item-index.css — WoW Item Price Guide (/item/) — "same fashion" as
   cheapest-realm. Self-contained (carries the shared search/typeahead/chip/tile
   toolkit) so the live cheapest-realm page is untouched. Tokens come from
   static/css/_tokens.css; the WoW quality colors + .crp-* price coins are kept
   here (the .coin-* names collide with the AH coin-swatch system — never reuse).
   TODO(consolidate): extract this toolkit + cheapest-realm's into a shared file.
   ============================================================================= */
:root {
  --q-poor: #9d9d9d; --q-common: #ffffff; --q-uncommon: #1eff00;
  --q-rare: #0070dd; --q-epic: #a335ee; --q-legendary: #ff8000; --q-heirloom: #00ccff;
}
.crp-g { color: var(--wgf-gold) } .crp-s { color: #c0c0c0 } .crp-c { color: #c8602c }
.ii-coin-na { color: var(--wgf-muted) }

/* ===== hero search ===== */
.ii-searchsec { position: relative; margin: 1.1rem 0 1.4rem; padding: 1.5rem 1.5rem 1.6rem;
  border: 1px solid var(--wgf-border-strong); border-radius: 18px;
  background: linear-gradient(180deg,rgba(244,196,92,.06),transparent 60%),var(--wgf-panel);
  box-shadow: 0 18px 50px -24px rgba(0,0,0,.8), inset 0 0 0 1px rgba(244,196,92,.04) }
.ii-kicker { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .14em;
  font-size: .74rem; color: var(--wgf-gold-soft); margin: 0 0 .7rem }
.search { position: relative }
.search__field { position: relative; display: flex; align-items: center }
.search__icon { position: absolute; left: 1.15rem; width: 26px; height: 26px; opacity: .85; pointer-events: none; color: var(--wgf-gold) }
.search__input { width: 100%; padding: 1.1rem 1.2rem 1.1rem 3.4rem; font-size: 1.45rem; font-family: var(--font-ui);
  border-radius: 14px; border: 1.5px solid var(--wgf-border-strong); background: #0e0c08; color: var(--wgf-text);
  transition: border-color .15s, box-shadow .15s }
.search__input::placeholder { color: #7d7565 }
.search__input:focus { outline: none; border-color: var(--wgf-gold); box-shadow: 0 0 0 4px rgba(240,192,64,.18) }

/* typeahead */
.results { list-style: none; margin: .6rem 0 0; padding: .3rem; position: absolute; left: 0; right: 0; z-index: 30;
  background: #14110c; border: 1px solid var(--wgf-border-strong); border-radius: 14px; max-height: 26rem;
  overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.6) }
.results[hidden] { display: none }
.results li { display: flex; align-items: center; gap: .85rem; padding: .6rem .7rem; cursor: pointer; border-radius: 10px; border: 1px solid transparent }
.results li:hover, .results li.is-active { background: var(--wgf-panel-3); border-color: var(--wgf-border) }
.ic { position: relative; flex: 0 0 auto; border-radius: 8px; background: #0a0906; border: 1px solid #3a3324; overflow: hidden }
.ic img { width: 100%; height: 100%; display: block }
.ic .qring { position: absolute; inset: 0; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--qc,transparent) }
.results .ic { width: 40px; height: 40px }
.results .meta { min-width: 0; flex: 1 1 auto }
.results .nm { display: block; font-weight: 600; font-size: 1.06rem; color: var(--qc,var(--wgf-text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.results .sub { display: block; font-size: .82rem; color: var(--wgf-muted); font-family: var(--font-mono); margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.results .from { flex: 0 0 auto; text-align: right; font-family: var(--font-mono); font-size: .92rem; color: var(--wgf-gold) }
.results .from small { display: block; color: var(--wgf-muted); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase }

/* ===== categories ===== */
.cats { margin: 1.05rem 0 0 }
.cats__label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; color: var(--wgf-muted); margin: 0 0 .55rem }
.cats__row { display: flex; flex-wrap: wrap; gap: .5rem }
.catchip { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .85rem; border-radius: 999px;
  border: 1px solid var(--wgf-border-neutral); background: var(--wgf-panel-2); color: var(--wgf-text);
  font-family: var(--font-ui); font-size: .95rem; cursor: pointer; transition: border-color .12s, background .12s, color .12s }
.catchip:hover { border-color: var(--wgf-gold-dim); background: var(--wgf-panel-3) }
.catchip.is-active { border-color: var(--wgf-gold); color: var(--wgf-gold); background: rgba(240,192,64,.08) }

/* ===== browse grid (category) ===== */
.browse-sec[hidden] { display: none }
.browse-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .2rem 0 .75rem }
.linkbtn { background: none; border: 0; color: var(--wgf-gold-bright); font-family: var(--font-ui); font-size: .9rem; cursor: pointer; padding: .2rem .3rem }
.linkbtn:hover { text-decoration: underline }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: .55rem }
.tile { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border: 1px solid var(--wgf-border-neutral);
  border-radius: 10px; background: var(--wgf-panel); cursor: pointer; text-align: left; text-decoration: none;
  transition: border-color .12s, transform .12s, box-shadow .12s }
.tile:hover { border-color: var(--wgf-border-strong); transform: translateY(-2px); box-shadow: 0 12px 26px -20px rgba(0,0,0,.9) }
.tile .ic { width: 42px; height: 42px }
.tile .info { min-width: 0; flex: 1 1 auto; overflow: hidden }
.tile .nm { display: block; font-weight: 600; color: var(--qc,var(--wgf-text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02rem }
.tile .mt { display: block; font-size: .78rem; color: var(--wgf-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.tile .fr { flex: 0 0 auto; min-width: 3.4rem; text-align: right; font-family: var(--font-mono); font-size: .86rem; color: var(--wgf-gold); line-height: 1.15 }
.tile .fr small { display: block; font-size: .6rem; color: var(--wgf-muted); text-transform: uppercase; letter-spacing: .04em }

/* ===== Top-Traded item rows (SSR + browse) ===== */
.ii-list { display: flex; flex-direction: column; gap: .5rem }
.ii-row { display: flex; align-items: center; gap: .9rem; text-decoration: none;
  border: 1px solid var(--wgf-border-neutral); border-radius: 11px; background: var(--wgf-panel);
  padding: .55rem 1.05rem; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease }
.ii-row:hover { border-color: var(--wgf-border-strong); transform: translateX(2px); box-shadow: 0 12px 28px -20px rgba(0,0,0,.9) }
.ii-row .ic { width: 40px; height: 40px; flex: 0 0 auto }
.ii-row .nm { flex: 0 1 auto; min-width: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem;
  line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--qc,var(--wgf-text)) }
.ii-row .cat { flex: 0 0 auto; padding: .14rem .55rem; border-radius: 6px; font-size: .72rem; font-weight: 600;
  color: var(--wgf-gold-soft); background: rgba(244,196,92,.10); border: 1px solid var(--wgf-border-neutral); white-space: nowrap }
.ii-row .grow { flex: 1 1 auto; min-width: .5rem }
.ii-row .price { flex: 0 0 8rem; font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem; color: var(--wgf-gold); text-align: right; white-space: nowrap }
.ii-row .avail { flex: 0 0 7rem; font-size: .86rem; color: var(--wgf-muted); text-align: right; white-space: nowrap }
.ii-row .avail b { color: var(--wgf-text); font-weight: 600 }

@media (max-width: 680px) {
  .ii-row { flex-wrap: wrap; gap: .4rem .8rem; padding: .6rem .85rem }
  .ii-row .nm { flex: 1 1 auto; font-size: 1.04rem }
  .ii-row .grow { display: none }
  .ii-row .price { order: 2; flex: 0 0 auto; margin-left: auto; font-size: 1.2rem }
  .ii-row .cat { order: 3 }
  .ii-row .avail { order: 4; flex: 0 0 auto; text-align: left }
}

.empty { margin: .5rem 0 0; color: var(--wgf-muted) }
.empty[hidden] { display: none }
.section-h { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; color: var(--wgf-gold); margin: 0 }

@media (max-width: 640px) {
  .search__input { font-size: 1.2rem; padding: 1rem 1rem 1rem 3rem }
}

.wgf-item-index-layout { max-width: 1280px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 32px); box-sizing: border-box; }
.wgf-item-index-layout .wgf-seo-main { min-width: 0; }
.wgf-item-index-layout .wgf-seo-hero { max-width: none; }
.wgf-item-index-layout .wgf-ad-slot { margin-left: auto; margin-right: auto; }
@media (max-width: 640px) {
  .wgf-item-index-layout { padding-inline: 14px; }
  .ii-searchsec { padding: 1.1rem 1rem 1.15rem; }
}
