/* ==========================================================================
   Tarjetas de producto y colores de rareza.
   --rc = color de rareza; lo hereda cualquier elemento con .rarity-*
   ========================================================================== */

.rarity-common    { --rc: #9aa58a; }
.rarity-rare      { --rc: #3fa7ff; }
.rarity-epic      { --rc: #b76cff; }
.rarity-legendary { --rc: #ff5a36; }

.item-wrap {
  position: relative;
  transition: transform .18s ease, filter .18s ease;
}
.item-wrap:hover,
.item-wrap:focus-within {
  transform: translateY(-4px);
  filter: drop-shadow(0 10px 22px color-mix(in srgb, var(--rc, #9aa58a) 38%, transparent));
}

.item {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #232c1d, #1b2216);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc, #9aa58a) 38%, #2a3323);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.item::before {                 /* barra superior del color de rareza */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--rc, #9aa58a);
  z-index: 2;
}
.item-link { position: absolute; inset: 0; z-index: 1; }
.item-link:focus-visible { outline-offset: -4px; }

.item-art {
  position: relative;
  aspect-ratio: 16 / 11;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc, #9aa58a) 26%, transparent), transparent 66%),
    #151a10;
}
.item-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.item-wrap:hover .item-art img { transform: scale(1.05); }
.item-art .art-icon { width: 34%; height: 34%; color: var(--rc, #9aa58a); stroke-width: 1.3; }
.art-fallback { display: grid; place-items: center; background: #151a10; color: var(--rc, #9aa58a); }
.art-fallback .ic { width: 38%; height: 38%; }

.item-cat, .item-rarity {
  position: absolute;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .55rem;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
}
.item-cat { left: 0; background: rgba(10, 12, 7, .78); color: var(--text); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.item-rarity { right: 0; background: var(--rc, #9aa58a); color: #11140d; }

.item-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.15rem 1.15rem; }
.item-name { font-size: 1.55rem; margin: 0 0 .3rem; line-height: 1; }
.item-tagline {
  margin: 0 0 .8rem;
  color: var(--muted, #a1ac90);
  font-size: .92rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .55rem;
  font-size: .8rem;
  font-weight: 500;
  color: #cdd6bd;
  background: rgba(0, 0, 0, .3);
  border: 1px solid #333f2a;
}
.chip-hot { color: var(--amber, #ffb000); border-color: rgba(255, 176, 0, .5); background: rgba(255, 176, 0, .08); }
.chip-out { color: var(--bad, #ff5c4d); border-color: rgba(255, 92, 77, .5); }
.chip-weapon { color: var(--rc, #cdd6bd); border-color: var(--rc, rgba(205, 214, 189, .4)); }

.item-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem; }
.item-foot form { position: relative; z-index: 2; margin: 0; }
.price {
  font-family: var(--font-display, Impact, sans-serif);
  font-weight: 900;
  font-size: 1.9rem;
  line-height: 1;
  white-space: nowrap; /* precios de 5 cifras: nunca se parten en dos líneas */
  color: var(--amber, #ffb000);
  font-variant-numeric: tabular-nums;
}
.item-foot .price { font-size: 1.7rem; }
.soldout-tag { color: var(--muted, #a1ac90); font-weight: 600; font-size: .9rem; }

.item.is-soldout .item-art img,
.item.is-soldout .art-icon { filter: grayscale(.9) brightness(.7); }
.item.is-soldout .price { color: var(--muted, #a1ac90); }

/* El legendario brilla un poco más incluso en reposo */
.rarity-legendary .item { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 60%, #2a3323), inset 0 0 40px -18px var(--rc); }
.rarity-epic .item { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 50%, #2a3323); }

@media (prefers-reduced-motion: reduce) {
  .item-wrap, .item-art img { transition: none; }
  .item-wrap:hover, .item-wrap:focus-within { transform: none; }
}

@media (max-width: 575.98px) {
  .item-art { aspect-ratio: 16 / 8; }
  .item-name { font-size: 1.4rem; }
}
