/* Safe baseline */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 1) Section wrapper: spacing only (generic) */
.grid-section {
  width: 100%;
  padding: 0 0 32px;
}

@media (max-width: 900px) {
  .grid-section {
    padding: 0 0 24px;
  }
}
.card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  justify-content: center;
  align-items: start;
}

/* Tablet */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
  }
}

/* 3) Tile/card */
.pack-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Important: do not fight the grid sizing */
  width: 100%;
  max-width: 100%;
  margin: 0;
  text-align: left;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.pack-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* 4) Image */
.pack-item a,
.card-item a {
  width: 100%;
  display: block;
}

.pack-item img,
.card-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

.pack-item-bottom {
  width: 100%;
  padding: 0px 10px 10px 10px;
}

.pack-item-top {
  width: 100%;
  background: #ededed;
  padding: 10px 10px 10px 10px;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.pack-item-top {
  position: relative;
}

.pack-price-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;

  padding: 4px 10px;
  border-radius: var(--radius-full);

  background: #111827;
  color: #fff;

  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
}

@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .pack-item {
    width: 100%;
    max-width: 100%;
  }

  .card-title {
    font-size: 0.85rem;
  }
}

.card-item {
  background: transparent;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  margin: 0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* =========================
   Badge / Chip (shared base)
   ========================= */
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;
  border-radius: 10px;

  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;

  border: 1px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Row when multiple badges/chips are shown together */
.badge-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge--grail {
  /*background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #ffd700; */
  background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
  color: #7d6608;
  border: 1px solid #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.card-supply-numbered {
  color: #ffd700;
}

/* old design before new designs -- todo delete if other is good. PURPLE
.badge--chase {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  border-color: #a78bfa;
} */

/* card-rarity badge badge--grail*/
.badge--chase {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
}
/* old rare */
.badge--rare {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: #ffffff;
} /**/

/*
.badge--rare {
  color: rgb(6, 95, 70);
  background: linear-gradient(135deg, rgb(167, 243, 208), rgb(110, 231, 183));
} */

.badge--base {
  background: #e5e7eb;
  color: #6b7280;
  border-color: #d1d5db;
}

.card-link {
  position: relative;
  display: block;
}

.card-rarity {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.pack-meta {
  margin-top: 6px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6b7280;
}

.grid-pack-price {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Status badge (right side) */
.pack-meta span:last-child {
  /* reuse badge base styles */
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.pack-meta-right {
  font-size: 0.8rem;
  color: #6b7280;
}

.drop-series {
  font-weight: 500;
  font-size: 0.85em;
  color: #6b7280;
}

.card-meta {
  margin-top: 6px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
}

.card-meta-left {
  font-weight: 500;
}

.card-title-row,
.pack-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.card-title,
.pack-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #333;
  overflow-wrap: anywhere;
  margin: 0;
}

.card-supply {
  white-space: nowrap;
  font-size: 0.75rem;
  color: #6b7280;
  flex-shrink: 0;
  margin: 0;
}

@media (max-width: 600px) {
  .card-title,
  .pack-title {
    font-size: 0.85rem;
  }
}

/* under card small pack styles */
.card-linked-pack img {
  width: 25px;
}

.card-linked-pack {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  padding-left: 8px;
  width: 100%;
  box-sizing: border-box;
}

.card-linked-pack::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px; /* inset from left */
  right: 8px; /* inset from right */
  height: 1px;
  background: #e5e7eb;
}

.card-linked-pack a,
.card-linked-pack a:visited {
  width: auto;
  display: flex;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .grid-section-header h2 {
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
  }
}

.card-content-section {
  padding: 0px 10px 10px 10px;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 16px 16px;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.card-item:hover .card-content-section {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}
.card-image-section,
.card-content-section {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.card-image-section {
  width: 100%;
}

.card-item:hover .card-image-section,
.card-item:hover .card-content-section {
  transform: translateY(-4px);
}

.card-item:hover .card-content-section {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}
