:root {
  --primary: #2563eb;
  --surface: #f8fafc;
}

body { background: var(--surface); }

/* Tarjetas de colección */
.coleccion-card {
  transition: transform .15s, box-shadow .15s;
  border: none;
  border-radius: 12px;
  overflow: hidden;
}
.coleccion-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.coleccion-card .card-img-top {
  height: 160px;
  object-fit: cover;
  background: #e2e8f0;
}
.coleccion-card .card-img-placeholder {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  font-size: 3rem;
  color: #94a3b8;
}

/* Item grid (láminas) */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
.item-chip {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px;
  text-align: center;
  font-size: .75rem;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  user-select: none;
  background: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}
.item-chip:hover { border-color: var(--primary); }

/* Estados sin imagen (fondo del chip) */
.item-chip.estado-uno      { border-color: #38bdf8; background: #e0f2fe; color: #0369a1; font-weight: 600; }
.item-chip.estado-repetida { border-color: #16a34a; background: #f0fdf4; color: #15803d; font-weight: 600; }
.item-chip.estado-wishlist { border-color: #d97706; background: #fffbeb; color: #b45309; font-weight: 600; }

/* Contenedor de imagen */
.item-chip-img-wrap {
  position: relative;
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 2px;
}
.item-chip-img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  display: block;
}

/* Overlay de color encima de la imagen según estado */
.item-chip-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background .12s;
}
.item-chip.estado-uno      .item-chip-img-wrap::after { background: rgba(56,189,248,.40); }
.item-chip.estado-repetida .item-chip-img-wrap::after { background: rgba(22,163,74, .40); }
.item-chip.estado-wishlist .item-chip-img-wrap::after { background: rgba(245,158,11,.40); }

/* Placeholder "subir imagen" */
.item-chip-placeholder {
  width: 100%;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border-radius: 5px;
  color: #94a3b8;
  font-size: .65rem;
  gap: 2px;
  margin-bottom: 2px;
  transition: background .12s, color .12s;
}
.item-chip:hover .item-chip-placeholder {
  background: #dbeafe;
  color: var(--primary);
}

/* Badge de cantidad */
.item-chip .qty-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  background: #16a34a;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 1;
}

/* Nombre del ítem */
.item-chip-name {
  font-size: .7rem;
  line-height: 1.2;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

/* Perfil */
.avatar-lg { width: 90px; height: 90px; object-fit: cover; border-radius: 50%; }
.avatar-placeholder-lg {
  width: 90px; height: 90px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: white;
}

/* Match card */
.match-card { border-left: 4px solid var(--primary); }
.badge-trading  { background: #dcfce7; color: #166534; }
.badge-wishing  { background: #fef9c3; color: #854d0e; }

/* Mensajes */
.msg-burbuja { max-width: 70%; }
.msg-propio  { margin-left: auto; background: var(--primary); color: white; border-radius: 18px 18px 4px 18px; }
.msg-otro    { background: #f1f5f9; color: #0f172a; border-radius: 18px 18px 18px 4px; }

/* Navbar fix */
.navbar .nav-link { font-size: .9rem; }
.navbar .dropdown-menu { z-index: 1040; }

/* Trust score */
.trust-badge { font-size: .7rem; padding: 2px 8px; border-radius: 20px; }
.trust-high   { background: #dcfce7; color: #166534; }
.trust-mid    { background: #fef9c3; color: #854d0e; }
.trust-low    { background: #fee2e2; color: #991b1b; }
